Add LICENSE
[riscv-tests.git] / benchmarks / vec-fft / cvt_fft.c
1 // See LICENSE for license details.
2
3 #include <stdio.h>
4 #include <stdint.h>
5 #include <inttypes.h>
6
7 #include "cvt16.h"
8
9 typedef float fftval_t;
10 #include "fft_data_generic.c"
11
12 static void _array(const char *s, const fftval_t *v, unsigned int n)
13 {
14 union single {
15 float f;
16 uint32_t u;
17 } bits;
18 unsigned int i;
19
20 printf("fftval_t %s[%u] = { ", s, n);
21 for (i = 0; i < n; i++) {
22 bits.f = v[i];
23 printf("0x%04" PRIx16 ", ", cvt_sh(bits.u, RNE));
24 }
25 puts("};");
26 }
27
28 #define array(v) _array(#v, (v), (sizeof(v) / sizeof(0[v])))
29
30 int main(void)
31 {
32 array(input_data_real);
33 array(input_data_imag);
34 array(output_data_real);
35 array(output_data_imag);
36 array(tf_real);
37 array(tf_imag);
38 return 0;
39 }