aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/vec-fft/cvt_fft.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/vec-fft/cvt_fft.c')
-rw-r--r--benchmarks/vec-fft/cvt_fft.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/benchmarks/vec-fft/cvt_fft.c b/benchmarks/vec-fft/cvt_fft.c
new file mode 100644
index 0000000..843f73c
--- /dev/null
+++ b/benchmarks/vec-fft/cvt_fft.c
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#include "cvt16.h"
+
+typedef float fftval_t;
+#include "fft_data_generic.c"
+
+static void _array(const char *s, const fftval_t *v, unsigned int n)
+{
+ union single {
+ float f;
+ uint32_t u;
+ } bits;
+ unsigned int i;
+
+ printf("fftval_t %s[%u] = { ", s, n);
+ for (i = 0; i < n; i++) {
+ bits.f = v[i];
+ printf("0x%04" PRIx16 ", ", cvt_sh(bits.u, RNE));
+ }
+ puts("};");
+}
+
+#define array(v) _array(#v, (v), (sizeof(v) / sizeof(0[v])))
+
+int main(void)
+{
+ array(input_data_real);
+ array(input_data_imag);
+ array(output_data_real);
+ array(output_data_imag);
+ array(tf_real);
+ array(tf_imag);
+ return 0;
+}