summaryrefslogtreecommitdiff
path: root/platform/wavelet3d/main.cpp
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2024-03-07 16:30:11 -0600
committerAlejandro Soto <alejandro@34project.org>2024-03-07 16:30:11 -0600
commit9ecb54925bbbc218c183c0ee9cb3b27bf79e6e80 (patch)
tree5e6d6de284a4d0af04499547ef81b9d53e02ab2d /platform/wavelet3d/main.cpp
parent3038edc09a2eb15762f2e58533f429489107520b (diff)
platform/wavelet3d: implement unified fp-integer lane
Diffstat (limited to 'platform/wavelet3d/main.cpp')
-rw-r--r--platform/wavelet3d/main.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/platform/wavelet3d/main.cpp b/platform/wavelet3d/main.cpp
index 1243dba..1bffb68 100644
--- a/platform/wavelet3d/main.cpp
+++ b/platform/wavelet3d/main.cpp
@@ -26,6 +26,54 @@ int main(int argc, char **argv)
float a, b;
std::cin >> a >> b;
+ // mul int
+ //top.mul_float_m1 = 0;
+ //top.unit_b_m1 = 0;
+ //top.float_a_1 = 0;
+ //top.int_hi_a_1 = 0;
+ //top.int_lo_a_1 = 1;
+ //top.zero_flags_a_1 = 1;
+ //top.zero_b_1 = 1;
+ //top.copy_flags_2 = 1;
+ //top.copy_flags_5 = 1;
+ //top.enable_norm_6 = 0;
+ //top.copy_flags_10 = 1;
+ //top.copy_flags_11 = 1;
+ //top.enable_round_11 = 0;
+ //top.encode_special_13 = 0;
+
+ // mul fp
+ //top.mul_float_m1 = 1;
+ //top.unit_b_m1 = 0;
+ //top.float_a_1 = 1;
+ //top.int_hi_a_1 = 0;
+ //top.int_lo_a_1 = 0;
+ //top.zero_flags_a_1 = 0;
+ //top.zero_b_1 = 1;
+ //top.copy_flags_2 = 1;
+ //top.copy_flags_5 = 1;
+ //top.enable_norm_6 = 1;
+ //top.copy_flags_10 = 1;
+ //top.copy_flags_11 = 1;
+ //top.enable_round_11 = 1;
+ //top.encode_special_13 = 1;
+
+ // suma/resta
+ top.mul_float_m1 = 0;
+ top.unit_b_m1 = 1;
+ top.float_a_1 = 0;
+ top.int_hi_a_1 = 0;
+ top.int_lo_a_1 = 1;
+ top.zero_flags_a_1 = 0;
+ top.zero_b_1 = 0;
+ top.copy_flags_2 = 0;
+ top.copy_flags_5 = 0;
+ top.enable_norm_6 = 1;
+ top.copy_flags_10 = 0;
+ top.copy_flags_11 = 0;
+ top.enable_round_11 = 1;
+ top.encode_special_13 = 1;
+
top.a = *reinterpret_cast<unsigned*>(&a);
top.b = *reinterpret_cast<unsigned*>(&b);
@@ -38,7 +86,7 @@ int main(int argc, char **argv)
}
unsigned q = top.q;
- std::cout << a << " * " << b << " = " << *reinterpret_cast<float*>(&q) << '\n';
+ std::cout << a << " * " << b << " = " << *reinterpret_cast<decltype(a)*>(&q) << '\n';
bool failed = Py_FinalizeEx() < 0;