fixed to fix and some more

This commit is contained in:
veclavtlica
2026-09-13 20:57:34 +03:00
parent a1745f3a52
commit 4e1fa1ed1c
12 changed files with 356 additions and 276 deletions
+19
View File
@@ -0,0 +1,19 @@
#include "mat.h"
#include "Timer/timer.h"
/* TODO: Doesn't work, clang optimizes it away. We need RNG here. */
void com_mat_run_bench(void) {
uint64_t start = com_timer_count_ns();
for (int i = 5000000; i--;) {
com_mat_t a = com_mat_identity();
com_mat_t b = com_mat_identity();
a.a[3] = i * COM_FIX_FRACUNIT;
b.a[9] = i * COM_FIX_FRACUNIT;
COM_MAT_PROFILE_SINK(a);
COM_MAT_PROFILE_SINK(b);
com_mat_t mul = com_mat_mul(a, b);
COM_MAT_PROFILE_SINK(mul);
}
com_timer_profile(start, "mat: mul");
}