Mercurial > vec
diff test/test_benchmark_simple.c @ 37:4b5a557aa64f
*: turns out extern is a practical joke. rewrite to be always inline again
the sample benchmark performs about 3x as well with optimizations
disabled :)
author | Paper <paper@tflc.us> |
---|---|
date | Sat, 26 Apr 2025 01:04:35 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/test_benchmark_simple.c Sat Apr 26 01:04:35 2025 -0400 @@ -0,0 +1,18 @@ +#include <stdint.h> + +extern void test_benchmark_sample_minmax_simple_impl(int16_t *smpl, + uint32_t length, int32_t *pmin, int32_t *pmax) +{ + int32_t min = *pmin; + int32_t max = *pmax; + + while (length--) { + if (*smpl < min) min = *smpl; + if (*smpl > max) max = *smpl; + + smpl++; + } + + *pmin = min; + *pmax = max; +}