From: Adam Izraelevitz Date: Tue, 11 Feb 2014 22:26:50 +0000 (-0800) Subject: Merge branch 'master' of github.com:ucb-bar/riscv-tests X-Git-Url: https://git.libre-soc.org/?p=riscv-tests.git;a=commitdiff_plain;h=0c98ef833db1f6eead3bd9ad083d9408d2d8decb;hp=2ee709bf9de12bb57a3c79f72560180cea72227e Merge branch 'master' of github.com:ucb-bar/riscv-tests Conflicts: README.md --- diff --git a/benchmarks/Makefile b/benchmarks/Makefile index dee7b23..8f580a4 100644 --- a/benchmarks/Makefile +++ b/benchmarks/Makefile @@ -25,6 +25,7 @@ bmarks = \ dhrystone \ spmv \ mt-vvadd \ + #vec-fft \ #mt-matmul \ #vec-vvadd \ #vec-cmplxmult \ @@ -50,17 +51,17 @@ HOST_OPTS = -std=gnu99 -DPREALLOCATE=0 -DHOST_DEBUG=1 HOST_COMP = gcc $(HOST_OPTS) RISCV_GCC = riscv-gcc -RISCV_GCC_OPTS = -Wa,-march=RVIMAFDXhwacha -std=gnu99 -O2 -nostdlib -nostartfiles -ffast-math +RISCV_GCC_OPTS = -Wa,-march=RVIMAFDXhwacha -std=gnu99 -O2 -ffast-math RISCV_LINK = riscv-gcc -T $(bmarkdir)/common/test.ld $(incs) RISCV_LINK_MT = riscv-gcc -T $(bmarkdir)/common/test-mt.ld -RISCV_LINK_OPTS = -lc +RISCV_LINK_OPTS = -nostdlib -nostartfiles -ffast-math -lc RISCV_OBJDUMP = riscv-objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.data RISCV_SIM = spike VPATH += $(addprefix $(bmarkdir)/, $(bmarks)) VPATH += $(bmarkdir)/common -incs += -I../env -I$(bmarkdir)/common $(addprefix -I$(bmarkdir)/, $(bmarks)) +incs += -I$(bmarkdir)/../env -I$(bmarkdir)/common $(addprefix -I$(bmarkdir)/, $(bmarks)) objs := include $(patsubst %, $(bmarkdir)/%/bmark.mk, $(bmarks)) @@ -90,7 +91,7 @@ $(bmarks_riscv_out): %.riscv.out: %.riscv -c $(incs) $< -o $@ %.o: %.S - $(RISCV_GCC) $(RISCV_GCC_OPTS) $(bmarks_defs) \ + $(RISCV_GCC) $(RISCV_GCC_OPTS) $(bmarks_defs) -D__ASSEMBLY__=1 \ -c $(incs) $< -o $@ riscv: $(bmarks_riscv_dump) $(bmarks_riscv_hex) diff --git a/benchmarks/common/crt-mt.S b/benchmarks/common/crt-mt.S deleted file mode 100644 index 6cedec0..0000000 --- a/benchmarks/common/crt-mt.S +++ /dev/null @@ -1,113 +0,0 @@ -#include "encoding.h" - - .data - .globl _heapend - .globl environ -_heapend: - .word 0 -environ: - .word 0 - - .text - .globl _start - -_start: - li x1, 0 - li x2, 0 - li x3, 0 - li x4, 0 - li x5, 0 - li x6, 0 - li x7, 0 - li x8, 0 - li x9, 0 - li x10,0 - li x11,0 - li x12,0 - li x13,0 - li x14,0 - li x15,0 - li x16,0 - li x17,0 - li x18,0 - li x19,0 - li x20,0 - li x21,0 - li x22,0 - li x23,0 - li x24,0 - li x25,0 - li x26,0 - li x27,0 - li x28,0 - li x29,0 - li x30,0 - li x31,0 - - # enable fp and accelerator - li a0, SR_EF | SR_EA - csrs status, a0 - - ## if that didn't stick, we don't have an FPU, so don't initialize it - csrr t0, status - and t0, t0, SR_EF - beqz t0, 1f - - fssr x0 - fmv.s.x f0, x0 - fmv.s.x f1, x0 - fmv.s.x f2, x0 - fmv.s.x f3, x0 - fmv.s.x f4, x0 - fmv.s.x f5, x0 - fmv.s.x f6, x0 - fmv.s.x f7, x0 - fmv.s.x f8, x0 - fmv.s.x f9, x0 - fmv.s.x f10,x0 - fmv.s.x f11,x0 - fmv.s.x f12,x0 - fmv.s.x f13,x0 - fmv.s.x f14,x0 - fmv.s.x f15,x0 - fmv.s.x f16,x0 - fmv.s.x f17,x0 - fmv.s.x f18,x0 - fmv.s.x f19,x0 - fmv.s.x f20,x0 - fmv.s.x f21,x0 - fmv.s.x f22,x0 - fmv.s.x f23,x0 - fmv.s.x f24,x0 - fmv.s.x f25,x0 - fmv.s.x f26,x0 - fmv.s.x f27,x0 - fmv.s.x f28,x0 - fmv.s.x f29,x0 - fmv.s.x f30,x0 - fmv.s.x f31,x0 -1: - - - # get core id and number of cores - csrr a0, hartid - lw a1, 4(zero) - - slli a2, a0, 13 - la sp, stacktop - sub sp, sp, a2 - - la tp, tlstop - sub tp, tp, a2 - - jal thread_entry - - .bss - .globl stacktop - .globl tlstop - - .align 4 - .skip 32768 -stacktop: - .skip 65536 -tlstop: diff --git a/benchmarks/common/crt.S b/benchmarks/common/crt.S index ae8706b..fb2cc25 100644 --- a/benchmarks/common/crt.S +++ b/benchmarks/common/crt.S @@ -93,48 +93,52 @@ _start: fmv.s.x f31,x0 1: - lui a0, %hi(trap_entry) - add a0, a0, %lo(trap_entry) - csrw evec, a0 - - lui a0, %hi(main) - add a0, a0, %lo(main) - csrw epc, a0 - - # only allow core 0 to proceed -1:csrr a0, hartid - bnez a0, 1b - - la sp,stacktop - - # jmp to main as a user program - sret -1:b 1b - -.align 4 -.globl trap_entry -trap_entry: # only check for SYS_exit, otherwise crash out - li a3, 1337 # magic "bad things" happened error code - csrr a1, cause - li a2, 6 # syscall exception number - bne a1, a2, exit_error -handle_syscall: - li a1, 93 # SYS_exit number - bne v0, a1, exit_error - li a1, 1 # successful exit code - move a3, a0 - bne a3, a1, exit_error - csrw tohost, a1 # exit successfully (tohost == 1) -1:b 1b -exit_error: - sll a3, a3, 1 - or a3, a3, 1 - csrw tohost, a3 -1:b 1b - - .bss - .globl stacktop - - .align 4 - .skip 131072 -stacktop: + la t0, trap_entry + csrw evec, t0 + + la tp, _end + 63 + and tp, tp, -64 + + # get core id and number of cores + csrr a0, hartid + lw a1, 4(zero) + + # give each core a 1KB TLS and a 127KB stack +#define STKSHIFT 17 + sll a2, a0, STKSHIFT + add tp, tp, a2 + add sp, a0, 1 + sll sp, sp, STKSHIFT + add sp, sp, tp + add tp, tp, 1024 + + jal _init + unimp + +trap_entry: + csrw sup0, t0 + csrw sup1, t1 + la t0, uarch_insn + lw t0, (t0) + csrr t1, epc + and t1, t1, ~3 + lw t1, (t1) + and t1, t1, t0 + beq t1, t0, handle_uarch_insn + + # a trap occurred that shouldn't have. + li t0, 1337 + csrw tohost, t0 +1:j 1b + +handle_uarch_insn: + # we trapped on an illegal uarch-specific CSR. just skip over it. + csrr t1, epc + add t1, t1, 4 + csrw epc, t1 + csrr t0, sup0 + csrr t1, sup1 + sret + +uarch_insn: + csrr x0, uarch0 diff --git a/benchmarks/common/syscalls.c b/benchmarks/common/syscalls.c index 4154ba4..1a53349 100644 --- a/benchmarks/common/syscalls.c +++ b/benchmarks/common/syscalls.c @@ -1,50 +1,106 @@ #include #include #include +#include +#include #include #include "encoding.h" -void exit(int code) +#define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; } + +void syscall(long which, long arg0, long arg1, long arg2) { - volatile uint64_t magic_mem[8] = {0}; - magic_mem[0] = SYS_exit; - magic_mem[1] = code; + volatile uint64_t magic_mem[8] __attribute__((aligned(64))); + magic_mem[0] = which; + magic_mem[1] = arg0; + magic_mem[2] = arg1; + magic_mem[3] = arg2; __sync_synchronize(); write_csr(tohost, (long)magic_mem); - while(1); + while (swap_csr(fromhost, 0) == 0); +} + +void exit(int code) +{ + write_csr(tohost, (code << 1) | 1); + while (1); } void printstr(const char* s) { - volatile uint64_t magic_mem[8] = {0}; - magic_mem[0] = SYS_write; - magic_mem[1] = 1; - magic_mem[2] = (unsigned long)s; - magic_mem[3] = strlen(s); - __sync_synchronize(); - write_csr(tohost, (long)magic_mem); - while (swap_csr(fromhost, 0) == 0); + syscall(SYS_write, 1, (long)s, strlen(s)); +} + +// In setStats, we might trap reading uarch-specific counters. +// The trap handler will skip over the instruction, but we want +// to pretend as though we read the value 0 in this case. +#define read_csr_safe(reg) ({ long __tmp = 0; \ + asm volatile ("csrr %0, " #reg : "+r"(__tmp)); \ + __tmp; }) + +#define NUM_COUNTERS 18 +static long counters[NUM_COUNTERS]; +static char* counter_names[NUM_COUNTERS]; +void setStats(int enable) +{ + int i = 0; +#define READ_CTR(name) do { \ + if (i >= NUM_COUNTERS) exit(-1); \ + long csr = read_csr_safe(name); \ + if (!enable) { csr -= counters[i]; counter_names[i] = #name; } \ + counters[i++] = csr; \ + } while (0) + READ_CTR(cycle); READ_CTR(instret); + READ_CTR(uarch0); READ_CTR(uarch1); READ_CTR(uarch2); READ_CTR(uarch3); + READ_CTR(uarch4); READ_CTR(uarch5); READ_CTR(uarch6); READ_CTR(uarch7); + READ_CTR(uarch8); READ_CTR(uarch9); READ_CTR(uarch10); READ_CTR(uarch11); + READ_CTR(uarch12); READ_CTR(uarch13); READ_CTR(uarch14); READ_CTR(uarch15); +#undef READ_CTR +} + +void __attribute__((weak)) thread_entry(int cid, int nc) +{ + // multi-threaded programs override this function. + // for the case of single-threaded programs, only let core 0 proceed. + while (cid != 0); +} + +int __attribute__((weak)) main(int argc, char** argv) +{ + // single-threaded programs override this function. + printstr("Implement main(), foo!\n"); + return -1; } +void _init(int cid, int nc) +{ + thread_entry(cid, nc); + + // only single-threaded programs should ever get here. + int ret = main(0, 0); + + char buf[NUM_COUNTERS * 32] __attribute__((aligned(64))); + char* pbuf = buf; + for (int i = 0; i < NUM_COUNTERS; i++) + if (counters[i]) + pbuf += sprintf(pbuf, "%s = %d\n", counter_names[i], counters[i]); + if (pbuf != buf) + printstr(buf); + + exit(ret); +} + +#undef putchar int putchar(int ch) { - static char buf[64]; + static char buf[64] __attribute__((aligned(64))); static int buflen = 0; - if(ch != -1) - buf[buflen++] = ch; + buf[buflen++] = ch; - if(ch == -1 || buflen == sizeof(buf)) + if (ch == '\n' || buflen == sizeof(buf)) { - volatile uint64_t magic_mem[8] = {0}; - magic_mem[0] = SYS_write; - magic_mem[1] = 1; - magic_mem[2] = (long)buf; - magic_mem[3] = buflen; - __sync_synchronize(); - write_csr(tohost, (long)magic_mem); - while (swap_csr(fromhost, 0) == 0); - + syscall(SYS_write, 1, (long)buf, buflen); buflen = 0; } @@ -65,15 +121,25 @@ void printhex(uint64_t x) printstr(str); } -static void printnum(void (*putch)(int, void**), void **putdat, - unsigned long long num, unsigned base, int width, int padc) +static inline void printnum(void (*putch)(int, void**), void **putdat, + unsigned long long num, unsigned base, int width, int padc) { - if (num >= base) - printnum(putch, putdat, num / base, base, width - 1, padc); - else while (--width > 0) + unsigned digs[sizeof(num)*CHAR_BIT]; + int pos = 0; + + while (1) + { + digs[pos++] = num % base; + if (num < base) + break; + num /= base; + } + + while (width-- > pos) putch(padc, putdat); - putch("0123456789abcdef"[num % base], putdat); + while (pos-- > 0) + putch(digs[pos] + (digs[pos] >= 10 ? 'a' - 10 : '0'), putdat); } static unsigned long long getuint(va_list *ap, int lflag) @@ -96,7 +162,7 @@ static long long getint(va_list *ap, int lflag) return va_arg(*ap, int); } -void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list ap) +static void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list ap) { register const char* p; const char* last_fmt; @@ -188,10 +254,7 @@ void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_li for (width -= strnlen(p, precision); width > 0; width--) putch(padc, putdat); for (; (ch = *p) != '\0' && (precision < 0 || --precision >= 0); width--) { - if (altflag && (ch < ' ' || ch > '~')) - putch('?', putdat); - else - putch(ch, putdat); + putch(ch, putdat); p++; } for (; width > 0; width--) @@ -206,35 +269,33 @@ void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_li num = -(long long) num; } base = 10; - goto number; + goto signed_number; // unsigned decimal case 'u': - num = getuint(&ap, lflag); base = 10; - goto number; + goto unsigned_number; // (unsigned) octal case 'o': // should do something with padding so it's always 3 octits - num = getuint(&ap, lflag); base = 8; - goto number; + goto unsigned_number; // pointer case 'p': + static_assert(sizeof(long) == sizeof(void*)); + lflag = 1; putch('0', putdat); putch('x', putdat); - num = (unsigned long long) - (uintptr_t) va_arg(ap, void *); - base = 16; - goto number; + /* fall through to 'x' */ // (unsigned) hexadecimal case 'x': - num = getuint(&ap, lflag); base = 16; - number: + unsigned_number: + num = getuint(&ap, lflag); + signed_number: printnum(putch, putdat, num, base, width, padc); break; @@ -258,8 +319,27 @@ int printf(const char* fmt, ...) va_start(ap, fmt); vprintfmt((void*)putchar, 0, fmt, ap); - putchar(-1); va_end(ap); return 0; // incorrect return value, but who cares, anyway? } + +int sprintf(char* str, const char* fmt, ...) +{ + va_list ap; + char* str0 = str; + va_start(ap, fmt); + + void sprintf_putch(int ch, void** data) + { + char** pstr = (char**)data; + **pstr = ch; + (*pstr)++; + } + + vprintfmt(sprintf_putch, (void**)&str, fmt, ap); + *str = 0; + + va_end(ap); + return str - str0; +} diff --git a/benchmarks/common/test-mt.ld b/benchmarks/common/test-mt.ld deleted file mode 100644 index 5523032..0000000 --- a/benchmarks/common/test-mt.ld +++ /dev/null @@ -1,45 +0,0 @@ -/*======================================================================*/ -/* Proxy kernel linker script */ -/*======================================================================*/ -/* This is the linker script used when building the proxy kernel. */ - -/*----------------------------------------------------------------------*/ -/* Setup */ -/*----------------------------------------------------------------------*/ - -/* The OUTPUT_ARCH command specifies the machine architecture where the - argument is one of the names used in the BFD library. More - specifically one of the entires in bfd/cpu-mips.c */ - -OUTPUT_ARCH( "riscv" ) - -/* The ENTRY command specifies the entry point (ie. first instruction - to execute). The symbol _start should be defined in each test. */ - -ENTRY( _start ) - -/*----------------------------------------------------------------------*/ -/* Sections */ -/*----------------------------------------------------------------------*/ - -SECTIONS -{ - - /* text: test code section */ - . = 0x00002000; - .text : - { - crt-mt.o(.text) - *(.text) - } - - /* data: Initialized data segment */ - .data : - { - *(.data) - } - - /* End of uninitalized data segement */ - _end = .; -} - diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h index 10f3169..1f0c73c 100644 --- a/benchmarks/common/util.h +++ b/benchmarks/common/util.h @@ -1,16 +1,99 @@ -// helpful utility and synch functions - -// relies on defining "ncores" before including this file... - #ifndef __UTIL_H #define __UTIL_H -#include +//-------------------------------------------------------------------------- +// Macros + +// Set HOST_DEBUG to 1 if you are going to compile this for a host +// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG +// to 0 if you are compiling with the smips-gcc toolchain. + +#ifndef HOST_DEBUG +#define HOST_DEBUG 0 +#endif + +// Set PREALLOCATE to 1 if you want to preallocate the benchmark +// function before starting stats. If you have instruction/data +// caches and you don't want to count the overhead of misses, then +// you will need to use preallocation. + +#ifndef PREALLOCATE +#define PREALLOCATE 0 +#endif + +// Set SET_STATS to 1 if you want to carve out the piece that actually +// does the computation. + +#ifndef SET_STATS +#define SET_STATS 0 +#endif + +#if HOST_DEBUG +#include +static void setStats(int enable) {} +#else +extern void setStats(int enable); +#endif + +static void printArray(const char name[], int n, const int arr[]) +{ +#if HOST_DEBUG + int i; + printf( " %10s :", name ); + for ( i = 0; i < n; i++ ) + printf( " %3d ", arr[i] ); + printf( "\n" ); +#endif +} + +static void printDoubleArray(const char name[], int n, const double arr[]) +{ +#if HOST_DEBUG + int i; + printf( " %10s :", name ); + for ( i = 0; i < n; i++ ) + printf( " %g ", arr[i] ); + printf( "\n" ); +#endif +} + +static int verify(int n, const int test[], const int verify[]) +{ + int i; + // Unrolled for faster verification + for (i = 0; i < n/2*2; i+=2) + { + int t0 = test[i], t1 = test[i+1]; + int v0 = verify[i], v1 = verify[i+1]; + if (t0 != v0) return i+1; + if (t1 != v1) return i+2; + } + if (n % 2 != 0 && test[n-1] != verify[n-1]) + return n; + return 0; +} -#define rdcycle() ({ unsigned long _c; asm volatile ("rdcycle %0" : "=r"(_c) :: "memory"); _c; }) -#define rdinstret() ({ unsigned long _c; asm volatile ("rdinstret %0" : "=r"(_c) :: "memory"); _c; }) - -void __attribute__((noinline)) barrier() +static int verifyDouble(int n, const double test[], const double verify[]) +{ + int i; + // Unrolled for faster verification + for (i = 0; i < n/2*2; i+=2) + { + double t0 = test[i], t1 = test[i+1]; + double v0 = verify[i], v1 = verify[i+1]; + int eq1 = t0 == v0, eq2 = t1 == v1; + if (!(eq1 & eq2)) return i+1+eq1; + } + if (n % 2 != 0 && test[n-1] != verify[n-1]) + return n; + return 0; +} + +#ifndef ncores +#define ncores 1 +#endif + +static void __attribute__((noinline)) barrier() { static volatile int sense; static volatile int count; @@ -30,31 +113,8 @@ void __attribute__((noinline)) barrier() __sync_synchronize(); } - - - - -void finishTest(int test_result) -{ -#if HOST_DEBUG - if ( test_result == 1 ) - printf( "*** PASSED ***\n" ); - else - printf( "*** FAILED *** (tohost = %d)\n", test_result); - exit(0); -#else - { - // perform exit syscall - asm volatile( - "move a0,%0 ;" - "li a1,0 ;" - "li a2,0 ;" - "li a3,0 ;" - "li v0,%1 ;" - "scall" : : "r"(test_result) , "i"(SYS_exit)); - } +#ifdef __riscv +#include "encoding.h" #endif -} #endif //__UTIL_H - diff --git a/benchmarks/dgemm/bmark.mk b/benchmarks/dgemm/bmark.mk index 5a26242..11d8656 100644 --- a/benchmarks/dgemm/bmark.mk +++ b/benchmarks/dgemm/bmark.mk @@ -10,6 +10,7 @@ dgemm_c_src = \ dgemm_main.c \ + syscalls.c \ dgemm_riscv_src = \ crt.S \ @@ -23,7 +24,7 @@ $(dgemm_host_bin) : $(dgemm_c_src) dgemm_riscv_bin = dgemm.riscv $(dgemm_riscv_bin) : $(dgemm_c_objs) $(dgemm_riscv_objs) - $(RISCV_LINK) $(dgemm_c_objs) $(dgemm_riscv_objs) -o $(dgemm_riscv_bin) + $(RISCV_LINK) $(dgemm_c_objs) $(dgemm_riscv_objs) -o $(dgemm_riscv_bin) $(RISCV_LINK_OPTS) junk += $(dgemm_c_objs) $(dgemm_riscv_objs) \ $(dgemm_host_bin) $(dgemm_riscv_bin) diff --git a/benchmarks/dgemm/dgemm_main.c b/benchmarks/dgemm/dgemm_main.c index 7fd7dc2..9f28c07 100644 --- a/benchmarks/dgemm/dgemm_main.c +++ b/benchmarks/dgemm/dgemm_main.c @@ -2,75 +2,13 @@ // Double-precision general matrix multiplication benchmark //-------------------------------------------------------------------------- -int ncores = 1; #include "util.h" -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif - //-------------------------------------------------------------------------- // Input/Reference Data #include "dataset1.h" -//-------------------------------------------------------------------------- -// Helper functions - -int verify( long n, const double test[], const double correct[] ) -{ - int i; - for ( i = 0; i < n; i++ ) { - if ( test[i] != correct[i] ) { - return 2; - } - } - return 1; -} - -#if HOST_DEBUG -#include -#include -void printArray( char name[], long n, const double arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %8.1f ", arr[i] ); - printf( "\n" ); -} -#endif - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - //-------------------------------------------------------------------------- // square_dgemm function @@ -162,33 +100,23 @@ int main( int argc, char* argv[] ) double results_data[DATA_SIZE*DATA_SIZE]; // Output the input array - -#if HOST_DEBUG - printArray( "input1", DATA_SIZE*DATA_SIZE, input1_data ); - printArray( "input2", DATA_SIZE*DATA_SIZE, input2_data ); - printArray( "verify", DATA_SIZE*DATA_SIZE, verify_data ); -#endif - - // If needed we preallocate everything in the caches + printDoubleArray( "input1", DATA_SIZE*DATA_SIZE, input1_data ); + printDoubleArray( "input2", DATA_SIZE*DATA_SIZE, input2_data ); + printDoubleArray( "verify", DATA_SIZE*DATA_SIZE, verify_data ); #if PREALLOCATE + // If needed we preallocate everything in the caches square_dgemm( DATA_SIZE, input1_data, input2_data, results_data ); #endif // Do the dgemm - setStats(1); square_dgemm( DATA_SIZE, input1_data, input2_data, results_data ); setStats(0); // Print out the results - -#if HOST_DEBUG - printArray( "results", DATA_SIZE*DATA_SIZE, results_data ); -#endif + printDoubleArray( "results", DATA_SIZE*DATA_SIZE, results_data ); // Check the results - - finishTest(verify( DATA_SIZE*DATA_SIZE, results_data, verify_data )); - + return verifyDouble( DATA_SIZE*DATA_SIZE, results_data, verify_data ); } diff --git a/benchmarks/dhrystone/bmark.mk b/benchmarks/dhrystone/bmark.mk index 6e45706..06b4ab8 100644 --- a/benchmarks/dhrystone/bmark.mk +++ b/benchmarks/dhrystone/bmark.mk @@ -11,6 +11,7 @@ dhrystone_c_src = \ dhrystone_main.c \ dhrystone.c \ + syscalls.c \ dhrystone_riscv_src = \ crt.S \ diff --git a/benchmarks/dhrystone/dhrystone.h b/benchmarks/dhrystone/dhrystone.h index 8abb874..f274c57 100644 --- a/benchmarks/dhrystone/dhrystone.h +++ b/benchmarks/dhrystone/dhrystone.h @@ -381,13 +381,9 @@ extern clock_t clock(); #define HZ 976563 #define Too_Small_Time 50 -#define rdcycle() ({ \ - long __x; \ - asm volatile("rdcycle %0; srl %0, %0, 10" : "=r"(__x)); \ - __x; }) #define CLOCK_TYPE "rdcycle()" -#define Start_Timer() Begin_Time = rdcycle() -#define Stop_Timer() End_Time = rdcycle() +#define Start_Timer() Begin_Time = rdcycle()/1024 +#define Stop_Timer() End_Time = rdcycle()/1024 #else /* Use times(2) time function unless */ diff --git a/benchmarks/dhrystone/dhrystone_main.c b/benchmarks/dhrystone/dhrystone_main.c index 93b79da..a755743 100644 --- a/benchmarks/dhrystone/dhrystone_main.c +++ b/benchmarks/dhrystone/dhrystone_main.c @@ -8,9 +8,6 @@ #include "dhrystone.h" -int ncores = 1; -#include "util.h" - //-------------------------------------------------------------------------- // Macros @@ -47,12 +44,7 @@ int __attribute__((noinline)) do_fprintf(FILE* f, const char* str, ...) } #endif -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} +#include "util.h" #include @@ -299,7 +291,7 @@ int main (int argc, char** argv) do_fprintf (stdout, "\n"); #endif - finishTest(1); + return 0; } diff --git a/benchmarks/median/bmark.mk b/benchmarks/median/bmark.mk index 31c853a..b489a67 100644 --- a/benchmarks/median/bmark.mk +++ b/benchmarks/median/bmark.mk @@ -11,6 +11,7 @@ median_c_src = \ median_main.c \ median.c \ + syscalls.c \ median_riscv_src = \ crt.S \ @@ -24,7 +25,7 @@ $(median_host_bin): $(median_c_src) median_riscv_bin = median.riscv $(median_riscv_bin): $(median_c_objs) $(median_riscv_objs) - $(RISCV_LINK) $(median_c_objs) $(median_riscv_objs) -o $(median_riscv_bin) + $(RISCV_LINK) $(median_c_objs) $(median_riscv_objs) -o $(median_riscv_bin) $(RISCV_LINK_OPTS) junk += $(median_c_objs) $(median_riscv_objs) \ $(median_host_bin) $(median_riscv_bin) diff --git a/benchmarks/median/median_main.c b/benchmarks/median/median_main.c index 0691bec..7d50f76 100644 --- a/benchmarks/median/median_main.c +++ b/benchmarks/median/median_main.c @@ -8,75 +8,15 @@ // dataset1.h You should not change anything except the // HOST_DEBUG and PREALLOCATE macros for your timing run. -#include "median.h" - -int ncores = 1; #include "util.h" -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif +#include "median.h" //-------------------------------------------------------------------------- // Input/Reference Data #include "dataset1.h" -//-------------------------------------------------------------------------- -// Helper functions - -int verify( int n, int test[], int correct[] ) -{ - int i; - for ( i = 0; i < n; i++ ) { - if ( test[i] != correct[i] ) { - return 2; - } - } - return 1; -} - -#if HOST_DEBUG -void printArray( char name[], int n, int arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %3d ", arr[i] ); - printf( "\n" ); -} -#endif - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - //-------------------------------------------------------------------------- // Main @@ -85,36 +25,22 @@ int main( int argc, char* argv[] ) int results_data[DATA_SIZE]; // Output the input array - -#if HOST_DEBUG printArray( "input", DATA_SIZE, input_data ); printArray( "verify", DATA_SIZE, verify_data ); -#endif +#if PREALLOCATE // If needed we preallocate everything in the caches - -#if ( !HOST_DEBUG && PREALLOCATE ) median( DATA_SIZE, input_data, results_data ); #endif // Do the filter - -#if HOST_DEBUG - median( DATA_SIZE, input_data, results_data ); -#else setStats(1); median( DATA_SIZE, input_data, results_data ); setStats(0); -#endif // Print out the results - -#if HOST_DEBUG printArray( "results", DATA_SIZE, results_data ); -#endif // Check the results - - finishTest(verify( DATA_SIZE, results_data, verify_data )); - + return verify( DATA_SIZE, results_data, verify_data ); } diff --git a/benchmarks/mt-matmul/bmark.mk b/benchmarks/mt-matmul/bmark.mk index 7749951..4b7fcb7 100644 --- a/benchmarks/mt-matmul/bmark.mk +++ b/benchmarks/mt-matmul/bmark.mk @@ -10,9 +10,10 @@ mt_matmul_c_src = \ mt-matmul.c \ + syscalls.c \ mt_matmul_riscv_src = \ - crt-mt.S \ + crt.S \ mt_matmul_c_objs = $(patsubst %.c, %.o, $(mt_matmul_c_src)) mt_matmul_riscv_objs = $(patsubst %.S, %.o, $(mt_matmul_riscv_src)) @@ -23,7 +24,7 @@ $(mt_matmul_host_bin) : $(mt_matmul_c_src) mt_matmul_riscv_bin = mt-matmul.riscv $(mt_matmul_riscv_bin) : $(mt_matmul_c_objs) $(mt_matmul_riscv_objs) - $(RISCV_LINK_MT) $(mt_matmul_c_objs) $(mt_matmul_riscv_objs) $(RISCV_LINK_OPTS) -o $(mt_matmul_riscv_bin) + $(RISCV_LINK) $(mt_matmul_c_objs) $(mt_matmul_riscv_objs) $(RISCV_LINK_OPTS) -o $(mt_matmul_riscv_bin) junk += $(mt_matmul_c_objs) $(mt_matmul_riscv_objs) \ $(mt_matmul_host_bin) $(mt_matmul_riscv_bin) diff --git a/benchmarks/mt-matmul/mt-matmul.c b/benchmarks/mt-matmul/mt-matmul.c index 93f8ea9..e795b50 100644 --- a/benchmarks/mt-matmul/mt-matmul.c +++ b/benchmarks/mt-matmul/mt-matmul.c @@ -25,7 +25,7 @@ //-------------------------------------------------------------------------- // Input/Reference Data -typedef float data_t; +typedef double data_t; #include "dataset.h" @@ -34,6 +34,7 @@ typedef float data_t; __thread unsigned long coreid; unsigned long ncores; +#define ncores ncores #include "util.h" @@ -48,41 +49,6 @@ unsigned long ncores; stringify(code), _c, _c/DIM_SIZE/DIM_SIZE/DIM_SIZE, 10*_c/DIM_SIZE/DIM_SIZE/DIM_SIZE%10, _c/_i, 10*_c/_i%10); \ } while(0) - -//-------------------------------------------------------------------------- -// Helper functions - -void printArray( char name[], int n, data_t arr[] ) -{ - int i; - if (coreid != 0) - return; - - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %3ld ", (long) arr[i] ); - printf( "\n" ); -} - -void __attribute__((noinline)) verify(size_t n, const data_t* test, const data_t* correct) -{ - if (coreid != 0) - return; - - size_t i; - for (i = 0; i < n; i++) - { - if (test[i] != correct[i]) - { - printf("FAILED test[%d]= %3ld, correct[%d]= %3ld\n", - i, (long)test[i], i, (long)correct[i]); - exit(-1); - } - } - - return; -} - //-------------------------------------------------------------------------- // matmul function @@ -139,8 +105,11 @@ void thread_entry(int cid, int nc) // verify - verify(ARRAY_SIZE, results_data, verify_data); - + int res = verifyDouble(ARRAY_SIZE, results_data, verify_data); + if (res) + exit(res); + +#if 0 // clear results from the first trial size_t i; if (coreid == 0) @@ -159,9 +128,11 @@ void thread_entry(int cid, int nc) #endif // verify - verify(ARRAY_SIZE, results_data, verify_data); + res = verify(ARRAY_SIZE, results_data, verify_data); + if (res) + exit(res); barrier(); +#endif exit(0); } - diff --git a/benchmarks/mt-vvadd/bmark.mk b/benchmarks/mt-vvadd/bmark.mk index 1f8b3ed..72b2d34 100644 --- a/benchmarks/mt-vvadd/bmark.mk +++ b/benchmarks/mt-vvadd/bmark.mk @@ -13,7 +13,7 @@ mt_vvadd_c_src = \ syscalls.c \ mt_vvadd_riscv_src = \ - crt-mt.S \ + crt.S \ mt_vvadd_c_objs = $(patsubst %.c, %.o, $(mt_vvadd_c_src)) mt_vvadd_riscv_objs = $(patsubst %.S, %.o, $(mt_vvadd_riscv_src)) @@ -24,7 +24,7 @@ $(mt_vvadd_host_bin) : $(mt_vvadd_c_src) mt_vvadd_riscv_bin = mt-vvadd.riscv $(mt_vvadd_riscv_bin) : $(mt_vvadd_c_objs) $(mt_vvadd_riscv_objs) - $(RISCV_LINK_MT) $(mt_vvadd_c_objs) $(mt_vvadd_riscv_objs) $(RISCV_LINK_OPTS) -o $(mt_vvadd_riscv_bin) + $(RISCV_LINK) $(mt_vvadd_c_objs) $(mt_vvadd_riscv_objs) $(RISCV_LINK_OPTS) -o $(mt_vvadd_riscv_bin) junk += $(mt_vvadd_c_objs) $(mt_vvadd_riscv_objs) \ $(mt_vvadd_host_bin) $(mt_vvadd_riscv_bin) diff --git a/benchmarks/mt-vvadd/mt-vvadd.c b/benchmarks/mt-vvadd/mt-vvadd.c index 497b9bb..60aa2e7 100644 --- a/benchmarks/mt-vvadd/mt-vvadd.c +++ b/benchmarks/mt-vvadd/mt-vvadd.c @@ -24,7 +24,7 @@ //-------------------------------------------------------------------------- // Input/Reference Data -typedef float data_t; +typedef double data_t; #include "dataset.h" @@ -33,6 +33,7 @@ typedef float data_t; __thread unsigned long coreid; unsigned long ncores; +#define ncores ncores #include "util.h" @@ -47,41 +48,6 @@ unsigned long ncores; stringify(code), _c, _c/DATA_SIZE, 10*_c/DATA_SIZE%10, _c/_i, 10*_c/_i%10); \ } while(0) - -//-------------------------------------------------------------------------- -// Helper functions - -void printArray( char name[], int n, data_t arr[] ) -{ - int i; - if (coreid != 0) - return; - - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %4ld ", (long) arr[i] ); - printf( "\n" ); -} - -void __attribute__((noinline)) verify(size_t n, const data_t* test, const data_t* correct) -{ - if (coreid != 0) - return; - - size_t i; - for (i = 0; i < n; i++) - { - if (test[i] != correct[i]) - { - printf("FAILED test[%d]= %4ld, correct[%d]= %4ld\n", - i, (long) test[i], i, (long)correct[i]); - exit(-1); - } - } - - return; -} - //-------------------------------------------------------------------------- // vvadd function @@ -136,8 +102,11 @@ void thread_entry(int cid, int nc) // verify - verify(DATA_SIZE, results_data, verify_data); - + int res = verifyDouble(DATA_SIZE, results_data, verify_data); + if (res) + exit(res); + +#if 0 // reset results from the first trial if (coreid == 0) { @@ -145,21 +114,22 @@ void thread_entry(int cid, int nc) results_data[i] = input1_data[i]; } barrier(); - - + // Execute your faster vvadd barrier(); stats(vvadd_opt(DATA_SIZE, results_data, input2_data); barrier()); #ifdef DEBUG - printArray("results: ", DATA_SIZE, results_data); - printArray("verify : ", DATA_SIZE, verify_data); + printDoubleArray("results: ", DATA_SIZE, results_data); + printDoubleArray("verify : ", DATA_SIZE, verify_data); #endif // verify - verify(DATA_SIZE, results_data, verify_data); + res = verifyDouble(DATA_SIZE, results_data, verify_data); + if (res) + exit(res); barrier(); +#endif exit(0); } - diff --git a/benchmarks/multiply/bmark.mk b/benchmarks/multiply/bmark.mk index d6114a1..93ba67f 100644 --- a/benchmarks/multiply/bmark.mk +++ b/benchmarks/multiply/bmark.mk @@ -11,6 +11,7 @@ multiply_c_src = \ multiply_main.c \ multiply.c \ + syscalls.c \ multiply_riscv_src = \ crt.S \ @@ -24,7 +25,7 @@ $(multiply_host_bin): $(multiply_c_src) multiply_riscv_bin = multiply.riscv $(multiply_riscv_bin): $(multiply_c_objs) $(multiply_riscv_objs) - $(RISCV_LINK) $(multiply_c_objs) $(multiply_riscv_objs) -o $(multiply_riscv_bin) + $(RISCV_LINK) $(multiply_c_objs) $(multiply_riscv_objs) -o $(multiply_riscv_bin) $(RISCV_LINK_OPTS) junk += $(multiply_c_objs) $(multiply_riscv_objs) \ $(multiply_host_bin) $(multiply_riscv_bin) diff --git a/benchmarks/multiply/multiply_main.c b/benchmarks/multiply/multiply_main.c index ca359eb..037de2f 100644 --- a/benchmarks/multiply/multiply_main.c +++ b/benchmarks/multiply/multiply_main.c @@ -8,84 +8,15 @@ // dataset1.h You should not change anything except the // HOST_DEBUG and VERIFY macros for your timing run. -#include "multiply.h" - -int ncores = 1; #include "util.h" -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set VERIFY to 1 if you want the program to check that the sort -// function returns the right answer. When you are doing your -// benchmarking you should set this to 0 so that the verification -// is not included in your timing. - -#ifndef VERIFY -#define VERIFY 1 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif +#include "multiply.h" //-------------------------------------------------------------------------- // Input/Reference Data #include "dataset1.h" -//-------------------------------------------------------------------------- -// Helper functions - -int verify( int n, int test[], int correct[] ) -{ - int i; - for ( i = 0; i < n; i++ ) { - if ( test[i] != correct[i] ) { - return 2; - } - } - return 1; -} - -#if HOST_DEBUG -void printArray( char name[], int n, int arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %3d ", arr[i] ); - printf( "\n" ); -} -#endif - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - //-------------------------------------------------------------------------- // Main @@ -95,42 +26,27 @@ int main( int argc, char* argv[] ) int results_data[DATA_SIZE]; // Output the input arrays - -#if HOST_DEBUG printArray( "input1", DATA_SIZE, input_data1 ); printArray( "input2", DATA_SIZE, input_data2 ); printArray( "verify", DATA_SIZE, verify_data ); -#endif -#if ( !HOST_DEBUG && PREALLOCATE ) +#if PREALLOCATE for (i = 0; i < DATA_SIZE; i++) { results_data[i] = multiply( input_data1[i], input_data2[i] ); } #endif -#if HOST_DEBUG - for (i = 0; i < DATA_SIZE; i++) - { - results_data[i] = multiply( input_data1[i], input_data2[i] ); - } -#else setStats(1); for (i = 0; i < DATA_SIZE; i++) { results_data[i] = multiply( input_data1[i], input_data2[i] ); } setStats(0); -#endif // Print out the results - -#if HOST_DEBUG printArray( "results", DATA_SIZE, results_data ); -#endif // Check the results - - finishTest(verify( DATA_SIZE, results_data, verify_data )); - + return verify( DATA_SIZE, results_data, verify_data ); } diff --git a/benchmarks/qsort/bmark.mk b/benchmarks/qsort/bmark.mk index cdc0545..4b39d96 100644 --- a/benchmarks/qsort/bmark.mk +++ b/benchmarks/qsort/bmark.mk @@ -10,6 +10,7 @@ qsort_c_src = \ qsort_main.c \ + syscalls.c \ qsort_riscv_src = \ crt.S \ @@ -23,7 +24,7 @@ $(qsort_host_bin) : $(qsort_c_src) qsort_riscv_bin = qsort.riscv $(qsort_riscv_bin) : $(qsort_c_objs) $(qsort_riscv_objs) - $(RISCV_LINK) $(qsort_c_objs) $(qsort_riscv_objs) -o $(qsort_riscv_bin) + $(RISCV_LINK) $(qsort_c_objs) $(qsort_riscv_objs) -o $(qsort_riscv_bin) $(RISCV_LINK_OPTS) junk += $(qsort_c_objs) $(qsort_riscv_objs) \ $(qsort_host_bin) $(qsort_riscv_bin) diff --git a/benchmarks/qsort/qsort_main.c b/benchmarks/qsort/qsort_main.c index e61eef2..9633356 100644 --- a/benchmarks/qsort/qsort_main.c +++ b/benchmarks/qsort/qsort_main.c @@ -11,36 +11,8 @@ // processor simulator itself. You should not change anything except // the HOST_DEBUG and PREALLOCATE macros for your timing run. -int ncores = 1; #include "util.h" -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif - // The INSERTION_THRESHOLD is the size of the subarray when the // algorithm switches to using an insertion sort instead of // quick sort. @@ -61,38 +33,6 @@ int ncores = 1; #include "dataset1.h" -//-------------------------------------------------------------------------- -// Helper functions - -int verify( int n, int test[], int correct[] ) -{ - int i; - for ( i = 0; i < n; i++ ) { - if ( test[i] != correct[i] ) { - return 2; - } - } - return 1; -} - -#if HOST_DEBUG -void printArray( char name[], int n, int arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %3d ", arr[i] ); - printf( "\n" ); -} -#endif - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - //-------------------------------------------------------------------------- // Quicksort function @@ -195,34 +135,23 @@ void sort( int n, int arr[] ) int main( int argc, char* argv[] ) { - // Output the input array - -#if HOST_DEBUG printArray( "input", DATA_SIZE, input_data ); printArray( "verify", DATA_SIZE, verify_data ); -#endif - - // If needed we preallocate everything in the caches #if PREALLOCATE + // If needed we preallocate everything in the caches sort( DATA_SIZE, input_data ); #endif // Do the sort - setStats(1); sort( DATA_SIZE, input_data ); setStats(0); // Print out the results - -#if HOST_DEBUG printArray( "test", DATA_SIZE, input_data ); -#endif // Check the results - - finishTest(verify( DATA_SIZE, input_data, verify_data )); - + return verify( DATA_SIZE, input_data, verify_data ); } diff --git a/benchmarks/spmv/bmark.mk b/benchmarks/spmv/bmark.mk index 5ab9cc0..dcfdb19 100644 --- a/benchmarks/spmv/bmark.mk +++ b/benchmarks/spmv/bmark.mk @@ -10,6 +10,7 @@ spmv_c_src = \ spmv_main.c \ + syscalls.c \ spmv_riscv_src = \ crt.S \ @@ -23,7 +24,7 @@ $(spmv_host_bin) : $(spmv_c_src) spmv_riscv_bin = spmv.riscv $(spmv_riscv_bin) : $(spmv_c_objs) $(spmv_riscv_objs) - $(RISCV_LINK) $(spmv_c_objs) $(spmv_riscv_objs) -o $(spmv_riscv_bin) + $(RISCV_LINK) $(spmv_c_objs) $(spmv_riscv_objs) -o $(spmv_riscv_bin) $(RISCV_LINK_OPTS) junk += $(spmv_c_objs) $(spmv_riscv_objs) \ $(spmv_host_bin) $(spmv_riscv_bin) diff --git a/benchmarks/spmv/spmv_main.c b/benchmarks/spmv/spmv_main.c index d765ca2..44cdc99 100644 --- a/benchmarks/spmv/spmv_main.c +++ b/benchmarks/spmv/spmv_main.c @@ -2,75 +2,13 @@ // Double-precision general matrix multiplication benchmark //-------------------------------------------------------------------------- -int ncores = 1; #include "util.h" -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif - //-------------------------------------------------------------------------- // Input/Reference Data #include "dataset1.h" -//-------------------------------------------------------------------------- -// Helper functions - -int verify( long n, const double test[], const double correct[] ) -{ - int i; - for ( i = 0; i < n; i++ ) { - if ( test[i] != correct[i] ) { - return 2; - } - } - return 1; -} - -#if HOST_DEBUG -#include -#include -void printArray( char name[], long n, const double arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %8.1f ", arr[i] ); - printf( "\n" ); -} -#endif - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - void spmv(int r, const double* val, const int* idx, const double* x, const int* ptr, double* y) { @@ -108,5 +46,5 @@ int main( int argc, char* argv[] ) spmv(R, val, idx, x, ptr, y); setStats(0); - finishTest(verify(R, y, verify_data)); + return verifyDouble(R, y, verify_data); } diff --git a/benchmarks/towers/bmark.mk b/benchmarks/towers/bmark.mk index 0c16a81..b16bf04 100644 --- a/benchmarks/towers/bmark.mk +++ b/benchmarks/towers/bmark.mk @@ -10,6 +10,7 @@ towers_c_src = \ towers_main.c \ + syscalls.c \ towers_riscv_src = \ crt.S \ @@ -23,7 +24,7 @@ $(towers_host_bin) : $(towers_c_src) towers_riscv_bin = towers.riscv $(towers_riscv_bin) : $(towers_c_objs) $(towers_riscv_objs) - $(RISCV_LINK) $(towers_c_objs) $(towers_riscv_objs) -o $(towers_riscv_bin) + $(RISCV_LINK) $(towers_c_objs) $(towers_riscv_objs) -o $(towers_riscv_bin) $(RISCV_LINK_OPTS) junk += $(towers_c_objs) $(towers_riscv_objs) \ $(towers_host_bin) $(towers_riscv_bin) diff --git a/benchmarks/towers/towers_main.c b/benchmarks/towers/towers_main.c index 724b73b..9f60017 100644 --- a/benchmarks/towers/towers_main.c +++ b/benchmarks/towers/towers_main.c @@ -16,50 +16,12 @@ // smips processor simulator itself. You should not change anything except // the HOST_DEBUG and PREALLOCATE macros for your timing run. -int ncores = 1; #include "util.h" -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif - // This is the number of discs in the puzzle. #define NUM_DISCS 7 -//-------------------------------------------------------------------------- -// Helper functions - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - //-------------------------------------------------------------------------- // List data structure and functions @@ -278,7 +240,7 @@ int towers_verify( struct Towers* this ) return 6; } - return 1; + return 0; } //-------------------------------------------------------------------------- @@ -323,8 +285,6 @@ int main( int argc, char* argv[] ) #endif // Check the results - - finishTest( towers_verify( &towers ) ); - + return towers_verify( &towers ); } diff --git a/benchmarks/vec-cmplxmult/vec_cmplxmult_main.c b/benchmarks/vec-cmplxmult/vec_cmplxmult_main.c index 3251ef9..6715c45 100644 --- a/benchmarks/vec-cmplxmult/vec_cmplxmult_main.c +++ b/benchmarks/vec-cmplxmult/vec_cmplxmult_main.c @@ -53,9 +53,10 @@ #include #else void printstr(const char*); -void exit(); #endif +#include "util.h" + //-------------------------------------------------------------------------- // Complex Value Structs diff --git a/benchmarks/vec-fft/bmark.mk b/benchmarks/vec-fft/bmark.mk new file mode 100644 index 0000000..46a2835 --- /dev/null +++ b/benchmarks/vec-fft/bmark.mk @@ -0,0 +1,41 @@ +#======================================================================= +# UCB CS250 Makefile fragment for benchmarks +#----------------------------------------------------------------------- +# +# Each benchmark directory should have its own fragment which +# essentially lists what the source files are and how to link them +# into an riscv and/or host executable. All variables should include +# the benchmark name as a prefix so that they are unique. +# + +vec-fft_data_src = fft-data.c + +vec-fft_c_src = \ + vec-fft_main.c \ + vec-fft.c \ + $(vec-fft_data_src) + +vec-fft_riscv_src = \ + crt.S \ + vec-vfft.S + +vec-fft_c_objs = $(patsubst %.c, %.o, $(vec-fft_c_src)) +vec-fft_riscv_objs = $(patsubst %.S, %.o, $(vec-fft_riscv_src)) + +vec-fft_data_bin = fft-data-gen +$(vec-fft_data_src): $(vec-fft_data_bin) + ./$< $(FFT_FLOATING_PREC) $(FFT_SIZE) > $@ + +vec-fft_host_bin = vec-fft.host +$(vec-fft_host_bin): $(vec-fft_c_src) +# $(HOST_COMP) $^ -o $(vec-fft_host_bin) + +RISCV_LINK_SYSCALL = $(bmarkdir)/common/syscalls.c -lc + +vec-fft_riscv_bin = vec-fft.riscv +$(vec-fft_riscv_bin): $(vec-fft_c_objs) $(vec-fft_riscv_objs) + $(RISCV_LINK) $(RISCV_LINK_SYSCALL) $(vec-fft_c_objs) $(vec-fft_riscv_objs) -o $(vec-fft_riscv_bin) + +junk += \ + $(vec-fft_data_src) $(vec-fft_c_objs) $(vec-fft_riscv_objs) \ + $(vec-fft_host_bin) $(vec-fft_riscv_bin) diff --git a/benchmarks/vec-fft/cvt16.c b/benchmarks/vec-fft/cvt16.c new file mode 100644 index 0000000..4307c7d --- /dev/null +++ b/benchmarks/vec-fft/cvt16.c @@ -0,0 +1,120 @@ +#include "cvt16.h" + +#define H_BIAS (UINT16_C(0xf)) +#define H_F_MASK (UINT16_C(0x03FF)) +#define H_E_MASK (UINT16_C(0x7C00)) +#define H_E_SHIFT (10) +#define H_S_MASK (UINT16_C(0x8000)) + +#define H_QNAN (H_F_MASK) + +#define S_BIAS (UINT32_C(0x7F)) +#define S_F_MASK (UINT32_C(0x007fffff)) +#define S_E_MASK (UINT32_C(0x7f800000)) +#define S_E_SHIFT (23) +#define S_S_MASK (UINT32_C(0x80000000)) + +#define S_QNAN (S_F_MASK) + +#define PAD (S_E_SHIFT - H_E_SHIFT) + +uint_fast32_t cvt_hs(uint_fast16_t x) +{ +#define MSB (UINT32_C(0x00800000)) + uint_fast32_t frac, exp, sign; + frac = (x & H_F_MASK) << PAD; + exp = (x & H_E_MASK); + sign = (x & H_S_MASK); + + switch (exp) { + case 0: + if (frac) { /* Denormal */ + exp = S_BIAS - 14; + /* Adjust fraction for implicit leading 1-bit */ + for (; !(frac & MSB); frac <<= 1, exp--); + frac &= ~(MSB); + exp <<= S_E_SHIFT; + } + break; + + case H_E_MASK: /* Infinity and NaN */ + exp = S_E_MASK; + if (frac) { /* Set padding bits for NaN */ + frac |= (1 << PAD) - 1; + } + break; + default: + exp += (S_BIAS - H_BIAS) << H_E_SHIFT; /* Re-bias */ + exp <<= PAD; + } + return (sign << 16) | exp | frac; +#undef MSB +} + +/* + * LSB : frac[13] + * Guard bit (G): frac[12] + * Round bit (R): frac[11] + * Sticky bit (S): OR of frac[10..0] + * + * RTZ: + * truncate + * RUP: + * 000 : exact + * else : round up + * RDN: + * 000 : exact + * else : round down + * RNE: + * 0xx : round down + * 100 : tie; round up if LSB is 1 + * 101 : round up + * 110 : round up + * 111 : round up + */ +uint_fast16_t cvt_sh(uint_fast32_t x, int rm) +{ +#define MSB UINT16_C(0x0400) + uint_fast32_t frac, exp, sign; + int e; + sign = (x & S_S_MASK) >> 16; + exp = (x & S_E_MASK); + if (exp && exp != S_E_MASK) { + int inc; + inc = 0; + switch (rm) { + case RNE: + /* Round up if G is set and either R, S, + or the bit before G is non-zero */ + inc = (x & 0x1000) && (x & 0x2fff); + break; + case RUP: + inc = ((x & 0x1fff) != 0) && (!sign); + break; + case RDN: + inc = ((x & 0x1fff) != 0) && sign; + break; + } + x += inc << PAD; + exp = (x & S_E_MASK); + } + frac = (x & S_F_MASK) >> PAD; + + e = (exp >> S_E_SHIFT) - S_BIAS; + if (e < -24) { /* Round to zero */ + return sign; + } else if (e < -14) { /* Denormal */ + frac = (frac | MSB) >> (-e - 14); + return sign | frac; + } else if (e < 16) { + exp = (e + H_BIAS) << H_E_SHIFT; + } else if (e < 127) { /* Round to infinity */ + exp = H_E_MASK; + frac = 0; + } else { + /* Infinity and NaN */ + } + return sign | exp | frac; +#undef MSB +} + diff --git a/benchmarks/vec-fft/cvt16.h b/benchmarks/vec-fft/cvt16.h new file mode 100644 index 0000000..d716d05 --- /dev/null +++ b/benchmarks/vec-fft/cvt16.h @@ -0,0 +1,17 @@ +#ifndef _CVT16_H +#define _CVT16_H + +#include + +extern uint_fast32_t cvt_hs(uint_fast16_t); +extern uint_fast16_t cvt_sh(uint_fast32_t, int); + +enum riscv_rm { + RNE = 0, /* Round to nearest; ties to even */ + RTZ = 1, /* Round towards zero (truncate) */ + RDN = 2, /* Round towards negative infinity (down) */ + RUP = 3, /* Round towards positive infinity (up) */ + RMM = 4, /* Round to nearest; ties to max magnitude */ +}; + +#endif 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 +#include +#include + +#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; +} diff --git a/benchmarks/vec-fft/data.c b/benchmarks/vec-fft/data.c new file mode 100644 index 0000000..fd91929 --- /dev/null +++ b/benchmarks/vec-fft/data.c @@ -0,0 +1,21 @@ +#include "fft_const.h" + +#if !defined(FP_HALF) + +fftval_t input_data_real[ 128 ] = { 0.639426798458, 0.0250107552227, 0.275029318369, 0.223210738149, 0.736471214164, 0.676699487423, 0.892179567705, 0.0869388326294, 0.421921819685, 0.0297972194381, 0.218637974804, 0.505355288103, 0.0265359696839, 0.198837650687, 0.64988443778, 0.544941480603, 0.220440622041, 0.589265683876, 0.809430456678, 0.00649875967806, 0.805819251833, 0.698139394988, 0.340250516518, 0.155479499812, 0.957213072207, 0.336594545113, 0.0927458433801, 0.0967163768335, 0.847494366347, 0.603726031367, 0.807128273274, 0.729731786694, 0.536228091455, 0.973115763979, 0.378534377208, 0.552040631273, 0.829404664253, 0.618519752364, 0.861706900311, 0.577352145257, 0.704571836215, 0.0458243836557, 0.227898275652, 0.289387963602, 0.0797919769236, 0.232790886361, 0.10100142941, 0.27797360311, 0.635684444264, 0.36483217897, 0.370180967117, 0.209507030771, 0.266977822049, 0.936654587712, 0.648035385247, 0.609131005667, 0.171138648198, 0.72912679795, 0.163402493762, 0.379455441758, 0.989523350637, 0.639999759854, 0.556949743775, 0.68461425099, 0.84285192019, 0.775999911546, 0.229048071964, 0.032100243904, 0.315453048059, 0.267740875976, 0.210982843586, 0.942909714335, 0.876367626473, 0.314677880798, 0.655438665295, 0.395631901061, 0.914547589741, 0.458851852587, 0.264880166498, 0.246627507694, 0.561368134163, 0.262741608523, 0.584585990224, 0.897822883602, 0.39940050514, 0.219320759157, 0.997537606495, 0.509526293676, 0.0909094121738, 0.0471163754247, 0.109649130351, 0.627446041703, 0.792079364363, 0.4221599668, 0.063527706152, 0.381619286507, 0.99612138024, 0.529114345099, 0.971078377614, 0.860779702234, 0.0114810219428, 0.72072181936, 0.681710369027, 0.536970330409, 0.266825189953, 0.64096179858, 0.111552173596, 0.434765250669, 0.453723706329, 0.953815927521, 0.875852940378, 0.263389050751, 0.50058611305, 0.17865188053, 0.912627839345, 0.870518569837, 0.298444791449, 0.638949494866, 0.608970211438, 0.15283926855, 0.762510800075, 0.53937903012, 0.778626478631, 0.530353672195, 0.000571896127944, 0.324156057005, 0.0194767423858, 0.929098616265 }; +fftval_t input_data_imag[ 128 ] = { 0.878721877823, 0.831665529361, 0.307514125403, 0.0579251664942, 0.878009599204, 0.946949445298, 0.0856534520679, 0.485990463317, 0.0692125184684, 0.760602165257, 0.765834429307, 0.1283914645, 0.475282378099, 0.549803593495, 0.26505662894, 0.872433041085, 0.423137940201, 0.211798205442, 0.539296088779, 0.72993106909, 0.20115106339, 0.311716291301, 0.995149356661, 0.649878057639, 0.438100083915, 0.517575841036, 0.121004195868, 0.224697337032, 0.338085562147, 0.588308718457, 0.230114732597, 0.220217384452, 0.070993086009, 0.63110295727, 0.228941783811, 0.905420013006, 0.859635400254, 0.0708573498887, 0.238004634369, 0.668977778296, 0.21423680737, 0.132311848725, 0.935514240581, 0.571043093325, 0.472671026312, 0.784619424291, 0.807496997767, 0.190409914362, 0.0969308142288, 0.431051182406, 0.42357862302, 0.467024668037, 0.72907584946, 0.673364547293, 0.984165211366, 0.098417871152, 0.402621282102, 0.339302605395, 0.861672536353, 0.24865633392, 0.190208908441, 0.448613547833, 0.421881639834, 0.278545144667, 0.249806447882, 0.923265599276, 0.443130745053, 0.861349104762, 0.55032531245, 0.0505883295249, 0.999282468413, 0.83602758508, 0.968996257285, 0.926366983008, 0.848695734414, 0.166311110604, 0.485641125451, 0.213747299199, 0.401040292549, 0.0586353999722, 0.378973118977, 0.98530884378, 0.265203058172, 0.784070601949, 0.455008367339, 0.42300748599, 0.95731764086, 0.995422689493, 0.555768323406, 0.718408275296, 0.154796825274, 0.296707825495, 0.968709364969, 0.579180290816, 0.542195201374, 0.747975560379, 0.0571652729075, 0.584177594459, 0.50285038292, 0.852719892048, 0.157432727939, 0.960778903274, 0.0801114652406, 0.185824960981, 0.59503510645, 0.675212553604, 0.235203895001, 0.119886613947, 0.890287314129, 0.246215347789, 0.594519153533, 0.619381510332, 0.419224915336, 0.583672289291, 0.522782715532, 0.934706257736, 0.204259199424, 0.716191800789, 0.238685952616, 0.395785846791, 0.67169022296, 0.299997079799, 0.316177196272, 0.751864492414, 0.0725431144932, 0.458285522619, 0.998454440854, 0.996096447855 }; +fftval_t output_data_real[ 128 ] = { 61.954455353, -3.55833399529, -0.523354806008, -3.37768557289, 3.32687067509, -3.0237541092, -0.378319273514, 0.525689010981, 5.25658573479, -2.28074215555, -4.28723433346, -4.4277864945, 1.25302215885, -0.482791893995, -1.12845609406, -3.21089274844, -0.078505416643, -2.1193590094, 4.98495906311, -3.56979439628, 2.72333789593, 2.25668218204, 0.335271678442, -6.34334972936, 0.712532452309, 0.409291142904, -1.22780527711, 3.84865910019, 0.969858896916, 1.05979174012, -0.405273430345, 1.0161952607, 2.65666792497, -7.17797945232, 3.35748060331, -1.93036005449, 5.79228873407, 6.83679539719, 0.455509780838, -4.32751152407, -0.195720493898, -4.39713867575, 4.04962604613, 8.55532419691, 0.793886999177, 2.74675335418, 1.78534557879, -0.150461101563, 4.79269199365, -0.097190171132, -2.93509465459, 0.000498021981268, -3.87438881161, -5.12734321093, -2.12762472404, -1.16638837683, 3.59130812163, -0.816225274592, -0.806189352525, -1.15586605458, -1.92113200189, 0.855167926588, 0.603604208411, -0.409696855698, 2.88640009067, 2.56152175575, -1.09096481126, 0.828707821899, -0.962267817144, -0.81230709709, 1.16163049602, -0.695404120144, -4.20242999608, -2.92482265517, 1.02303060189, -2.70129415201, 0.525364381257, 2.49338291739, 2.34783772688, 4.95908644781, 0.177530769676, 5.16759926801, -2.55397551085, 1.48552350843, -4.50573276988, 0.451229866674, -6.81151821737, -5.00364260745, -0.98762260691, 5.226676945, 1.73684083074, -4.95366720132, 2.43429602647, 0.460297668808, 0.111897844813, -2.75691723482, 0.310022422864, -1.58528590021, -2.03689286823, -1.102027189, 3.51353594739, 1.0387748517, 3.84115211002, 3.81032001841, 2.43243605239, 0.621532229972, 5.36804043022, 7.69993469463, 3.63860246238, 3.633002238, -2.47462170952, 5.24293295589, 0.774064132507, -3.91244434865, 4.72655267242, -2.81469193189, 0.993153378271, -3.2354193083, 0.474071574908, 0.756162196284, -1.15709647317, 3.31705213122, -6.01086540873, 2.37742277745, 2.84408587391, -3.65152823413, -3.16692487284, 2.0388874191 }; +fftval_t output_data_imag[ 128 ] = { 64.7050383851, 0.698184545699, 3.42493175348, 5.66261938459, 1.00574698274, -3.1031255135, 5.20424207641, 2.0448135066, -4.63849287023, 2.51117736295, 1.41295259621, -2.45639979763, 5.86862949669, -4.29715899392, 1.97792740773, 1.61104358821, 3.55985554637, -0.852668449458, 3.78965920404, 1.11985520891, -3.08121666225, 4.31756301978, 7.89587646848, 5.66554418397, -6.1086556137, 5.62222049291, 4.34787054172, 0.668211990523, 2.31296531095, 5.41014021609, 0.453996830494, 2.7935768665, -2.34494675051, 1.17549556253, -2.36863533542, 3.34802654836, 0.810944712905, -3.46714468032, -4.00653978407, -3.0699493452, 5.34453801646, -1.15007047713, 1.48224491218, 1.96983218353, -2.35988258452, -3.83406990073, 1.05359927173, -2.62518260336, -2.26840395653, 4.53058951798, 4.37784201599, 1.74456564948, 1.17919710136, 5.85762105311, -2.17089571025, -0.186855334345, -2.78684050993, 11.2542088523, 3.53682020657, 0.921750647669, -2.75033375937, -2.39105725671, 5.69627942011, -2.14262056709, -3.24450591785, -4.88101239098, -0.82019947831, 1.73555667725, -2.67542169613, 2.70255959353, -1.56904900802, 0.813903077259, -4.79584930282, -0.827151380084, -0.153701429418, -2.79898616186, 2.31828350443, 2.21515556736, -3.40293773784, -0.162985084297, -3.05206321075, 1.75265985778, 1.95085395048, -4.00325708931, -4.0551434497, 1.05832733908, -0.462016761175, -10.7553551483, -1.34633968539, 3.33861851859, 0.17331130312, -3.50040264719, -0.469531530722, -6.75712678783, 0.101038910495, 4.60866018427, -1.43982416145, -0.388454731031, -2.90742197761, 0.187444758531, 2.66953361587, 6.87916789749, -1.25246099771, -0.80213619158, 0.490239247273, -4.52070544206, 1.9815151617, -4.46229763612, -2.28749790966, 0.771352499303, 2.42025535542, 2.63871825487, -3.99023733181, -0.379591050964, 2.64500129424, -1.50502365382, 1.35040224487, 6.8258533247, -2.71874835374, 5.97039779238, 3.11574368961, 6.0121394881, -1.19573643258, 2.25554012485, -0.82195704339, -1.2418186553, 1.11396326277, -1.87990085069 }; +fftval_t tf_real[ 128 ] = { 1.0, 0.998795456205, 0.995184726672, 0.989176509965, 0.980785280403, 0.970031253195, 0.956940335732, 0.941544065183, 0.923879532511, 0.903989293123, 0.881921264348, 0.85772861, 0.831469612303, 0.803207531481, 0.773010453363, 0.740951125355, 0.707106781187, 0.671558954847, 0.634393284164, 0.595699304492, 0.55557023302, 0.514102744193, 0.471396736826, 0.42755509343, 0.382683432365, 0.336889853392, 0.290284677254, 0.242980179903, 0.195090322016, 0.146730474455, 0.0980171403296, 0.0490676743274, 6.12323399574e-17, -0.0490676743274, -0.0980171403296, -0.146730474455, -0.195090322016, -0.242980179903, -0.290284677254, -0.336889853392, -0.382683432365, -0.42755509343, -0.471396736826, -0.514102744193, -0.55557023302, -0.595699304492, -0.634393284164, -0.671558954847, -0.707106781187, -0.740951125355, -0.773010453363, -0.803207531481, -0.831469612303, -0.85772861, -0.881921264348, -0.903989293123, -0.923879532511, -0.941544065183, -0.956940335732, -0.970031253195, -0.980785280403, -0.989176509965, -0.995184726672, -0.998795456205, -1.0, -0.998795456205, -0.995184726672, -0.989176509965, -0.980785280403, -0.970031253195, -0.956940335732, -0.941544065183, -0.923879532511, -0.903989293123, -0.881921264348, -0.85772861, -0.831469612303, -0.803207531481, -0.773010453363, -0.740951125355, -0.707106781187, -0.671558954847, -0.634393284164, -0.595699304492, -0.55557023302, -0.514102744193, -0.471396736826, -0.42755509343, -0.382683432365, -0.336889853392, -0.290284677254, -0.242980179903, -0.195090322016, -0.146730474455, -0.0980171403296, -0.0490676743274, -1.83697019872e-16, 0.0490676743274, 0.0980171403296, 0.146730474455, 0.195090322016, 0.242980179903, 0.290284677254, 0.336889853392, 0.382683432365, 0.42755509343, 0.471396736826, 0.514102744193, 0.55557023302, 0.595699304492, 0.634393284164, 0.671558954847, 0.707106781187, 0.740951125355, 0.773010453363, 0.803207531481, 0.831469612303, 0.85772861, 0.881921264348, 0.903989293123, 0.923879532511, 0.941544065183, 0.956940335732, 0.970031253195, 0.980785280403, 0.989176509965, 0.995184726672, 0.998795456205 }; +fftval_t tf_imag[ 128 ] = { -0.0, -0.0490676743274, -0.0980171403296, -0.146730474455, -0.195090322016, -0.242980179903, -0.290284677254, -0.336889853392, -0.382683432365, -0.42755509343, -0.471396736826, -0.514102744193, -0.55557023302, -0.595699304492, -0.634393284164, -0.671558954847, -0.707106781187, -0.740951125355, -0.773010453363, -0.803207531481, -0.831469612303, -0.85772861, -0.881921264348, -0.903989293123, -0.923879532511, -0.941544065183, -0.956940335732, -0.970031253195, -0.980785280403, -0.989176509965, -0.995184726672, -0.998795456205, -1.0, -0.998795456205, -0.995184726672, -0.989176509965, -0.980785280403, -0.970031253195, -0.956940335732, -0.941544065183, -0.923879532511, -0.903989293123, -0.881921264348, -0.85772861, -0.831469612303, -0.803207531481, -0.773010453363, -0.740951125355, -0.707106781187, -0.671558954847, -0.634393284164, -0.595699304492, -0.55557023302, -0.514102744193, -0.471396736826, -0.42755509343, -0.382683432365, -0.336889853392, -0.290284677254, -0.242980179903, -0.195090322016, -0.146730474455, -0.0980171403296, -0.0490676743274, -1.22464679915e-16, 0.0490676743274, 0.0980171403296, 0.146730474455, 0.195090322016, 0.242980179903, 0.290284677254, 0.336889853392, 0.382683432365, 0.42755509343, 0.471396736826, 0.514102744193, 0.55557023302, 0.595699304492, 0.634393284164, 0.671558954847, 0.707106781187, 0.740951125355, 0.773010453363, 0.803207531481, 0.831469612303, 0.85772861, 0.881921264348, 0.903989293123, 0.923879532511, 0.941544065183, 0.956940335732, 0.970031253195, 0.980785280403, 0.989176509965, 0.995184726672, 0.998795456205, 1.0, 0.998795456205, 0.995184726672, 0.989176509965, 0.980785280403, 0.970031253195, 0.956940335732, 0.941544065183, 0.923879532511, 0.903989293123, 0.881921264348, 0.85772861, 0.831469612303, 0.803207531481, 0.773010453363, 0.740951125355, 0.707106781187, 0.671558954847, 0.634393284164, 0.595699304492, 0.55557023302, 0.514102744193, 0.471396736826, 0.42755509343, 0.382683432365, 0.336889853392, 0.290284677254, 0.242980179903, 0.195090322016, 0.146730474455, 0.0980171403296, 0.0490676743274 }; + +#else + +fftval_t input_data_real[128] = { 0x391e, 0x2667, 0x3467, 0x3325, 0x39e4, 0x396a, 0x3b23, 0x2d90, 0x36c0, 0x27a1, 0x32ff, 0x380b, 0x26cb, 0x325d, 0x3933, 0x385c, 0x330e, 0x38b7, 0x3a7a, 0x1ea8, 0x3a72, 0x3996, 0x3572, 0x30fa, 0x3ba8, 0x3563, 0x2df0, 0x2e31, 0x3ac8, 0x38d4, 0x3a75, 0x39d6, 0x384a, 0x3bc9, 0x360e, 0x386b, 0x3aa3, 0x38f3, 0x3ae5, 0x389e, 0x39a3, 0x29de, 0x334b, 0x34a1, 0x2d1b, 0x3373, 0x2e77, 0x3473, 0x3916, 0x35d6, 0x35ec, 0x32b4, 0x3446, 0x3b7e, 0x392f, 0x38e0, 0x317a, 0x39d5, 0x313b, 0x3612, 0x3beb, 0x391f, 0x3875, 0x397a, 0x3abe, 0x3a35, 0x3354, 0x281c, 0x350c, 0x3449, 0x32c0, 0x3b8b, 0x3b03, 0x3509, 0x393e, 0x3655, 0x3b51, 0x3757, 0x343d, 0x33e4, 0x387e, 0x3434, 0x38ad, 0x3b2f, 0x3664, 0x3305, 0x3bfb, 0x3814, 0x2dd1, 0x2a08, 0x2f04, 0x3905, 0x3a56, 0x36c1, 0x2c11, 0x361b, 0x3bf8, 0x383c, 0x3bc5, 0x3ae3, 0x21e1, 0x39c4, 0x3974, 0x384c, 0x3445, 0x3921, 0x2f24, 0x36f5, 0x3742, 0x3ba1, 0x3b02, 0x3437, 0x3801, 0x31b8, 0x3b4d, 0x3af7, 0x34c6, 0x391d, 0x38df, 0x30e4, 0x3a1a, 0x3851, 0x3a3b, 0x383e, 0x10af, 0x3530, 0x24fc, 0x3b6f, }; +fftval_t input_data_imag[128] = { 0x3b08, 0x3aa7, 0x34ec, 0x2b6a, 0x3b06, 0x3b93, 0x2d7b, 0x37c7, 0x2c6e, 0x3a16, 0x3a20, 0x301c, 0x379b, 0x3866, 0x343e, 0x3afb, 0x36c5, 0x32c7, 0x3850, 0x39d7, 0x3270, 0x34fd, 0x3bf6, 0x3933, 0x3702, 0x3824, 0x2fbf, 0x3331, 0x3569, 0x38b5, 0x335d, 0x330c, 0x2c8b, 0x390c, 0x3353, 0x3b3e, 0x3ae1, 0x2c89, 0x339e, 0x395a, 0x32db, 0x303c, 0x3b7c, 0x3891, 0x3790, 0x3a47, 0x3a76, 0x3218, 0x2e34, 0x36e6, 0x36c7, 0x3779, 0x39d5, 0x3963, 0x3be0, 0x2e4c, 0x3671, 0x356e, 0x3ae5, 0x33f5, 0x3216, 0x372e, 0x36c0, 0x3475, 0x33fe, 0x3b63, 0x3717, 0x3ae4, 0x3867, 0x2a7a, 0x3bff, 0x3ab0, 0x3bc1, 0x3b69, 0x3aca, 0x3152, 0x37c5, 0x32d7, 0x366b, 0x2b81, 0x3610, 0x3be2, 0x343e, 0x3a46, 0x3748, 0x36c5, 0x3ba9, 0x3bf7, 0x3872, 0x39bf, 0x30f4, 0x34bf, 0x3bc0, 0x38a2, 0x3856, 0x39fc, 0x2b51, 0x38ac, 0x3806, 0x3ad2, 0x310a, 0x3bb0, 0x2d21, 0x31f2, 0x38c3, 0x3967, 0x3387, 0x2fac, 0x3b1f, 0x33e1, 0x38c2, 0x38f4, 0x36b5, 0x38ab, 0x382f, 0x3b7a, 0x3289, 0x39bb, 0x33a3, 0x3655, 0x3960, 0x34cd, 0x350f, 0x3a04, 0x2ca5, 0x3755, 0x3bfd, 0x3bf8, }; +fftval_t output_data_real[128] = { 0x53bf, 0xc31e, 0xb830, 0xc2c1, 0x42a7, 0xc20c, 0xb60e, 0x3835, 0x4542, 0xc090, 0xc44a, 0xc46e, 0x3d03, 0xb7ba, 0xbc84, 0xc26c, 0xad06, 0xc03d, 0x44fc, 0xc324, 0x4172, 0x4083, 0x355d, 0xc658, 0x39b3, 0x368c, 0xbce9, 0x43b3, 0x3bc2, 0x3c3d, 0xb67c, 0x3c11, 0x4150, 0xc72e, 0x42b7, 0xbfb9, 0x45cb, 0x46d6, 0x374a, 0xc454, 0xb243, 0xc466, 0x440d, 0x4847, 0x3a5a, 0x417e, 0x3f24, 0xb0d1, 0x44cb, 0xae38, 0xc1df, 0x1014, 0xc3c0, 0xc521, 0xc041, 0xbcaa, 0x432f, 0xba88, 0xba73, 0xbca0, 0xbfaf, 0x3ad7, 0x38d4, 0xb68e, 0x41c6, 0x411f, 0xbc5d, 0x3aa1, 0xbbb3, 0xba80, 0x3ca6, 0xb990, 0xc434, 0xc1da, 0x3c18, 0xc167, 0x3834, 0x40fd, 0x40b2, 0x44f6, 0x31ae, 0x452b, 0xc11c, 0x3df1, 0xc481, 0x3738, 0xc6d0, 0xc501, 0xbbe7, 0x453a, 0x3ef3, 0xc4f4, 0x40de, 0x375d, 0x2f29, 0xc184, 0x34f6, 0xbe57, 0xc013, 0xbc68, 0x4307, 0x3c28, 0x43af, 0x439f, 0x40dd, 0x38f9, 0x455e, 0x47b3, 0x4347, 0x4344, 0xc0f3, 0x453e, 0x3a31, 0xc3d3, 0x44ba, 0xc1a1, 0x3bf2, 0xc279, 0x3796, 0x3a0d, 0xbca1, 0x42a2, 0xc603, 0x40c1, 0x41b0, 0xc34e, 0xc255, 0x4014, }; +fftval_t output_data_imag[128] = { 0x540b, 0x3996, 0x42da, 0x45aa, 0x3c06, 0xc235, 0x4534, 0x4017, 0xc4a3, 0x4106, 0x3da7, 0xc0ea, 0x45de, 0xc44c, 0x3fe9, 0x3e72, 0x431f, 0xbad2, 0x4394, 0x3c7b, 0xc22a, 0x4451, 0x47e5, 0x45aa, 0xc61c, 0x459f, 0x4459, 0x3958, 0x40a0, 0x4569, 0x3744, 0x4196, 0xc0b1, 0x3cb4, 0xc0bd, 0x42b2, 0x3a7d, 0xc2ef, 0xc402, 0xc224, 0x4558, 0xbc9a, 0x3dee, 0x3fe1, 0xc0b8, 0xc3ab, 0x3c37, 0xc140, 0xc089, 0x4488, 0x4461, 0x3efa, 0x3cb7, 0x45dc, 0xc057, 0xb1fb, 0xc193, 0x49a1, 0x4313, 0x3b60, 0xc180, 0xc0c8, 0x45b2, 0xc049, 0xc27d, 0xc4e2, 0xba90, 0x3ef1, 0xc15a, 0x4168, 0xbe47, 0x3a83, 0xc4cc, 0xba9e, 0xb0eb, 0xc199, 0x40a3, 0x406e, 0xc2ce, 0xb137, 0xc21b, 0x3f03, 0x3fce, 0xc401, 0xc40e, 0x3c3c, 0xb764, 0xc961, 0xbd63, 0x42ad, 0x318c, 0xc300, 0xb783, 0xc6c2, 0x2e77, 0x449c, 0xbdc2, 0xb637, 0xc1d1, 0x3200, 0x4157, 0x46e1, 0xbd03, 0xba6b, 0x37d8, 0xc485, 0x3fed, 0xc476, 0xc093, 0x3a2c, 0x40d7, 0x4147, 0xc3fb, 0xb613, 0x414a, 0xbe05, 0x3d67, 0x46d3, 0xc170, 0x45f8, 0x423b, 0x4603, 0xbcc8, 0x4083, 0xba93, 0xbcf8, 0x3c75, 0xbf85, }; +fftval_t tf_real[128] = { 0x3c00, 0x3bfe, 0x3bf6, 0x3bea, 0x3bd9, 0x3bc3, 0x3ba8, 0x3b88, 0x3b64, 0x3b3b, 0x3b0e, 0x3add, 0x3aa7, 0x3a6d, 0x3a2f, 0x39ed, 0x39a8, 0x395f, 0x3913, 0x38c4, 0x3872, 0x381d, 0x378b, 0x36d7, 0x361f, 0x3564, 0x34a5, 0x33c6, 0x323e, 0x30b2, 0x2e46, 0x2a48, 0x0000, 0xaa48, 0xae46, 0xb0b2, 0xb23e, 0xb3c6, 0xb4a5, 0xb564, 0xb61f, 0xb6d7, 0xb78b, 0xb81d, 0xb872, 0xb8c4, 0xb913, 0xb95f, 0xb9a8, 0xb9ed, 0xba2f, 0xba6d, 0xbaa7, 0xbadd, 0xbb0e, 0xbb3b, 0xbb64, 0xbb88, 0xbba8, 0xbbc3, 0xbbd9, 0xbbea, 0xbbf6, 0xbbfe, 0xbc00, 0xbbfe, 0xbbf6, 0xbbea, 0xbbd9, 0xbbc3, 0xbba8, 0xbb88, 0xbb64, 0xbb3b, 0xbb0e, 0xbadd, 0xbaa7, 0xba6d, 0xba2f, 0xb9ed, 0xb9a8, 0xb95f, 0xb913, 0xb8c4, 0xb872, 0xb81d, 0xb78b, 0xb6d7, 0xb61f, 0xb564, 0xb4a5, 0xb3c6, 0xb23e, 0xb0b2, 0xae46, 0xaa48, 0x8000, 0x2a48, 0x2e46, 0x30b2, 0x323e, 0x33c6, 0x34a5, 0x3564, 0x361f, 0x36d7, 0x378b, 0x381d, 0x3872, 0x38c4, 0x3913, 0x395f, 0x39a8, 0x39ed, 0x3a2f, 0x3a6d, 0x3aa7, 0x3add, 0x3b0e, 0x3b3b, 0x3b64, 0x3b88, 0x3ba8, 0x3bc3, 0x3bd9, 0x3bea, 0x3bf6, 0x3bfe, }; +fftval_t tf_imag[128] = { 0x8000, 0xaa48, 0xae46, 0xb0b2, 0xb23e, 0xb3c6, 0xb4a5, 0xb564, 0xb61f, 0xb6d7, 0xb78b, 0xb81d, 0xb872, 0xb8c4, 0xb913, 0xb95f, 0xb9a8, 0xb9ed, 0xba2f, 0xba6d, 0xbaa7, 0xbadd, 0xbb0e, 0xbb3b, 0xbb64, 0xbb88, 0xbba8, 0xbbc3, 0xbbd9, 0xbbea, 0xbbf6, 0xbbfe, 0xbc00, 0xbbfe, 0xbbf6, 0xbbea, 0xbbd9, 0xbbc3, 0xbba8, 0xbb88, 0xbb64, 0xbb3b, 0xbb0e, 0xbadd, 0xbaa7, 0xba6d, 0xba2f, 0xb9ed, 0xb9a8, 0xb95f, 0xb913, 0xb8c4, 0xb872, 0xb81d, 0xb78b, 0xb6d7, 0xb61f, 0xb564, 0xb4a5, 0xb3c6, 0xb23e, 0xb0b2, 0xae46, 0xaa48, 0x8000, 0x2a48, 0x2e46, 0x30b2, 0x323e, 0x33c6, 0x34a5, 0x3564, 0x361f, 0x36d7, 0x378b, 0x381d, 0x3872, 0x38c4, 0x3913, 0x395f, 0x39a8, 0x39ed, 0x3a2f, 0x3a6d, 0x3aa7, 0x3add, 0x3b0e, 0x3b3b, 0x3b64, 0x3b88, 0x3ba8, 0x3bc3, 0x3bd9, 0x3bea, 0x3bf6, 0x3bfe, 0x3c00, 0x3bfe, 0x3bf6, 0x3bea, 0x3bd9, 0x3bc3, 0x3ba8, 0x3b88, 0x3b64, 0x3b3b, 0x3b0e, 0x3add, 0x3aa7, 0x3a6d, 0x3a2f, 0x39ed, 0x39a8, 0x395f, 0x3913, 0x38c4, 0x3872, 0x381d, 0x378b, 0x36d7, 0x361f, 0x3564, 0x34a5, 0x33c6, 0x323e, 0x30b2, 0x2e46, 0x2a48, }; + +#endif diff --git a/benchmarks/vec-fft/dc_data.c b/benchmarks/vec-fft/dc_data.c new file mode 100644 index 0000000..87475c0 --- /dev/null +++ b/benchmarks/vec-fft/dc_data.c @@ -0,0 +1,12 @@ +int input_data_real[1024] = {1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576, 1048576}; + +int input_data_imag[1024] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +int output_data_real[1024] = {1073741824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +int output_data_imag[1024] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +int tf_real[1024] = {1048576, 1048556, 1048497, 1048398, 1048260, 1048082, 1047865, 1047608, 1047312, 1046977, 1046602, 1046188, 1045734, 1045241, 1044709, 1044137, 1043526, 1042876, 1042186, 1041458, 1040690, 1039883, 1039036, 1038151, 1037226, 1036263, 1035260, 1034218, 1033138, 1032019, 1030860, 1029663, 1028427, 1027153, 1025840, 1024488, 1023097, 1021668, 1020201, 1018695, 1017151, 1015569, 1013948, 1012289, 1010592, 1008857, 1007084, 1005273, 1003424, 1001538, 999613, 997651, 995652, 993615, 991541, 989429, 987280, 985094, 982871, 980610, 978313, 975979, 973609, 971201, 968757, 966277, 963760, 961207, 958618, 955993, 953331, 950634, 947901, 945132, 942328, 939488, 936613, 933703, 930757, 927777, 924761, 921711, 918626, 915506, 912352, 909163, 905941, 902684, 899393, 896068, 892710, 889318, 885893, 882434, 878942, 875417, 871859, 868268, 864644, 860988, 857299, 853578, 849825, 846040, 842224, 838375, 834495, 830583, 826641, 822667, 818662, 814626, 810560, 806463, 802336, 798178, 793991, 789773, 785526, 781249, 776943, 772608, 768243, 763850, 759428, 754977, 750498, 745990, 741455, 736891, 732300, 727681, 723035, 718362, 713661, 708934, 704180, 699400, 694593, 689760, 684901, 680016, 675106, 670170, 665209, 660223, 655212, 650177, 645117, 640032, 634924, 629792, 624635, 619456, 614253, 609027, 603778, 598506, 593212, 587896, 582557, 577197, 571814, 566410, 560985, 555539, 550072, 544584, 539075, 533547, 527998, 522429, 516841, 511233, 505606, 499960, 494295, 488611, 482909, 477189, 471451, 465695, 459922, 454131, 448324, 442499, 436658, 430800, 424926, 419036, 413130, 407209, 401272, 395320, 389354, 383373, 377377, 371367, 365343, 359305, 353254, 347190, 341112, 335022, 328919, 322803, 316676, 310536, 304385, 298222, 292049, 285864, 279668, 273462, 267246, 261019, 254783, 248537, 242281, 236017, 229744, 223462, 217172, 210873, 204567, 198252, 191931, 185602, 179266, 172923, 166574, 160219, 153858, 147490, 141118, 134740, 128356, 121968, 115576, 109179, 102778, 96373, 89965, 83553, 77138, 70720, 64299, 57876, 51451, 45024, 38595, 32164, 25733, 19300, 12867, 6433, 0, -6433, -12867, -19300, -25733, -32164, -38595, -45024, -51451, -57876, -64299, -70720, -77138, -83553, -89965, -96373, -102778, -109179, -115576, -121968, -128356, -134740, -141118, -147490, -153858, -160219, -166574, -172923, -179266, -185602, -191931, -198252, -204567, -210873, -217172, -223462, -229744, -236017, -242281, -248537, -254783, -261019, -267246, -273462, -279668, -285864, -292049, -298222, -304385, -310536, -316676, -322803, -328919, -335022, -341112, -347190, -353254, -359305, -365343, -371367, -377377, -383373, -389354, -395320, -401272, -407209, -413130, -419036, -424926, -430800, -436658, -442499, -448324, -454131, -459922, -465695, -471451, -477189, -482909, -488611, -494295, -499960, -505606, -511233, -516841, -522429, -527998, -533547, -539075, -544584, -550072, -555539, -560985, -566410, -571814, -577197, -582557, -587896, -593212, -598506, -603778, -609027, -614253, -619456, -624635, -629792, -634924, -640032, -645117, -650177, -655212, -660223, -665209, -670170, -675106, -680016, -684901, -689760, -694593, -699400, -704180, -708934, -713661, -718362, -723035, -727681, -732300, -736891, -741455, -745990, -750498, -754977, -759428, -763850, -768243, -772608, -776943, -781249, -785526, -789773, -793991, -798178, -802336, -806463, -810560, -814626, -818662, -822667, -826641, -830583, -834495, -838375, -842224, -846040, -849825, -853578, -857299, -860988, -864644, -868268, -871859, -875417, -878942, -882434, -885893, -889318, -892710, -896068, -899393, -902684, -905941, -909163, -912352, -915506, -918626, -921711, -924761, -927777, -930757, -933703, -936613, -939488, -942328, -945132, -947901, -950634, -953331, -955993, -958618, -961207, -963760, -966277, -968757, -971201, -973609, -975979, -978313, -980610, -982871, -985094, -987280, -989429, -991541, -993615, -995652, -997651, -999613, -1001538, -1003424, -1005273, -1007084, -1008857, -1010592, -1012289, -1013948, -1015569, -1017151, -1018695, -1020201, -1021668, -1023097, -1024488, -1025840, -1027153, -1028427, -1029663, -1030860, -1032019, -1033138, -1034218, -1035260, -1036263, -1037226, -1038151, -1039036, -1039883, -1040690, -1041458, -1042186, -1042876, -1043526, -1044137, -1044709, -1045241, -1045734, -1046188, -1046602, -1046977, -1047312, -1047608, -1047865, -1048082, -1048260, -1048398, -1048497, -1048556, -1048576, -1048556, -1048497, -1048398, -1048260, -1048082, -1047865, -1047608, -1047312, -1046977, -1046602, -1046188, -1045734, -1045241, -1044709, -1044137, -1043526, -1042876, -1042186, -1041458, -1040690, -1039883, -1039036, -1038151, -1037226, -1036263, -1035260, -1034218, -1033138, -1032019, -1030860, -1029663, -1028427, -1027153, -1025840, -1024488, -1023097, -1021668, -1020201, -1018695, -1017151, -1015569, -1013948, -1012289, -1010592, -1008857, -1007084, -1005273, -1003424, -1001538, -999613, -997651, -995652, -993615, -991541, -989429, -987280, -985094, -982871, -980610, -978313, -975979, -973609, -971201, -968757, -966277, -963760, -961207, -958618, -955993, -953331, -950634, -947901, -945132, -942328, -939488, -936613, -933703, -930757, -927777, -924761, -921711, -918626, -915506, -912352, -909163, -905941, -902684, -899393, -896068, -892710, -889318, -885893, -882434, -878942, -875417, -871859, -868268, -864644, -860988, -857299, -853578, -849825, -846040, -842224, -838375, -834495, -830583, -826641, -822667, -818662, -814626, -810560, -806463, -802336, -798178, -793991, -789773, -785526, -781249, -776943, -772608, -768243, -763850, -759428, -754977, -750498, -745990, -741455, -736891, -732300, -727681, -723035, -718362, -713661, -708934, -704180, -699400, -694593, -689760, -684901, -680016, -675106, -670170, -665209, -660223, -655212, -650177, -645117, -640032, -634924, -629792, -624635, -619456, -614253, -609027, -603778, -598506, -593212, -587896, -582557, -577197, -571814, -566410, -560985, -555539, -550072, -544584, -539075, -533547, -527998, -522429, -516841, -511233, -505606, -499960, -494295, -488611, -482909, -477189, -471451, -465695, -459922, -454131, -448324, -442499, -436658, -430800, -424926, -419036, -413130, -407209, -401272, -395320, -389354, -383373, -377377, -371367, -365343, -359305, -353254, -347190, -341112, -335022, -328919, -322803, -316676, -310536, -304385, -298222, -292049, -285864, -279668, -273462, -267246, -261019, -254783, -248537, -242281, -236017, -229744, -223462, -217172, -210873, -204567, -198252, -191931, -185602, -179266, -172923, -166574, -160219, -153858, -147490, -141118, -134740, -128356, -121968, -115576, -109179, -102778, -96373, -89965, -83553, -77138, -70720, -64299, -57876, -51451, -45024, -38595, -32164, -25733, -19300, -12867, -6433, 0, 6433, 12867, 19300, 25733, 32164, 38595, 45024, 51451, 57876, 64299, 70720, 77138, 83553, 89965, 96373, 102778, 109179, 115576, 121968, 128356, 134740, 141118, 147490, 153858, 160219, 166574, 172923, 179266, 185602, 191931, 198252, 204567, 210873, 217172, 223462, 229744, 236017, 242281, 248537, 254783, 261019, 267246, 273462, 279668, 285864, 292049, 298222, 304385, 310536, 316676, 322803, 328919, 335022, 341112, 347190, 353254, 359305, 365343, 371367, 377377, 383373, 389354, 395320, 401272, 407209, 413130, 419036, 424926, 430800, 436658, 442499, 448324, 454131, 459922, 465695, 471451, 477189, 482909, 488611, 494295, 499960, 505606, 511233, 516841, 522429, 527998, 533547, 539075, 544584, 550072, 555539, 560985, 566410, 571814, 577197, 582557, 587896, 593212, 598506, 603778, 609027, 614253, 619456, 624635, 629792, 634924, 640032, 645117, 650177, 655212, 660223, 665209, 670170, 675106, 680016, 684901, 689760, 694593, 699400, 704180, 708934, 713661, 718362, 723035, 727681, 732300, 736891, 741455, 745990, 750498, 754977, 759428, 763850, 768243, 772608, 776943, 781249, 785526, 789773, 793991, 798178, 802336, 806463, 810560, 814626, 818662, 822667, 826641, 830583, 834495, 838375, 842224, 846040, 849825, 853578, 857299, 860988, 864644, 868268, 871859, 875417, 878942, 882434, 885893, 889318, 892710, 896068, 899393, 902684, 905941, 909163, 912352, 915506, 918626, 921711, 924761, 927777, 930757, 933703, 936613, 939488, 942328, 945132, 947901, 950634, 953331, 955993, 958618, 961207, 963760, 966277, 968757, 971201, 973609, 975979, 978313, 980610, 982871, 985094, 987280, 989429, 991541, 993615, 995652, 997651, 999613, 1001538, 1003424, 1005273, 1007084, 1008857, 1010592, 1012289, 1013948, 1015569, 1017151, 1018695, 1020201, 1021668, 1023097, 1024488, 1025840, 1027153, 1028427, 1029663, 1030860, 1032019, 1033138, 1034218, 1035260, 1036263, 1037226, 1038151, 1039036, 1039883, 1040690, 1041458, 1042186, 1042876, 1043526, 1044137, 1044709, 1045241, 1045734, 1046188, 1046602, 1046977, 1047312, 1047608, 1047865, 1048082, 1048260, 1048398, 1048497, 1048556}; + +int tf_imag[1024] = {0, -6433, -12867, -19300, -25733, -32164, -38595, -45024, -51451, -57876, -64299, -70720, -77138, -83553, -89965, -96373, -102778, -109179, -115576, -121968, -128356, -134740, -141118, -147490, -153858, -160219, -166574, -172923, -179266, -185602, -191931, -198252, -204567, -210873, -217172, -223462, -229744, -236017, -242281, -248537, -254783, -261019, -267246, -273462, -279668, -285864, -292049, -298222, -304385, -310536, -316676, -322803, -328919, -335022, -341112, -347190, -353254, -359305, -365343, -371367, -377377, -383373, -389354, -395320, -401272, -407209, -413130, -419036, -424926, -430800, -436658, -442499, -448324, -454131, -459922, -465695, -471451, -477189, -482909, -488611, -494295, -499960, -505606, -511233, -516841, -522429, -527998, -533547, -539075, -544584, -550072, -555539, -560985, -566410, -571814, -577197, -582557, -587896, -593212, -598506, -603778, -609027, -614253, -619456, -624635, -629792, -634924, -640032, -645117, -650177, -655212, -660223, -665209, -670170, -675106, -680016, -684901, -689760, -694593, -699400, -704180, -708934, -713661, -718362, -723035, -727681, -732300, -736891, -741455, -745990, -750498, -754977, -759428, -763850, -768243, -772608, -776943, -781249, -785526, -789773, -793991, -798178, -802336, -806463, -810560, -814626, -818662, -822667, -826641, -830583, -834495, -838375, -842224, -846040, -849825, -853578, -857299, -860988, -864644, -868268, -871859, -875417, -878942, -882434, -885893, -889318, -892710, -896068, -899393, -902684, -905941, -909163, -912352, -915506, -918626, -921711, -924761, -927777, -930757, -933703, -936613, -939488, -942328, -945132, -947901, -950634, -953331, -955993, -958618, -961207, -963760, -966277, -968757, -971201, -973609, -975979, -978313, -980610, -982871, -985094, -987280, -989429, -991541, -993615, -995652, -997651, -999613, -1001538, -1003424, -1005273, -1007084, -1008857, -1010592, -1012289, -1013948, -1015569, -1017151, -1018695, -1020201, -1021668, -1023097, -1024488, -1025840, -1027153, -1028427, -1029663, -1030860, -1032019, -1033138, -1034218, -1035260, -1036263, -1037226, -1038151, -1039036, -1039883, -1040690, -1041458, -1042186, -1042876, -1043526, -1044137, -1044709, -1045241, -1045734, -1046188, -1046602, -1046977, -1047312, -1047608, -1047865, -1048082, -1048260, -1048398, -1048497, -1048556, -1048576, -1048556, -1048497, -1048398, -1048260, -1048082, -1047865, -1047608, -1047312, -1046977, -1046602, -1046188, -1045734, -1045241, -1044709, -1044137, -1043526, -1042876, -1042186, -1041458, -1040690, -1039883, -1039036, -1038151, -1037226, -1036263, -1035260, -1034218, -1033138, -1032019, -1030860, -1029663, -1028427, -1027153, -1025840, -1024488, -1023097, -1021668, -1020201, -1018695, -1017151, -1015569, -1013948, -1012289, -1010592, -1008857, -1007084, -1005273, -1003424, -1001538, -999613, -997651, -995652, -993615, -991541, -989429, -987280, -985094, -982871, -980610, -978313, -975979, -973609, -971201, -968757, -966277, -963760, -961207, -958618, -955993, -953331, -950634, -947901, -945132, -942328, -939488, -936613, -933703, -930757, -927777, -924761, -921711, -918626, -915506, -912352, -909163, -905941, -902684, -899393, -896068, -892710, -889318, -885893, -882434, -878942, -875417, -871859, -868268, -864644, -860988, -857299, -853578, -849825, -846040, -842224, -838375, -834495, -830583, -826641, -822667, -818662, -814626, -810560, -806463, -802336, -798178, -793991, -789773, -785526, -781249, -776943, -772608, -768243, -763850, -759428, -754977, -750498, -745990, -741455, -736891, -732300, -727681, -723035, -718362, -713661, -708934, -704180, -699400, -694593, -689760, -684901, -680016, -675106, -670170, -665209, -660223, -655212, -650177, -645117, -640032, -634924, -629792, -624635, -619456, -614253, -609027, -603778, -598506, -593212, -587896, -582557, -577197, -571814, -566410, -560985, -555539, -550072, -544584, -539075, -533547, -527998, -522429, -516841, -511233, -505606, -499960, -494295, -488611, -482909, -477189, -471451, -465695, -459922, -454131, -448324, -442499, -436658, -430800, -424926, -419036, -413130, -407209, -401272, -395320, -389354, -383373, -377377, -371367, -365343, -359305, -353254, -347190, -341112, -335022, -328919, -322803, -316676, -310536, -304385, -298222, -292049, -285864, -279668, -273462, -267246, -261019, -254783, -248537, -242281, -236017, -229744, -223462, -217172, -210873, -204567, -198252, -191931, -185602, -179266, -172923, -166574, -160219, -153858, -147490, -141118, -134740, -128356, -121968, -115576, -109179, -102778, -96373, -89965, -83553, -77138, -70720, -64299, -57876, -51451, -45024, -38595, -32164, -25733, -19300, -12867, -6433, 0, 6433, 12867, 19300, 25733, 32164, 38595, 45024, 51451, 57876, 64299, 70720, 77138, 83553, 89965, 96373, 102778, 109179, 115576, 121968, 128356, 134740, 141118, 147490, 153858, 160219, 166574, 172923, 179266, 185602, 191931, 198252, 204567, 210873, 217172, 223462, 229744, 236017, 242281, 248537, 254783, 261019, 267246, 273462, 279668, 285864, 292049, 298222, 304385, 310536, 316676, 322803, 328919, 335022, 341112, 347190, 353254, 359305, 365343, 371367, 377377, 383373, 389354, 395320, 401272, 407209, 413130, 419036, 424926, 430800, 436658, 442499, 448324, 454131, 459922, 465695, 471451, 477189, 482909, 488611, 494295, 499960, 505606, 511233, 516841, 522429, 527998, 533547, 539075, 544584, 550072, 555539, 560985, 566410, 571814, 577197, 582557, 587896, 593212, 598506, 603778, 609027, 614253, 619456, 624635, 629792, 634924, 640032, 645117, 650177, 655212, 660223, 665209, 670170, 675106, 680016, 684901, 689760, 694593, 699400, 704180, 708934, 713661, 718362, 723035, 727681, 732300, 736891, 741455, 745990, 750498, 754977, 759428, 763850, 768243, 772608, 776943, 781249, 785526, 789773, 793991, 798178, 802336, 806463, 810560, 814626, 818662, 822667, 826641, 830583, 834495, 838375, 842224, 846040, 849825, 853578, 857299, 860988, 864644, 868268, 871859, 875417, 878942, 882434, 885893, 889318, 892710, 896068, 899393, 902684, 905941, 909163, 912352, 915506, 918626, 921711, 924761, 927777, 930757, 933703, 936613, 939488, 942328, 945132, 947901, 950634, 953331, 955993, 958618, 961207, 963760, 966277, 968757, 971201, 973609, 975979, 978313, 980610, 982871, 985094, 987280, 989429, 991541, 993615, 995652, 997651, 999613, 1001538, 1003424, 1005273, 1007084, 1008857, 1010592, 1012289, 1013948, 1015569, 1017151, 1018695, 1020201, 1021668, 1023097, 1024488, 1025840, 1027153, 1028427, 1029663, 1030860, 1032019, 1033138, 1034218, 1035260, 1036263, 1037226, 1038151, 1039036, 1039883, 1040690, 1041458, 1042186, 1042876, 1043526, 1044137, 1044709, 1045241, 1045734, 1046188, 1046602, 1046977, 1047312, 1047608, 1047865, 1048082, 1048260, 1048398, 1048497, 1048556, 1048576, 1048556, 1048497, 1048398, 1048260, 1048082, 1047865, 1047608, 1047312, 1046977, 1046602, 1046188, 1045734, 1045241, 1044709, 1044137, 1043526, 1042876, 1042186, 1041458, 1040690, 1039883, 1039036, 1038151, 1037226, 1036263, 1035260, 1034218, 1033138, 1032019, 1030860, 1029663, 1028427, 1027153, 1025840, 1024488, 1023097, 1021668, 1020201, 1018695, 1017151, 1015569, 1013948, 1012289, 1010592, 1008857, 1007084, 1005273, 1003424, 1001538, 999613, 997651, 995652, 993615, 991541, 989429, 987280, 985094, 982871, 980610, 978313, 975979, 973609, 971201, 968757, 966277, 963760, 961207, 958618, 955993, 953331, 950634, 947901, 945132, 942328, 939488, 936613, 933703, 930757, 927777, 924761, 921711, 918626, 915506, 912352, 909163, 905941, 902684, 899393, 896068, 892710, 889318, 885893, 882434, 878942, 875417, 871859, 868268, 864644, 860988, 857299, 853578, 849825, 846040, 842224, 838375, 834495, 830583, 826641, 822667, 818662, 814626, 810560, 806463, 802336, 798178, 793991, 789773, 785526, 781249, 776943, 772608, 768243, 763850, 759428, 754977, 750498, 745990, 741455, 736891, 732300, 727681, 723035, 718362, 713661, 708934, 704180, 699400, 694593, 689760, 684901, 680016, 675106, 670170, 665209, 660223, 655212, 650177, 645117, 640032, 634924, 629792, 624635, 619456, 614253, 609027, 603778, 598506, 593212, 587896, 582557, 577197, 571814, 566410, 560985, 555539, 550072, 544584, 539075, 533547, 527998, 522429, 516841, 511233, 505606, 499960, 494295, 488611, 482909, 477189, 471451, 465695, 459922, 454131, 448324, 442499, 436658, 430800, 424926, 419036, 413130, 407209, 401272, 395320, 389354, 383373, 377377, 371367, 365343, 359305, 353254, 347190, 341112, 335022, 328919, 322803, 316676, 310536, 304385, 298222, 292049, 285864, 279668, 273462, 267246, 261019, 254783, 248537, 242281, 236017, 229744, 223462, 217172, 210873, 204567, 198252, 191931, 185602, 179266, 172923, 166574, 160219, 153858, 147490, 141118, 134740, 128356, 121968, 115576, 109179, 102778, 96373, 89965, 83553, 77138, 70720, 64299, 57876, 51451, 45024, 38595, 32164, 25733, 19300, 12867, 6433}; + diff --git a/benchmarks/vec-fft/fft-data-gen b/benchmarks/vec-fft/fft-data-gen new file mode 100755 index 0000000..a8a14d0 --- /dev/null +++ b/benchmarks/vec-fft/fft-data-gen @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +import sys +import numpy + +def array_print(name, data): + if type_scalar == numpy.float16: + a = ['{:#04x}'.format(h.astype(int)) for h in data.view(dtype=numpy.uint16)] + else: + a = [repr(x) for x in data] + print 'fftval_t {}[{}] = {{ {} }};'.format(name, len(a), ', '.join(a)) + +def array_permute(data, radix = 2): + logradix = int(numpy.log2(radix)) + term_mask = int(radix - 1) +# num_term = int(numpy.log2(len(data)) / logradix) + for i in xrange(0, len(data)): + # Obtain permuted address + i_left = i + permuted = 0 + cur_fft_size = radix + while cur_fft_size <= len(data): + permuted = (permuted << logradix) | (i_left & term_mask) + i_left >>= logradix + cur_fft_size <<= logradix + # Permute only once and when addresses are different + if i < permuted: + tmp = data[i] + data[i] = data[permuted] + data[permuted] = tmp + +fft_size = 1024 +type_scalar = numpy.float16 +permute = True + +if len(sys.argv) > 1: + type_scalar = { + '16' : numpy.float16, + '32' : numpy.float32, + '64' : numpy.float64 }.get(sys.argv[1].strip(), None) + if type_scalar == None: + sys.exit('Invalid datatype') + +if len(sys.argv) > 2: + fft_size = sys.argv[2].strip() + if not fft_size.isdigit(): + sys.exit('Invalid FFT size') + fft_size = int(fft_size) + +numpy.random.seed(seed=0) + +print '#include "fft_const.h"' + +# Generate input data +input_real = numpy.random.uniform(size=fft_size).astype(type_scalar) +input_imag = numpy.random.uniform(size=fft_size).astype(type_scalar) + +# Compute reference FFT output +type_cmplx = numpy.complex128 if (type_scalar == numpy.float64) else numpy.complex64 +input_cmplx = input_real.astype(type_cmplx) +input_cmplx.imag = input_imag +output_cmplx = numpy.fft.fft(input_cmplx) + +if permute: + array_permute(input_real) + array_permute(input_imag) + +array_print('input_data_real', input_real) +array_print('input_data_imag', input_imag) + +output_real = output_cmplx.real.astype(type_scalar) +output_imag = output_cmplx.imag.astype(type_scalar) + +array_print('output_data_real', output_real) +array_print('output_data_imag', output_imag) + +# Generate twiddle factors (TFs) +# Negate sine since twiddle factor angles are generated *clockwise* from 0 +rad = [(2.0 * numpy.pi * (float(i) / fft_size)) for i in xrange(fft_size)] +tf_real = numpy.cos(rad).astype(type_scalar) +tf_imag = -numpy.sin(rad).astype(type_scalar) + +array_print('tf_real', tf_real) +array_print('tf_imag', tf_imag) diff --git a/benchmarks/vec-fft/fft_const.h b/benchmarks/vec-fft/fft_const.h new file mode 100644 index 0000000..eb6f156 --- /dev/null +++ b/benchmarks/vec-fft/fft_const.h @@ -0,0 +1,69 @@ +#ifndef __FFT_CONST_H +#define __FFT_CONST_H + +#ifndef FFT_SIZE +#define FFT_SIZE 1024 +#endif /* FFT_SIZE */ + +#if 0 + #define FFT_FIXED + #define DATA_IN_PERMUTED +#else +// #define DATA_IN_UNPERMUTED + #define FFT_FLOATING + #define FFT_FLOATING_PREC 64 +#endif + +#if defined(FFT_FIXED) + #define FIX_PT 20 + #define DATA_WIDTH 32 +#elif defined(FFT_FLOATING) + #if FFT_FLOATING_PREC == 16 + #define FP_HALF + #elif FFT_FLOATING_PREC == 32 + #define FP_SINGLE + #elif FFT_FLOATING_PREC == 64 + #define FP_DOUBLE + #else + #error "Unsupported floating-point configuration" + #endif + #define DATA_WIDTH FFT_FLOATING_PREC +#else + #error "Define fixed or floating point in fft_const.h" +#endif + +#if !defined(__ASSEMBLY__) + +#include +#include + +#if defined(FFT_FIXED) + typedef int fftval_t; + typedef int fftbit_t; + #define FFT_PRI "%08x" +#elif defined(FFT_FLOATING) + #if defined(FP_HALF) + typedef uint16_t fftval_t; + typedef uint16_t fftbit_t; + #define FFT_PRI "%04" PRIx16 + #elif defined(FP_SINGLE) + typedef float fftval_t; + typedef uint32_t fftbit_t; + #define FFT_PRI "%08" PRIx32 + #elif defined(FP_DOUBLE) + typedef double fftval_t; + typedef uint64_t fftbit_t; + #define FFT_PRI "%016" PRIx64 + #endif +#endif + +extern fftval_t input_data_real[FFT_SIZE]; +extern fftval_t input_data_imag[FFT_SIZE]; +extern fftval_t output_data_real[FFT_SIZE]; +extern fftval_t output_data_imag[FFT_SIZE]; +extern fftval_t tf_real[FFT_SIZE]; +extern fftval_t tf_imag[FFT_SIZE]; + +#endif /* __ASSEMBLY__ */ + +#endif /* __FFT_CONST_H */ diff --git a/benchmarks/vec-fft/fft_cos_data.c b/benchmarks/vec-fft/fft_cos_data.c new file mode 100644 index 0000000..de195e5 --- /dev/null +++ b/benchmarks/vec-fft/fft_cos_data.c @@ -0,0 +1,6 @@ +float input_data_real[ 1024 ] = { 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915, 6.12323399574e-17, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.83697019872e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283 }; +float input_data_imag[ 1024 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +float output_data_real[ 1024 ] = { -3.98328871302e-14, 512.0, 1.27235727414e-14, 2.11219930435e-13, 2.56426491579e-15, 6.90867309258e-14, 2.59436596681e-15, 1.02395635854e-13, 5.61080391287e-16, 2.85262909278e-14, 3.79032227216e-16, 7.53393398908e-14, 2.66162910625e-16, 2.13178823599e-14, -1.93700945762e-15, 2.54685161849e-13, -1.0480207485e-16, 1.49529977383e-14, 1.67741767281e-15, 4.43915870872e-14, 2.72764222422e-16, 1.52808625925e-14, -2.99940488335e-16, 2.81673052451e-14, -3.14206394495e-16, 9.73082752877e-15, 3.41332290024e-16, 2.63398836114e-14, 9.01376884194e-16, 1.07971860501e-14, -2.16489859293e-16, 1.22399044814e-13, -2.81903879404e-16, 7.70972419107e-15, -1.60972715089e-16, 1.94010784335e-14, 1.30859141192e-16, 6.63927036612e-15, 6.13055952407e-16, 2.02306856577e-14, -5.75282259126e-16, 8.03563339119e-15, -1.71840381989e-15, 1.94213634363e-14, -1.48370317037e-16, 2.94407121745e-15, 1.03703984616e-15, 8.23035203833e-14, 7.01961623624e-16, 4.34745397051e-15, 4.56259003886e-16, 1.86244190865e-14, -7.52443713212e-16, 5.72672412574e-15, -4.67950066318e-16, 1.58021773106e-14, 5.894955421e-17, 5.67365377039e-15, 5.84754391954e-16, 1.3231125266e-14, 1.32571081181e-15, 3.25209579784e-15, -2.40264994719e-16, 2.57571741713e-13, -5.00002386189e-16, 3.02656006773e-15, -3.26405588808e-16, 1.42487690053e-14, -6.63822354292e-16, 6.6022019812e-15, 9.94981112262e-16, 5.49373271562e-15, 1.00761570794e-16, 3.95666287023e-15, -1.95071483446e-15, 1.56333546729e-14, 1.70620506332e-15, 2.70111065119e-15, 1.58344416309e-15, 5.66002978792e-14, -1.78754920909e-15, 3.22081292635e-15, 3.72585484986e-16, 9.92942942162e-15, -3.5930568463e-17, 4.215937795e-15, -1.33163046986e-15, 3.72038284346e-15, 1.31631749194e-15, 6.69001898104e-15, 7.5809899164e-16, 1.16035168759e-14, 2.06193747392e-16, -2.05766401993e-15, 3.17731451744e-15, 3.40668848718e-14, -4.64380668017e-16, 9.40864217653e-15, -3.49175297909e-15, 9.34771079725e-15, 1.1341541471e-15, 4.12668346235e-16, 1.33761095312e-15, 1.04488133379e-14, -1.41400258841e-15, -2.14683976834e-16, -5.15479064209e-16, 7.07691580819e-15, -5.95914117692e-16, 5.36244098615e-15, -4.51177893942e-16, 3.68493980688e-14, 7.82350136714e-16, 1.10543728146e-14, 2.27743811408e-16, 3.28225870764e-15, 5.40130814212e-16, 6.67645215345e-15, -3.50843836178e-16, 1.279343385e-14, -1.02139125531e-15, 1.09149611348e-15, 8.77607632505e-16, 9.14235345858e-15, 7.89502628481e-16, 2.25734666014e-15, -4.50745100905e-17, 8.66746035337e-14, 6.27447048091e-16, 3.65533132722e-15, 1.43174399109e-16, 5.82956652231e-15, -1.45737981045e-16, -1.29157867952e-16, 1.18978725726e-15, 1.38364373427e-15, 8.41747333429e-16, 4.3673989967e-15, -3.85906290425e-17, 5.09925725437e-15, 1.50240781231e-16, -1.76650582842e-15, -7.39518114382e-16, 2.87280700733e-14, -9.96989952227e-16, 2.31548911934e-16, 2.36889949114e-16, 6.34954615877e-15, -5.85757554919e-16, -1.68242621986e-15, -4.66248195508e-16, 9.02584093418e-15, 1.40782032941e-16, 3.15901910566e-15, 4.98055709469e-16, 1.20596584076e-14, -8.89342670076e-17, -6.3516242516e-16, -1.7458138716e-15, 2.8058807857e-14, -2.21973351348e-16, 2.04649181021e-15, 3.87342319562e-16, 6.06353860395e-15, -3.81708513492e-16, 1.89335817025e-15, -4.04021120233e-16, -8.93181398066e-15, 2.67075596151e-17, 8.46234003187e-16, -3.08961223442e-16, -5.74890322552e-15, -2.37625728097e-16, -2.5658294371e-15, 1.53521183787e-15, 1.26425818542e-14, -6.13776272451e-18, -1.05988554149e-15, -2.17239450599e-15, -1.08085321211e-15, -1.38697234275e-15, 4.2038156275e-15, -1.59780806146e-15, -7.66808409701e-15, -6.05376786395e-16, 1.30073416562e-14, 2.21277076554e-15, 4.54954264027e-16, 2.61462296006e-15, -3.30725510621e-16, 1.17196752845e-15, 8.49820133083e-14, -8.76902171665e-16, 8.76384566986e-15, -1.5968293806e-15, -6.96917929091e-16, 6.18966041212e-16, 1.4533812346e-15, 1.88194306608e-15, 5.53878921704e-15, 6.41947497837e-16, -2.58911446434e-15, -3.57354629937e-16, -8.36897940857e-16, -1.09968330794e-15, 3.75360545117e-15, -2.38950959284e-15, 1.11602857754e-14, 7.40738951969e-17, 2.18554944972e-15, 2.4737094729e-15, 2.23631813468e-15, -2.38358796158e-16, 7.11506892815e-16, -1.43566227545e-15, 3.63828639912e-15, 3.23176624349e-16, 3.26693081305e-15, 4.06264334213e-16, 1.08648883704e-15, 3.97081814176e-17, -4.11183923829e-15, 1.40901037236e-16, 1.07728205061e-14, 2.49215789888e-16, 1.86987739338e-15, -3.54353005052e-16, 7.49453470008e-16, -8.04573384604e-16, -3.12010826146e-15, 7.73598790599e-16, 7.00000300529e-15, 7.85638252146e-16, 2.66154338778e-15, -1.48244958666e-16, 4.2260599496e-15, -2.71278947456e-16, -2.87357207886e-16, -1.80358697424e-17, 1.84429384913e-14, 1.58318646262e-16, -2.65314193883e-15, -5.70094465335e-16, 4.19048722376e-15, -1.41749070227e-15, 3.88976423898e-15, 7.02433451731e-16, -6.08449237004e-16, 7.61467782713e-16, -5.66018000355e-16, -6.04391978181e-16, -3.3201876178e-15, 7.15562261709e-17, -2.29442813759e-15, 3.192686443e-16, 2.34479102801e-13, -1.57159149434e-16, -2.60208521397e-16, -1.14878564218e-15, -1.31838984174e-15, 4.74081709404e-16, 7.66456304007e-16, 1.7831988913e-15, 4.02011759265e-16, -1.13495040105e-15, 5.07623728442e-15, -1.88288108205e-15, 5.45192154517e-15, 3.06475416731e-15, -2.66569831313e-15, 4.07464728363e-15, 8.65973959208e-15, -2.37551463362e-15, 9.17224986529e-16, -3.09021178563e-15, 2.35961352891e-15, 4.17582405778e-15, -4.10455452096e-15, 5.30952606861e-15, 2.962502435e-14, 5.14002246939e-16, -2.80909888336e-14, -4.26985256491e-15, 1.42928510756e-14, -3.76137762878e-15, -7.32702696459e-16, 1.49462486312e-15, 3.76673344319e-15, 4.2194325517e-16, 3.24382123682e-15, -2.72383715929e-15, 4.55419167509e-15, -9.97821069011e-16, 8.59877137244e-16, 1.73508606445e-15, 2.64691339524e-15, 1.25989890426e-15, 1.87513917999e-15, -4.92411118081e-16, 2.46348904585e-15, -6.27494788887e-16, -3.96750865671e-15, 1.76804844506e-16, 1.52297985316e-14, 1.00538925333e-15, 3.2213904896e-15, 1.88974179837e-17, -1.15748486176e-15, -4.03684563621e-16, -3.09287506838e-16, -3.10177439566e-17, 4.75067161654e-15, 1.9038176849e-16, 1.56016551202e-15, 7.39547679204e-16, 2.66502474114e-15, 2.7423617409e-16, -7.14183467585e-16, -7.83710908369e-16, 9.05941988094e-14, -9.80495714737e-16, 6.85615184726e-16, -1.62855636973e-15, -8.78121607031e-16, -3.3553596728e-16, 7.21229796572e-16, 1.17858908338e-15, -4.6750047143e-16, 1.1511683809e-16, -6.22060882854e-16, -2.06807788113e-17, 2.57050914047e-15, -1.60530397929e-16, 2.82280236155e-16, -1.441330434e-17, 3.36275358528e-14, 7.9160390211e-16, 2.78872405136e-15, 5.71816496774e-16, 1.05669220751e-14, -5.90464067592e-16, 4.70750685665e-15, -4.5809790381e-16, -8.76218356501e-15, 3.22883908531e-16, 1.83351937784e-15, -4.75357553212e-16, 1.12137751537e-14, -6.52233985352e-16, 1.27478459404e-15, -2.48514390054e-16, 1.12642100855e-14, -5.21748385391e-16, 1.17998198641e-15, -5.50000492759e-16, 1.767476236e-15, 1.8743037822e-16, 1.54063158514e-15, 1.45415852793e-16, -7.14244637222e-15, -1.10637652425e-16, 2.24969279334e-15, -5.73868014574e-16, 2.74291992254e-15, 9.92962068291e-16, -2.5412196985e-15, 4.33490689622e-15, 2.91999603692e-14, -4.28995942772e-16, -5.19949879346e-15, -5.01054248088e-15, 4.14925757339e-15, -3.37494690924e-16, 2.28922769946e-15, 2.14932931869e-15, 7.66998402116e-15, -5.69881550658e-17, -8.02603177859e-15, -9.80390426905e-16, 1.94763095569e-15, 4.99722813172e-18, -6.66210410455e-16, 9.41928479954e-16, 4.19895250363e-14, 5.08463478957e-16, 6.20190538995e-15, -2.35854522357e-15, -2.67071268032e-15, -1.38642994103e-15, -1.02418768022e-15, 1.94115907508e-15, 4.56342584147e-15, 7.2192452627e-16, -1.92582982702e-15, -1.449258867e-16, -9.07398851732e-16, 8.64525455475e-16, 3.77536167485e-15, -9.1841281355e-17, 4.89964006655e-15, -1.20756076199e-15, -7.88195479675e-16, -3.68567647009e-16, -8.12712584812e-16, 4.16898212995e-16, 1.3701924654e-15, 5.74575746489e-16, 1.34567384015e-16, 8.12670897395e-16, -9.91145971777e-16, 6.74576695871e-16, 3.85800421458e-15, 5.20619714792e-16, -1.06836589264e-15, -3.72800798199e-16, -2.40927752498e-15, -1.06744761661e-15, -2.95216879137e-16, -6.08174658384e-16, -1.6644187365e-15, -3.86699638476e-16, -7.96907084358e-17, 1.16545894065e-15, -1.24484226387e-15, 1.08374478299e-15, 9.4403695106e-16, -2.08497272972e-16, 4.94396399916e-15, 2.12726465997e-16, -1.77481532024e-15, -6.39406839322e-16, 3.04923459776e-15, -8.69606102743e-16, 2.2219282865e-15, 3.95813673121e-16, -1.7990688344e-16, -5.63916824224e-16, -5.67077590969e-16, 4.22181597111e-16, 1.39110577279e-15, 1.11863342183e-15, 1.81880283834e-15, -2.43702564934e-16, 1.74625259159e-15, 4.3103310218e-16, 7.1373344441e-16, -9.87981427945e-16, 1.98880192188e-14, -2.07375018449e-15, -3.66389163663e-15, 7.63201784862e-16, 2.39596787516e-15, 1.75272272327e-15, 1.254146269e-15, 6.98734718797e-16, -6.50986450705e-15, 2.1034371653e-16, 4.54545295019e-15, -1.913438378e-15, 3.13131278631e-15, 4.26525055625e-15, -9.36882402956e-15, 1.2201732239e-14, 9.71756235254e-15, 5.77507229304e-16, -1.0879283722e-14, -1.20603705944e-14, 1.0169796636e-14, -5.60452211765e-15, 2.38066479825e-16, 2.54995294177e-15, 1.77922351918e-15, 1.35382575568e-15, -4.35716175585e-15, -2.0632735534e-15, 3.19751487327e-15, -1.46551759471e-15, -8.61052538447e-16, 2.31447787942e-15, 6.03596667648e-15, 5.7351050901e-16, 1.35654182726e-15, -3.45858121827e-15, 6.42595130315e-15, -6.48862312509e-16, -1.86443760579e-15, 2.21095741615e-15, -8.20287105612e-16, -1.14763726476e-16, 8.93294678651e-16, -1.42541384839e-15, 4.30201097178e-15, 3.23312042966e-16, -7.90493991157e-16, 9.93935809561e-16, -2.51295030043e-15, -4.98399645598e-17, 3.43126754284e-15, -6.12625705211e-16, 2.02054707759e-15, 9.92734328274e-16, 2.14432093605e-15, 1.27664789667e-15, 3.82656793812e-15, -1.17513236038e-15, 6.46771091798e-16, -6.58541155666e-16, 1.23306063544e-15, 8.63775523006e-16, -4.3065359981e-16, 7.99782798654e-17, 0.0, -7.408935991e-16, 0.0, 7.99782798654e-17, 2.77555756156e-16, 8.63775523006e-16, -2.12613825371e-15, -6.58541155666e-16, -6.3246075703e-15, -1.17513236038e-15, 3.50738763842e-15, 1.27664789667e-15, -3.09021880097e-15, 9.92734328274e-16, 3.03678304335e-16, -6.12625705211e-16, -6.43929354283e-15, -4.98399645598e-17, -3.62120518093e-16, 9.93935809561e-16, -5.08325525014e-15, 3.23312042966e-16, 5.77869894261e-15, -1.42541384839e-15, -3.48884750087e-15, -1.14763726476e-16, -2.22769577566e-15, 2.21095741615e-15, -2.19560878634e-15, -6.48862312509e-16, 1.82487923371e-15, -3.45858121827e-15, -1.02058767664e-14, 5.7351050901e-16, -1.35654182726e-15, 2.31447787942e-15, 1.84725066254e-15, -1.46551759471e-15, -7.01948110961e-16, -2.0632735534e-15, -9.10105706027e-16, 1.35382575568e-15, 2.20007464334e-15, 2.54995294177e-15, -2.9175292536e-15, -5.60452211765e-15, 8.86782446531e-15, -1.20603705944e-14, -1.63373187952e-14, 5.77507229303e-16, 7.93803009299e-15, 1.2201732239e-14, -1.58959478948e-14, 4.26525055625e-15, 6.04573375385e-15, -1.913438378e-15, 7.3258645698e-15, 2.1034371653e-16, -4.98967084796e-15, 6.98734718797e-16, -2.05549959344e-15, 1.75272272327e-15, 7.68385982522e-16, 7.63201784862e-16, -3.01980662698e-14, -2.07375018449e-15, 3.66389163663e-15, -9.87981427945e-16, -5.24382996407e-15, 4.3103310218e-16, 2.04619277278e-15, -2.43702564934e-16, 7.45136378507e-16, 1.11863342183e-15, 8.01862849642e-16, 4.22181597111e-16, 1.03597885229e-15, -5.63916824224e-16, -1.49699967674e-15, 3.95813673121e-16, 5.44753569854e-15, -8.69606102743e-16, -1.48071746875e-15, -6.39406839322e-16, -1.00333450332e-15, 2.12726465997e-16, 3.50683788947e-15, -2.08497272972e-16, -2.96870996645e-15, 1.08374478299e-15, -2.47185893733e-15, 1.16545894065e-15, -3.71558463505e-15, -3.86699638476e-16, -1.30128748642e-15, -6.08174658384e-16, 1.10884195507e-14, -1.06744761661e-15, 2.95216879137e-16, -3.72800798199e-16, 2.84241644262e-15, 5.20619714792e-16, 2.52322931447e-15, 6.74576695871e-16, -3.1022517619e-15, 8.12670897395e-16, -1.35686661376e-15, 5.74575746489e-16, -1.47887556814e-15, 4.16898212995e-16, -3.56342139879e-15, -3.68567647009e-16, -6.17787340511e-15, -1.20756076199e-15, -1.00129216777e-15, -9.1841281355e-17, 5.80591434315e-16, 8.64525455475e-16, 9.37218183823e-16, -1.449258867e-16, -1.08059682348e-15, 7.2192452627e-16, -3.20883147224e-18, 1.94115907508e-15, -3.89446511198e-15, -1.38642994103e-15, -9.96824637036e-16, -2.35854522357e-15, -2.12360666947e-15, 5.08463478957e-16, -6.20190538995e-15, 9.41928479954e-16, -1.80500805804e-15, 4.99722813172e-18, 3.6853304815e-15, -9.80390426905e-16, -8.23624187394e-15, -5.69881550659e-17, 3.32625278161e-15, 2.14932931869e-15, -3.32008827134e-15, -3.37494690924e-16, 2.44443948251e-15, -5.01054248088e-15, -2.33989995551e-14, -4.28995942772e-16, 4.04423170661e-15, 4.33490689622e-15, -5.52681703026e-15, 9.92962068291e-16, 3.41366099079e-15, -5.73868014574e-16, 4.53980096769e-15, -1.10637652425e-16, -4.90690073699e-15, 1.45415852793e-16, -3.83676377132e-15, 1.8743037822e-16, -5.71127218112e-16, -5.50000492759e-16, -1.69405723416e-14, -5.21748385391e-16, -1.17998198641e-15, -2.48514390054e-16, -1.37094578956e-14, -6.52233985352e-16, -1.74972395421e-15, -4.75357553212e-16, 1.00574099701e-14, 3.22883908531e-16, 2.64812859627e-15, -4.5809790381e-16, -1.27698595878e-14, -5.90464067592e-16, -1.65381610939e-15, 5.71816496774e-16, -2.70837644704e-14, 7.9160390211e-16, -1.83425181237e-15, -1.441330434e-17, -4.93951306978e-15, -1.60530397929e-16, -4.18555326087e-16, -2.06807788113e-17, 4.2742176548e-15, 1.1511683809e-16, 1.43023548865e-16, 1.17858908338e-15, 6.98475617935e-16, -3.3553596728e-16, -2.71937835408e-15, -1.62855636973e-15, -7.07711585931e-14, -9.80495714737e-16, -6.85615184726e-16, -7.83710908369e-16, -5.88860604709e-15, 2.7423617409e-16, 3.45294997788e-16, 7.39547679204e-16, -2.94724655451e-15, 1.9038176849e-16, 1.26835957679e-17, -3.10177439566e-17, -1.90223835643e-15, -4.03684563621e-16, -1.80679336733e-15, 1.88974179837e-17, -1.43881511287e-14, 1.00538925333e-15, -8.38271502277e-16, 1.76804844506e-16, -1.07529288593e-15, -6.27494788887e-16, -1.94098315881e-16, -4.92411118081e-16, -1.27913041272e-15, 1.25989890426e-15, -5.36544050569e-16, 1.73508606445e-15, -1.48155012895e-15, -9.97821069011e-16, 4.15057248691e-15, -2.72383715929e-15, -5.77648211823e-15, 4.2194325517e-16, -3.24382123682e-15, 1.49462486312e-15, -1.8054003715e-15, -3.76137762878e-15, 6.07589488891e-15, -4.26985256491e-15, -3.55292890168e-14, 5.14002246939e-16, 3.21517708057e-14, 5.30952606861e-15, -5.34435750472e-15, 4.17582405778e-15, -3.97790495752e-17, -3.09021178563e-15, -1.01652223712e-14, -2.37551463362e-15, 6.33120358087e-16, 4.07464728363e-15, -4.82942871756e-15, 3.06475416731e-15, 1.97881378861e-15, -1.88288108205e-15, 2.76755019208e-15, -1.13495040105e-15, -2.52778382087e-15, 1.7831988913e-15, -1.47788897876e-15, 4.74081709404e-16, 8.03809676956e-17, -1.14878564218e-15, -2.34479102801e-13, -1.57159149434e-16, 2.60208521397e-16, 3.192686443e-16, -5.23192600355e-15, 7.15562261709e-17, -4.25119562298e-15, -6.04391978181e-16, -7.83671062062e-15, 7.61467782713e-16, -5.04172299165e-16, 7.02433451731e-16, -2.10294556608e-15, -1.41749070227e-15, -5.48981100148e-16, -5.70094465335e-16, -4.66293670343e-15, 1.58318646262e-16, -8.7098537217e-16, -1.80358697424e-17, -2.27532007435e-15, -2.71278947456e-16, 1.68378392771e-15, -1.48244958666e-16, 3.07586485054e-17, 7.85638252146e-16, -5.22365417556e-15, 7.73598790599e-16, -3.53829557192e-15, -8.04573384604e-16, 3.90956922218e-15, -3.54353005052e-16, -2.19020428393e-14, 2.49215789888e-16, -1.86987739338e-15, 1.40901037236e-16, -4.5904923547e-15, 3.97081814176e-17, 1.73632359456e-15, 4.06264334213e-16, -2.02248558346e-15, 3.23176624349e-16, -1.39636105172e-15, -1.43566227545e-15, -1.46008034978e-15, -2.38358796158e-16, -4.18834972627e-15, 2.4737094729e-15, -2.5713237352e-14, 7.40738951969e-17, -1.08421915539e-15, -2.38950959284e-15, 2.26871291959e-15, -1.09968330794e-15, 2.97468012304e-16, -3.57354629937e-16, -3.46977886104e-15, 6.41947497837e-16, 1.13725373844e-15, 1.88194306608e-15, -2.61245323064e-15, 6.18966041212e-16, -5.20509779573e-15, -1.5968293806e-15, -6.2172489379e-14, -8.76902171665e-16, -8.76384566986e-15, 1.17196752845e-15, -4.13001454552e-15, 2.61462296006e-15, -2.16502587336e-15, 2.21277076554e-15, 1.04403312756e-14, -6.05376786395e-16, -1.29271495657e-14, -1.59780806146e-15, 6.5665843656e-15, -1.38697234275e-15, -1.37935396685e-15, -2.17239450599e-15, -8.63388429993e-15, -6.13776272452e-18, -5.8768675312e-16, 1.53521183787e-15, 4.8123749377e-15, -2.37625728097e-16, -3.233700987e-16, -3.08961223442e-16, 3.40924736096e-15, 2.67075596151e-17, -1.41750324373e-15, -4.04021120233e-16, 1.68219473853e-15, -3.81708513492e-16, -3.4726970431e-15, 3.87342319562e-16, -2.36913960358e-14, -2.21973351348e-16, -2.04649181021e-15, -1.7458138716e-15, -7.83153542858e-15, -8.89342670076e-17, -4.34569832689e-15, 4.98055709469e-16, -1.01007693457e-14, 1.40782032941e-16, -6.49417390119e-16, -4.66248195508e-16, -8.16132272723e-15, -5.85757554919e-16, -7.19649188366e-15, 2.36889949114e-16, -3.05813987445e-14, -9.96989952227e-16, -2.03025529022e-15, -7.39518114382e-16, -2.35384490801e-15, 1.50240781231e-16, -4.882785595e-15, -3.85906290425e-17, -4.33544352438e-15, 8.41747333429e-16, -2.43325585761e-15, 1.18978725726e-15, -5.20113274643e-15, -1.45737981045e-16, -1.7572801079e-15, 1.43174399109e-16, -9.81188124701e-14, 6.27447048091e-16, -3.65533132722e-15, -4.50745100905e-17, -7.79313932677e-15, 7.89502628481e-16, -1.02993825451e-15, 8.77607632505e-16, -7.95700244129e-15, -1.02139125531e-15, 3.6031784029e-15, -3.50843836178e-16, -7.98476832232e-15, 5.40130814212e-16, -8.1970177362e-15, 2.27743811408e-16, -4.2203133694e-14, 7.82350136714e-16, -6.31091170203e-15, -4.51177893942e-16, -4.63744167336e-15, -5.95914117693e-16, -2.59375338172e-15, -5.15479064209e-16, -7.49034383788e-15, -1.41400258841e-15, 2.71030279049e-15, 1.33761095312e-15, -1.26418339437e-14, 1.1341541471e-15, -2.07045836128e-16, -3.49175297909e-15, -3.24266744932e-14, -4.64380668017e-16, -9.40864217653e-15, 3.17731451744e-15, -1.50103148572e-14, 2.06193747392e-16, 2.27227094656e-15, 7.5809899164e-16, -3.02254702386e-15, 1.31631749194e-15, -9.07257572833e-15, -1.33163046986e-15, -8.44464247043e-15, -3.5930568463e-17, -4.86015568863e-15, 3.72585484986e-16, -5.11962421069e-14, -1.78754920909e-15, -3.26892368847e-15, 1.58344416309e-15, -1.43700865822e-14, 1.70620506332e-15, 3.4898600853e-16, -1.95071483446e-15, -8.85669591942e-15, 1.00761570794e-16, -6.17848331473e-15, 9.94981112262e-16, -8.8604874255e-15, -6.63822354292e-16, -3.70083634403e-15, -3.26405588808e-16, -2.61472549377e-13, -5.00002386189e-16, -3.02656006773e-15, -2.40264994719e-16, -1.3574012293e-14, 1.32571081181e-15, -2.98787954048e-15, 5.84754391954e-16, -1.26967296071e-14, 5.894955421e-17, -5.3504242545e-15, -4.67950066318e-16, -1.53725096238e-14, -7.52443713212e-16, -6.70433491573e-15, 4.56259003886e-16, -8.64257547722e-14, 7.01961623624e-16, -4.89064962318e-15, 1.03703984616e-15, -2.59924929928e-14, -1.48370317037e-16, -5.9921142312e-15, -1.71840381989e-15, -1.75167215756e-14, -5.75282259126e-16, -9.08771116942e-15, 6.13055952407e-16, -2.28217866367e-14, 1.30859141192e-16, -6.61543881274e-15, -1.60972715089e-16, -1.14100565686e-13, -2.81903879404e-16, -7.70972419107e-15, -2.16489859293e-16, -2.97037300528e-14, 9.01376884194e-16, -9.69539643162e-15, 3.41332290024e-16, -3.54466068642e-14, -3.14206394495e-16, -9.89509761608e-15, -2.99940488335e-16, -4.26352084326e-14, 2.72764222422e-16, -1.6326395471e-14, 1.67741767281e-15, -2.55323100194e-13, -1.0480207485e-16, -1.60483627967e-14, -1.93700945762e-15, -7.02452656662e-14, 2.66162910625e-16, -2.244010883e-14, 3.79032227216e-16, -9.72442087284e-14, 5.61080391287e-16, -3.41587128221e-14, 2.59436596681e-15, -2.02224056364e-13, 2.56426491579e-15, -6.32228954874e-14, 1.27235727414e-14, 512.0 }; +float output_data_imag[ 1024 ] = { 0.0, -2.73953068846e-13, 1.15172383906e-15, 3.68662073617e-15, -1.45479157899e-15, 2.48165218159e-15, -2.08879510066e-16, -3.85093749736e-16, 5.46113498614e-15, 2.44894545386e-16, -1.68032250205e-15, -3.63986713248e-15, 1.14467078969e-15, 2.62379558266e-15, -1.20173507003e-16, 2.45588135991e-14, -2.28073078977e-15, -9.53898338068e-16, 8.87809217826e-16, 4.12808780082e-15, -2.56251438336e-16, 3.30146726949e-15, -3.54940262707e-16, 8.03877524948e-15, 1.15285950656e-15, -2.30506445454e-16, 8.87513413854e-17, 2.23261909814e-15, 1.5063710346e-15, 4.33122162145e-17, -1.89599352224e-16, 7.60192042751e-15, -6.02005880314e-16, 1.40456009736e-15, 9.6334874024e-16, 6.16753874481e-15, -2.79440119233e-15, 7.58459144135e-16, -9.69817982155e-17, -1.02144885918e-15, 6.91272417172e-16, 8.56194950051e-16, -1.73762849479e-15, 1.76239136203e-16, 7.01809248253e-16, 1.67538466295e-15, 5.85407041713e-16, -4.08080055893e-15, -9.33375515213e-16, 1.86124598693e-15, 1.07736225398e-15, 2.49127345913e-15, -1.34168769079e-15, 3.74217398683e-17, -2.46964522561e-16, 1.73613760301e-15, -5.292814139e-16, 3.15536314342e-15, -1.24304317762e-15, 1.49412576636e-15, 9.5116703599e-17, -3.08361084214e-15, -5.57200987754e-16, 5.27584784246e-14, -4.38802570717e-16, 7.50641619326e-16, 1.4339129634e-16, 2.77869203777e-15, -1.19948718688e-15, 1.5010958528e-15, 5.61489696854e-16, 1.10581498676e-14, -6.49624898559e-16, -7.74709496067e-16, 1.20842656842e-15, 4.14245116142e-15, 1.94514500159e-15, 4.10166856894e-15, -9.65961864596e-16, 8.6875315271e-15, 2.30258216555e-15, 8.72132579025e-16, -1.29036326958e-15, 5.45154445953e-15, 7.20381737789e-16, -1.39624137643e-15, 2.98104266618e-15, -6.05386165158e-15, -4.4850648388e-15, -2.05528714873e-16, 3.26666197019e-15, 4.87260297905e-15, -2.37907983094e-15, 2.67048811613e-15, 7.24055578052e-15, 1.29495798241e-14, -1.4274727085e-14, -6.51401619087e-16, 9.12521170012e-15, 5.19436767679e-15, -4.46023168045e-15, 4.09915099629e-17, 5.43887418291e-16, 7.22166519042e-15, 3.87071888059e-15, 3.15972494277e-15, -2.58665031383e-15, 5.91326033617e-15, 8.71432135114e-16, -5.43469963092e-15, 6.21762895013e-16, 1.45491025006e-14, -2.62650078075e-15, 4.60081762556e-16, 2.0674938355e-15, 1.35294748496e-15, -6.87341536638e-16, 5.08905965428e-15, 5.99905973439e-16, -4.23065985666e-15, 1.82031123201e-15, -1.46333181508e-15, -6.8309871823e-16, 4.40227356677e-15, 7.239150452e-16, 7.0106959564e-16, -8.08802501863e-16, 6.5877373318e-14, -1.31418601149e-16, 2.25141356872e-15, 3.5172838985e-16, 3.44013830933e-15, -1.75788615762e-15, 3.48768747897e-15, 1.46855202014e-16, 7.27213449042e-15, 8.38081251592e-16, 1.49813912017e-16, -6.127982626e-16, 4.08551466839e-15, 1.1310458676e-15, 3.56826164738e-15, 5.70155242519e-17, 1.11868821688e-14, 1.36575582806e-15, 4.81064806855e-16, 2.09172631408e-16, 2.6352845297e-15, -3.51163600879e-16, 1.80215435991e-15, 1.15875883238e-15, 1.8974577543e-15, 9.09195860278e-17, 1.68406438478e-15, -4.52996069251e-16, 7.16598795991e-15, -3.16341778083e-16, 7.19036831591e-17, -2.07538381817e-15, 1.19525619111e-14, 1.50466816212e-15, 1.84871764945e-15, 4.6143140642e-16, 1.23331070715e-14, -1.07218380206e-15, 6.14417737434e-16, 6.77303719623e-16, 1.44568346796e-14, -9.11413353252e-16, -1.886112873e-15, -4.63247220387e-16, 3.22941920061e-15, -2.99741558825e-16, 4.78748900403e-15, -8.08889827204e-16, 1.59212885519e-15, 2.44889260229e-15, -2.26072842079e-15, -1.44413919146e-15, 7.59273364297e-16, -2.75187425977e-17, 3.62442320155e-15, 7.62203077378e-15, -4.56065051903e-15, -1.36578151305e-14, -2.70522479486e-15, 6.20798781571e-15, -3.2701216735e-15, 2.9308161452e-15, 2.26318853066e-15, -1.50147548979e-15, 2.71536915785e-14, -1.0582799372e-15, 1.55630501158e-16, 1.58007273902e-15, 1.99864191434e-15, -1.52779539895e-16, 2.10511581427e-15, -4.87706719594e-16, 3.83599367747e-15, 2.57798035437e-15, 2.72503514671e-15, -1.11551257282e-15, 3.79956633175e-15, 6.58165718252e-17, 1.94068261795e-15, -7.2971861241e-16, 1.53938428317e-15, -1.61852535736e-15, 1.87027481149e-15, -8.75257341819e-16, 1.05001481037e-15, -1.58460373069e-15, 1.44282331787e-15, -7.88127363583e-17, 2.17999174599e-15, 1.24831743062e-15, 2.93495848303e-15, -5.98969996062e-16, 2.6507319804e-15, 4.57756990983e-16, 3.16240869392e-15, 5.04529873205e-16, 1.96896872755e-14, 1.48256414363e-16, 1.76415150978e-15, -1.16075694013e-16, 3.26728884325e-15, -1.31887586034e-15, 1.43015338233e-16, 6.20025641148e-16, 3.52423571023e-15, -3.78777065646e-16, -6.40918411023e-16, -1.71454239283e-15, 4.29410127026e-15, 5.82491925549e-16, 2.41815943113e-16, 1.06847904754e-15, 9.82445238275e-15, -3.08636449864e-16, 2.1981949625e-15, -7.98080310683e-17, 1.57967036623e-15, -5.9142466091e-16, 1.29893812167e-16, 1.04393914747e-15, -2.97749689255e-15, -8.60515224882e-16, 2.05084022671e-15, 1.55232536105e-16, 6.43333838214e-15, 1.76930977808e-15, 1.71998355771e-15, -3.27866146078e-16, 1.75327100343e-13, -1.49619899803e-15, 2.17327516568e-15, 6.27230612655e-16, 2.28496416758e-15, 4.31061372935e-16, 1.51498556345e-15, -2.41379657496e-16, 8.54922474292e-15, -2.53561776174e-15, -1.96447154088e-15, 2.46918155941e-15, -2.67247754713e-15, 1.20896925943e-15, -1.67710097423e-15, -5.03563949166e-15, 1.23463603282e-14, 3.88281935351e-15, -1.1424375941e-15, 4.99640215333e-16, -1.04677547743e-14, 4.55567315921e-16, 1.42661144347e-16, -1.80034340757e-14, 9.1368787862e-15, 3.74104800735e-14, 4.00380603665e-15, -1.8706945529e-14, -2.20818470989e-16, 1.01999118023e-15, -4.01042068495e-15, 4.66953597322e-15, 9.44164533434e-15, -6.87306490459e-15, 1.08736024308e-15, 9.31705575511e-16, 2.32883817834e-15, -8.06961215069e-16, -1.47089236451e-15, 1.77077881743e-15, 3.90918337789e-15, 1.57990274188e-15, 1.74207324944e-15, -3.30443144419e-15, 2.73324021617e-15, 2.11076281525e-16, 7.73929782593e-16, 5.40861669409e-16, 1.73884379909e-14, -2.73405127195e-15, 2.85004867239e-16, 1.23083033936e-15, -1.56874307021e-15, -1.6356257922e-16, 8.07722696748e-16, 1.53282664689e-16, 5.364085064e-15, 3.11824908548e-17, 1.41089768053e-15, -6.38938501779e-16, 2.05736294853e-15, 1.91885771844e-15, -2.57743472288e-16, -2.99081365518e-16, 3.49949100306e-14, -6.26180595204e-16, 1.27989187959e-15, 1.8653083502e-15, -6.88959173984e-16, -5.94001284124e-16, 1.95206111324e-15, 8.35526733382e-16, -7.17586251191e-16, 7.94471446201e-16, -3.75954311181e-15, -9.64968503347e-16, 6.78789892289e-15, 9.03780977626e-16, -4.48394529542e-16, -1.01347542423e-15, 3.24769590978e-15, 1.03434867957e-15, 5.93750240162e-17, 3.41941256699e-16, -2.44970720548e-15, -5.91886740811e-16, 2.31733889993e-15, 1.53956173749e-15, -5.09325879895e-15, -8.46364173071e-17, -1.31049784366e-15, 2.72307441143e-16, -8.35462049356e-15, 2.0789546282e-15, -2.97490424655e-16, -2.43920969935e-15, 2.0780366678e-14, 1.43010813713e-15, 1.08680349384e-15, -4.99993130819e-17, 1.3680270116e-14, -1.40145030122e-15, 3.28706638594e-15, -9.09427414205e-16, 5.30016397989e-15, -3.33019544847e-15, -3.15270030444e-16, 8.33013116985e-16, 3.2837614527e-15, -8.60412920251e-16, 3.52974170665e-15, -3.46724512498e-15, 8.25136006591e-15, 7.38228425443e-15, 7.78682260469e-16, -1.22884453464e-15, 7.61251483515e-16, -2.67927805373e-15, -3.4724735923e-15, -2.91227515194e-15, 2.25458342396e-15, 8.63807144024e-15, 3.94723677236e-15, -4.69103089485e-15, 1.79576307685e-15, 9.76657567195e-16, 1.29424672859e-15, -7.8591867691e-16, 8.82586683227e-14, -5.61630023192e-16, 1.33879732711e-15, 3.04735560047e-16, 2.96410916004e-15, -6.32746643693e-16, 2.13171849548e-15, 1.79549912284e-16, -1.37624603807e-17, 7.26603588845e-16, 5.34517424813e-15, -1.53186598697e-15, 1.12739162102e-15, 1.57021092237e-15, -3.47030469894e-15, -1.18897281333e-15, 2.40747130957e-14, -1.05267373886e-15, -1.28194598679e-16, 2.08151664043e-15, 3.37542627501e-15, -5.683054308e-16, 3.08330910932e-15, -7.16428068166e-16, 5.79006317403e-15, 5.14656906134e-16, -1.93911940545e-15, -5.97663274908e-16, 3.63481646884e-15, 7.28614918687e-16, 3.14792560133e-15, -6.60308405852e-16, 1.66100069802e-14, -5.06121189428e-16, 1.91495894075e-15, 4.45548779047e-16, 3.50951956396e-15, -1.05944300987e-15, 2.7856512572e-15, 6.01975675551e-16, 5.17446671808e-15, 3.31070910974e-16, 1.20601098318e-16, -7.4426931679e-18, 3.47449350828e-15, 1.59667472032e-15, -1.08415641271e-15, 4.81781264109e-16, 1.94990794908e-14, -6.73463851011e-16, 2.22808131986e-15, 4.35441399322e-16, 2.63459727026e-15, -8.80130817626e-16, 3.39520236172e-15, 2.92930541465e-17, 2.0183756753e-15, -6.24042921308e-16, 2.83589172759e-15, -3.11700531387e-16, 6.00367777332e-17, 8.10893172234e-16, 1.83522365021e-15, 7.06860747402e-16, 5.8949581831e-14, -1.04753731431e-15, 1.64787634483e-16, 3.35728878682e-16, -1.88475924946e-15, 6.33964389112e-16, 9.31502974883e-16, -3.26657487871e-16, 8.30401977958e-15, -4.07592395138e-15, -5.45651366298e-15, 2.90213508097e-15, 1.86236227006e-16, -8.3007961954e-16, 5.54053228612e-15, -9.52706427437e-15, 1.37906889101e-14, 2.41761718074e-14, 2.82538102906e-15, -1.06762551442e-14, 2.75798217925e-15, -2.88001099304e-15, -2.28664254033e-15, 2.11912893337e-15, 3.5762590347e-15, 3.59009480548e-15, 4.28953465839e-15, -4.66990708882e-15, 1.66935096227e-15, 1.57105507873e-15, -3.6015676964e-16, 1.43426043374e-15, 1.54443678718e-14, -4.88239152496e-15, 2.15112376664e-17, 1.30008265697e-15, 2.98259119492e-15, -5.57512769384e-16, -3.90128205711e-15, 3.74488886447e-18, 4.67403343815e-15, 2.93834111152e-16, 2.97009596838e-15, -1.0606029569e-15, 3.59389654082e-15, 2.74299797442e-15, -2.72719448966e-15, 1.33912843396e-15, 1.55794281528e-14, -2.0568874456e-15, 9.25544153536e-16, 2.8772277208e-15, 1.60162392082e-15, 7.15690976427e-16, 3.97451358465e-16, -4.34861403234e-16, 6.54731976893e-15, -5.50309884485e-16, 3.21363537806e-16, -5.83283100715e-18, 7.97606207447e-15, 1.35539048596e-15, 5.49479200048e-17, -1.35902499261e-15, 2.81908510707e-13, 0.0, 2.30384872588e-16, 1.35902499261e-15, 7.15606768812e-15, -1.35539048596e-15, -3.32934781371e-16, 5.83283100715e-18, 6.82396271486e-15, 5.50309884485e-16, 2.28191148578e-15, 4.34861403234e-16, -2.60841819373e-15, -7.15690976427e-16, 1.65356121823e-15, -2.8772277208e-15, 1.78974754514e-14, 2.0568874456e-15, 3.26502957885e-15, -1.33912843396e-15, -7.18705074102e-16, -2.74299797442e-15, -1.43829432517e-15, 1.0606029569e-15, 6.14487166166e-16, -2.93834111152e-16, 1.82087292996e-15, -3.7448888645e-18, 2.83217041153e-15, 5.57512769384e-16, 5.84411288227e-15, -1.30008265697e-15, 1.91578000059e-14, 4.88239152496e-15, 2.15112376664e-17, -1.43426043374e-15, 3.65576990312e-15, -1.57105507873e-15, 8.14864619644e-16, 4.66990708882e-15, -7.51238578891e-16, -3.59009480548e-15, -5.5463129009e-16, -2.11912893337e-15, 3.30124938173e-15, 2.88001099304e-15, -4.05336817949e-15, 1.06762551442e-14, 1.19937957534e-14, -2.41761718074e-14, 2.77219011992e-16, 9.52706427437e-15, 2.6201569591e-15, 8.3007961954e-16, 7.39881718642e-15, -2.90213508097e-15, 5.26181244446e-15, 4.07592395138e-15, -3.91241475767e-15, 3.26657487871e-16, 3.77537176656e-16, -6.33964389112e-16, 3.75835979084e-15, -3.35728878682e-16, 6.3416619461e-14, 1.04753731431e-15, 1.64787634483e-16, -7.06860747402e-16, 4.02790012768e-15, -8.10893172234e-16, 2.68479927427e-15, 3.11700531387e-16, 3.34204015564e-15, 6.24042921308e-16, 1.55992276644e-15, -2.92930541465e-17, 3.2529261471e-15, 8.80130817626e-16, -1.30593528745e-15, -4.35441399322e-16, 5.61643337054e-15, 6.73463851011e-16, -4.66938752557e-16, -4.81781264109e-16, 4.428652364e-15, -1.59667472032e-15, 7.95230774979e-16, 7.4426931679e-18, 1.22715914665e-15, -3.31070910974e-16, 1.15986701527e-15, -6.01975675551e-16, 1.95237376217e-15, 1.05944300987e-15, 2.92636799221e-16, -4.45548779047e-16, 2.11510661465e-14, 5.06121189428e-16, 1.91495894075e-15, 6.60308405852e-16, 1.24243697491e-15, -7.28614918687e-16, -2.50585927707e-15, 5.97663274908e-16, 6.97384463069e-16, -5.14656906134e-16, 6.13828595537e-16, 7.16428068166e-16, 2.89649113404e-15, 5.683054308e-16, 2.62058961239e-15, -2.08151664043e-15, 2.68798005623e-14, 1.05267373886e-15, 2.21171437386e-15, 1.18897281333e-15, 2.21205744799e-15, -1.57021092237e-15, 9.39373151287e-16, 1.53186598697e-15, 2.37866323832e-16, -7.26603588845e-16, 3.27389998158e-16, -1.79549912284e-16, 3.29480019222e-15, 6.32746643693e-16, -1.01868335642e-15, -3.04735560047e-16, 6.15654149049e-14, 5.61630023192e-16, 1.33879732711e-15, 7.8591867691e-16, 5.26537079255e-15, -9.76657567195e-16, 2.91705036903e-15, 4.69103089485e-15, 1.31151687544e-15, -8.63807144024e-15, 7.86244214477e-16, 2.91227515194e-15, 7.59356035427e-15, 2.67927805373e-15, -1.49384253891e-15, 1.22884453464e-15, 7.73267875967e-15, -7.38228425443e-15, 1.8988338842e-15, 3.46724512498e-15, -1.4020687178e-15, 8.60412920251e-16, -4.87670330244e-16, -8.33013116985e-16, 7.19262436095e-15, 3.33019544847e-15, 4.01627770763e-15, 9.09427414205e-16, 9.72413130659e-15, 1.40145030122e-15, 1.57738825679e-15, 4.99993130819e-17, 1.77297211517e-14, -1.43010813713e-15, 1.08680349384e-15, 2.43920969935e-15, -6.08708242797e-15, -2.0789546282e-15, -4.91157384466e-17, -2.72307441143e-16, 1.02039121842e-15, 8.46364173071e-17, 7.85620489305e-16, -1.53956173749e-15, -2.12716529091e-15, 5.91886740811e-16, 4.91875266305e-15, -3.41941256699e-16, 6.71726243149e-15, -1.03434867957e-15, 1.45809598464e-15, 1.01347542423e-15, 6.43812545996e-15, -9.03780977626e-16, -2.54449499174e-15, 9.64968503347e-16, -4.24045442967e-15, -7.94471446201e-16, 1.0789220926e-15, -8.35526733382e-16, -8.97592237344e-15, 5.94001284124e-16, 1.40934196371e-15, -1.8653083502e-15, 3.21779874463e-14, 6.26180595204e-16, 1.27989187959e-15, 2.99081365518e-16, 4.18991609102e-15, -1.91885771844e-15, 1.457314646e-15, 6.38938501779e-16, 3.30429387224e-15, -3.11824908548e-17, 1.35410602249e-15, -1.53282664689e-16, -7.19080720576e-16, 1.6356257922e-16, 1.45268634384e-16, -1.23083033936e-15, 6.26870255769e-15, 2.73405127195e-15, -9.15700928308e-16, -5.40861669409e-16, 4.99849276968e-15, -2.11076281525e-16, 1.84032641067e-15, 3.30443144419e-15, 5.06816268077e-15, -1.57990274188e-15, -1.89905199305e-15, -1.77077881743e-15, 3.71527664165e-15, 8.06961215069e-16, 4.7410458348e-15, -9.3170557551e-16, -4.50565123995e-15, 6.87306490459e-15, 1.08736024308e-15, -4.66953597322e-15, 4.35029778249e-15, -1.01999118023e-15, 4.89314709131e-15, 1.8706945529e-14, -6.16308667791e-15, -3.74104800735e-14, -5.76141369393e-15, 1.80034340757e-14, 2.47118694407e-15, -4.55567315921e-16, 6.37223544748e-15, -4.99640215333e-16, -1.20077714778e-15, -3.88281935351e-15, -7.16408559454e-16, 5.03563949166e-15, 2.89206114375e-15, -1.20896925943e-15, 4.80808147015e-15, -2.46918155941e-15, 3.55147911791e-15, 2.53561776174e-15, 4.67228908488e-16, 2.41379657496e-16, -6.51848873468e-16, -4.31061372935e-16, -1.18281780027e-15, -6.27230612655e-16, 1.75327100343e-13, 1.49619899803e-15, 2.17327516568e-15, 3.27866146078e-16, 2.06291956265e-15, -1.76930977808e-15, -1.51954841335e-15, -1.55232536105e-16, 1.85634316912e-15, 8.60515224882e-16, -4.79735756367e-16, -1.04393914747e-15, 3.34834238626e-15, 5.9142466091e-16, -4.53559929379e-16, 7.98080310683e-17, 8.79364664944e-15, 3.08636449864e-16, -3.29749467993e-16, -1.06847904754e-15, 3.0522885131e-15, -5.82491925549e-16, 8.2113910652e-16, 1.71454239283e-15, 1.68749234869e-15, 3.78777065646e-16, -2.04120004293e-15, -6.20025641148e-16, 2.14938315916e-15, 1.31887586034e-15, 1.36203846026e-16, 1.16075694013e-16, 1.29034184016e-14, -1.48256414363e-16, 1.76415150978e-15, -5.04529873205e-16, 2.6396666765e-17, -4.57756990983e-16, 2.2689832801e-15, 5.98969996062e-16, 8.30174523195e-16, -1.24831743062e-15, 2.83079749708e-15, 7.88127363583e-17, -1.91114405181e-16, 1.58460373069e-15, 2.48579725793e-16, 8.75257341819e-16, 1.49867157085e-14, 1.61852535736e-15, -2.35310396817e-17, 7.2971861241e-16, 1.84460278871e-16, -6.58165718252e-17, -1.00676834563e-15, 1.11551257282e-15, 5.40627912031e-15, -2.57798035437e-15, -1.81676189856e-15, 4.87706719594e-16, -8.97467477404e-16, 1.52779539895e-16, 5.08435804738e-15, -1.58007273902e-15, 5.27584784246e-14, 1.0582799372e-15, 1.55630501158e-16, 1.50147548979e-15, -1.80724647827e-15, -2.9308161452e-15, -2.64987903975e-16, -6.20798781571e-15, -6.37192886982e-15, 1.36578151305e-14, 4.11449856153e-15, -7.62203077378e-15, -6.65115982007e-15, 2.75187425977e-17, -1.6839065087e-15, 1.44413919146e-15, 1.63571423575e-15, -2.44889260229e-15, 2.62244182149e-15, 8.08889827204e-16, 5.09607550247e-15, 2.99741558825e-16, 1.48427418572e-15, 4.63247220387e-16, 1.37354149963e-14, 9.11413353252e-16, -7.83770724268e-17, -6.77303719623e-16, 1.12313319789e-14, 1.07218380206e-15, 1.8393415929e-15, -4.6143140642e-16, 3.05305988781e-14, -1.50466816212e-15, 1.84871764945e-15, 2.07538381817e-15, 6.87804381697e-15, 3.16341778083e-16, 3.63391108165e-16, 4.52996069251e-16, 5.29858240133e-15, -9.09195860278e-17, 4.14766347666e-15, -1.15875883238e-15, 3.82181230853e-15, 3.51163600879e-16, -9.82802227161e-16, -2.09172631408e-16, 1.02740527923e-14, -1.36575582806e-15, -3.72565535798e-16, -5.70155242519e-17, 1.96149018218e-15, -1.1310458676e-15, 2.29347123987e-15, 6.127982626e-16, 4.07732164444e-15, -8.38081251592e-16, 2.04440430943e-15, -1.46855202014e-16, 8.27680517458e-15, 1.75788615762e-15, 2.44534317827e-15, -3.5172838985e-16, 5.92813033713e-14, 1.31418601149e-16, 2.25141356872e-15, 8.08802501863e-16, 3.96504310245e-15, -7.239150452e-16, -1.5570024126e-15, 6.8309871823e-16, 5.02630634649e-15, -1.82031123201e-15, 5.54336545356e-15, -5.99905973439e-16, 4.72572983089e-15, 6.87341536638e-16, 4.60419615043e-15, -2.0674938355e-15, 9.94388096759e-15, 2.62650078075e-15, 8.2620876871e-16, -6.21762895013e-16, 3.48264103018e-15, -8.71432135114e-16, -3.52048620971e-15, 2.58665031383e-15, 2.40544909649e-15, -3.87071888059e-15, -2.06322263271e-15, -5.43887418291e-16, 2.85971092565e-15, 4.46023168045e-15, -1.19012926654e-15, -9.12521170012e-15, 1.81942124296e-14, 1.4274727085e-14, -6.51401619087e-16, -7.24055578052e-15, -3.54335205748e-15, 2.37907983094e-15, 5.39475479005e-16, -3.26666197019e-15, 9.14040512567e-15, 4.4850648388e-15, 4.49291860245e-15, -2.98104266618e-15, 5.48993257022e-15, -7.20381737789e-16, -2.18820258483e-15, 1.29036326958e-15, 2.00161219181e-14, -2.30258216555e-15, 1.66156178826e-15, 9.65961864596e-16, -1.09395513157e-15, -1.94514500159e-15, -2.90903521817e-15, -1.20842656842e-15, 2.68715045171e-15, 6.49624898559e-16, -1.45562041651e-15, -5.61489696854e-16, -5.52605006013e-16, 1.19948718688e-15, 2.23410230192e-15, -1.4339129634e-16, 2.88038066242e-14, 4.38802570717e-16, 7.50641619326e-16, 5.57200987754e-16, 3.5593014361e-15, -9.5116703599e-17, 2.67414836986e-15, 1.24304317762e-15, 7.33674732368e-15, 5.292814139e-16, -1.17174344976e-15, 2.46964522561e-16, 6.11851770024e-15, 1.34168769079e-15, 2.10778164938e-15, -1.07736225398e-15, 4.69402664978e-15, 9.33375515213e-16, -1.38001608576e-15, -5.85407041713e-16, 1.59325420701e-15, -7.01809248253e-16, -2.45204764222e-15, 1.73762849479e-15, 1.36478639217e-15, -6.91272417172e-16, 3.49655719087e-15, 9.69817982155e-17, 3.37141467259e-15, 2.79440119233e-15, -1.81105091978e-15, -9.6334874024e-16, 1.76484546791e-14, 6.02005880314e-16, 1.40456009736e-15, 1.89599352224e-16, 4.7762565697e-15, -1.5063710346e-15, 7.10647037785e-16, -8.87513413854e-17, 2.90865656137e-15, -1.15285950656e-15, 1.07726168453e-15, 3.54940262707e-16, 4.10136317079e-15, 2.56251438336e-16, -5.29623538998e-16, -8.87809217826e-16, 1.8166176996e-14, 2.28073078977e-15, -1.56838637789e-15, 1.20173507003e-16, -4.92020930739e-15, -1.14467078969e-15, -5.16312506711e-16, 1.68032250205e-15, 6.57367591077e-16, -5.46113498614e-15, 4.21206462423e-15, 2.08879510066e-16, 2.03269633698e-15, 1.45479157899e-15, -1.65721007671e-15, -1.15172383906e-15, -2.29025619274e-12 }; +float tf_real[ 1024 ] = { 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915, 6.12323399574e-17, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.83697019872e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283 }; +float tf_imag[ 1024 ] = { -0.0, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.22464679915e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283, 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915 }; diff --git a/benchmarks/vec-fft/fft_dc_float.c b/benchmarks/vec-fft/fft_dc_float.c new file mode 100644 index 0000000..36814c8 --- /dev/null +++ b/benchmarks/vec-fft/fft_dc_float.c @@ -0,0 +1,6 @@ +double input_data_real[ 1024 ] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; +double input_data_imag[ 1024 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +double output_data_real[ 1024 ] = { 1024.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +double output_data_imag[ 1024 ] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; +double tf_real[ 1024 ] = { 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915, 6.12323399574e-17, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.83697019872e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283 }; +double tf_imag[ 1024 ] = { -0.0, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.22464679915e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283, 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915 }; diff --git a/benchmarks/vec-fft/fft_gaussian_float.c b/benchmarks/vec-fft/fft_gaussian_float.c new file mode 100644 index 0000000..9d3cb19 --- /dev/null +++ b/benchmarks/vec-fft/fft_gaussian_float.c @@ -0,0 +1,6 @@ +float input_data_real[ 1024 ] = { 0.639426798458, 0.0250107552227, 0.275029318369, 0.223210738149, 0.736471214164, 0.676699487423, 0.892179567705, 0.0869388326294, 0.421921819685, 0.0297972194381, 0.218637974804, 0.505355288103, 0.0265359696839, 0.198837650687, 0.64988443778, 0.544941480603, 0.220440622041, 0.589265683876, 0.809430456678, 0.00649875967806, 0.805819251833, 0.698139394988, 0.340250516518, 0.155479499812, 0.957213072207, 0.336594545113, 0.0927458433801, 0.0967163768335, 0.847494366347, 0.603726031367, 0.807128273274, 0.729731786694, 0.536228091455, 0.973115763979, 0.378534377208, 0.552040631273, 0.829404664253, 0.618519752364, 0.861706900311, 0.577352145257, 0.704571836215, 0.0458243836557, 0.227898275652, 0.289387963602, 0.0797919769236, 0.232790886361, 0.10100142941, 0.27797360311, 0.635684444264, 0.36483217897, 0.370180967117, 0.209507030771, 0.266977822049, 0.936654587712, 0.648035385247, 0.609131005667, 0.171138648198, 0.72912679795, 0.163402493762, 0.379455441758, 0.989523350637, 0.639999759854, 0.556949743775, 0.68461425099, 0.84285192019, 0.775999911546, 0.229048071964, 0.032100243904, 0.315453048059, 0.267740875976, 0.210982843586, 0.942909714335, 0.876367626473, 0.314677880798, 0.655438665295, 0.395631901061, 0.914547589741, 0.458851852587, 0.264880166498, 0.246627507694, 0.561368134163, 0.262741608523, 0.584585990224, 0.897822883602, 0.39940050514, 0.219320759157, 0.997537606495, 0.509526293676, 0.0909094121738, 0.0471163754247, 0.109649130351, 0.627446041703, 0.792079364363, 0.4221599668, 0.063527706152, 0.381619286507, 0.99612138024, 0.529114345099, 0.971078377614, 0.860779702234, 0.0114810219428, 0.72072181936, 0.681710369027, 0.536970330409, 0.266825189953, 0.64096179858, 0.111552173596, 0.434765250669, 0.453723706329, 0.953815927521, 0.875852940378, 0.263389050751, 0.50058611305, 0.17865188053, 0.912627839345, 0.870518569837, 0.298444791449, 0.638949494866, 0.608970211438, 0.15283926855, 0.762510800075, 0.53937903012, 0.778626478631, 0.530353672195, 0.000571896127944, 0.324156057005, 0.0194767423858, 0.929098616265, 0.878721877823, 0.831665529361, 0.307514125403, 0.0579251664942, 0.878009599204, 0.946949445298, 0.0856534520679, 0.485990463317, 0.0692125184684, 0.760602165257, 0.765834429307, 0.1283914645, 0.475282378099, 0.549803593495, 0.26505662894, 0.872433041085, 0.423137940201, 0.211798205442, 0.539296088779, 0.72993106909, 0.20115106339, 0.311716291301, 0.995149356661, 0.649878057639, 0.438100083915, 0.517575841036, 0.121004195868, 0.224697337032, 0.338085562147, 0.588308718457, 0.230114732597, 0.220217384452, 0.070993086009, 0.63110295727, 0.228941783811, 0.905420013006, 0.859635400254, 0.0708573498887, 0.238004634369, 0.668977778296, 0.21423680737, 0.132311848725, 0.935514240581, 0.571043093325, 0.472671026312, 0.784619424291, 0.807496997767, 0.190409914362, 0.0969308142288, 0.431051182406, 0.42357862302, 0.467024668037, 0.72907584946, 0.673364547293, 0.984165211366, 0.098417871152, 0.402621282102, 0.339302605395, 0.861672536353, 0.24865633392, 0.190208908441, 0.448613547833, 0.421881639834, 0.278545144667, 0.249806447882, 0.923265599276, 0.443130745053, 0.861349104762, 0.55032531245, 0.0505883295249, 0.999282468413, 0.83602758508, 0.968996257285, 0.926366983008, 0.848695734414, 0.166311110604, 0.485641125451, 0.213747299199, 0.401040292549, 0.0586353999722, 0.378973118977, 0.98530884378, 0.265203058172, 0.784070601949, 0.455008367339, 0.42300748599, 0.95731764086, 0.995422689493, 0.555768323406, 0.718408275296, 0.154796825274, 0.296707825495, 0.968709364969, 0.579180290816, 0.542195201374, 0.747975560379, 0.0571652729075, 0.584177594459, 0.50285038292, 0.852719892048, 0.157432727939, 0.960778903274, 0.0801114652406, 0.185824960981, 0.59503510645, 0.675212553604, 0.235203895001, 0.119886613947, 0.890287314129, 0.246215347789, 0.594519153533, 0.619381510332, 0.419224915336, 0.583672289291, 0.522782715532, 0.934706257736, 0.204259199424, 0.716191800789, 0.238685952616, 0.395785846791, 0.67169022296, 0.299997079799, 0.316177196272, 0.751864492414, 0.0725431144932, 0.458285522619, 0.998454440854, 0.996096447855, 0.0732607210996, 0.213154312267, 0.26520041475, 0.933259377994, 0.880864173686, 0.879270242485, 0.369527088739, 0.157746832357, 0.83374495464, 0.703539925087, 0.611677765726, 0.987233063632, 0.653976317711, 0.00782310715216, 0.817104135115, 0.2993787522, 0.663388714966, 0.938930003927, 0.134291114393, 0.115428670419, 0.107035977709, 0.553223640885, 0.272348212315, 0.60482982703, 0.717612187139, 0.203597312327, 0.634237958885, 0.26398390163, 0.488531852149, 0.905336491079, 0.846103713295, 0.0922984677127, 0.423575772564, 0.276680223972, 0.00354568908778, 0.77111922302, 0.637113377301, 0.261955262434, 0.741230908348, 0.551680421126, 0.427686918981, 0.00966969960834, 0.0752438600738, 0.8831063933, 0.90392857156, 0.545590289206, 0.834595019886, 0.58250956649, 0.148093785567, 0.127445519282, 0.30825834993, 0.898981488743, 0.796122304888, 0.860702582001, 0.898924636526, 0.21007653834, 0.249529739223, 0.102793621672, 0.780116241871, 0.884134701451, 0.406377389832, 0.620661510151, 0.154553338332, 0.929881015694, 0.86460569622, 0.976206032931, 0.81077171994, 0.881416204663, 0.0247863618982, 0.736564471755, 0.332185467946, 0.930815886048, 0.802235138937, 0.864064028375, 0.810749316574, 0.266805709594, 0.787374509135, 0.108095626403, 0.872166782906, 0.858593251338, 0.222433717546, 0.816586605597, 0.460303234679, 0.305190867339, 0.795345499153, 0.227595487408, 0.0236644347015, 0.193129788328, 0.328261951198, 0.86435294203, 0.966889104048, 0.279124992722, 0.641481738608, 0.39967838436, 0.981149687198, 0.536215732479, 0.939237140325, 0.115341751851, 0.970400611022, 0.178567816172, 0.962534315762, 0.265466362523, 0.108402547215, 0.434563758565, 0.728545060653, 0.313677314195, 0.606208853306, 0.511423059669, 0.385195433345, 0.576588043497, 0.254722506139, 0.708785283834, 0.00169127821863, 0.925575165499, 0.538451997093, 0.719429999145, 0.741950077839, 0.670628504433, 0.364221471781, 0.0699738111263, 0.664237684911, 0.330200036043, 0.313915645058, 0.848015279506, 0.719754263014, 0.300322268211, 0.309284662209, 0.408392908619, 0.402400387058, 0.295655202526, 0.127287799059, 0.420446333773, 0.94036367073, 0.677317945273, 0.902805545733, 0.615514915951, 0.300949874566, 0.547937213136, 0.000405939697288, 0.286913716869, 0.42988814999, 0.579984781196, 0.654705623703, 0.464988190247, 0.442159799305, 0.213701400989, 0.473186185909, 0.901180825828, 0.796024760127, 0.169691396198, 0.0847955367251, 0.515452009915, 0.632940855766, 0.33518825541, 0.818423464537, 0.751138137541, 0.672795670557, 0.224640665997, 0.199129932727, 0.0244253877268, 0.244842544078, 0.475136344219, 0.849737694625, 0.0728282291846, 0.414441010998, 0.629765380738, 0.19443523674, 0.696354250491, 0.49437716901, 0.243984439578, 0.656058011112, 0.00554481813803, 0.750964476618, 0.770046188574, 0.106587296564, 0.425146193943, 0.175886681707, 0.95796604228, 0.517957750444, 0.0502183851406, 0.24919827966, 0.848336347352, 0.45646182547, 0.801416601722, 0.667577732586, 0.987892453066, 0.595452318469, 0.950039608443, 0.89142592581, 0.612652322762, 0.719273961276, 0.504778164824, 0.830569169721, 0.547871950611, 0.897208103233, 0.74365544216, 0.474674436823, 0.259191548465, 0.24723973751, 0.637661436776, 0.765813684297, 0.521299812828, 0.626748436982, 0.274597446918, 0.0774833538647, 0.285728150863, 0.271715107082, 0.319709568419, 0.540152222518, 0.138374061516, 0.231261479728, 0.693949812299, 0.706419141695, 0.0642288507139, 0.407599369667, 0.542611140504, 0.415774234103, 0.206834389514, 0.420143517773, 0.90483847834, 0.584079414204, 0.695522986498, 0.856732032304, 0.765594576118, 0.380381028928, 0.00589608358399, 0.351758802672, 0.753475125059, 0.853447950569, 0.95343033847, 0.41902128263, 0.747515668978, 0.546132309734, 0.603252588941, 0.220538694324, 0.219421634621, 0.435835976047, 0.0290248199467, 0.336129543698, 0.679141885028, 0.404316669138, 0.165044731204, 0.467390149232, 0.127627797281, 0.622256960974, 0.0269664519051, 0.39402025634, 0.564391983025, 0.0271020463403, 0.642749648009, 0.135699487231, 0.461698444052, 0.0502846334886, 0.379103864188, 0.211660284211, 0.326845804881, 0.761229707894, 0.379126215564, 0.752009823555, 0.831924285155, 0.252271531782, 0.0819062327616, 0.01938328705, 0.539419047923, 0.999907828509, 0.34996034372, 0.65014409325, 0.781233049611, 0.651754655244, 0.75423320406, 0.949611732716, 0.199360682363, 0.0203800173203, 0.152382345785, 0.126220974874, 0.66945884462, 0.56396958193, 0.217964540907, 0.699464971246, 0.766898098356, 0.167789143368, 0.607247493891, 0.747925651955, 0.114532871379, 0.819301174311, 0.964720773034, 0.108098749658, 0.0256784254975, 0.311957244395, 0.67734728685, 0.958172838206, 0.396654441517, 0.715014705049, 0.0759964778431, 0.690614415933, 0.627242395601, 0.101901305446, 0.772480884951, 0.850293239089, 0.600411614817, 0.121055065067, 0.983844351515, 0.782635346361, 0.347203765308, 0.428378013235, 0.370570876218, 0.505960789677, 0.341231174861, 0.849575627, 0.82233091809, 0.105538870644, 0.960787567215, 0.635585106101, 0.828707311002, 0.707308643706, 0.435487145008, 0.733795304013, 0.965473731238, 0.270082396387, 0.808199218807, 0.538172906448, 0.483497503883, 0.435574493004, 0.731026214305, 0.268395538049, 0.851713160019, 0.830731018891, 0.0866628980557, 0.881631184003, 0.243863439191, 0.464708466603, 0.610331704231, 0.378989304128, 0.0286999977701, 0.850952836312, 0.181839857158, 0.21211985018, 0.797832356828, 0.340338843164, 0.880319979758, 0.701183750332, 0.276268575756, 0.0101511144387, 0.948062577777, 0.085612961958, 0.720074664104, 0.488577846849, 0.758164653482, 0.690609339447, 0.645902899741, 0.490821335079, 0.792932868132, 0.0930533505547, 0.221596400473, 0.691787155295, 0.30620603013, 0.581555585332, 0.47326048876, 0.530921931146, 0.425503812705, 0.745935436714, 0.330791297196, 0.702854942186, 0.270916426976, 0.251403676201, 0.120655884752, 0.192584293452, 0.119554741255, 0.535863965384, 0.762189609484, 0.185149842438, 0.216384639879, 0.484198587213, 0.724585001093, 0.976607022883, 0.524636869109, 0.282998703275, 0.100526108091, 0.194117578091, 0.227483163483, 0.179441543685, 0.0141483672561, 0.534135089268, 0.274311326783, 0.974294931103, 0.553358966799, 0.69741739291, 0.126279492958, 0.868461197263, 0.490878694524, 0.872719734999, 0.574064219626, 0.469396944931, 0.440468798136, 0.18436367039, 0.0513767171836, 0.941063596768, 0.477729187266, 0.822115645299, 0.400707442252, 0.0740821702556, 0.629445706952, 0.0536090742925, 0.149197584474, 0.562839597085, 0.303835511842, 0.99391812271, 0.118451562211, 0.764443445326, 0.606317651243, 0.790740829843, 0.225687137065, 0.52257253513, 0.450514464889, 0.442721004019, 0.860166665826, 0.990031260467, 0.305380244319, 0.621027321072, 0.609630912245, 0.740089305485, 0.947590200325, 0.207787905824, 0.211025195305, 0.660428137192, 0.157057093381, 0.173813548326, 0.0750648689012, 0.00267572260289, 0.450503704618, 0.59381119512, 0.291259289031, 0.231476234556, 0.706955829879, 0.702987558094, 0.454031326407, 0.687384920071, 0.923911044483, 0.787828026647, 0.625058007164, 0.661183042853, 0.933668458446, 0.425138966104, 0.544562378711, 0.647634723402, 0.908411445213, 0.82663115965, 0.0714098368558, 0.165922789221, 0.307611812614, 0.74895772207, 0.569207049319, 0.288610588306, 0.124353658175, 0.688677991212, 0.699733684976, 0.942676240744, 0.500472177118, 0.493795219345, 0.0804418518993, 0.0398607841836, 0.432028664161, 0.322321583358, 0.250367902412, 0.091326886631, 0.961911102193, 0.835958613906, 0.57519910922, 0.950786277806, 0.999572416877, 0.672281584303, 0.269511025967, 0.0402316731446, 0.756268830413, 0.470500823252, 0.651509489434, 0.916072787927, 0.181489147223, 0.585329625278, 0.634784719454, 0.491725802191, 0.0912424062938, 0.347961056295, 0.333308393665, 0.670133509521, 0.8577330944, 0.329803663579, 0.693673673983, 0.288217795361, 0.945193539563, 0.813566034738, 0.550096608972, 0.454825908602, 0.31451715717, 0.323273786276, 0.970184726809, 0.404175057001, 0.514596252329, 0.988119214782, 0.657660386483, 0.542593594357, 0.413247570799, 0.187582541395, 0.361779359152, 0.756443154056, 0.625408742145, 0.759990536061, 0.20355823835, 0.549219639085, 0.927672760844, 0.438116095072, 0.698250029122, 0.121426083363, 0.973146815822, 0.608871667082, 0.239297462328, 0.158378163805, 0.550839007003, 0.552251409054, 0.0932092012815, 0.992257139395, 0.912929878484, 0.461447894179, 0.11746614909, 0.832143173769, 0.498375504707, 0.716603325992, 0.50887201507, 0.273424896713, 0.834723945577, 0.980244632603, 0.243730906075, 0.55126507688, 0.383586013247, 0.921868149932, 0.508240891593, 0.879326255146, 0.864026934429, 0.276247402822, 0.790006182003, 0.414942423551, 0.934248393683, 0.50773767581, 0.820549473186, 0.282838983283, 0.298555849772, 0.586937722414, 0.998902333229, 0.489640346656, 0.148595418383, 0.538580577704, 0.345123941693, 0.551917417071, 0.543430062959, 0.455344616867, 0.321777350229, 0.188652373707, 0.697498427621, 0.571797641985, 0.233562446058, 0.775544475099, 0.0436472990973, 0.744705151565, 0.705227881025, 0.811408902565, 0.386078752491, 0.663688829485, 0.82074755171, 0.98081813866, 0.495328649616, 0.0370196113456, 0.502291150133, 0.59018042931, 0.869700313362, 0.874190374054, 0.440306209771, 0.525951086808, 0.456928074474, 0.722443827571, 0.409978619746, 0.654781326428, 0.154361218772, 0.469490600985, 0.969203630574, 0.338561234051, 0.692704598587, 0.649836652579, 0.851765292351, 0.852341336566, 0.859342184168, 0.380009397523, 0.316661153933, 0.718717425223, 0.759401809334, 0.872383017399, 0.0358990998377, 0.0684207471816, 0.631161016855, 0.92092909878, 0.997425922956, 0.746766366738, 0.433971471923, 0.0984431263832, 0.633747828781, 0.872579232607, 0.443678551662, 0.694001162793, 0.90342406205, 0.0459909686772, 0.796143465162, 0.293367775965, 0.374841089775, 0.145569795699, 0.531166318149, 0.565928061916, 0.792519473881, 0.169983649068, 0.07896835066, 0.870839598645, 0.619710368537, 0.240829791856, 0.912829016024, 0.143117720129, 0.461149913355, 0.253977339414, 0.255326708159, 0.00939743145487, 0.804633076975, 0.901209423599, 0.677610885699, 0.157975622072, 0.441729783604, 0.345565624443, 0.587571705126, 0.63893870236, 0.424308938461, 0.250098224408, 0.845303925143, 0.199216999109, 0.384693248967, 0.483208061059, 0.237205701928, 0.571922692351, 0.574811930179, 0.992692043627, 0.295230753883, 0.977944484577, 0.658229815929, 0.274480380178, 0.565929016956, 0.685799492734, 0.744668841165, 0.049044250776, 0.606406493076, 0.496727286524, 0.904155290894, 0.286194151459, 0.798860119508, 0.607064998164, 0.352320955835, 0.636617878006, 0.62089116313, 0.677764458623, 0.720928376671, 0.659181540317, 0.838337116963, 0.628248103687, 0.903403704073, 0.646340608891, 0.308932883953, 0.440823190163, 0.579573805368, 0.732359767939, 0.0901333757462, 0.295110451629, 0.747480864938, 0.175640070444, 0.132159797747, 0.539407758984, 0.971489581211, 0.530852373703, 0.913486974482, 0.830472619567, 0.256970084563, 0.824689812542, 0.481847829874, 0.806488493794, 0.746559350717, 0.338715253802, 0.11516970745, 0.962893292869, 0.140757015006, 0.966500209463, 0.860140596899, 0.724216712076, 0.979942242782, 0.9672697473, 0.804587644021, 0.365775049406, 0.790681968589, 0.0139186551009, 0.536572308269, 0.454786027734, 0.672828381874, 0.672340797351, 0.584560091652, 0.822417301227, 0.94029189178, 0.108346102199, 0.233821902212, 0.0250246496465, 0.884234845215, 0.56140738225, 0.915255908743, 0.221367200074, 0.0632170411602, 0.82385535139, 0.909387638428, 0.302190174529, 0.408295855795, 0.139777012507, 0.946261532882, 0.304364584356, 0.492624618978, 0.0971919986218, 0.887259308529, 0.135664048706, 0.453643756889, 0.67048621885, 0.743140121523, 0.945974085779, 0.419126753415, 0.742269014765, 0.15452290241, 0.414884527437, 0.0990216347105, 0.48934703779, 0.408115885698, 0.951521525381, 0.032716286855, 0.370529958734, 0.443383086061, 0.950555169851, 0.855450193306, 0.0993546246061, 0.685680265481, 0.544465861482, 0.977842529452, 0.358673841212, 0.398139642744, 0.189808562161, 0.122159719087, 0.848033188464, 0.454717368571, 0.662768738062, 0.641704467233, 0.59714595952, 0.0213574547364, 0.786794590455, 0.243568897164, 0.125923885308, 0.564577975908, 0.0686101528244, 0.765157375889, 0.207157370347, 0.215951351919, 0.86969542677, 0.328559553432 }; +float input_data_imag[ 1024 ] = { 0.147554179941, 0.900531035632, 0.00283555148002, 0.85840612638, 0.144687980321, 0.129992131443, 0.250654196728, 0.174497120901, 0.661057642597, 0.0257801497862, 0.0148603272307, 0.789984664235, 0.23793160609, 0.323771461962, 0.174246201406, 0.0523990178612, 0.741718056954, 0.526085526598, 0.745665275034, 0.476245965423, 0.778017039314, 0.513237957609, 0.109054010004, 0.503838689786, 0.94541564297, 0.0433650368992, 0.78322699598, 0.86698090776, 0.521451214713, 0.458042522098, 0.964026183122, 0.0608254074945, 0.478981910998, 0.401617254513, 0.686097496062, 0.490268854144, 0.909700829115, 0.0734907157665, 0.0807904774108, 0.608297423633, 0.0656822333201, 0.275015999558, 0.633076724301, 0.548356434048, 0.325185443319, 0.994627755861, 0.530556837431, 0.453715417575, 0.605426791535, 0.099178461679, 0.701779418546, 0.852792737296, 0.650916664881, 0.768962730105, 0.720839916658, 0.215023066327, 0.451554915965, 0.228493574365, 0.338931618835, 0.453498902907, 0.415989650261, 0.0950858392756, 0.426764006261, 0.66510786306, 0.374301023436, 0.152638924769, 0.922985035734, 0.0671333081366, 0.831771888475, 0.0932301017037, 0.0965644325658, 0.738795998489, 0.811769285277, 0.556370735615, 0.586465082739, 0.561586413992, 0.329645981416, 0.122231285355, 0.353598079634, 0.665340520003, 0.750284250251, 0.868092148869, 0.721060678746, 0.968398625311, 0.600410091225, 0.351646185693, 0.57791851839, 0.212738805672, 0.656736302988, 0.224244869108, 0.108218381927, 0.845373418601, 0.367561050615, 0.762605631937, 0.574100004331, 0.807221371152, 0.845155161328, 0.974546602126, 0.818426859541, 0.613573280535, 0.64269916383, 0.0262538314536, 0.929084290995, 0.82946078996, 0.267447725154, 0.180416071961, 0.702698772866, 0.30898468883, 0.339824656777, 0.00610578940366, 0.869862706536, 0.566321094761, 0.400784344, 0.141874654151, 0.633172012656, 0.0306570983809, 0.746111762006, 0.215132880034, 0.419832493765, 0.340895981769, 0.370053092477, 0.721595967743, 0.776835619967, 0.567593556614, 0.0849570399772, 0.0526088264255, 0.157409897107, 0.617838181926, 0.673968710613, 0.272102843546, 0.661938692808, 0.485661704891, 0.442044186698, 0.273166844365, 0.754943143668, 0.11381750811, 0.429913633398, 0.28324647008, 0.67848625476, 0.486632753364, 0.667132558736, 0.0454173626044, 0.395263396088, 0.599324956944, 0.00768708589988, 0.301419362018, 0.21123397922, 0.137234805257, 0.255519504021, 0.328122355938, 0.00772990656931, 0.74701412343, 0.175694801876, 0.380207445715, 0.703671263383, 0.500262346556, 0.83335420242, 0.806200186567, 0.0720754965922, 0.861764362023, 0.0423022615628, 0.0187415365856, 0.921162434502, 0.862110013612, 0.575759160737, 0.573399680886, 0.709498961569, 0.417693959843, 0.115173372664, 0.0208565590247, 0.324768179446, 0.80132215431, 0.618125263304, 0.832025913072, 0.919769751741, 0.0881298812979, 0.844484359815, 0.243316474823, 0.588871288303, 0.523962543001, 0.395766696859, 0.310274561836, 0.339513281148, 0.333068622493, 0.168132708046, 0.510483284542, 0.114026639839, 0.509952062323, 0.90592273158, 0.349375265472, 0.727379105674, 0.818948601525, 0.81503700575, 0.236268848947, 0.146444218278, 0.197271802824, 0.602398985273, 0.760215295547, 0.655509010519, 0.177146128947, 0.772848089248, 0.494117025017, 0.754445825247, 0.759877149608, 0.448905256995, 0.924154258386, 0.564491783403, 0.635298319061, 0.624521779442, 0.864246874831, 0.6272174069, 0.150957401393, 0.0682862584958, 0.442208063836, 0.302820435139, 0.274673667486, 0.0561721202131, 0.50733688529, 0.310407850606, 0.451913863701, 0.056890050834, 0.831696631663, 0.0767310011735, 0.864250033925, 0.855293371456, 0.615008388416, 0.507067817334, 0.462711658927, 0.554316371338, 0.791817797265, 0.895876765557, 0.449733703651, 0.809815917698, 0.651837454649, 0.32152676288, 0.475629027943, 0.150861076696, 0.0618737001011, 0.10350187727, 0.899126833956, 0.343437775838, 0.714315549167, 0.504549001501, 0.172558911436, 0.247743723598, 0.437758274309, 0.439421791763, 0.522748035266, 0.158746207982, 0.372851982101, 0.282893578614, 0.408769397247, 0.338367146841, 0.597885862383, 0.789226931564, 0.647305356969, 0.0659118542797, 0.0945059475151, 0.67837934484, 0.284146973878, 0.723733655002, 0.65656408641, 0.906342697164, 0.873279662061, 0.333362036061, 0.582739514586, 0.141428380584, 0.349820787536, 0.967696507693, 0.698479962812, 0.391957984335, 0.595041228152, 0.938002199566, 0.309581887416, 0.376679306056, 0.791661957864, 0.813184783815, 0.670116399995, 0.828958972894, 0.738774672129, 0.685414440278, 0.526393339734, 0.646024820733, 0.423406366322, 0.361828096347, 0.362597668982, 0.180262922877, 0.214192661209, 0.947668267534, 0.486270920873, 0.226543046534, 0.137565353177, 0.0771650843009, 0.844428388686, 0.101140763668, 0.770874720363, 0.835119826635, 0.883682165493, 0.0377474923576, 0.336764371964, 0.766307604447, 0.13104904143, 0.376719870823, 0.162247212088, 0.831345056689, 0.771097813731, 0.809043719639, 0.165539165744, 0.437673405138, 0.410858611497, 0.676362922189, 0.237530201447, 0.444198709805, 0.284927932563, 0.748536518095, 0.448927963033, 0.534011149698, 0.309467896563, 0.808623871091, 0.469015605032, 0.835113392726, 0.367840958225, 0.947130170244, 0.984439793532, 0.461679978441, 0.281771732704, 0.381872434191, 0.527459788461, 0.966268153206, 0.816891239581, 0.801259224152, 0.138398534603, 0.250003211589, 0.641179036204, 0.874116945052, 0.554540745424, 0.102589731748, 0.845892276733, 0.851166048085, 0.285063014059, 0.763116830292, 0.272791299591, 0.905306208978, 0.147348655992, 0.437472560195, 0.946413263012, 0.222038006907, 0.451127990221, 0.349585078139, 0.0266701908029, 0.0532568871711, 0.502007114693, 0.235778073863, 0.994525351238, 0.374912673418, 0.0281875455282, 0.93082590475, 0.839176287612, 0.649960684294, 0.791380637482, 0.137599587726, 0.286879397313, 0.829761583153, 0.696071988576, 0.138792691818, 0.705536175289, 0.448601473982, 0.00525119830562, 0.0792257712707, 0.255923928437, 0.834963099282, 0.548804245444, 0.727234785325, 0.527771505887, 0.111186860324, 0.288101578039, 0.301151194586, 0.0477494466189, 0.419825543753, 0.793899108639, 0.457113616636, 0.11085789529, 0.905146885662, 0.596739042819, 0.0164353522059, 0.515375730209, 0.241938134421, 0.143576840246, 0.429238893103, 0.614809582776, 0.240564238807, 0.416567595209, 0.664371301742, 0.0856139549873, 0.974654490952, 0.0676793229088, 0.526059445322, 0.50732769658, 0.988331485596, 0.554151952418, 0.39045373256, 0.470135078158, 0.635670791469, 0.981039422552, 0.253650261069, 0.0162422311089, 0.78852001628, 0.344802493163, 0.732941021451, 0.628256962476, 0.77150137411, 0.735186984812, 0.332518608372, 0.0443356882952, 0.546013745208, 0.813508865556, 0.175089127052, 0.779142593478, 0.464622899747, 0.695389251996, 0.631735847758, 0.811497681848, 0.0631005370322, 0.776190399703, 0.457679577447, 0.293442571175, 0.0438062756591, 0.199469833715, 0.0419059419304, 0.93337097995, 0.515383589254, 0.989122702296, 0.543030697654, 0.253313765203, 0.753290918819, 0.191103430734, 0.356974176035, 0.780841566978, 0.865798277078, 0.331924686381, 0.124475008244, 0.368019174315, 0.889486517012, 0.74330770552, 0.894637494955, 0.386644768261, 0.973723584315, 0.496203226537, 0.497523392494, 0.924310466627, 0.519275853535, 0.801148087402, 0.727081324343, 0.0789270060555, 0.60245329883, 0.82234127954, 0.545474397345, 0.321211428215, 0.080068911075, 0.660919221458, 0.306495856091, 0.602621627731, 0.426116072883, 0.689764808445, 0.351546983772, 0.0423551628501, 0.870037175056, 0.352559310308, 0.998150597773, 0.274555360075, 0.980027279194, 0.947904378603, 0.0750411649882, 0.637512537883, 0.363311130651, 0.801095975562, 0.679410607815, 0.95278939628, 0.142779468363, 0.607572903321, 0.781311969743, 0.0347989657985, 0.0672333630621, 0.778515373507, 0.366328473107, 0.382854401689, 0.567244641724, 0.605094828855, 0.679062056913, 0.948823529266, 0.372013378471, 0.763084471799, 0.573921778334, 0.529459881536, 0.398034045952, 0.649560736706, 0.249611653093, 0.113448612585, 0.735674859479, 0.499043960256, 0.386987380039, 0.56167271076, 0.261776676587, 0.26028977114, 0.446273112406, 0.996365112155, 0.285576877698, 0.916478909542, 0.491200195254, 0.122637421904, 0.852826290384, 0.452042685245, 0.898679030786, 0.445111192742, 0.0877907411047, 0.681929260251, 0.845521218975, 0.3195877721, 0.347425294739, 0.0649390783161, 0.542171361226, 0.891331682354, 0.851362050753, 0.711809104007, 0.927324456723, 0.637700022564, 0.793696383845, 0.508755745174, 0.121362455078, 0.200980371178, 0.138876872038, 0.790373060808, 0.0262840268083, 0.55402143726, 0.368911165501, 0.803661726289, 0.551646933926, 0.611948362621, 0.0862154816519, 0.309290717528, 0.999595043934, 0.718869659891, 0.52569565483, 0.769164550375, 0.823339399508, 0.0737507129112, 0.972379731514, 0.642338589386, 0.449974495663, 0.68010899065, 0.344514780703, 0.87796015165, 0.780262928838, 0.639793929367, 0.181963136552, 0.966264613934, 0.432618286482, 0.910712270947, 0.0554128500178, 0.124161120639, 0.15301546681, 0.16465707989, 0.322660751155, 0.709332132529, 0.346023082342, 0.940904054932, 0.894925916821, 0.845933706156, 0.250605308982, 0.635057091388, 0.550841415483, 0.125170295127, 0.302824606109, 0.533478029768, 0.502573144741, 0.168635901748, 0.941606987869, 0.15419426688, 0.658732873384, 0.720632768437, 0.605138907862, 0.842530004113, 0.563618034431, 0.825236267327, 0.0283734878989, 0.0454618032913, 0.641453733824, 0.576771231477, 0.651129977486, 0.766959000916, 0.416586783663, 0.638991192209, 0.498038060136, 0.627164010298, 0.289671656802, 0.956650169954, 0.482944818175, 0.804688154216, 0.684990841196, 0.29743387143, 0.0729730255053, 0.0599130329347, 0.43960549992, 0.484251130107, 0.204023013563, 0.606660262821, 0.312582499247, 0.718362885112, 0.734199754805, 0.860777365754, 0.975374127915, 0.130766151552, 0.37054019805, 0.561651215748, 0.319115886403, 0.466472567041, 0.267471674454, 0.247918882526, 0.0968116525606, 0.29021200497, 0.384149833502, 0.615377444164, 0.248270280381, 0.865307501721, 0.15969966213, 0.327435820801, 0.577687037894, 0.312714920862, 0.763121375139, 0.49826554206, 0.514724839231, 0.498759708398, 0.308540482054, 0.0231762982164, 0.945232804069, 0.505444463024, 0.966686630552, 0.215144422526, 0.352895088856, 0.0505404046279, 0.494894203525, 0.882339476368, 0.65426003689, 0.470586853368, 0.536690749289, 0.847172365393, 0.430927769348, 0.882455730919, 0.727508063359, 0.763856764162, 0.365937352518, 0.400581621015, 0.570281643881, 0.194655301888, 0.553222926621, 0.0735317497428, 0.504255529123, 0.764404114707, 0.279720677624, 0.989090700621, 0.680398640119, 0.118811019724, 0.975082815414, 0.393903712729, 0.794897228381, 0.339085299953, 0.938948566955, 0.754965172293, 0.199057881552, 0.509122516225, 0.500077903571, 0.0453033524671, 0.137036373568, 0.333040705353, 0.473744150395, 0.456988559283, 0.606260522404, 0.515505732147, 0.327965847637, 0.613068121065, 0.162502045877, 0.990615737561, 0.739319360574, 0.299234342528, 0.336373452152, 0.828289385957, 0.532339829876, 0.708739806435, 0.299790564737, 0.815748833244, 0.368357809866, 0.673806392473, 0.979898031179, 0.583702141849, 0.79675481393, 0.725324212552, 0.688043651203, 0.0266471549638, 0.474590214085, 0.967070696172, 0.782903991431, 0.776162025172, 0.577634395864, 0.721400112296, 0.583523277048, 0.170512061747, 0.629025241145, 0.619735805501, 0.841167124958, 0.1477757083, 0.680726895051, 0.0315705133421, 0.948205170784, 0.109895521334, 0.0189373675066, 0.313692483446, 0.151431258119, 0.690500260919, 0.410377409323, 0.774972301807, 0.920520949897, 0.872817708912, 0.735837271269, 0.0622812860144, 0.138082485785, 0.207341704971, 0.325049534426, 0.662226799714, 0.5254771514, 0.313752598738, 0.173182423857, 0.912124160924, 0.342327017682, 0.354286988645, 0.771989784149, 0.720924561327, 0.643309099999, 0.69331331003, 0.610076580079, 0.192264169137, 0.246519135527, 0.558086650807, 0.224867037993, 0.972910627591, 0.297614565277, 0.289004137404, 0.207277794855, 0.70498825974, 0.317040745018, 0.348803174201, 0.933700374771, 0.795405356002, 0.273457536755, 0.121874105733, 0.676622245783, 0.379694185374, 0.980160537321, 0.818377460131, 0.954608863391, 0.804615833957, 0.290452651993, 0.287630341614, 0.714141287498, 0.346363514096, 0.442376111865, 0.256443975473, 0.479079263016, 0.202068007201, 0.538577923709, 0.933023933783, 0.696171300647, 0.137272954801, 0.615677034414, 0.586830498571, 0.24245803841, 0.669833964893, 0.531041489733, 0.637944573409, 0.0524911068395, 0.413301366048, 0.71735805625, 0.100544904777, 0.770766058098, 0.00518144640713, 0.55035256578, 0.92909968017, 0.406907451547, 0.935032098596, 0.878399621514, 0.477448520441, 0.199455974668, 0.963914038891, 0.321167702119, 0.64589791789, 0.907936958736, 0.0894607205115, 0.574133353175, 0.535152276894, 0.723117678242, 0.936669379751, 0.91322972567, 0.175064775481, 0.882244973165, 0.175788707539, 0.919634811851, 0.997171803089, 0.396994574278, 0.495383897322, 0.936608744778, 0.962131380083, 0.926039697896, 0.876743167918, 0.0092671684801, 0.567961868664, 0.107300690774, 0.982993888371, 0.28456165235, 0.989099470089, 0.543300483557, 0.493912420342, 0.938560501741, 0.851059738578, 0.468020769006, 0.192811398274, 0.11264676102, 0.16249426254, 0.458914471032, 0.25726488023, 0.186199069128, 0.736617895492, 0.790767664425, 0.567781222421, 0.757282750258, 0.175494913838, 0.856146504273, 0.897042761784, 0.826989825276, 0.51528065896, 0.0867377698484, 0.66925585341, 0.184781201047, 0.140611875634, 0.323601670085, 0.248047083667, 0.260785277065, 0.235521252802, 0.753756651781, 0.954034822655, 0.301945839692, 0.722882528401, 0.0114357341942, 0.65368336707, 0.692768590423, 0.0621243318005, 0.118224847804, 0.306806342004, 0.405416612968, 0.502520471238, 0.895118369816, 0.703557035102, 0.310977948385, 0.117415745845, 0.916130385851, 0.295037600156, 0.614625448144, 0.219128600935, 0.133568782197, 0.153185564689, 0.747734837151, 0.605738948089, 0.415845615431, 0.549234508818, 0.470828076879, 0.537517687693, 0.66409443934, 0.218411622657, 0.247465429309, 0.754739549725, 0.873135058488, 0.0818703064733, 0.446747977496, 0.703766125156, 0.0781027221474, 0.564168722273, 0.0617580475567, 0.547649248711, 0.505487056093, 0.572701674228, 0.149852381382, 0.328117637742, 0.520341541185, 0.116240022185, 0.205401485539, 0.583147678441, 0.0909416444517, 0.510375354033, 0.808692083177, 0.45343230018, 0.513247843202, 0.456798475712, 0.0577367809325, 0.462378305739, 0.806915352554, 0.723280079825, 0.395948709953, 0.816453225933, 0.745804482832, 0.578311265059, 0.0452898027278, 0.344528866562, 0.0637599121121, 0.994123660477, 0.934582798885, 0.0690191461603, 0.933775562585, 0.0317348710231, 0.408866935819, 0.768972062583, 0.765827682924, 0.978333284924, 0.645880818097, 0.420361938882, 0.992856598581, 0.382479618851, 0.869620285311, 0.906767311525, 0.375645533802, 0.682730354102, 0.661792538125, 0.539300263919, 0.653534098419, 0.347769887139, 0.178473629004, 0.537258486398, 0.528842539544, 0.727858140906, 0.222690215966, 0.00347329494491, 0.022735327322, 0.298362988703, 0.673499857777, 0.544445339025, 0.531933608497, 0.823360437376, 0.247512038504, 0.346159734988, 0.275649727795, 0.937410361135, 0.725023945909, 0.112844638766, 0.809478183539, 0.419240598492, 0.766053467514, 0.883756621845, 0.0156457963635, 0.20608162185, 0.100896713093, 0.0335762757543, 0.597784896732, 0.703286266865, 0.0486763212437, 0.74054107848, 0.402265350811, 0.234339278488, 0.217269210178, 0.86373024267, 0.0564440350245, 0.503895848941, 0.289263451354, 0.815786256763, 0.731517483116, 0.318903696369, 0.597917674277, 0.672531901437, 0.320665115393, 0.301764435144, 0.143260434163, 0.660212423811, 0.221042740446, 0.300500953757, 0.0609576371068, 0.948520255027, 0.879713890964, 0.911577665621, 0.625993137648, 0.427200582295, 0.495620787493, 0.972290235344, 0.941586409832, 0.671342524746, 0.785804595981, 0.318734457316, 0.416324633421, 0.149217607825, 0.376460188507, 0.754416097238, 0.473518820412, 0.84934093226, 0.300736418795, 0.707576797488, 0.805776159935, 0.914741173816, 0.562385949587, 0.967786188547, 0.557286758199, 0.134092751059, 0.24285851609, 0.20333673306, 0.646705851548, 0.922226104511, 0.84713338592, 0.0924639965269, 0.724584712307, 0.190481618431, 0.268461587855, 0.673671920635, 0.602922044989, 0.87362045849, 0.188163293933, 0.761696417537, 0.724305239852, 0.558850476273, 0.479394206471, 0.869473851525 }; +float output_data_real[ 1024 ] = { 523.339819046, -2.25302908212, -13.6281669096, -0.80619315498, -0.530026276956, -4.61942176839, -15.3890656376, -3.0913060525, -11.2804237404, 1.99387250637, -13.4091466836, -4.09537922666, -2.32245381054, -0.64832532284, -9.73667687407, -9.06594386518, 10.9668241754, -3.45541390314, -0.385557892975, -1.5693787719, -14.9361104082, -5.66587656353, -17.715522953, 1.17114033618, -8.0000550754, -2.69813152147, 6.46776849676, 5.82847924327, 6.36864326639, -11.4604071804, -1.94502670431, -1.29965751473, 9.96555961198, -17.6728067097, 0.558747943009, -2.13636750466, -5.40103429067, 2.21299623501, 6.30779448836, -15.274800562, -3.57404067061, 12.2855136836, 1.42858053935, -12.7703797658, -5.77711407326, -15.9385041121, 9.81315261269, 12.2999220423, -4.8845795721, 4.13254134413, -2.36796593852, 6.47175206967, 2.20243239151, 7.76650946603, -16.0451024828, 11.6051149242, 6.97855004663, -4.55588851949, -14.0775515689, 0.917378719286, -11.57332925, 5.43583632389, -1.24037435335, -1.01714644098, -3.17204619793, -0.968743494785, -13.7217839771, 18.117348241, 6.70087486842, 0.837543266277, -5.72502516431, -2.51079035409, -2.22933773533, 13.5957934661, -1.82248187106, -4.18577974683, 9.61244462198, -8.95651190197, 5.12501793077, -3.61159316886, 10.6470567404, 2.27092976986, -0.0827896650535, 5.50874293233, 7.33731902236, -2.94822920479, 3.91670085012, -16.7425658488, 5.0179945464, -11.713599987, -7.36612720367, -2.31339159954, -17.4146633541, -15.0787281324, 0.735615068694, 10.6787096792, -1.74662053045, -2.87977051903, 4.11229707267, -7.13004519893, 3.15294576203, -13.5065322624, 11.5554697347, 11.0551720774, -21.1109429596, -6.31675367637, -13.9481012236, -5.2479309573, 11.3818534919, -9.69120798387, 9.15997041226, -5.41868267967, 6.10171039384, -1.37509560649, 7.66322947892, -8.68542240579, 9.147981111, -18.262887187, -3.52019639509, 10.1440556833, -0.345591164593, -14.5981916828, 8.16769814775, -14.1702575208, -6.78170466623, 12.6927064711, 8.41024019164, 11.461314248, -8.25572360343, 6.65464555168, 3.07617698317, 4.22311151574, 4.21561422449, 20.54703981, 5.08203365767, -13.2867290596, 4.18334512326, 2.92294590961, 4.30019095423, 0.129794257549, -1.68914651643, -0.0441216512604, 0.799742445747, 3.7055524499, 13.3151504339, -5.36352809629, 6.37966591064, -3.26733547436, -8.38241501637, -17.4911917886, 1.69296723227, -12.9639911866, 4.47907548169, 2.22339201317, -5.99590099077, -11.7418486065, -24.4071199552, 12.943538646, 8.07081501288, -7.40333434291, 6.93800908458, -3.76115503048, 4.56867439411, 12.2657935523, -8.71070098935, -7.51509898975, -7.09604387498, 6.37115040803, -2.24526151697, 14.935076979, 4.12746162596, 11.1845803849, 1.9404937002, -7.99298471277, -21.569739492, -4.01176561996, 4.5444659373, 0.277298384199, -5.44957967534, -2.0520874358, -2.83396857543, 14.013157912, 3.33770001111, -15.7334864981, 15.929866936, 8.34316517803, -6.38972756559, 2.00666412991, -0.068013211758, 26.6388942369, 8.10213306678, 1.17811684207, -14.6849117564, 7.37450850342, 8.46112849842, 9.36178946446, -11.3646733656, -8.71053552884, -4.2241057277, 29.8348373812, 3.73772044572, 15.768902937, -6.42540800291, 15.6630657621, -10.932270682, 10.3506262793, 1.90282408301, -10.5136356229, -11.4445468029, 7.27309719693, 9.34589135464, 0.703716953688, -5.98949342887, 11.1221093369, 2.97844209831, 9.21370893117, 20.8753121238, -9.66716466095, -4.47077749851, -7.04508394114, 1.03164401125, -6.19998822626, 3.84935326632, 1.24899505755, -7.62342343114, 6.10823431141, -0.154318543253, -6.33938551055, -25.3376326449, -0.525787380384, -13.0502718768, -7.0974425784, 9.34509201089, 2.4758422549, -1.65468766696, 8.58010266138, 15.1573153552, 2.82021091072, -6.80785036054, 1.24792131136, -1.90507688987, 10.4497165234, 12.7431470321, -5.03265223978, -5.53173749138, -6.64891013269, 4.53880277599, -6.29032354847, 1.22878949443, -15.1803883384, 5.65667122151, -1.61094200518, -3.93388522011, 13.9359552058, 0.721061101985, -8.48163777509, -14.5029571154, 0.38870448995, -8.65823100584, 1.05538669802, 5.65423482084, 12.3796360364, -9.36598247279, -6.43583522755, -0.0599501770835, 5.8243135972, -16.5031706035, -10.3233921733, -9.16715101614, -11.4895608137, 13.2715816904, 1.41386869053, 4.36107566034, -7.89013206755, 9.61213095446, -12.9420175864, -2.70928277087, 12.2321759489, -6.5746312976, -5.77009892318, 6.87638926056, -0.838056927886, -11.410527574, -2.38068549491, 1.3429932681, 1.570869201, 7.77050574327, 1.00120457495, 12.653671588, -6.50713951566, -9.0157516339, 0.996272550324, 0.748772529975, -9.39314796374, 2.8112781953, 3.19905539975, -10.063653504, -3.24424962098, 1.91183056321, 4.73179732548, 0.692044118492, 0.518544836905, 4.49057710504, -6.67315308685, -8.12266907846, 1.48856600312, 4.36723192457, -1.49894108982, 0.767667455247, -3.46285611381, 0.939843019606, -1.16629942151, -1.37260262341, -1.59507907153, 13.1188978143, -1.38903341062, -10.9607019671, -1.52922889652, -3.96961033611, 9.21877442521, 4.74341372311, 1.97730233687, 4.72580730819, -6.53108554459, -10.6594718628, 8.60092081117, 4.64088988963, 0.372694746369, -4.47837214022, -0.950882075714, -2.23624187301, 17.7024719392, -16.1803045833, 0.643701740843, 4.58016010356, -3.26303394234, -0.767126947127, -15.0727153516, -9.90620302183, -11.3521592266, 12.4915506167, 0.28532973901, 10.2785017474, 1.21526327579, 9.63089150898, -5.93595058575, -2.48194641563, -15.8250388835, -0.879498151116, 22.6648231025, -7.25246583129, -2.78593034449, -5.44427824938, -14.1403150963, 20.661828921, 2.63021399105, 9.7275375501, -8.28117738735, -15.419850599, -0.939910470156, -5.87929934337, -0.40704690097, 0.0285233583903, 2.64371166801, -0.674956515198, -27.2940459915, 2.80564486542, -9.40067344751, 21.119716226, -14.4558953803, 1.45059507862, -4.20801842802, 14.5434401031, 1.1383817686, -0.904149789762, 6.28241763168, 1.12301311363, 1.33678200232, -3.82686686713, -4.35501795966, 6.33247921457, 3.01448061343, 5.69075219782, 5.51438263581, -15.5752726654, -3.19876217205, 2.38822632773, 5.11803178251, 9.03681162213, -7.64315099375, 18.5157358267, -2.31470463367, 5.44377517955, -0.89638986682, 6.69476956698, 7.27397239951, 4.67722114955, 8.92482689274, 6.54599423533, 3.45891564942, 6.26819615338, 6.46289871658, 8.37901001134, 1.58029807742, 16.7916633295, -8.68493651473, 7.47975213912, 15.0775856513, 6.57976319637, 11.8432250726, 24.8286196195, 1.98738281554, -2.95527871376, 10.2219654466, 8.40474435333, -9.8036628942, 10.0601549232, -4.75579153827, 4.93761657863, -3.7990227251, 4.61241988297, -6.34002518477, -7.29851062035, -14.8105414469, -6.00843262059, 4.145151184, 15.7003631256, 9.94165176585, -6.13800672603, 7.0325930659, 15.0169600884, -9.29010687958, 16.3518466818, -2.49892516086, 7.31471744425, 0.976087299479, 0.370525080287, 4.94559490274, 12.6275015156, -10.1957705583, -4.60319356206, -6.79865866686, 1.03453533203, 7.51243715589, -6.97500071338, -3.63501551246, 16.8194269911, 12.7040610273, -9.45951873812, -12.4511428807, 8.10693626771, 6.88149515167, 6.47059617301, -6.18203738574, -3.14337978189, 7.15565243698, 11.1428731917, -12.6838583214, -7.00454344477, -1.24942263615, 4.06431770396, 0.242639774491, -0.215811452352, -3.79320934011, -10.3962669193, -1.75865348002, -0.260794248678, -13.7928251442, -16.0960904341, 24.6536827836, -1.9482655919, -7.33570926663, -2.61373091016, 7.53418158389, -7.05322569436, -0.441928141677, -20.9188431906, 31.7656019752, 1.01141445699, 5.32893083516, 7.57287149852, -20.258044967, 14.2693223362, 13.6630541705, 5.25505749426, 8.87075217455, 8.98371257401, 5.88329372983, 4.31838341274, 3.77437123185, -8.5610174536, -0.0550407163278, -1.59605768557, -23.1154382969, -9.86064527802, 0.149375883171, -7.41427182703, 16.0127755832, 3.37786723258, -0.395288010988, -0.383952855883, 11.1594795898, 5.75416090548, 4.23276044599, -2.58395757316, -15.1074827218, 11.5810942635, 3.53221851127, -9.48578699782, 1.54203908981, -1.88999810745, -10.6952242683, 0.973985183599, 1.67709481112, 7.60010284998, 25.0518538543, 8.3797545114, 11.6966856337, 7.28668730547, -0.779808137497, 8.93754037904, -1.35850784573, 9.19642899483, 21.8247580436, 8.38644884496, -4.96141786248, -7.89479913799, -9.97609974766, 0.943366945053, 1.87835852196, 1.73989736357, -8.05289176845, -6.1490278606, -3.79812434999, -6.07435296688, 1.6847057444, 2.46811841959, 8.62611461392, 9.35710516723, -2.34062027598, -12.246891283, -1.40459429136, 3.14983216227, 9.4227364389, -9.37139526452, -9.17976622289, 3.42875035918, 2.76481350452, 0.586627416449, -0.347561789886, 8.342021447, -6.39182988372, 12.4297018349, -2.39618022941, 5.22527790319, -3.14495278275, -11.1248430401, -3.44486302191, 3.44061515155, -3.51230995411, -5.46608193938, 16.543397519, 0.610803749273, -0.407128688406, 3.71897275045, 4.20916054505, 9.89155973428, 19.9895386161, -4.31430171745, -7.96199174005, -1.5238602446, -9.54133785576, 2.74660076868, 7.20794248106, 6.5200050301, -8.69762122123, 6.76268083782, 11.9346594069, 14.0779830645, -6.55574372818, 7.06614051869, -7.85333217665, -1.18661562519, 0.673813691248, -13.3938621965, 1.80316429397, 10.6428734897, 10.7434679068, -1.17208902677, -0.01483175185, -5.84943074664, 11.1671281163, -7.06624429263, 4.00116834898, 16.6838107599, 3.24501031511, 18.7767296032, -14.9763767446, -6.40112320724, -9.16648958561, 4.24617715411, -9.22908050833, -5.71754287492, -11.9612541612, -14.8862084135, 6.53695176904, -1.47558858683, 8.54501795675, 11.9720024735, -10.1673362408, -9.89081355487, 5.85811284216, -4.36922644899, -5.10396309106, -0.503850014566, -17.994679406, -6.07636392138, 3.67031871895, -3.78376609739, 1.29163026537, 10.8416556654, 3.85390520537, 9.82654557371, -1.34634076299, -10.1265190018, 2.022785566, -9.107550749, -5.76046545624, -10.7919879947, -3.92689287052, 19.3734179073, 7.90239389483, -6.06127912302, 3.43940549778, -19.9547694625, -8.04644125361, -4.52268154612, 5.71564205724, -10.9268140761, 0.0882393120662, -1.4428863352, 9.62768911165, 5.34079437126, -15.5631481427, -0.609268156607, 9.22746963715, -3.09921631123, 4.80208936755, 4.06370991743, 7.90578027042, -10.1691449222, 2.18509245644, -9.44801644889, 0.249557551385, -3.40234341804, -2.94358540932, 9.44376157112, -8.76216433592, 1.17941691867, 15.6751527011, 7.41621277563, 2.56840946397, -6.7774831759, 1.03223647466, -4.35216073676, -3.02892169166, 12.3215673011, -3.98164106106, 15.2421736938, -2.96723298044, -6.34681796872, -2.23856177552, 5.25141669145, -7.29968459557, -15.0269397352, -0.117006510322, -1.58253704926, 0.418029734363, -19.6167092519, 0.0885155474245, 2.76229832756, 17.975144782, 7.81334938579, 5.73492660901, -8.06903123994, 3.37338038709, -1.37311318827, 16.735763082, -4.56116196516, 14.9102250908, 3.21863804056, 2.32075886622, -17.5756071528, 2.74457048931, 23.4107961003, -2.29637675603, -17.7813253475, -7.29708557192, -2.03714412547, -22.4471213606, -5.09369712293, -7.98202299728, 10.6018783082, -0.0987504936222, -6.89889233608, -0.029459686453, 8.17956704936, -37.292699509, 2.19702417685, -5.84173605994, 3.44897388101, 1.76628361916, 5.31030951162, -0.933256606343, -2.16987032896, -2.1113381745, -4.25849018987, 9.87827457973, -2.9018168622, 14.9804326771, 3.81597394649, -12.7021549434, 0.488326056575, 0.878459366206, 12.6078342059, 4.26920862349, -2.22764184572, 5.01915099635, 0.430009786856, -5.37882389571, 23.3905609294, -7.1433255282, -10.5068809166, -5.13248407725, -3.93508948096, -2.93916594793, 5.35089084167, 24.501920232, 6.65096119652, 11.6667959451, -0.44427518301, -13.0248852286, 19.0292901679, 8.593513351, -13.3238513808, -5.0766454333, 2.49516742408, -1.84578928952, -11.8766739262, -13.4806705587, 1.36140485336, -2.35811829779, -3.40836571982, -13.9594646374, 17.3894732988, 5.99748217953, -14.1851377321, 6.50042768309, -4.71689380413, 1.37843539139, -6.7615620232, 2.47130415484, -7.787045771, -1.29248486886, -0.323661988576, -1.03045451334, -1.35777760665, 5.86286433572, 8.4422090052, -8.70120690085, 23.0863564772, 0.245134233748, -4.64215816506, -2.59322571567, -4.68335277722, -4.24871342488, 9.91761655462, -14.8454676578, -2.76689887041, 6.08004322514, 13.1283341556, -1.43136540703, -16.3304890752, 14.7796750865, 6.07080407931, -2.40807567747, 1.17707070947, 9.53495165147, -4.00702535567, -11.6120489871, 7.41954663215, 14.0464366147, 0.304038154373, 3.27493740605, -12.2908069445, 7.89122966561, -3.03815193187, -5.07914998948, 4.31379166563, -3.17021606046, 13.9516372038, -6.91967542016, -4.79620209374, 3.38114420657, 4.01151865388, -4.62440769708, 10.8056923529, 4.07720173867, -3.02575307432, -5.10707082448, -2.14667941846, 1.27125589902, -4.85357899777, 5.07090081787, 5.65296234207, -1.26245896262, 3.22952020387, -12.4457278952, 8.23246985883, 7.62542427771, -2.99799587699, -1.56815119875, 4.12373253207, 5.93588144219, 15.744735818, 6.18477689994, 9.99567740613, -3.19912886244, -13.5963965598, -0.0300414604038, -1.20499751099, 6.60984427422, -12.1725160547, 3.62667900986, 5.40254759653, 0.19405641981, -4.97093551023, 7.088021249, 5.26698199829, -3.60220237116, -2.58008219335, -19.6790582274, -0.543028985889, -6.05484918315, 4.12842659773, -21.7854900328, -3.68988896967, 19.8453220422, 9.56456909772, -0.983070183798, 13.9230223281, -3.54498175124, -16.7554053018, -10.832267165, -1.98582543676, 10.5293774423, 3.11419474408, -14.0109607888, 5.3115959838, 9.29092076359, -4.17081657171, 1.45522689409, 9.04585449717, 2.60102743437, -6.07515192315, 13.2252890907, 4.54443580238, 8.65992803991, -2.62773818471, -10.9747158103, 11.038860357, 4.4741802426, 6.3651306917, -5.85828491174, 10.934374214, 8.54919101805, 11.5447629714, 4.44678741372, 5.14859044038, -14.4447275381, -1.27730756252, 7.50103999815, -7.11591016282, -12.5269582365, 7.29210023326, 6.95418028319, -13.5672698339, 14.2665244497, 3.79961893735, -0.86969458347, -14.8171046542, 9.44567564533, 8.84033674182, -6.48908945724, 8.54873310988, -0.991931831299, 0.819767692714, 3.85024552543, -13.4003939151, -5.84699418572, -3.53228820341, -11.1669422816, -11.798509079, -6.6320835748, -22.6296018425, -15.4443258958, -4.00180652461, -7.21735237858, 4.44672772704, -6.12262816437, -11.042945385, 2.38213932171, 16.594259392, -8.79890381178, -1.6968087909, 9.71757606345, -8.09468303059, -0.470562727864, 0.146538679337, 8.65961773296, -23.0385409155, -10.9214807335, 14.6857408456, 10.118624921, -1.73862374893, 3.76864875832, -5.93831192463, 9.65307332486, 10.1112103628, 7.22873193795, -3.23249319907, -13.3071276712, 11.2510459799, -13.5188172998, -3.53044756606, -18.7937893665, 8.31744052527, -8.87213448921, 6.83814761925, 10.334207486, 1.1804028064, 13.0344395614, 21.2474321153, 0.410376259619, 2.63894040567, -4.25650611174, -10.8224886944, -4.90009439502, -5.98370713826, -4.90932643765, -1.48289926845, -13.0693942993, 13.8750013114, -5.95421303299, 5.26181073167, -9.97907915767, 7.08658613581, -11.0241191446, -10.2459058562, 2.94173856289, -17.6900623347, 2.87806436337, 19.7425579727, 8.74884646833, 0.447305120572, 3.05130317267, 23.7766750752, 8.0349226689, 3.21611175978, 7.85018838915, 5.59161663627, -1.66466738679, 7.14637566498, 5.25527904538, 10.911957863, -6.94509849087, -7.7468387913, -3.00545968063, -10.2729547873, -9.94084986564, 4.54709454456, 11.5975258459, -15.6177137743, 11.9732733939, 1.86540627037, 5.423909769, 4.14842170245, 3.97345558088, 0.796229208129, 17.1338966154, 10.7550460829, -13.0280141702, 10.7275763996, 5.99221683915, 17.4892540856, 10.6162985655, 6.28543786214, -5.48654556475, -8.94400295375, 6.9577541525, -13.2217448, -1.50007779867, 2.83212349433, -8.45992566313, -2.13389097053, 4.28699214386, -6.4467678228, 0.472119917794, 0.636720062476, -0.589415334199, -3.68183129529, -6.93624325627, 2.87113390282, 14.5613780272, 7.30713580898, 22.7425671488, -23.8488643239, -2.98954951344, -2.39062078061, -7.43468697593, 0.938529384739, -5.16984948735, -10.8804447342, 9.94019846898 }; +float output_data_imag[ 1024 ] = { 515.372543542, -1.39721348545, 10.1872177703, 4.97312139391, 8.56615800138, 5.26946644107, -4.76718277996, -5.39303864414, -10.1766897459, 11.6651683132, -2.55590312336, -1.62064077661, 2.60503785405, -2.32572256328, -7.13035199964, 0.117094076428, -12.2415223307, -22.4415418588, 7.01186200928, 16.7583958065, -5.03467635445, -8.08636428443, 2.38113322932, 11.8152780479, -16.886764963, 9.59796369217, -3.44147464984, 12.367972241, 5.09142147673, -6.12839297782, 6.00253686212, 8.86338094192, 11.5809739339, -10.1331616944, -2.70760892076, -1.87040888632, -9.89740229602, -3.22004803381, -3.12407160704, 1.68035606799, 0.520408239648, 16.7925985655, 3.70357095426, -4.42457205827, -4.30899317358, 2.71300535388, -0.0770774035021, -5.13783366086, -6.49412533958, 6.68172017102, 9.99230122699, 8.53494825248, 14.3388838351, 4.12899504721, 13.7860216338, -0.555454974724, -16.1753294103, 6.02133502722, -16.9287950184, 5.79931112036, 20.0702050614, -1.98443007191, -3.40262415723, 1.31102065156, -3.96508849855, -0.801374291047, -9.11243487604, -13.8229553002, -17.5757593267, -1.13816747302, -2.06250595908, 2.84440327561, -10.6735458885, -10.3583657142, 3.9430548598, -0.557114604573, 21.9153488242, -8.17977111002, -5.28986670415, -13.5238370603, 6.06978879635, 16.9742578446, -4.34354115522, -2.49777620631, 0.401444950326, 1.46778066776, 22.0924447132, -2.61745145472, -0.526474228508, -1.40337186604, -10.4894325571, -10.7457040347, 13.2830292365, 0.207832450955, 11.9826663405, -2.36632049512, 7.19944307034, -1.2961162383, -1.95318137222, 10.5525481216, 11.0735334534, 3.72473015523, -3.7171243994, -3.14118006238, -11.7829872863, 5.59237420807, -19.1911058027, 0.778087732867, -14.3718324042, 0.674325226128, 2.86315342438, 17.7144348346, 8.93917913741, 7.87419114508, -3.64517226361, 7.74112441382, -14.6584793453, 5.59041036269, 23.6780087823, -1.99765372782, 3.4616907022, 7.23972519111, -15.7903400016, -8.07648029678, 4.91419506283, 11.52592989, -4.98522718976, 8.05972505268, 1.65153218902, 12.9585487364, -11.3172417806, -3.18756722006, -4.2696517891, -8.00953012568, 7.4870091479, -7.30601620761, 5.52093558966, 5.37686612651, 2.51806081888, -2.01639371814, -6.14324857931, 16.6972967679, 25.0035427567, -1.02771445453, -15.1397582862, 5.56546623216, 15.6967093413, -6.15973450259, 3.87774894256, 17.3701869345, -2.27119637672, -18.3341793865, 14.7087854734, 10.1900199214, -12.7209736732, 10.3217655477, 0.458574449659, 6.62911469977, -7.08868136351, -2.55080768945, -2.96501082983, 1.70208591169, -5.20267927638, -10.8084095211, -4.14883512987, 11.2822683102, -0.835580003973, 2.61763522985, 20.1628639226, 10.8484761875, -17.3954643494, 4.64315864035, 14.7895152511, -8.75919985307, 3.53258374804, 13.2689429956, 1.42774296249, 10.2767177851, 0.828754106875, -19.2871199165, -14.0306724734, -8.54192937399, -4.23408658438, 5.83749345055, 9.43471489227, 17.2608670221, -3.09061490638, -0.807774861539, -4.13312973514, -10.4470861188, -1.67814064437, 0.0902316182714, 1.88141876355, -9.05711363354, -20.1930809358, 7.93556657063, 0.285868865745, -6.80681233537, -3.70692320314, -7.07372246824, 21.1893159717, 21.4394687842, -1.99130360755, 7.52936006618, 0.0352604706926, -13.0018265756, 12.8511101974, 10.8469568926, 4.74226207823, -7.18420232824, 10.9874589472, -6.19428172478, -4.14743942818, -1.09735572316, 5.72835071266, -0.178980101135, -3.07794572803, -16.4162185699, 5.24774032083, -9.81201959856, -3.51977591195, 12.1338712576, 3.16453213552, -8.85609603, 13.8224139526, -7.87892934249, -14.7541834729, 0.401221062348, -3.70429954757, 4.18492088809, 5.49818561207, -14.059704981, -0.95761540893, -16.7534920098, -4.45152198852, -14.2434989658, 4.23625441724, 1.34971858743, -4.03790664127, -0.337760584135, -6.44377940869, 9.48197324128, 10.3732278142, 16.2127826498, 3.63881803004, 16.1244061222, 12.6540868083, -8.066109085, -0.0942734621073, 2.72237703815, 2.87578953268, -3.05709006404, 18.5454132495, -11.7995360437, -1.9091437187, 4.58200468397, -7.24076452987, -2.60615777979, 14.4833385377, 0.846704538173, 7.15787238511, -9.83582686497, 6.16929798575, -2.3298831297, 2.28895981291, -3.79015358844, 16.4803954155, 5.59554663668, 2.93500463786, 13.3588101495, 8.79429374252, -4.61568198752, -4.35532906565, -0.599627943355, -5.06765016362, -11.1255998804, -2.85811238618, 5.15098133111, 8.55406129301, 10.8124649943, 3.16835436414, 10.3348113174, 3.43299874083, 4.61454885969, -0.232937412846, -9.78358973897, 8.09822295011, -3.99189619583, 10.0552037179, 5.72746199607, 7.10191941122, -7.12882295702, -5.41533196755, -0.176950929733, -1.28880519398, -6.48975974311, -23.2846991273, 12.6156968601, 2.77080561963, 7.76754268734, -5.81532128165, 1.77789517553, -1.36233878316, -10.9073302533, -4.85292005442, -10.6978688188, 3.96396559305, -2.66912602834, 4.15554956853, -2.31654113808, -8.31258700746, 1.74223674197, -1.44376253474, -5.31000467603, -6.24665222585, -8.92733183842, 4.93904978984, 2.34725591134, 1.33755064474, -5.47524753503, -6.2800319428, 11.5586250689, -3.24104601972, -17.5592411579, -7.2382927463, -7.4570934705, -10.0456570414, -3.0093087703, 0.0326329126099, 25.6506795317, -0.551008280991, -5.40179805107, -3.27302482669, 3.10422202674, -5.46270504131, -3.5925421044, -4.36755793615, 4.44238069315, 4.50016928288, 7.98315728247, 3.7948769076, 5.26217069322, 10.8707473808, 24.5537033949, 8.02312952241, 8.39270609912, 6.85428251519, -1.60797504292, 9.5338274449, -13.4401704936, -9.01515577705, -8.05274645683, -0.79624923273, -14.2664364538, 3.26336520858, 1.1350475833, 9.88249407272, -10.3317908279, 3.62304402437, 3.94780305131, 5.29286691654, 13.4922434491, 9.03814279888, -18.5808131628, -4.76424640134, -8.97457373971, -5.55162424761, -10.496230905, -11.2588566395, -8.17017589155, 5.3444460585, 1.68120328714, 3.88774211214, 5.00942886681, -7.98361486698, -6.87853659607, -11.3724051423, -3.66909422043, -10.0737432757, 2.10395358445, -3.05688199401, -0.680595485147, 9.40829136785, 2.73072777475, -3.82666057325, -7.4050439337, 7.68356731912, -7.32690192024, -4.2591987446, -14.1171416467, 10.4950911106, 19.7346832769, -5.86014807139, 4.67677905828, 3.39018233418, -19.6451410171, -16.8801034329, -15.1510349154, -5.99614647065, 14.0483211109, -2.18594603488, 13.688664104, -12.6896403024, -0.609270920324, -3.71235042366, -9.33010619616, 8.80048777167, 1.19935823832, -10.8376850564, 2.46805194939, -6.16495968579, -4.83613756974, -26.4366771289, 9.57790020791, -17.0179644529, 1.63941526616, 10.9586098519, -9.83538741582, 2.92393361215, -2.45315092959, 11.3285484046, -1.03025047044, 3.35792762648, -19.3151103377, 7.85174699539, -8.73776740831, -9.54550272695, 8.71950675089, -3.90664754281, -8.69903733053, -2.09242139715, 5.28082426165, 4.0760452652, -6.98807557649, -6.96971224487, -3.5884137165, -14.6974864828, 14.439921231, 2.13076876006, -4.5957643093, 11.1062069556, -6.3857076639, -0.828204652515, -10.2644137244, 12.3884971712, -12.9226633131, -2.27455319931, -7.07147025725, 9.13568529399, 10.4546630297, 16.7793197481, -4.19157472783, 5.59261441982, 3.00768792733, 15.6170568192, 17.6302744603, 6.72194235797, 7.69340080465, -3.95730922739, 10.8094377311, -1.64481885661, -2.53978927111, -0.108771052026, -2.9977637601, 1.365502019, 13.6753162552, 5.19361476028, -6.14387856079, -0.588174664231, -30.2790879877, -0.0807555401685, -9.41246822684, -10.4761672496, -1.48040881353, -6.29226831372, 12.6985977018, -0.0336674543381, -11.6767166367, -12.0000788329, -17.3574584005, 12.0136354194, -3.03633531001, 11.7433566196, -6.34290351895, 7.76951522736, 1.29928530557, -5.93506956716, -4.94362445788, -14.2937864706, 8.03621777441, -7.85916845196, -3.94698192968, -1.54374090896, 0.942254686412, 5.87560738605, -19.7288625682, 17.5931845839, -13.1220821655, -18.6415975706, 3.02148036978, 1.89724260025, -5.41510251721, 2.86007903817, -5.56759171235, 10.5846480369, 7.07933062188, -2.4645390969, -4.38430720223, -6.54152573321, 11.9777498071, -1.65467634669, 1.41286256821, -1.89836792248, 5.36776727815, -12.8500052006, 0.585049911802, -10.9097341288, -10.682774499, 6.37189420237, -5.22944996742, -6.76021229626, -0.923555321395, 2.63445186278, 7.74443348168, -6.82623764214, -0.599997036117, -2.27401198097, -16.214674231, 7.37511139793, 2.33208986426, -7.42910380231, -4.95316948146, -0.652565891454, -15.1321844277, -10.8505889569, -1.70541613004, -18.5193681876, -15.9860696698, 17.430944535, -6.09542568784, -1.98747606646, -5.65279998381, -3.18125223244, 7.19101464722, 1.9301333772, -1.97302890495, -6.17933193281, -8.14725633549, 5.67139238021, 3.46671738738, -6.32341126273, 4.95837394077, 4.72701885176, -3.05417064497, 0.492670481059, 12.6127914828, -14.8064895869, 2.74005472274, -7.07623831765, -8.55503848056, -18.5093301753, -8.94988523559, -8.50867351524, -9.42777909935, -7.85817038637, -16.2303057415, -8.38254520158, 6.80405664171, -19.5792381391, -1.46021951879, -10.5552756753, 2.18204240572, 8.51231134663, 5.21374522605, -3.83190914823, -3.6779838146, 5.66286537126, -4.12180445484, -6.37750158224, -10.521953577, 17.3255996831, -11.7655028099, -5.41970008609, 8.24449732849, 9.05518189675, -23.7516867483, -16.4565340327, 13.4034776737, 6.29436683929, -8.38561483616, 1.87633431136, -12.3004212108, 3.8804690228, 4.30957973542, 9.33742038466, 1.43640851294, 2.37018010837, -1.52476726025, 3.38887499944, -7.12445494584, -12.3001804858, -1.75594862132, -6.41981163711, 1.95445603202, 2.6725607993, 1.72262710764, 6.15882566959, -6.86465902336, 4.40472279662, 3.30606086423, -0.080400991724, 0.956027944393, 2.211513373, -4.45373463977, 9.40195347876, -1.75959053126, -14.4419894971, -0.381775720589, 3.07108076587, -4.00180919454, 10.7898847878, -2.87631274837, 2.08608554915, 1.68574265474, -12.748190244, -8.33986277455, 13.096455873, -2.28366258502, -10.3419786929, 0.67868572497, 6.26949023863, 10.5982016628, 6.87103386037, -1.4346001826, 3.95093003466, 10.3045326337, 17.2489952408, -0.433533930457, 1.66873014606, 2.7408511324, -4.8111589701, 1.41185141288, -2.32691131588, 3.80216985452, 2.15210000055, 3.49287516765, 10.9170513457, 5.55253480293, -10.2642120133, -11.8066812429, 24.842283673, 14.8267235174, -11.1195360376, 4.70956476708, -5.69274291665, -14.1158214071, 12.9971452941, -5.62156194696, -12.8168870135, 19.9363191495, -11.0910838779, 10.2216469789, -2.80213636904, 0.383057234948, 18.913132623, 13.9620546016, -1.40450590425, -18.745533806, 4.66240445306, -24.5292761367, -12.7504651025, 11.7584615455, -8.25284829627, 18.7860755918, -7.76985030769, 4.04956901882, 1.12807474528, 10.2822471144, 9.62416872859, 1.94798112977, -2.19966682514, 7.09414227287, 9.99936738669, -2.06618675929, -12.7388529872, 1.26616878473, -3.76513576345, -7.23786590453, -2.35468482424, 7.65740054628, -8.10339820932, -9.71683570638, -11.8401567574, -10.942862162, -12.6487440174, -10.2299518088, 0.365528280529, 11.3724963199, 3.77734568125, -10.7822539252, -14.2997339986, -24.5286467825, 10.8889075384, -0.428783681142, -5.08763973414, -17.8954296647, -0.426187071928, -2.35771841329, -0.724984041007, 6.7065793947, 11.2387180869, 10.7569894969, -10.8981085449, 11.7131074172, 0.117975145046, 19.0369001409, 7.08759342038, -4.27384034165, -6.53146582932, 9.42310365586, 1.74535531089, 7.35866324802, 5.44489391229, -2.39059266295, 10.3989658382, -9.42841282947, -2.09471870388, 7.72416129617, 11.7059906925, 0.483519810969, 15.1693421387, -13.2079942305, 6.03639028947, -5.86966558741, 9.68887531534, -0.876612433391, -8.40279155425, -6.7133424974, -2.90857852641, -11.058947794, 2.74862204445, -2.31643581592, -5.02577123984, -2.59510340053, -5.92217586188, -1.97363581006, 5.69003177365, 6.13196037613, -5.42676466078, -6.40430616712, -2.48895097836, 8.64911757173, 7.01239046469, -3.08570425145, 3.88509613982, -2.14832816716, -13.97137205, 1.69000377526, -1.16058808252, 12.6057115948, 0.307761264406, -1.57859403061, 6.49687777791, 13.9343377523, 14.583627508, 22.241089854, 0.773907086026, 7.23662504949, -2.7044987795, -2.47865227991, -3.53565004129, -7.34655968029, 12.6881133963, -6.26801373015, 3.89040256943, 2.90707469124, -2.50599822982, -13.2940739182, -4.45830428406, -1.48632963185, 7.00931705549, 3.05789752818, -6.98269392176, -0.822173197564, -2.70233124319, 6.74124607571, -3.68796988126, 1.13687823253, -18.8573409748, -0.287946180151, 4.43772862774, -4.68340491943, 4.96847149337, -3.88418801075, 3.47115763098, 0.614807466875, -2.94769166299, 6.1364507764, 8.1722803549, -1.66932548887, 2.44433524291, -11.9359173943, 1.0826189915, -11.2697880543, -1.77137540418, -0.0375210061261, 11.0050865466, 7.75511368286, 4.09905332933, 3.0784495471, -3.08303198739, -12.4463929549, 1.2715465502, 1.04018349862, -3.11925401937, 16.158667843, -11.8032600508, -28.438336596, -5.87429338229, -7.11836220733, -13.7087199105, 3.83326989915, 13.5489786862, -7.38198265218, -11.5111097906, -1.25949398476, -9.06727806269, 17.6486398412, 4.13725785078, -0.617137505634, -4.93545061677, 11.258840464, 5.13895912658, 6.92450702081, 2.37683666309, -13.6664858262, -14.3881579912, 0.489832020234, -4.44310669082, 0.989771733606, -3.89531663597, -5.52426307456, 6.69898914683, -5.22050160187, 7.07631262185, -5.76764036578, 16.7036858228, -1.27211388629, 2.15213837831, -18.8027946935, 2.02879055733, 19.0147782866, -0.959592833218, 11.8440027882, -1.52528787563, -14.1985055113, -5.34935861279, -17.1149031754, -1.09609286687, -26.104923835, -11.8358997344, -3.39910768528, 1.02688009486, -5.19617953397, 10.26807382, -16.9454749626, 6.03701601049, 0.0459879804055, -11.5827459433, 6.25687081534, -10.3610011149, 1.80363596924, -6.99792788872, 0.052506344362, 11.749343374, -10.262154839, 3.20000904789, -7.82050636824, 4.09994395616, 14.3273897843, 2.52001862129, 5.91010590912, -10.5700140469, -7.25881668389, 6.10095265186, -9.48149939471, 23.8590026554, 14.6083898171, -1.852508789, 4.63591829932, -10.991844607, -11.1342820927, -9.61373152301, -5.58740113338, -9.00334730382, -4.73221902937, -3.9113545044, 10.3185279408, -5.23392619211, 5.93039638941, 13.1417535792, -10.576627254, -11.9264311627, -0.430537564576, 4.16612536744, 4.31236982288, 5.59207001124, -6.35106175875, -4.60819377585, 0.149457890351, 15.864402698, 7.45614247329, -3.72552761408, 3.98375770898, 8.61908534699, -13.1270519529, -0.0869702479982, -10.2553166432, -9.95812440745, -8.75709097699, 0.142131441963, -7.84627211735, -6.9410951242, -1.25297349346, 8.22817141993, -11.9680553355, 13.7718576981, -1.75450620207, -6.46894187878, -2.02870184455, 7.37684174247, -7.30360048154, -8.92893475984, -11.4281515221, 5.21670802397, -10.9409480909, 6.69255947444, 9.45913287923, -5.617219161, 5.60290886058, -6.0427176748, -5.94471440101, -5.97465818594, 7.816571649, 9.90780188496, -9.38413247861, 6.12841046347, 8.58054229075, 0.429138800867, 1.84560724408, 25.4375016169, -2.26554496194, -9.25241437119, 2.65702504454, -1.66343743359, 10.9701425652, -8.75474547492, 7.15527136911, -3.301520542, 13.9642208242, 14.3733493127, -3.53881757204, -8.51007380462, -3.42129326175, -5.58606293826, 9.55343445314, 0.0201436376397, 3.03701754911, -5.64661429762, -2.40878536462, 21.825466502, -5.17428551274, -1.86807882223, 4.48624400284, -9.47455589302, 1.54156556466, 6.35567094496, -10.3488653658, -8.72209782237, 1.31819547145, 4.46884479118, 13.1970650146, 5.93727415103, 5.21686859262, 17.9831659941, 10.7058217989, 0.696449957925, 12.7303447817, -1.64905679371, -2.35613279778, 5.17833665782, -7.25306146968, -1.57962414835, 5.58174322862, 4.30090307292, -17.9179860137, 4.11361923204, -15.471754533, 10.5771327568, -6.98638375446, 6.37910385361, -7.90730261689, 5.57101574051, -2.199939871, -5.35328317677, 6.62551896408, -9.25325963185, -11.0379824943, -4.82179500229, -9.22298216092, -11.1201369226, -8.29282449768, 0.340902491192, 6.62565882598, 15.2645284087, 10.0636088014, -7.96323285426, -7.47199240228, -1.93634653821, -10.0923789761, 14.5528816281, -1.93370182031, -9.63247298114, -14.254508783 }; +float tf_real[ 1024 ] = { 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915, 6.12323399574e-17, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.83697019872e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283 }; +float tf_imag[ 1024 ] = { -0.0, -0.00613588464915, -0.0122715382857, -0.0184067299058, -0.0245412285229, -0.0306748031766, -0.0368072229414, -0.0429382569349, -0.0490676743274, -0.0551952443497, -0.0613207363022, -0.0674439195637, -0.0735645635997, -0.0796824379714, -0.0857973123444, -0.0919089564971, -0.0980171403296, -0.104121633872, -0.110222207294, -0.116318630912, -0.122410675199, -0.128498110794, -0.134580708507, -0.140658239333, -0.146730474455, -0.152797185258, -0.158858143334, -0.16491312049, -0.17096188876, -0.177004220412, -0.183039887955, -0.18906866415, -0.195090322016, -0.201104634842, -0.207111376192, -0.213110319916, -0.219101240157, -0.22508391136, -0.231058108281, -0.237023605994, -0.242980179903, -0.248927605746, -0.254865659605, -0.260794117915, -0.266712757475, -0.27262135545, -0.278519689385, -0.284407537211, -0.290284677254, -0.296150888244, -0.302005949319, -0.307849640042, -0.313681740399, -0.319502030816, -0.325310292162, -0.33110630576, -0.336889853392, -0.342660717312, -0.348418680249, -0.35416352542, -0.359895036535, -0.365612997805, -0.371317193952, -0.377007410216, -0.382683432365, -0.388345046699, -0.393992040061, -0.399624199846, -0.405241314005, -0.410843171058, -0.416429560098, -0.4220002708, -0.42755509343, -0.433093818853, -0.438616238539, -0.44412214457, -0.449611329655, -0.455083587126, -0.460538710958, -0.465976495768, -0.471396736826, -0.476799230063, -0.482183772079, -0.487550160148, -0.49289819223, -0.498227666973, -0.503538383726, -0.508830142543, -0.514102744193, -0.519355990166, -0.524589682678, -0.529803624686, -0.534997619887, -0.54017147273, -0.545324988422, -0.550457972937, -0.55557023302, -0.560661576197, -0.565731810784, -0.570780745887, -0.575808191418, -0.580813958096, -0.585797857456, -0.590759701859, -0.595699304492, -0.600616479384, -0.605511041404, -0.610382806276, -0.615231590581, -0.620057211763, -0.624859488142, -0.629638238915, -0.634393284164, -0.639124444864, -0.64383154289, -0.648514401022, -0.653172842954, -0.657806693297, -0.66241577759, -0.666999922304, -0.671558954847, -0.676092703575, -0.680600997795, -0.685083667773, -0.689540544737, -0.69397146089, -0.698376249409, -0.702754744457, -0.707106781187, -0.711432195745, -0.715730825284, -0.720002507961, -0.724247082951, -0.728464390448, -0.732654271672, -0.736816568877, -0.740951125355, -0.745057785441, -0.749136394523, -0.753186799044, -0.757208846506, -0.761202385484, -0.765167265622, -0.769103337646, -0.773010453363, -0.776888465673, -0.780737228572, -0.784556597156, -0.788346427627, -0.7921065773, -0.795836904609, -0.799537269108, -0.803207531481, -0.806847553544, -0.810457198253, -0.814036329706, -0.817584813152, -0.821102514991, -0.824589302785, -0.828045045258, -0.831469612303, -0.834862874986, -0.838224705555, -0.841554977437, -0.84485356525, -0.848120344803, -0.851355193105, -0.854557988365, -0.85772861, -0.860866938638, -0.863972856122, -0.867046245516, -0.870086991109, -0.873094978418, -0.876070094195, -0.879012226429, -0.881921264348, -0.884797098431, -0.887639620403, -0.890448723245, -0.893224301196, -0.895966249756, -0.898674465694, -0.901348847046, -0.903989293123, -0.906595704515, -0.909167983091, -0.911706032005, -0.914209755704, -0.916679059921, -0.91911385169, -0.921514039342, -0.923879532511, -0.926210242138, -0.928506080473, -0.930766961079, -0.932992798835, -0.935183509939, -0.937339011913, -0.939459223602, -0.941544065183, -0.943593458162, -0.945607325381, -0.947585591018, -0.949528180593, -0.951435020969, -0.953306040354, -0.955141168306, -0.956940335732, -0.958703474896, -0.960430519416, -0.962121404269, -0.963776065795, -0.965394441698, -0.966976471045, -0.968522094274, -0.970031253195, -0.971503890986, -0.972939952206, -0.974339382786, -0.975702130039, -0.977028142658, -0.97831737072, -0.979569765685, -0.980785280403, -0.98196386911, -0.983105487431, -0.984210092387, -0.985277642389, -0.986308097245, -0.987301418158, -0.988257567731, -0.989176509965, -0.990058210262, -0.990902635428, -0.991709753669, -0.992479534599, -0.993211949235, -0.993906970002, -0.994564570734, -0.995184726672, -0.995767414468, -0.996312612183, -0.996820299291, -0.997290456679, -0.997723066644, -0.9981181129, -0.998475580573, -0.998795456205, -0.999077727753, -0.999322384588, -0.999529417501, -0.999698818696, -0.999830581796, -0.999924701839, -0.999981175283, -1.0, -0.999981175283, -0.999924701839, -0.999830581796, -0.999698818696, -0.999529417501, -0.999322384588, -0.999077727753, -0.998795456205, -0.998475580573, -0.9981181129, -0.997723066644, -0.997290456679, -0.996820299291, -0.996312612183, -0.995767414468, -0.995184726672, -0.994564570734, -0.993906970002, -0.993211949235, -0.992479534599, -0.991709753669, -0.990902635428, -0.990058210262, -0.989176509965, -0.988257567731, -0.987301418158, -0.986308097245, -0.985277642389, -0.984210092387, -0.983105487431, -0.98196386911, -0.980785280403, -0.979569765685, -0.97831737072, -0.977028142658, -0.975702130039, -0.974339382786, -0.972939952206, -0.971503890986, -0.970031253195, -0.968522094274, -0.966976471045, -0.965394441698, -0.963776065795, -0.962121404269, -0.960430519416, -0.958703474896, -0.956940335732, -0.955141168306, -0.953306040354, -0.951435020969, -0.949528180593, -0.947585591018, -0.945607325381, -0.943593458162, -0.941544065183, -0.939459223602, -0.937339011913, -0.935183509939, -0.932992798835, -0.930766961079, -0.928506080473, -0.926210242138, -0.923879532511, -0.921514039342, -0.91911385169, -0.916679059921, -0.914209755704, -0.911706032005, -0.909167983091, -0.906595704515, -0.903989293123, -0.901348847046, -0.898674465694, -0.895966249756, -0.893224301196, -0.890448723245, -0.887639620403, -0.884797098431, -0.881921264348, -0.879012226429, -0.876070094195, -0.873094978418, -0.870086991109, -0.867046245516, -0.863972856122, -0.860866938638, -0.85772861, -0.854557988365, -0.851355193105, -0.848120344803, -0.84485356525, -0.841554977437, -0.838224705555, -0.834862874986, -0.831469612303, -0.828045045258, -0.824589302785, -0.821102514991, -0.817584813152, -0.814036329706, -0.810457198253, -0.806847553544, -0.803207531481, -0.799537269108, -0.795836904609, -0.7921065773, -0.788346427627, -0.784556597156, -0.780737228572, -0.776888465673, -0.773010453363, -0.769103337646, -0.765167265622, -0.761202385484, -0.757208846506, -0.753186799044, -0.749136394523, -0.745057785441, -0.740951125355, -0.736816568877, -0.732654271672, -0.728464390448, -0.724247082951, -0.720002507961, -0.715730825284, -0.711432195745, -0.707106781187, -0.702754744457, -0.698376249409, -0.69397146089, -0.689540544737, -0.685083667773, -0.680600997795, -0.676092703575, -0.671558954847, -0.666999922304, -0.66241577759, -0.657806693297, -0.653172842954, -0.648514401022, -0.64383154289, -0.639124444864, -0.634393284164, -0.629638238915, -0.624859488142, -0.620057211763, -0.615231590581, -0.610382806276, -0.605511041404, -0.600616479384, -0.595699304492, -0.590759701859, -0.585797857456, -0.580813958096, -0.575808191418, -0.570780745887, -0.565731810784, -0.560661576197, -0.55557023302, -0.550457972937, -0.545324988422, -0.54017147273, -0.534997619887, -0.529803624686, -0.524589682678, -0.519355990166, -0.514102744193, -0.508830142543, -0.503538383726, -0.498227666973, -0.49289819223, -0.487550160148, -0.482183772079, -0.476799230063, -0.471396736826, -0.465976495768, -0.460538710958, -0.455083587126, -0.449611329655, -0.44412214457, -0.438616238539, -0.433093818853, -0.42755509343, -0.4220002708, -0.416429560098, -0.410843171058, -0.405241314005, -0.399624199846, -0.393992040061, -0.388345046699, -0.382683432365, -0.377007410216, -0.371317193952, -0.365612997805, -0.359895036535, -0.35416352542, -0.348418680249, -0.342660717312, -0.336889853392, -0.33110630576, -0.325310292162, -0.319502030816, -0.313681740399, -0.307849640042, -0.302005949319, -0.296150888244, -0.290284677254, -0.284407537211, -0.278519689385, -0.27262135545, -0.266712757475, -0.260794117915, -0.254865659605, -0.248927605746, -0.242980179903, -0.237023605994, -0.231058108281, -0.22508391136, -0.219101240157, -0.213110319916, -0.207111376192, -0.201104634842, -0.195090322016, -0.18906866415, -0.183039887955, -0.177004220412, -0.17096188876, -0.16491312049, -0.158858143334, -0.152797185258, -0.146730474455, -0.140658239333, -0.134580708507, -0.128498110794, -0.122410675199, -0.116318630912, -0.110222207294, -0.104121633872, -0.0980171403296, -0.0919089564971, -0.0857973123444, -0.0796824379714, -0.0735645635997, -0.0674439195637, -0.0613207363022, -0.0551952443497, -0.0490676743274, -0.0429382569349, -0.0368072229414, -0.0306748031766, -0.0245412285229, -0.0184067299058, -0.0122715382857, -0.00613588464915, -1.22464679915e-16, 0.00613588464915, 0.0122715382857, 0.0184067299058, 0.0245412285229, 0.0306748031766, 0.0368072229414, 0.0429382569349, 0.0490676743274, 0.0551952443497, 0.0613207363022, 0.0674439195637, 0.0735645635997, 0.0796824379714, 0.0857973123444, 0.0919089564971, 0.0980171403296, 0.104121633872, 0.110222207294, 0.116318630912, 0.122410675199, 0.128498110794, 0.134580708507, 0.140658239333, 0.146730474455, 0.152797185258, 0.158858143334, 0.16491312049, 0.17096188876, 0.177004220412, 0.183039887955, 0.18906866415, 0.195090322016, 0.201104634842, 0.207111376192, 0.213110319916, 0.219101240157, 0.22508391136, 0.231058108281, 0.237023605994, 0.242980179903, 0.248927605746, 0.254865659605, 0.260794117915, 0.266712757475, 0.27262135545, 0.278519689385, 0.284407537211, 0.290284677254, 0.296150888244, 0.302005949319, 0.307849640042, 0.313681740399, 0.319502030816, 0.325310292162, 0.33110630576, 0.336889853392, 0.342660717312, 0.348418680249, 0.35416352542, 0.359895036535, 0.365612997805, 0.371317193952, 0.377007410216, 0.382683432365, 0.388345046699, 0.393992040061, 0.399624199846, 0.405241314005, 0.410843171058, 0.416429560098, 0.4220002708, 0.42755509343, 0.433093818853, 0.438616238539, 0.44412214457, 0.449611329655, 0.455083587126, 0.460538710958, 0.465976495768, 0.471396736826, 0.476799230063, 0.482183772079, 0.487550160148, 0.49289819223, 0.498227666973, 0.503538383726, 0.508830142543, 0.514102744193, 0.519355990166, 0.524589682678, 0.529803624686, 0.534997619887, 0.54017147273, 0.545324988422, 0.550457972937, 0.55557023302, 0.560661576197, 0.565731810784, 0.570780745887, 0.575808191418, 0.580813958096, 0.585797857456, 0.590759701859, 0.595699304492, 0.600616479384, 0.605511041404, 0.610382806276, 0.615231590581, 0.620057211763, 0.624859488142, 0.629638238915, 0.634393284164, 0.639124444864, 0.64383154289, 0.648514401022, 0.653172842954, 0.657806693297, 0.66241577759, 0.666999922304, 0.671558954847, 0.676092703575, 0.680600997795, 0.685083667773, 0.689540544737, 0.69397146089, 0.698376249409, 0.702754744457, 0.707106781187, 0.711432195745, 0.715730825284, 0.720002507961, 0.724247082951, 0.728464390448, 0.732654271672, 0.736816568877, 0.740951125355, 0.745057785441, 0.749136394523, 0.753186799044, 0.757208846506, 0.761202385484, 0.765167265622, 0.769103337646, 0.773010453363, 0.776888465673, 0.780737228572, 0.784556597156, 0.788346427627, 0.7921065773, 0.795836904609, 0.799537269108, 0.803207531481, 0.806847553544, 0.810457198253, 0.814036329706, 0.817584813152, 0.821102514991, 0.824589302785, 0.828045045258, 0.831469612303, 0.834862874986, 0.838224705555, 0.841554977437, 0.84485356525, 0.848120344803, 0.851355193105, 0.854557988365, 0.85772861, 0.860866938638, 0.863972856122, 0.867046245516, 0.870086991109, 0.873094978418, 0.876070094195, 0.879012226429, 0.881921264348, 0.884797098431, 0.887639620403, 0.890448723245, 0.893224301196, 0.895966249756, 0.898674465694, 0.901348847046, 0.903989293123, 0.906595704515, 0.909167983091, 0.911706032005, 0.914209755704, 0.916679059921, 0.91911385169, 0.921514039342, 0.923879532511, 0.926210242138, 0.928506080473, 0.930766961079, 0.932992798835, 0.935183509939, 0.937339011913, 0.939459223602, 0.941544065183, 0.943593458162, 0.945607325381, 0.947585591018, 0.949528180593, 0.951435020969, 0.953306040354, 0.955141168306, 0.956940335732, 0.958703474896, 0.960430519416, 0.962121404269, 0.963776065795, 0.965394441698, 0.966976471045, 0.968522094274, 0.970031253195, 0.971503890986, 0.972939952206, 0.974339382786, 0.975702130039, 0.977028142658, 0.97831737072, 0.979569765685, 0.980785280403, 0.98196386911, 0.983105487431, 0.984210092387, 0.985277642389, 0.986308097245, 0.987301418158, 0.988257567731, 0.989176509965, 0.990058210262, 0.990902635428, 0.991709753669, 0.992479534599, 0.993211949235, 0.993906970002, 0.994564570734, 0.995184726672, 0.995767414468, 0.996312612183, 0.996820299291, 0.997290456679, 0.997723066644, 0.9981181129, 0.998475580573, 0.998795456205, 0.999077727753, 0.999322384588, 0.999529417501, 0.999698818696, 0.999830581796, 0.999924701839, 0.999981175283, 1.0, 0.999981175283, 0.999924701839, 0.999830581796, 0.999698818696, 0.999529417501, 0.999322384588, 0.999077727753, 0.998795456205, 0.998475580573, 0.9981181129, 0.997723066644, 0.997290456679, 0.996820299291, 0.996312612183, 0.995767414468, 0.995184726672, 0.994564570734, 0.993906970002, 0.993211949235, 0.992479534599, 0.991709753669, 0.990902635428, 0.990058210262, 0.989176509965, 0.988257567731, 0.987301418158, 0.986308097245, 0.985277642389, 0.984210092387, 0.983105487431, 0.98196386911, 0.980785280403, 0.979569765685, 0.97831737072, 0.977028142658, 0.975702130039, 0.974339382786, 0.972939952206, 0.971503890986, 0.970031253195, 0.968522094274, 0.966976471045, 0.965394441698, 0.963776065795, 0.962121404269, 0.960430519416, 0.958703474896, 0.956940335732, 0.955141168306, 0.953306040354, 0.951435020969, 0.949528180593, 0.947585591018, 0.945607325381, 0.943593458162, 0.941544065183, 0.939459223602, 0.937339011913, 0.935183509939, 0.932992798835, 0.930766961079, 0.928506080473, 0.926210242138, 0.923879532511, 0.921514039342, 0.91911385169, 0.916679059921, 0.914209755704, 0.911706032005, 0.909167983091, 0.906595704515, 0.903989293123, 0.901348847046, 0.898674465694, 0.895966249756, 0.893224301196, 0.890448723245, 0.887639620403, 0.884797098431, 0.881921264348, 0.879012226429, 0.876070094195, 0.873094978418, 0.870086991109, 0.867046245516, 0.863972856122, 0.860866938638, 0.85772861, 0.854557988365, 0.851355193105, 0.848120344803, 0.84485356525, 0.841554977437, 0.838224705555, 0.834862874986, 0.831469612303, 0.828045045258, 0.824589302785, 0.821102514991, 0.817584813152, 0.814036329706, 0.810457198253, 0.806847553544, 0.803207531481, 0.799537269108, 0.795836904609, 0.7921065773, 0.788346427627, 0.784556597156, 0.780737228572, 0.776888465673, 0.773010453363, 0.769103337646, 0.765167265622, 0.761202385484, 0.757208846506, 0.753186799044, 0.749136394523, 0.745057785441, 0.740951125355, 0.736816568877, 0.732654271672, 0.728464390448, 0.724247082951, 0.720002507961, 0.715730825284, 0.711432195745, 0.707106781187, 0.702754744457, 0.698376249409, 0.69397146089, 0.689540544737, 0.685083667773, 0.680600997795, 0.676092703575, 0.671558954847, 0.666999922304, 0.66241577759, 0.657806693297, 0.653172842954, 0.648514401022, 0.64383154289, 0.639124444864, 0.634393284164, 0.629638238915, 0.624859488142, 0.620057211763, 0.615231590581, 0.610382806276, 0.605511041404, 0.600616479384, 0.595699304492, 0.590759701859, 0.585797857456, 0.580813958096, 0.575808191418, 0.570780745887, 0.565731810784, 0.560661576197, 0.55557023302, 0.550457972937, 0.545324988422, 0.54017147273, 0.534997619887, 0.529803624686, 0.524589682678, 0.519355990166, 0.514102744193, 0.508830142543, 0.503538383726, 0.498227666973, 0.49289819223, 0.487550160148, 0.482183772079, 0.476799230063, 0.471396736826, 0.465976495768, 0.460538710958, 0.455083587126, 0.449611329655, 0.44412214457, 0.438616238539, 0.433093818853, 0.42755509343, 0.4220002708, 0.416429560098, 0.410843171058, 0.405241314005, 0.399624199846, 0.393992040061, 0.388345046699, 0.382683432365, 0.377007410216, 0.371317193952, 0.365612997805, 0.359895036535, 0.35416352542, 0.348418680249, 0.342660717312, 0.336889853392, 0.33110630576, 0.325310292162, 0.319502030816, 0.313681740399, 0.307849640042, 0.302005949319, 0.296150888244, 0.290284677254, 0.284407537211, 0.278519689385, 0.27262135545, 0.266712757475, 0.260794117915, 0.254865659605, 0.248927605746, 0.242980179903, 0.237023605994, 0.231058108281, 0.22508391136, 0.219101240157, 0.213110319916, 0.207111376192, 0.201104634842, 0.195090322016, 0.18906866415, 0.183039887955, 0.177004220412, 0.17096188876, 0.16491312049, 0.158858143334, 0.152797185258, 0.146730474455, 0.140658239333, 0.134580708507, 0.128498110794, 0.122410675199, 0.116318630912, 0.110222207294, 0.104121633872, 0.0980171403296, 0.0919089564971, 0.0857973123444, 0.0796824379714, 0.0735645635997, 0.0674439195637, 0.0613207363022, 0.0551952443497, 0.0490676743274, 0.0429382569349, 0.0368072229414, 0.0306748031766, 0.0245412285229, 0.0184067299058, 0.0122715382857, 0.00613588464915 }; diff --git a/benchmarks/vec-fft/vec-fft.c b/benchmarks/vec-fft/vec-fft.c new file mode 100644 index 0000000..47d13cd --- /dev/null +++ b/benchmarks/vec-fft/vec-fft.c @@ -0,0 +1,169 @@ +// ************************************************************************* +// multiply function (c version) +// ------------------------------------------------------------------------- +#include "vec-fft.h" +#include "fft_const.h" + +int log2down(int in) +{ + int counter = -1; + while(in > 0) { counter++; in = in >> 1; } + return counter; +} + +void fft(fftval_t workspace_real[], fftval_t workspace_imag[], + const fftval_t tf_real[], const fftval_t tf_imag[]) //size is FFT_SIZE +{ + const int num_stage_ops = FFT_SIZE >> 1; + const int logfftsize = log2down(FFT_SIZE); + + int given_vl; + // First, setup hwacha to what we need: +#if defined(FFT_FIXED) + // num_stage_ops VL, 9 x-reg (1 zero, 2 ctrl, 4 data, 2 scratch), 1 fpu (avert bug) + asm volatile ("vsetcfg 9, 1"); +#elif defined(FFT_FLOATING) + asm volatile ("vsetcfg 8, 6"); + #if defined(FP_SINGLE) +// asm volatile ("vsetprec 32"); + #elif defined(FP_HALF) +// asm volatile ("vsetprec 16"); + #elif defined(FP_DOUBLE) + #else + #error wat + #endif +#endif + asm volatile ("vsetvl %[gvl], %[nvl]" : [gvl]"=r"(given_vl) : [nvl]"r"(num_stage_ops)); + asm volatile ("fence"); // Make sure prefilling of workspace is complete + + for(int stage = 0; stage < logfftsize; stage++) + { + const int half_cur_fft_size = (1 << stage); + const int sel_block_op = half_cur_fft_size-1; + const int sel_block = ~sel_block_op; + const int tf_scale = logfftsize - stage - 1; + + // Stripmining loop + for(int lane_start = 0; lane_start < num_stage_ops; lane_start += given_vl) + { + // Setup new vector length for this stripmining pass + const int needed_vl = num_stage_ops - lane_start; + asm volatile ("vsetvl %[gvl], %[nvl]" : [gvl]"=r"(given_vl) : [nvl]"r"(needed_vl)); + +#if defined(FFT_FIXED) + // First VF block to have vector unit determine what op it is doing + asm volatile (R"( + vmsv vx1, %[lane_start] + vmsv vx2, %[sel_block] + vmsv vx3, %[sel_block_op] + vmsv vx4, %[tf_scale] + vmsv vx5, %[half_cfs] + vf 0(%[vf_ptr]) + )": // no output registers + : [lane_start]"r"(lane_start), + [sel_block]"r"(sel_block), + [sel_block_op]"r"(sel_block_op), + [tf_scale]"r"(tf_scale), + [half_cfs]"r"(half_cur_fft_size), + [vf_ptr]"r"(&vf_fft_init) + : // no clobber + ); + + // Second VF block loads tf and op2 then calculates scale factor + asm volatile (R"( + vmsv vx4, %[tf_real] + vmsv vx5, %[tf_imag] + vmsv vx6, %[workspace_real] + vmsv vx7, %[workspace_imag] + vmsv vx8, %[fix_pt] + vf 0(%[vf_ptr]) + )": // no output registers + : [tf_real]"r"(tf_real), + [tf_imag]"r"(tf_imag), + [workspace_real]"r"(workspace_real), + [workspace_imag]"r"(workspace_imag), + [fix_pt]"r"(FIX_PT), + [vf_ptr]"r"(&vf_fft_scale) + : // no clobber + ); +#elif defined(FFT_FLOATING) + // First VF block to have vector unit determine what op it is doing + asm volatile (R"( + vmsv vx1, %[lane_start] + vmsv vx2, %[sel_block] + vmsv vx3, %[sel_block_op] + vmsv vx4, %[tf_scale] + vmsv vx5, %[half_cfs] + vf 0(%[vf_ptr]) + )": // no output registers + : [lane_start]"r"(lane_start), + [sel_block]"r"(sel_block), + [sel_block_op]"r"(sel_block_op), + [tf_scale]"r"(tf_scale), + [half_cfs]"r"(half_cur_fft_size), + [vf_ptr]"r"(&vf_fft_init) + : // no clobber + ); + + // Second VF block loads tf and op2 then calculates scale factor + asm volatile (R"( + vmsv vx4, %[tf_real] + vmsv vx5, %[tf_imag] + vmsv vx6, %[workspace_real] + vmsv vx7, %[workspace_imag] + vf 0(%[vf_ptr]) + )": // no output registers + : [tf_real]"r"(tf_real), + [tf_imag]"r"(tf_imag), + [workspace_real]"r"(workspace_real), + [workspace_imag]"r"(workspace_imag), + [vf_ptr]"r"(&vf_fft_scale) + : // no clobber + ); +#else + #error no mode selected in vec-fft/vec-fft.c +#endif + + // Third VF block actually calculates the results + asm volatile (R"( + vmsv vx5, %[workspace_real] + vmsv vx6, %[workspace_imag] + vf 0(%[vf_ptr]) + )": // no output registers + : [workspace_real]"r"(workspace_real), + [workspace_imag]"r"(workspace_imag), + [vf_ptr]"r"(&vf_fft_exec) + : // no clobber + ); + + // Fourth VF block stores first result + asm volatile (R"( + vmsv vx3, %[workspace_real] + vmsv vx4, %[workspace_imag] + vf 0(%[vf_ptr]) + )": // no output registers + : [workspace_real]"r"(workspace_real), + [workspace_imag]"r"(workspace_imag), + [vf_ptr]"r"(&vf_fft_store1) + : "memory" + ); + + // Fifth VF block stores second result + asm volatile (R"( + vmsv vx3, %[workspace_real] + vmsv vx4, %[workspace_imag] + vf 0(%[vf_ptr]) + )": // no output registers + : [workspace_real]"r"(workspace_real), + [workspace_imag]"r"(workspace_imag), + [vf_ptr]"r"(&vf_fft_store2) + : "memory" + ); + + } + } + + asm volatile ("fence"); // Make sure all that work from vector unit is visible to CPU + + return; +} diff --git a/benchmarks/vec-fft/vec-fft.h b/benchmarks/vec-fft/vec-fft.h new file mode 100644 index 0000000..117be3a --- /dev/null +++ b/benchmarks/vec-fft/vec-fft.h @@ -0,0 +1,19 @@ +#ifndef __VEC_FFT_H +#define __VEC_FFT_H + +#include "fft_const.h" + +// Simple C version + +int log2down(int in); +void fft(fftval_t workspace_real[], fftval_t workspace_imag[], const fftval_t tf_real[], const fftval_t tf_imag[]); + +// VF blocks - DO NOT CALL FROM SCALAR CORE +extern void vf_test(); +extern void vf_fft_init(); +extern void vf_fft_scale(); +extern void vf_fft_exec(); +extern void vf_fft_store1(); +extern void vf_fft_store2(); + +#endif /* __VEC_FFT_H */ diff --git a/benchmarks/vec-fft/vec-fft_gaussian.c b/benchmarks/vec-fft/vec-fft_gaussian.c new file mode 100644 index 0000000..bc1de95 --- /dev/null +++ b/benchmarks/vec-fft/vec-fft_gaussian.c @@ -0,0 +1,12 @@ +int input_data_real[1024] = {-896054, 949431, -1181578, 253232, -258369, -152000, 619625, -76677, 465711, -549326, -886958, -966940, 642303, -1412490, 762634, -220791, -1315319, -2559848, 1722557, -1279554, -784697, -85712, -470933, -2785179, -66578, -1597429, -409911, 896, 1027796, 48085, 1774527, 562113, 1795654, 983044, -60377, -1573581, 1030270, -773291, -987375, -291152, 1126075, -406236, -630897, 1531200, 153252, -1544032, 518357, -479677, -489022, 768468, 216657, 978756, 60305, 323742, -266762, -1654684, 1162783, 367356, -215242, 77760, 584574, 352846, -1205031, 202189, 12621, -777742, 1241171, -353489, -201242, 268114, 7405, 511548, 594019, 1378269, -470360, -1419079, -2068041, -224985, 773760, -133786, 166345, 56818, -329117, 710806, -406329, -325712, -1090084, 70838, 1004493, 716570, 1557742, 1814687, -1044653, 865660, 423172, 280485, 122644, 1599035, 836955, -966475, -731759, -1342635, -918704, -478514, -1729195, -275916, 1481397, -80107, -320867, 1571394, 441358, 1095253, 123305, 515740, 558500, 735220, -1409019, -192480, 750830, -385698, -133846, 582203, -538534, 906199, 448649, -1011173, 1112875, 305645, -427417, -1621730, -771200, -807072, -1648200, 2275694, -250040, 166780, 75114, 1498792, -852391, -1449432, 387756, 590382, 630725, 1111966, -1463601, 1379964, 588656, 36544, 585505, -675475, -1147007, 122834, -2281502, 1148931, 840446, -1322731, 2822403, 164183, 799482, 212823, -1077917, -2276541, -2416247, -1866483, 25406, -532814, -28766, -3399, -229289, -884731, -697664, 1388647, 1413131, 695668, 1600785, 1053622, 1882168, 807694, 1496109, 414407, -354594, 852655, -726330, -760018, 203035, 861991, 2077817, -278761, -1692805, -163980, 152551, 99640, -1544466, 424749, 600022, -224627, 1700150, 257985, -710227, -653561, -278079, 65958, 536047, -514225, 131065, 1879774, 1325692, -418569, -94234, -1567061, -1329031, -185396, 321072, -576789, -2082050, 120663, -1112296, -526319, 763200, -26381, 1324391, -740749, 173611, -1034909, -400867, -599852, -854975, 506465, -470497, -1690555, -599600, -774910, 480166, -551595, -154846, 1148952, -531685, -1420372, 115244, -44897, 224230, -235359, -491645, 580113, -930422, -1959150, 660689, -312934, -775785, -1447388, -738147, 327008, 117518, -1024839, -742963, 1113591, 512088, 981759, 224251, 879687, 530700, 793549, -1133250, -1984799, -201157, -226046, -693217, 1865422, -1323405, 727875, 1099706, -572954, 876134, 5546, -359252, -1477340, -1827760, 1425401, -713946, 407302, 296915, 428736, -1928924, 199630, -268383, 524386, -954547, -1009395, -299817, -310362, -3118676, 619580, 274035, -291538, 10998, 54373, -2682711, 1059473, 1900561, -1072897, 390315, 553662, 286722, -575054, 291089, -324509, -2201875, -1739589, -592230, -2358024, 1035206, 101656, 51362, -161931, 982101, 1972023, -940406, 117267, 919302, 706673, -526962, 3251470, -70727, 1354903, -123238, 191080, 2197403, -907972, -1631270, -273662, -43394, 100110, -1757122, 424462, -318587, 241805, -1161233, -766219, -844215, -424058, -571869, 1058981, -576705, -69864, 786586, 3420949, 1175440, -1369774, -1033382, 1895799, -160257, -500482, 649412, 523523, 1044180, 455826, 604125, 781678, -35555, -380257, -2101152, -2052395, 1345031, -1749075, -1898768, 2596126, 877930, 886063, -1747101, 361069, -2709924, -387654, 1461459, 278642, 284030, -2189727, -579640, -410905, 1800776, -387552, -616487, -891888, 1293689, 544185, 165521, -746200, 25612, -748496, -693907, 440270, -1355509, 802877, -226185, -122957, -163764, 706156, -599130, 2085773, 687121, 1536468, -197261, -65999, -602517, -1996625, 711481, 558923, 1575241, -131589, 1443891, 853304, 1450518, 2433068, -614678, 902956, 276921, -865560, 1250774, 1178148, 1627304, -526388, -293789, 163521, -2227160, -1681836, 1054701, -2316942, -575982, -220544, -907539, -728331, -149547, -309108, 1339888, -698216, 333701, 437526, 2094829, -1361341, -461547, 1162315, 1493649, -1052221, 403851, 841804, 2322413, 271887, 1100268, 954880, 97292, 638758, 300629, 654241, -1190910, -141642, 709317, -1761989, -1445740, 1071331, 1503261, -492201, -975276, 730555, -450130, -678104, -690089, -1439162, 226482, -48190, 977167, -403028, -660667, 602354, -970278, 376586, 1099863, -537913, 627956, -71364, -819583, -116110, 114762, 1227038, -416023, 1263602, 419692, 1489545, -323662, 57509, 148590, -627405, -1416122, -994706, -1207921, 2849186, 87464, 38164, -790326, -810378, 917028, -1707856, -782588, 39726, 1311549, 476992, 121776, -5966, -1107219, -113871, -1836494, 292648, 782507, -327742, 1568375, 1031082, 875287, -949597, -364015, -1345238, 2049161, 1199569, -1566459, 432513, -697595, -1989664, 117455, -298029, -372192, -278563, 785990, -307587, 2308882, -128000, 853709, -469916, 569248, -1013809, -92453, -612595, -976635, 407757, -278549, -553747, -1127594, 35556, -967385, -1254461, 2458671, -1235129, 112282, -7618, 1232264, -1584499, 546417, 636949, -788087, 204249, 563736, 905080, 24683, -772095, 957269, -476610, 3997491, -1132151, -87573, -1925741, 423206, 1759035, 345800, -1505568, 857837, 1280631, 672655, 1133353, -2360246, -310429, 1471262, 1874920, -942267, -494638, -1092077, -10703, -798528, 291551, 195560, 603693, 485551, -37890, -681278, 1318510, -1775936, -267078, -1193401, -626711, 427957, -977820, 1177448, -1891652, -486457, -1858903, -251575, 1087978, -1625087, 298155, -1557769, 1112788, 1633070, 742091, 750361, 717342, -597939, -393911, -348514, 1606463, 1104431, -1780884, -1724355, -1087455, -626704, -234591, -841, 595062, -210024, -1150164, 298276, -1357687, 1092760, -795133, 437956, -1073763, -541, -1756437, -423091, -135638, -501750, 1843207, -499411, 515043, -347171, -1864412, 2081029, 935757, -1217682, -862780, 643680, -1682284, 1052595, -1055351, 1278938, -2296045, 728516, -1328562, 316609, -503151, -1317546, -310576, -821390, 717855, -447765, -82472, 226472, -2007236, 1839585, -908416, -131113, 61112, -439936, 37521, -56853, -322043, -537081, -1305022, 613039, -398354, -2251352, -274268, 213708, 1216898, -145297, 163831, 802134, 616814, 742237, 71663, -181725, -234834, 1567310, -433700, 1143683, 1217074, 588362, 880977, 257134, -251325, 419032, 1358747, -1010892, 911781, -114881, 1358209, 1938967, 2496063, 643557, 1131044, 1215299, -1293521, -552701, 535820, -59013, -364820, 401230, -493578, 934606, 947383, 90222, -982021, 823033, -767065, 719868, 555083, -542885, -248389, 683906, -1000980, 960526, 379686, -1332005, 3005752, -1014656, -707705, 957653, 1395720, 695949, -2199684, -1472357, -1402525, -1056170, -773175, -1038523, -1648483, 439225, -604068, 323281, 990838, -258093, -642187, 638228, 1016123, 1215852, -755431, -791548, 232428, -82638, 420739, -1182173, 2073021, -190956, -1426757, 1310320, -529883, 905258, 232249, -107927, -778138, -739516, 819476, 380856, 324304, 750739, -85899, -224870, 2741555, 241328, -1001409, 410347, -803508, 1603523, 83407, -1310198, -841961, -1499826, -231665, -1204370, 365869, 657035, -870479, -947226, 41541, 53460, 1185594, 197060, -442508, 560089, -648000, -1789746, 199013, 792625, 983644, -1255249, 611407, -642979, 2761, 1029260, 165283, -346945, -1241505, -1867499, -330354, 453762, 1144514, 1677530, -794614, -113484, 93134, 174381, 91979, -1072786, 546927, -950065, -1068562, -1316833, 2010054, 1167861, 376645, -1598679, -330354, -64535, -439935, 108686, -122528, -816010, -1657702, 1640815, -729089, -2109620, -1544674, 1751899, 828989, 1396845, -840295, 807944, -1422573, -1962193, -1494306, 1100314, -1035079, -113884, -755568, 311640, 21811, 1118977, 1769466, 272869, 1483856, -2397511, -1212979, -1870837, 66655, -844513, 566095, 258971, -2441991, -53408, 2379521, 1579490, 94538, -1729911, -2271954, -92893, -57722, 755889, 971922, 61839, 1289233, -1708188, 429444, 329090, -846816, -1406843, -329808, -487371, -1342151, -7656, 2160620, 1048363, -1481379, -1973413, 89442, -863813, -334120, 2920250, 1679680, -203732, -840043, 812270, -1065058, 1000115, -1755099, 1098146, -206412, -352184, 45945, -2653853, 539338, -217170, -25474, -1541171, -640479, -1465498, -590507, -294424, 1133931, -258876, -1336660, -36708, -136578, 274059, 2340197, -1661670, -569377, 11224, -781516, 1231584, 2084167, 647286, 1491175, 1359026, 1980953, -529280, 326660, 833554, 1246125, -1181280, -440724, -999991, -1751126, -1058615, 1202373, 379613, -94962, -548041, -2378721, 340897, 1644642, 384925, 10212, -1439416, 1377793, 1736966, -677616, -185008, 1062970, 334065, -923961, 1591540, -323994, 1729168, 1105046, -261575, -256889, 417819, 591476, -1039900, -873951, 299386, -365, -574062, -12822, 773415, -1887046, 1720955, 401646, 903317, 843614, 24321, 397914, -517594, -966687, 1225655, 1041758, 1609662, 530653, 2082272, 379586, -653861, -1324874, -543320, -902844, -156747, 314204, -221853, 698115, 2373708, -473267, -867591, 1789907, 50399, 148680, 110642, 2565631, 1338325, 1122299, -771531, -434336, 962718, -417205, 325343, 221979, -432146, 2039328, -496594, 646733, 707371, -555182, -499570, -1122461, 70865, -267403, -21031, 967469, 515973, 1838992, 1806965, -118340}; + +int input_data_imag[1024] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +int output_data_real[1024] = {-12552904, 900359, 13572614, 6612100, 21544345, 11727877, 41132063, 19376007, 28943753, -27164137, -33144128, 6308054, -4036209, 5075419, 61637708, -7000522, 10258235, -3290422, -1930761, -34401327, 11137064, 7072560, -5882191, -220280, 23820092, -2747162, -28342204, 3125936, 7067612, -29776710, 55435764, -17075007, -19174432, 20671700, -12850843, -7092760, 28566808, 7334062, -4448199, 9472241, 47990150, -14256806, 34713414, 685658, -11454543, -23878239, -3851980, -31644251, -37423854, -1393894, 7232213, 8636293, 11497913, 9667982, 35262268, 5288923, -55684640, 3700995, -22558252, 18480571, -3559982, -8088458, -4285223, 7405114, -7771936, 12380211, -22448319, -4486944, -5799558, -6360713, -42620553, 9922426, 53490, 34344676, 9036257, -11010380, 8992865, 6702815, 37459231, -51621029, 45427877, -33475926, 6145230, -1165894, 9274164, -6597275, -3224277, 7626625, 61264116, -44474201, 124449, -2018025, 17789771, -17386333, 21059636, 25853157, 24492414, -36973351, -898990, 10429825, 33784360, -12611474, -9253302, -11470671, -23838238, -5434085, -8063059, -10329404, -24686045, 7658790, -17604946, 4041983, 17475815, -15225635, -6527846, -73005557, -386102, 17003988, -12259825, -11144953, 36458684, 29952905, 23484279, -30698712, 34127344, 9315402, -786106, -20800916, 27201257, 4772119, -20300899, -5423789, 30842314, -24840735, -18319755, 50925957, 19428607, -20411834, 12547811, -1014932, 10278862, -32309319, -1845021, -1849277, -45728792, 2285470, 35351079, 4290917, -30853329, -8422261, -36146114, 27125965, -17918864, -3137631, 16473491, 4954133, -15439592, 17157868, -18076982, -34202615, -18793524, -10174558, -2904950, 11985992, -44150120, -35036737, 21105041, 20053489, -1150444, 5200899, -9805414, -23632872, -9796924, -17291839, -12551635, -16640164, -6028118, -12190830, -10279820, -883003, 3527116, 40755752, 28098784, -7167611, 5362554, -41423374, 24889496, 47850412, 12089976, -37773935, -18754709, 46972743, 22713778, -16370229, 26601571, 6009203, -23452807, -11836470, 43211515, 20586799, 33670875, -50098827, 38216755, 3992212, -48197762, 10221413, -4180759, 38877047, 24300809, 29759474, -3046819, -24536720, 36519832, -32126982, 48288800, -35312888, 609558, -47953658, -37884802, 25200530, 4336904, 1479356, -7797884, -18955924, -32376585, -21405801, 29384571, -24481459, 2543253, 17158726, -2776591, 11240742, 15819802, -6537788, -4704053, 714275, 11628194, 28723061, 5738400, -37731881, 13312717, 5031202, 3486856, 33969822, -45736651, 9926004, 11254269, -8851157, -32157646, 12021993, 5884165, 15241604, 6434347, -17375580, -15489770, 52491003, -15225800, -14319845, 16184057, -23298538, -12183843, 15891533, -24134472, -15409885, -33973366, 36464591, -41740876, -5814469, -47863361, 5361930, 23994350, 25062493, -3595486, 5781951, 11066975, 20050830, 1161667, -48325555, -50611922, 9501699, 40705759, -5313072, -9659277, 10592603, -20218838, 18738334, -3328681, 36037414, -7491180, -31052879, -16631065, 8521060, 33240862, 32028228, 4855574, -4137820, -2219601, 18511495, -18457783, 32503042, -24587081, -10376774, 48721064, 5739730, -19871347, -3666797, 2290638, -46611214, 34189522, 34232428, -76237564, 16828591, -653519, -24934144, -13619213, -34352692, -9241485, -38754679, -29896052, 14155622, -14851765, -7247528, -11442225, 23899339, 21619168, 16078611, 1056057, 12534212, -8524125, -18563168, 1189818, 3284210, 18933819, -168384, -19548176, 3351897, 26023992, 5652407, 18821169, 5444904, -21497967, -18921004, 16911041, -28914605, -32035931, 29907843, 25885333, -4662420, -44175706, -18961154, -12390312, -30787883, 234931, 20687676, 1626383, 24397270, 28930792, 23854935, 3621212, -14037045, 5835273, -22733870, -15069814, 22891991, -5135262, -38748231, -8301851, -32091129, 6556125, 19593984, 29121989, 21557498, 24757875, 7340453, -12388807, -14846595, 31262548, -19666223, 6846384, 25564004, 1344657, -14261594, 34748326, 26024037, -2144417, -16123700, 14820402, 11115160, -24641550, -22153858, -9135007, 5480795, -2482695, 29012030, 20961896, -10222219, 3885264, -11027804, -22889506, 34689823, 8311915, -22242556, 18673513, -5202883, 5908575, 23036139, -3855230, -74608942, 13512302, -9837005, 3273908, -49960540, -11076455, 45599654, -40257199, 9076658, -27009729, 4399532, -13005537, -28775110, -3973568, -21385680, -14196021, -24651745, -18867054, -19140980, 29662849, -29940752, -18104043, -16287558, -9058976, 28073203, 27184046, -7723259, 701913, 18190003, 12586763, -34934264, -11473700, 4147803, 12865353, -23153211, 14184342, 849631, 9742551, 15656015, 1221034, -2745933, -55104836, 818333, 10184835, -39362197, 3106268, 49992663, 37017075, 3750303, -983440, -10290521, 4533740, 8052801, -27625442, -11484030, -5162240, 44681978, -14633727, 21739135, 6304123, 29959360, -17983352, 13539318, -42605105, -16083591, -41238795, -734838, -18941413, -23180474, 5784245, 42435559, -9134333, 7998833, -6148840, -35251769, -11080087, 5868914, 20072717, -24259041, -3030660, 16518116, -63597382, 21360935, 6670140, 27257482, -1314107, 7280448, 55584322, 9679983, 1404784, -20769472, -9417164, -15378773, -37098082, 20582563, -20200971, 4098965, 3273742, 5234704, 17739141, -35916362, 2538992, 7932900, 13107659, -66841471, -16623704, -66841471, 13107659, 7932900, 2538992, -35916362, 17739141, 5234704, 3273742, 4098965, -20200971, 20582563, -37098082, -15378773, -9417164, -20769472, 1404784, 9679983, 55584322, 7280448, -1314107, 27257482, 6670140, 21360935, -63597382, 16518116, -3030660, -24259041, 20072717, 5868914, -11080087, -35251769, -6148840, 7998833, -9134333, 42435559, 5784245, -23180474, -18941413, -734838, -41238795, -16083591, -42605105, 13539318, -17983352, 29959360, 6304123, 21739135, -14633727, 44681978, -5162240, -11484030, -27625442, 8052801, 4533740, -10290521, -983440, 3750303, 37017075, 49992663, 3106268, -39362197, 10184835, 818333, -55104836, -2745933, 1221034, 15656015, 9742551, 849631, 14184342, -23153211, 12865353, 4147803, -11473700, -34934264, 12586763, 18190003, 701913, -7723259, 27184046, 28073203, -9058976, -16287558, -18104043, -29940752, 29662849, -19140980, -18867054, -24651745, -14196021, -21385680, -3973568, -28775110, -13005537, 4399532, -27009729, 9076658, -40257199, 45599654, -11076455, -49960540, 3273908, -9837005, 13512302, -74608942, -3855230, 23036139, 5908575, -5202883, 18673513, -22242556, 8311915, 34689823, -22889506, -11027804, 3885264, -10222219, 20961896, 29012030, -2482695, 5480795, -9135007, -22153858, -24641550, 11115160, 14820402, -16123700, -2144417, 26024037, 34748326, -14261594, 1344657, 25564004, 6846384, -19666223, 31262548, -14846595, -12388807, 7340453, 24757875, 21557498, 29121989, 19593984, 6556125, -32091129, -8301851, -38748231, -5135262, 22891991, -15069814, -22733870, 5835273, -14037045, 3621212, 23854935, 28930792, 24397270, 1626383, 20687676, 234931, -30787883, -12390312, -18961154, -44175706, -4662420, 25885333, 29907843, -32035931, -28914605, 16911041, -18921004, -21497967, 5444904, 18821169, 5652407, 26023992, 3351897, -19548176, -168384, 18933819, 3284210, 1189818, -18563168, -8524125, 12534212, 1056057, 16078611, 21619168, 23899339, -11442225, -7247528, -14851765, 14155622, -29896052, -38754679, -9241485, -34352692, -13619213, -24934144, -653519, 16828591, -76237564, 34232428, 34189522, -46611214, 2290638, -3666797, -19871347, 5739730, 48721064, -10376774, -24587081, 32503042, -18457783, 18511495, -2219601, -4137820, 4855574, 32028228, 33240862, 8521060, -16631065, -31052879, -7491180, 36037414, -3328681, 18738334, -20218838, 10592603, -9659277, -5313072, 40705759, 9501699, -50611922, -48325555, 1161667, 20050830, 11066975, 5781951, -3595486, 25062493, 23994350, 5361930, -47863361, -5814469, -41740876, 36464591, -33973366, -15409885, -24134472, 15891533, -12183843, -23298538, 16184057, -14319845, -15225800, 52491003, -15489770, -17375580, 6434347, 15241604, 5884165, 12021993, -32157646, -8851157, 11254269, 9926004, -45736651, 33969822, 3486856, 5031202, 13312717, -37731881, 5738400, 28723061, 11628194, 714275, -4704053, -6537788, 15819802, 11240742, -2776591, 17158726, 2543253, -24481459, 29384571, -21405801, -32376585, -18955924, -7797884, 1479356, 4336904, 25200530, -37884802, -47953658, 609558, -35312888, 48288800, -32126982, 36519832, -24536720, -3046819, 29759474, 24300809, 38877047, -4180759, 10221413, -48197762, 3992212, 38216755, -50098827, 33670875, 20586799, 43211515, -11836470, -23452807, 6009203, 26601571, -16370229, 22713778, 46972743, -18754709, -37773935, 12089976, 47850412, 24889496, -41423374, 5362554, -7167611, 28098784, 40755752, 3527116, -883003, -10279820, -12190830, -6028118, -16640164, -12551635, -17291839, -9796924, -23632872, -9805414, 5200899, -1150444, 20053489, 21105041, -35036737, -44150120, 11985992, -2904950, -10174558, -18793524, -34202615, -18076982, 17157868, -15439592, 4954133, 16473491, -3137631, -17918864, 27125965, -36146114, -8422261, -30853329, 4290917, 35351079, 2285470, -45728792, -1849277, -1845021, -32309319, 10278862, -1014932, 12547811, -20411834, 19428607, 50925957, -18319755, -24840735, 30842314, -5423789, -20300899, 4772119, 27201257, -20800916, -786106, 9315402, 34127344, -30698712, 23484279, 29952905, 36458684, -11144953, -12259825, 17003988, -386102, -73005557, -6527846, -15225635, 17475815, 4041983, -17604946, 7658790, -24686045, -10329404, -8063059, -5434085, -23838238, -11470671, -9253302, -12611474, 33784360, 10429825, -898990, -36973351, 24492414, 25853157, 21059636, -17386333, 17789771, -2018025, 124449, -44474201, 61264116, 7626625, -3224277, -6597275, 9274164, -1165894, 6145230, -33475926, 45427877, -51621029, 37459231, 6702815, 8992865, -11010380, 9036257, 34344676, 53490, 9922426, -42620553, -6360713, -5799558, -4486944, -22448319, 12380211, -7771936, 7405114, -4285223, -8088458, -3559982, 18480571, -22558252, 3700995, -55684640, 5288923, 35262268, 9667982, 11497913, 8636293, 7232213, -1393894, -37423854, -31644251, -3851980, -23878239, -11454543, 685658, 34713414, -14256806, 47990150, 9472241, -4448199, 7334062, 28566808, -7092760, -12850843, 20671700, -19174432, -17075007, 55435764, -29776710, 7067612, 3125936, -28342204, -2747162, 23820092, -220280, -5882191, 7072560, 11137064, -34401327, -1930761, -3290422, 10258235, -7000522, 61637708, 5075419, -4036209, 6308054, -33144128, -27164137, 28943753, 19376007, 41132063, 11727877, 21544345, 6612100, 13572614, 900359}; + +int output_data_imag[1024] = {0, -5173739, 8732116, -9198791, 14335177, 438680, -22709701, -17845044, 46347274, -6345647, -2448769, -3536186, -11317514, -6755869, -56193258, 20510638, 36621773, 15143807, -23048336, -38525115, -34883897, 24214333, -25231715, -12107006, 713935, -26002012, 9793100, 27093766, 4897309, -15653296, 10724876, -29977588, 4309154, 23693365, -7664895, -45459513, 23194556, -2303636, 1369664, 2909709, -27032265, 20630463, -6235213, -2795181, -11657347, -56308552, -20811426, -35038296, 17912124, -14484060, -6781618, -38557643, -19148006, 35906257, 48027176, -21283279, 40736471, -11382928, 38262486, 12787192, -23033012, -8422805, -5377539, 22253959, -30745831, -29877218, -4239294, -28422500, -3618200, 13973117, 29741342, -17022267, -1957036, 8899885, 15742866, -33238888, 10084317, 26605444, 1030161, -21185160, -34935187, -16030047, 3642533, -34366997, 1826498, 29308452, -25112834, 20471937, -1180009, 37130194, -38361361, -15382227, -28458875, -10901236, 51939635, -10001075, 8415830, 14969775, -2200086, -8987923, -33459044, -19604410, 14599232, 15030263, 3116624, -240613, 35488914, -17880023, 12116931, 970002, -1645052, 11739988, -12405219, -8531371, 6280980, 43285275, 53294091, 14438956, -30709790, 3150296, -33870140, -30033796, -28257394, 2750861, 25734336, -10970839, -11661418, 44020436, 51741722, 31593825, 1747345, -20312309, -10179497, -21226148, 9835530, -9842343, -37542741, 42470495, -11301906, 11074125, 8780329, -17607802, -3312496, 13724852, 7735047, 26992838, -9180479, 32233478, -16313096, -18433286, -30525619, 28005433, -10111916, 21313758, 16044736, 12597726, -32790484, -16457884, -22200939, -18952889, -8466738, -31433357, 16965458, -2667905, 34294230, -15693435, -38503205, -27036248, 9870059, -10850678, 34292210, -41648342, -51497130, -14892223, 37945215, 8713693, -35858488, 5589150, 9267318, 8617025, -26936877, -4618667, 28945096, -18109048, 4284503, -20954012, 18336350, 8975377, 5324160, 32515341, 8257865, -12876619, 15988251, -96265292, -4176864, 2844196, 10868795, -21900938, 5968061, 1897870, -22256630, 5224738, 60085554, -16237695, -6969494, 3596058, -53074519, -18673224, 4900205, -24041184, 14133732, 25686170, 21028590, 19631795, -59800506, 14736647, 4895114, 4574152, -16549930, -50712873, 25373350, -32709009, -44358772, 58484885, 30214820, -11849460, 28322835, 21857252, -5628499, 36482875, -45328150, -30533556, 37530144, -3175589, -8391765, 20977257, -45409365, -14941794, 26381932, -17752896, -20050130, 29577848, -24457742, -51927238, -24413730, -12321691, -45195789, 30714238, -36509740, -40891318, -536372, 38490970, 37769763, -22775001, -8782034, 50315786, 8747460, -8082453, 9112167, 25470858, -9026632, -12237932, 11922939, -37462363, 30931967, 26476785, 11104819, -2942996, 36609737, -10110669, -17494763, -32857246, -22093506, -26127426, -41073536, 12327567, -10858236, -1433333, 3051905, -41817568, -25322923, 21665127, -41081131, 9433003, -33500087, 6396874, -13125160, 14694942, 33578834, 5602343, 13130115, 11729869, -3278485, -8709757, -25016094, -18683886, 6448906, 3171432, 21909223, -13641011, 44653591, 1198608, -11304099, -2542801, 32260023, 39939458, -16829798, -9366616, 63722083, -20680408, 4166791, 8554116, -19087027, -14876678, -9029718, -16314336, -5015656, -28571608, 26241701, 23027632, -8151529, 9721116, 536487, -41407616, 25405396, -22804081, 18988939, 23502922, 14160197, 17047542, 30171442, -35782940, 18122433, 7041401, -7896995, -38654097, 6224865, 9032313, -43765857, 5509349, -32164669, 15514221, -9215526, -2280056, -33678728, -5924909, -15688654, 5877933, -21068700, 33958782, -21540809, 21514861, -23099501, 12167718, 1477466, -31225530, 30547368, 34724033, -12194598, -6927380, 28757001, 3608809, 6260154, 21036639, 26307468, 6147806, 32175079, 3022892, 4585861, 13438166, -1341850, -32018696, 20165657, 10924238, 4349653, 29344316, 11808656, -38962700, 2846524, 29271928, 14628346, -1606887, 19934345, -15553962, 20620814, -15345862, 13570431, -26033484, -17323815, 19138174, -5342012, -10847049, 6212685, 36134613, -19766821, 3420438, 14880233, -7546326, -30108011, -8147370, 5736405, -28832233, 7260622, -38196573, 7983744, 39941609, 36752501, -18229998, -12591531, -5449065, -3928810, -1198627, 21680350, 27274726, -24915723, 3674016, 10314988, -43129459, -11082589, -30512620, 35820807, -22031772, 10768143, 13007038, 532791, 10880345, -18259021, -2701802, 20569560, 4152182, -13884018, 10854482, 12409669, -16238838, 13056624, -5799578, -57146386, 33718206, 21125488, -23646294, -41201403, 6564701, 12270149, 34778357, -40546139, -8501137, 39065223, 5721295, 14034699, 39589659, -490345, -26369806, -36847561, 14754701, 40726766, -29337748, -1383770, 19937687, 15436341, -396690, -16681977, 6868965, -21414293, -6831406, 15671217, 165948, -31373984, -14083491, 31088721, -7143287, -22061171, -29467733, 56712, -20509584, -78381147, 32974224, -62195634, -17486541, -28238711, -44529567, 31706075, -44738518, -25633029, 8759873, -15345780, -12994147, -21208035, -25026091, -11433931, 15909594, -15057552, 4344815, 16416258, -19924616, -25098907, -15034316, 7031513, -9625884, -35247437, 2958647, 34044834, -47596541, 30806704, 31809436, -51382701, -109428, -30027525, -2742560, -12145827, 17664073, 7117373, -26213934, 0, 26213934, -7117373, -17664073, 12145827, 2742560, 30027525, 109428, 51382701, -31809436, -30806704, 47596541, -34044834, -2958647, 35247437, 9625884, -7031513, 15034316, 25098907, 19924616, -16416258, -4344815, 15057552, -15909594, 11433931, 25026091, 21208035, 12994147, 15345780, -8759873, 25633029, 44738518, -31706075, 44529567, 28238711, 17486541, 62195634, -32974224, 78381147, 20509584, -56712, 29467733, 22061171, 7143287, -31088721, 14083491, 31373984, -165948, -15671217, 6831406, 21414293, -6868965, 16681977, 396690, -15436341, -19937687, 1383770, 29337748, -40726766, -14754701, 36847561, 26369806, 490345, -39589659, -14034699, -5721295, -39065223, 8501137, 40546139, -34778357, -12270149, -6564701, 41201403, 23646294, -21125488, -33718206, 57146386, 5799578, -13056624, 16238838, -12409669, -10854482, 13884018, -4152182, -20569560, 2701802, 18259021, -10880345, -532791, -13007038, -10768143, 22031772, -35820807, 30512620, 11082589, 43129459, -10314988, -3674016, 24915723, -27274726, -21680350, 1198627, 3928810, 5449065, 12591531, 18229998, -36752501, -39941609, -7983744, 38196573, -7260622, 28832233, -5736405, 8147370, 30108011, 7546326, -14880233, -3420438, 19766821, -36134613, -6212685, 10847049, 5342012, -19138174, 17323815, 26033484, -13570431, 15345862, -20620814, 15553962, -19934345, 1606887, -14628346, -29271928, -2846524, 38962700, -11808656, -29344316, -4349653, -10924238, -20165657, 32018696, 1341850, -13438166, -4585861, -3022892, -32175079, -6147806, -26307468, -21036639, -6260154, -3608809, -28757001, 6927380, 12194598, -34724033, -30547368, 31225530, -1477466, -12167718, 23099501, -21514861, 21540809, -33958782, 21068700, -5877933, 15688654, 5924909, 33678728, 2280056, 9215526, -15514221, 32164669, -5509349, 43765857, -9032313, -6224865, 38654097, 7896995, -7041401, -18122433, 35782940, -30171442, -17047542, -14160197, -23502922, -18988939, 22804081, -25405396, 41407616, -536487, -9721116, 8151529, -23027632, -26241701, 28571608, 5015656, 16314336, 9029718, 14876678, 19087027, -8554116, -4166791, 20680408, -63722083, 9366616, 16829798, -39939458, -32260023, 2542801, 11304099, -1198608, -44653591, 13641011, -21909223, -3171432, -6448906, 18683886, 25016094, 8709757, 3278485, -11729869, -13130115, -5602343, -33578834, -14694942, 13125160, -6396874, 33500087, -9433003, 41081131, -21665127, 25322923, 41817568, -3051905, 1433333, 10858236, -12327567, 41073536, 26127426, 22093506, 32857246, 17494763, 10110669, -36609737, 2942996, -11104819, -26476785, -30931967, 37462363, -11922939, 12237932, 9026632, -25470858, -9112167, 8082453, -8747460, -50315786, 8782034, 22775001, -37769763, -38490970, 536372, 40891318, 36509740, -30714238, 45195789, 12321691, 24413730, 51927238, 24457742, -29577848, 20050130, 17752896, -26381932, 14941794, 45409365, -20977257, 8391765, 3175589, -37530144, 30533556, 45328150, -36482875, 5628499, -21857252, -28322835, 11849460, -30214820, -58484885, 44358772, 32709009, -25373350, 50712873, 16549930, -4574152, -4895114, -14736647, 59800506, -19631795, -21028590, -25686170, -14133732, 24041184, -4900205, 18673224, 53074519, -3596058, 6969494, 16237695, -60085554, -5224738, 22256630, -1897870, -5968061, 21900938, -10868795, -2844196, 4176864, 96265292, -15988251, 12876619, -8257865, -32515341, -5324160, -8975377, -18336350, 20954012, -4284503, 18109048, -28945096, 4618667, 26936877, -8617025, -9267318, -5589150, 35858488, -8713693, -37945215, 14892223, 51497130, 41648342, -34292210, 10850678, -9870059, 27036248, 38503205, 15693435, -34294230, 2667905, -16965458, 31433357, 8466738, 18952889, 22200939, 16457884, 32790484, -12597726, -16044736, -21313758, 10111916, -28005433, 30525619, 18433286, 16313096, -32233478, 9180479, -26992838, -7735047, -13724852, 3312496, 17607802, -8780329, -11074125, 11301906, -42470495, 37542741, 9842343, -9835530, 21226148, 10179497, 20312309, -1747345, -31593825, -51741722, -44020436, 11661418, 10970839, -25734336, -2750861, 28257394, 30033796, 33870140, -3150296, 30709790, -14438956, -53294091, -43285275, -6280980, 8531371, 12405219, -11739988, 1645052, -970002, -12116931, 17880023, -35488914, 240613, -3116624, -15030263, -14599232, 19604410, 33459044, 8987923, 2200086, -14969775, -8415830, 10001075, -51939635, 10901236, 28458875, 15382227, 38361361, -37130194, 1180009, -20471937, 25112834, -29308452, -1826498, 34366997, -3642533, 16030047, 34935187, 21185160, -1030161, -26605444, -10084317, 33238888, -15742866, -8899885, 1957036, 17022267, -29741342, -13973117, 3618200, 28422500, 4239294, 29877218, 30745831, -22253959, 5377539, 8422805, 23033012, -12787192, -38262486, 11382928, -40736471, 21283279, -48027176, -35906257, 19148006, 38557643, 6781618, 14484060, -17912124, 35038296, 20811426, 56308552, 11657347, 2795181, 6235213, -20630463, 27032265, -2909709, -1369664, 2303636, -23194556, 45459513, 7664895, -23693365, -4309154, 29977588, -10724876, 15653296, -4897309, -27093766, -9793100, 26002012, -713935, 12107006, 25231715, -24214333, 34883897, 38525115, 23048336, -15143807, -36621773, -20510638, 56193258, 6755869, 11317514, 3536186, 2448769, 6345647, -46347274, 17845044, 22709701, -438680, -14335177, 9198791, -8732116, 5173739}; + +int tf_real[1024] = {1048576, 1048556, 1048497, 1048398, 1048260, 1048082, 1047865, 1047608, 1047312, 1046977, 1046602, 1046188, 1045734, 1045241, 1044709, 1044137, 1043526, 1042876, 1042186, 1041458, 1040690, 1039883, 1039036, 1038151, 1037226, 1036263, 1035260, 1034218, 1033138, 1032019, 1030860, 1029663, 1028427, 1027153, 1025840, 1024488, 1023097, 1021668, 1020201, 1018695, 1017151, 1015569, 1013948, 1012289, 1010592, 1008857, 1007084, 1005273, 1003424, 1001538, 999613, 997651, 995652, 993615, 991541, 989429, 987280, 985094, 982871, 980610, 978313, 975979, 973609, 971201, 968757, 966277, 963760, 961207, 958618, 955993, 953331, 950634, 947901, 945132, 942328, 939488, 936613, 933703, 930757, 927777, 924761, 921711, 918626, 915506, 912352, 909163, 905941, 902684, 899393, 896068, 892710, 889318, 885893, 882434, 878942, 875417, 871859, 868268, 864644, 860988, 857299, 853578, 849825, 846040, 842224, 838375, 834495, 830583, 826641, 822667, 818662, 814626, 810560, 806463, 802336, 798178, 793991, 789773, 785526, 781249, 776943, 772608, 768243, 763850, 759428, 754977, 750498, 745990, 741455, 736891, 732300, 727681, 723035, 718362, 713661, 708934, 704180, 699400, 694593, 689760, 684901, 680016, 675106, 670170, 665209, 660223, 655212, 650177, 645117, 640032, 634924, 629792, 624635, 619456, 614253, 609027, 603778, 598506, 593212, 587896, 582557, 577197, 571814, 566410, 560985, 555539, 550072, 544584, 539075, 533547, 527998, 522429, 516841, 511233, 505606, 499960, 494295, 488611, 482909, 477189, 471451, 465695, 459922, 454131, 448324, 442499, 436658, 430800, 424926, 419036, 413130, 407209, 401272, 395320, 389354, 383373, 377377, 371367, 365343, 359305, 353254, 347190, 341112, 335022, 328919, 322803, 316676, 310536, 304385, 298222, 292049, 285864, 279668, 273462, 267246, 261019, 254783, 248537, 242281, 236017, 229744, 223462, 217172, 210873, 204567, 198252, 191931, 185602, 179266, 172923, 166574, 160219, 153858, 147490, 141118, 134740, 128356, 121968, 115576, 109179, 102778, 96373, 89965, 83553, 77138, 70720, 64299, 57876, 51451, 45024, 38595, 32164, 25733, 19300, 12867, 6433, 0, -6433, -12867, -19300, -25733, -32164, -38595, -45024, -51451, -57876, -64299, -70720, -77138, -83553, -89965, -96373, -102778, -109179, -115576, -121968, -128356, -134740, -141118, -147490, -153858, -160219, -166574, -172923, -179266, -185602, -191931, -198252, -204567, -210873, -217172, -223462, -229744, -236017, -242281, -248537, -254783, -261019, -267246, -273462, -279668, -285864, -292049, -298222, -304385, -310536, -316676, -322803, -328919, -335022, -341112, -347190, -353254, -359305, -365343, -371367, -377377, -383373, -389354, -395320, -401272, -407209, -413130, -419036, -424926, -430800, -436658, -442499, -448324, -454131, -459922, -465695, -471451, -477189, -482909, -488611, -494295, -499960, -505606, -511233, -516841, -522429, -527998, -533547, -539075, -544584, -550072, -555539, -560985, -566410, -571814, -577197, -582557, -587896, -593212, -598506, -603778, -609027, -614253, -619456, -624635, -629792, -634924, -640032, -645117, -650177, -655212, -660223, -665209, -670170, -675106, -680016, -684901, -689760, -694593, -699400, -704180, -708934, -713661, -718362, -723035, -727681, -732300, -736891, -741455, -745990, -750498, -754977, -759428, -763850, -768243, -772608, -776943, -781249, -785526, -789773, -793991, -798178, -802336, -806463, -810560, -814626, -818662, -822667, -826641, -830583, -834495, -838375, -842224, -846040, -849825, -853578, -857299, -860988, -864644, -868268, -871859, -875417, -878942, -882434, -885893, -889318, -892710, -896068, -899393, -902684, -905941, -909163, -912352, -915506, -918626, -921711, -924761, -927777, -930757, -933703, -936613, -939488, -942328, -945132, -947901, -950634, -953331, -955993, -958618, -961207, -963760, -966277, -968757, -971201, -973609, -975979, -978313, -980610, -982871, -985094, -987280, -989429, -991541, -993615, -995652, -997651, -999613, -1001538, -1003424, -1005273, -1007084, -1008857, -1010592, -1012289, -1013948, -1015569, -1017151, -1018695, -1020201, -1021668, -1023097, -1024488, -1025840, -1027153, -1028427, -1029663, -1030860, -1032019, -1033138, -1034218, -1035260, -1036263, -1037226, -1038151, -1039036, -1039883, -1040690, -1041458, -1042186, -1042876, -1043526, -1044137, -1044709, -1045241, -1045734, -1046188, -1046602, -1046977, -1047312, -1047608, -1047865, -1048082, -1048260, -1048398, -1048497, -1048556, -1048576, -1048556, -1048497, -1048398, -1048260, -1048082, -1047865, -1047608, -1047312, -1046977, -1046602, -1046188, -1045734, -1045241, -1044709, -1044137, -1043526, -1042876, -1042186, -1041458, -1040690, -1039883, -1039036, -1038151, -1037226, -1036263, -1035260, -1034218, -1033138, -1032019, -1030860, -1029663, -1028427, -1027153, -1025840, -1024488, -1023097, -1021668, -1020201, -1018695, -1017151, -1015569, -1013948, -1012289, -1010592, -1008857, -1007084, -1005273, -1003424, -1001538, -999613, -997651, -995652, -993615, -991541, -989429, -987280, -985094, -982871, -980610, -978313, -975979, -973609, -971201, -968757, -966277, -963760, -961207, -958618, -955993, -953331, -950634, -947901, -945132, -942328, -939488, -936613, -933703, -930757, -927777, -924761, -921711, -918626, -915506, -912352, -909163, -905941, -902684, -899393, -896068, -892710, -889318, -885893, -882434, -878942, -875417, -871859, -868268, -864644, -860988, -857299, -853578, -849825, -846040, -842224, -838375, -834495, -830583, -826641, -822667, -818662, -814626, -810560, -806463, -802336, -798178, -793991, -789773, -785526, -781249, -776943, -772608, -768243, -763850, -759428, -754977, -750498, -745990, -741455, -736891, -732300, -727681, -723035, -718362, -713661, -708934, -704180, -699400, -694593, -689760, -684901, -680016, -675106, -670170, -665209, -660223, -655212, -650177, -645117, -640032, -634924, -629792, -624635, -619456, -614253, -609027, -603778, -598506, -593212, -587896, -582557, -577197, -571814, -566410, -560985, -555539, -550072, -544584, -539075, -533547, -527998, -522429, -516841, -511233, -505606, -499960, -494295, -488611, -482909, -477189, -471451, -465695, -459922, -454131, -448324, -442499, -436658, -430800, -424926, -419036, -413130, -407209, -401272, -395320, -389354, -383373, -377377, -371367, -365343, -359305, -353254, -347190, -341112, -335022, -328919, -322803, -316676, -310536, -304385, -298222, -292049, -285864, -279668, -273462, -267246, -261019, -254783, -248537, -242281, -236017, -229744, -223462, -217172, -210873, -204567, -198252, -191931, -185602, -179266, -172923, -166574, -160219, -153858, -147490, -141118, -134740, -128356, -121968, -115576, -109179, -102778, -96373, -89965, -83553, -77138, -70720, -64299, -57876, -51451, -45024, -38595, -32164, -25733, -19300, -12867, -6433, 0, 6433, 12867, 19300, 25733, 32164, 38595, 45024, 51451, 57876, 64299, 70720, 77138, 83553, 89965, 96373, 102778, 109179, 115576, 121968, 128356, 134740, 141118, 147490, 153858, 160219, 166574, 172923, 179266, 185602, 191931, 198252, 204567, 210873, 217172, 223462, 229744, 236017, 242281, 248537, 254783, 261019, 267246, 273462, 279668, 285864, 292049, 298222, 304385, 310536, 316676, 322803, 328919, 335022, 341112, 347190, 353254, 359305, 365343, 371367, 377377, 383373, 389354, 395320, 401272, 407209, 413130, 419036, 424926, 430800, 436658, 442499, 448324, 454131, 459922, 465695, 471451, 477189, 482909, 488611, 494295, 499960, 505606, 511233, 516841, 522429, 527998, 533547, 539075, 544584, 550072, 555539, 560985, 566410, 571814, 577197, 582557, 587896, 593212, 598506, 603778, 609027, 614253, 619456, 624635, 629792, 634924, 640032, 645117, 650177, 655212, 660223, 665209, 670170, 675106, 680016, 684901, 689760, 694593, 699400, 704180, 708934, 713661, 718362, 723035, 727681, 732300, 736891, 741455, 745990, 750498, 754977, 759428, 763850, 768243, 772608, 776943, 781249, 785526, 789773, 793991, 798178, 802336, 806463, 810560, 814626, 818662, 822667, 826641, 830583, 834495, 838375, 842224, 846040, 849825, 853578, 857299, 860988, 864644, 868268, 871859, 875417, 878942, 882434, 885893, 889318, 892710, 896068, 899393, 902684, 905941, 909163, 912352, 915506, 918626, 921711, 924761, 927777, 930757, 933703, 936613, 939488, 942328, 945132, 947901, 950634, 953331, 955993, 958618, 961207, 963760, 966277, 968757, 971201, 973609, 975979, 978313, 980610, 982871, 985094, 987280, 989429, 991541, 993615, 995652, 997651, 999613, 1001538, 1003424, 1005273, 1007084, 1008857, 1010592, 1012289, 1013948, 1015569, 1017151, 1018695, 1020201, 1021668, 1023097, 1024488, 1025840, 1027153, 1028427, 1029663, 1030860, 1032019, 1033138, 1034218, 1035260, 1036263, 1037226, 1038151, 1039036, 1039883, 1040690, 1041458, 1042186, 1042876, 1043526, 1044137, 1044709, 1045241, 1045734, 1046188, 1046602, 1046977, 1047312, 1047608, 1047865, 1048082, 1048260, 1048398, 1048497, 1048556}; + +int tf_imag[1024] = {0, -6433, -12867, -19300, -25733, -32164, -38595, -45024, -51451, -57876, -64299, -70720, -77138, -83553, -89965, -96373, -102778, -109179, -115576, -121968, -128356, -134740, -141118, -147490, -153858, -160219, -166574, -172923, -179266, -185602, -191931, -198252, -204567, -210873, -217172, -223462, -229744, -236017, -242281, -248537, -254783, -261019, -267246, -273462, -279668, -285864, -292049, -298222, -304385, -310536, -316676, -322803, -328919, -335022, -341112, -347190, -353254, -359305, -365343, -371367, -377377, -383373, -389354, -395320, -401272, -407209, -413130, -419036, -424926, -430800, -436658, -442499, -448324, -454131, -459922, -465695, -471451, -477189, -482909, -488611, -494295, -499960, -505606, -511233, -516841, -522429, -527998, -533547, -539075, -544584, -550072, -555539, -560985, -566410, -571814, -577197, -582557, -587896, -593212, -598506, -603778, -609027, -614253, -619456, -624635, -629792, -634924, -640032, -645117, -650177, -655212, -660223, -665209, -670170, -675106, -680016, -684901, -689760, -694593, -699400, -704180, -708934, -713661, -718362, -723035, -727681, -732300, -736891, -741455, -745990, -750498, -754977, -759428, -763850, -768243, -772608, -776943, -781249, -785526, -789773, -793991, -798178, -802336, -806463, -810560, -814626, -818662, -822667, -826641, -830583, -834495, -838375, -842224, -846040, -849825, -853578, -857299, -860988, -864644, -868268, -871859, -875417, -878942, -882434, -885893, -889318, -892710, -896068, -899393, -902684, -905941, -909163, -912352, -915506, -918626, -921711, -924761, -927777, -930757, -933703, -936613, -939488, -942328, -945132, -947901, -950634, -953331, -955993, -958618, -961207, -963760, -966277, -968757, -971201, -973609, -975979, -978313, -980610, -982871, -985094, -987280, -989429, -991541, -993615, -995652, -997651, -999613, -1001538, -1003424, -1005273, -1007084, -1008857, -1010592, -1012289, -1013948, -1015569, -1017151, -1018695, -1020201, -1021668, -1023097, -1024488, -1025840, -1027153, -1028427, -1029663, -1030860, -1032019, -1033138, -1034218, -1035260, -1036263, -1037226, -1038151, -1039036, -1039883, -1040690, -1041458, -1042186, -1042876, -1043526, -1044137, -1044709, -1045241, -1045734, -1046188, -1046602, -1046977, -1047312, -1047608, -1047865, -1048082, -1048260, -1048398, -1048497, -1048556, -1048576, -1048556, -1048497, -1048398, -1048260, -1048082, -1047865, -1047608, -1047312, -1046977, -1046602, -1046188, -1045734, -1045241, -1044709, -1044137, -1043526, -1042876, -1042186, -1041458, -1040690, -1039883, -1039036, -1038151, -1037226, -1036263, -1035260, -1034218, -1033138, -1032019, -1030860, -1029663, -1028427, -1027153, -1025840, -1024488, -1023097, -1021668, -1020201, -1018695, -1017151, -1015569, -1013948, -1012289, -1010592, -1008857, -1007084, -1005273, -1003424, -1001538, -999613, -997651, -995652, -993615, -991541, -989429, -987280, -985094, -982871, -980610, -978313, -975979, -973609, -971201, -968757, -966277, -963760, -961207, -958618, -955993, -953331, -950634, -947901, -945132, -942328, -939488, -936613, -933703, -930757, -927777, -924761, -921711, -918626, -915506, -912352, -909163, -905941, -902684, -899393, -896068, -892710, -889318, -885893, -882434, -878942, -875417, -871859, -868268, -864644, -860988, -857299, -853578, -849825, -846040, -842224, -838375, -834495, -830583, -826641, -822667, -818662, -814626, -810560, -806463, -802336, -798178, -793991, -789773, -785526, -781249, -776943, -772608, -768243, -763850, -759428, -754977, -750498, -745990, -741455, -736891, -732300, -727681, -723035, -718362, -713661, -708934, -704180, -699400, -694593, -689760, -684901, -680016, -675106, -670170, -665209, -660223, -655212, -650177, -645117, -640032, -634924, -629792, -624635, -619456, -614253, -609027, -603778, -598506, -593212, -587896, -582557, -577197, -571814, -566410, -560985, -555539, -550072, -544584, -539075, -533547, -527998, -522429, -516841, -511233, -505606, -499960, -494295, -488611, -482909, -477189, -471451, -465695, -459922, -454131, -448324, -442499, -436658, -430800, -424926, -419036, -413130, -407209, -401272, -395320, -389354, -383373, -377377, -371367, -365343, -359305, -353254, -347190, -341112, -335022, -328919, -322803, -316676, -310536, -304385, -298222, -292049, -285864, -279668, -273462, -267246, -261019, -254783, -248537, -242281, -236017, -229744, -223462, -217172, -210873, -204567, -198252, -191931, -185602, -179266, -172923, -166574, -160219, -153858, -147490, -141118, -134740, -128356, -121968, -115576, -109179, -102778, -96373, -89965, -83553, -77138, -70720, -64299, -57876, -51451, -45024, -38595, -32164, -25733, -19300, -12867, -6433, 0, 6433, 12867, 19300, 25733, 32164, 38595, 45024, 51451, 57876, 64299, 70720, 77138, 83553, 89965, 96373, 102778, 109179, 115576, 121968, 128356, 134740, 141118, 147490, 153858, 160219, 166574, 172923, 179266, 185602, 191931, 198252, 204567, 210873, 217172, 223462, 229744, 236017, 242281, 248537, 254783, 261019, 267246, 273462, 279668, 285864, 292049, 298222, 304385, 310536, 316676, 322803, 328919, 335022, 341112, 347190, 353254, 359305, 365343, 371367, 377377, 383373, 389354, 395320, 401272, 407209, 413130, 419036, 424926, 430800, 436658, 442499, 448324, 454131, 459922, 465695, 471451, 477189, 482909, 488611, 494295, 499960, 505606, 511233, 516841, 522429, 527998, 533547, 539075, 544584, 550072, 555539, 560985, 566410, 571814, 577197, 582557, 587896, 593212, 598506, 603778, 609027, 614253, 619456, 624635, 629792, 634924, 640032, 645117, 650177, 655212, 660223, 665209, 670170, 675106, 680016, 684901, 689760, 694593, 699400, 704180, 708934, 713661, 718362, 723035, 727681, 732300, 736891, 741455, 745990, 750498, 754977, 759428, 763850, 768243, 772608, 776943, 781249, 785526, 789773, 793991, 798178, 802336, 806463, 810560, 814626, 818662, 822667, 826641, 830583, 834495, 838375, 842224, 846040, 849825, 853578, 857299, 860988, 864644, 868268, 871859, 875417, 878942, 882434, 885893, 889318, 892710, 896068, 899393, 902684, 905941, 909163, 912352, 915506, 918626, 921711, 924761, 927777, 930757, 933703, 936613, 939488, 942328, 945132, 947901, 950634, 953331, 955993, 958618, 961207, 963760, 966277, 968757, 971201, 973609, 975979, 978313, 980610, 982871, 985094, 987280, 989429, 991541, 993615, 995652, 997651, 999613, 1001538, 1003424, 1005273, 1007084, 1008857, 1010592, 1012289, 1013948, 1015569, 1017151, 1018695, 1020201, 1021668, 1023097, 1024488, 1025840, 1027153, 1028427, 1029663, 1030860, 1032019, 1033138, 1034218, 1035260, 1036263, 1037226, 1038151, 1039036, 1039883, 1040690, 1041458, 1042186, 1042876, 1043526, 1044137, 1044709, 1045241, 1045734, 1046188, 1046602, 1046977, 1047312, 1047608, 1047865, 1048082, 1048260, 1048398, 1048497, 1048556, 1048576, 1048556, 1048497, 1048398, 1048260, 1048082, 1047865, 1047608, 1047312, 1046977, 1046602, 1046188, 1045734, 1045241, 1044709, 1044137, 1043526, 1042876, 1042186, 1041458, 1040690, 1039883, 1039036, 1038151, 1037226, 1036263, 1035260, 1034218, 1033138, 1032019, 1030860, 1029663, 1028427, 1027153, 1025840, 1024488, 1023097, 1021668, 1020201, 1018695, 1017151, 1015569, 1013948, 1012289, 1010592, 1008857, 1007084, 1005273, 1003424, 1001538, 999613, 997651, 995652, 993615, 991541, 989429, 987280, 985094, 982871, 980610, 978313, 975979, 973609, 971201, 968757, 966277, 963760, 961207, 958618, 955993, 953331, 950634, 947901, 945132, 942328, 939488, 936613, 933703, 930757, 927777, 924761, 921711, 918626, 915506, 912352, 909163, 905941, 902684, 899393, 896068, 892710, 889318, 885893, 882434, 878942, 875417, 871859, 868268, 864644, 860988, 857299, 853578, 849825, 846040, 842224, 838375, 834495, 830583, 826641, 822667, 818662, 814626, 810560, 806463, 802336, 798178, 793991, 789773, 785526, 781249, 776943, 772608, 768243, 763850, 759428, 754977, 750498, 745990, 741455, 736891, 732300, 727681, 723035, 718362, 713661, 708934, 704180, 699400, 694593, 689760, 684901, 680016, 675106, 670170, 665209, 660223, 655212, 650177, 645117, 640032, 634924, 629792, 624635, 619456, 614253, 609027, 603778, 598506, 593212, 587896, 582557, 577197, 571814, 566410, 560985, 555539, 550072, 544584, 539075, 533547, 527998, 522429, 516841, 511233, 505606, 499960, 494295, 488611, 482909, 477189, 471451, 465695, 459922, 454131, 448324, 442499, 436658, 430800, 424926, 419036, 413130, 407209, 401272, 395320, 389354, 383373, 377377, 371367, 365343, 359305, 353254, 347190, 341112, 335022, 328919, 322803, 316676, 310536, 304385, 298222, 292049, 285864, 279668, 273462, 267246, 261019, 254783, 248537, 242281, 236017, 229744, 223462, 217172, 210873, 204567, 198252, 191931, 185602, 179266, 172923, 166574, 160219, 153858, 147490, 141118, 134740, 128356, 121968, 115576, 109179, 102778, 96373, 89965, 83553, 77138, 70720, 64299, 57876, 51451, 45024, 38595, 32164, 25733, 19300, 12867, 6433}; + diff --git a/benchmarks/vec-fft/vec-fft_main.c b/benchmarks/vec-fft/vec-fft_main.c new file mode 100644 index 0000000..db4997f --- /dev/null +++ b/benchmarks/vec-fft/vec-fft_main.c @@ -0,0 +1,300 @@ +// ************************************************************************* +// multiply filter bencmark +// ------------------------------------------------------------------------- +// +// This benchmark tests the software multiply implemenation. The +// input data (and reference data) should be generated using the +// multiply_gendata.pl perl script and dumped to a file named +// dataset1.h You should not change anything except the +// HOST_DEBUG and VERIFY macros for your timing run. + +#include "vec-fft.h" + +//-------------------------------------------------------------------------- +// Macros + +// Set HOST_DEBUG to 1 if you are going to compile this for a host +// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG +// to 0 if you are compiling with the smips-gcc toolchain. + +#ifndef HOST_DEBUG +#define HOST_DEBUG 0 +#endif + +// Set PREALLOCATE to 1 if you want to preallocate the benchmark +// function before starting stats. If you have instruction/data +// caches and you don't want to count the overhead of misses, then +// you will need to use preallocation. + +#ifndef PREALLOCATE +#define PREALLOCATE 0 +#endif + +// Set VERIFY to 1 if you want the program to check that the sort +// function returns the right answer. When you are doing your +// benchmarking you should set this to 0 so that the verification +// is not included in your timing. + +#ifndef VERIFY +#define VERIFY 1 +#endif + +// Set SET_STATS to 1 if you want to carve out the piece that actually +// does the computation. + +#ifndef SET_STATS +#define SET_STATS 0 +#endif + +// Set MINIMAL to 1 if you want to run the core FFT kernel without +// any instrumentation or warm-up. +#ifndef MINIMAL +#define MINIMAL 1 +#endif + +//-------------------------------------------------------------------------- +// Platform Specific Includes + +#if HOST_DEBUG + #include + #include +#else +void printstr(const char*); +void exit(); +#endif + + +//-------------------------------------------------------------------------- +// Input/Reference Data + +#include "fft_const.h" + +//-------------------------------------------------------------------------- +// Helper functions + +#if !MINIMAL + +void setup_input(int n, fftval_t in_real[], fftval_t in_imag[]) +{ + int i; + for(i=0; i < n; i++) { + in_real[i] = input_data_real[i]; + in_imag[i] = input_data_imag[i]; + } +} +void setup_warm_tf(int n, fftval_t in_real[], fftval_t in_imag[]) +{ + int i; + for(i=0; i < n; i++) { + in_real[i] = tf_real[i]; + in_imag[i] = tf_imag[i]; + } +} + +fftval_t calculate_error( int n, const fftval_t test_real[], const fftval_t test_imag[]) +{ + fftval_t current_max = 0; + printf("idx, real expected, real observed, imag expected, imag observed %d\n", 0); + +#if defined(FFT_FIXED) + for(int i = 0; i < n; i++) + { + const double scale = 1 << FIX_PT; + const double real_diff = (test_real[i] - output_data_real[i])/scale; + const double imag_diff = (test_imag[i] - output_data_imag[i])/scale; + + const double i_sq_error = real_diff*real_diff + imag_diff*imag_diff; + if(i_sq_error > current_max) { + printf("i = %d, current error: %d\n", i, (long)current_max); + current_max = i_sq_error; + } + } +#elif defined(FFT_FLOATING) + fftval_t real_expect = 0.0; + fftval_t imag_expect = 0.0; + for(int i = 0; i < n; i++) + { + /* TODO: Fix error caculation for half precision */ + const fftval_t real_diff = (test_real[i] - output_data_real[i]); + const fftval_t imag_diff = (test_imag[i] - output_data_imag[i]); + fftval_t i_sq_error = real_diff*real_diff + imag_diff*imag_diff; + +#if 0 + long tr = (long)(test_real[i] * 1000000000); + long ti = (long)(test_imag[i] * 1000000000); + long er = (long)(output_data_real[i] * 1000000000); + long ei = (long)(output_data_imag[i] * 1000000000); + + printf("i = %d, expected (%d,%d) and got (%d,%d), diff (%d,%d)\n", + i, + er, ei, + tr, ti, + er-tr, ei-ti); +#endif + +#if 1 + fftbit_t tr, ti, er, ei; +#ifdef FP_HALF + tr = test_real[i]; + ti = test_imag[i]; + er = output_data_real[i]; + ei = output_data_imag[i]; +#else + union bits { + fftval_t v; + fftbit_t u; + } bits; + bits.v = test_real[i]; tr = bits.u; + bits.v = test_imag[i]; ti = bits.u; + bits.v = output_data_real[i]; er = bits.u; + bits.v = output_data_imag[i]; ei = bits.u; +#endif + printf("%d: %d %d %d %d\n", i, er, tr, ei, ti); + // printf("%4d\t" FFT_PRI "\t" FFT_PRI "\t" FFT_PRI "\t" FFT_PRI "\n", + // i, er, tr, ei, ti); +#endif + +#if 0 + if(i_sq_error > current_max) { + printf("i = %d, max error (ppb): %ld\n", i, (long)(current_max * 1000000000)); + current_max = i_sq_error; + real_expect = output_data_real[i]; + imag_expect = output_data_imag[i]; + } +#endif + } +/* + printf("real expected: %d\n", (long)(real_expect)); + printf("imag expected: %d\n", (long)(imag_expect)); +*/ +#endif + + return current_max; +} + +void finishTest( double max_sq_error, long long num_cycles, long long num_retired) +{ + int passed = max_sq_error < 10e-8; + + if( passed ) printstr("*** PASSED ***"); + else printstr("*** FAILED ***"); + + printf(" (num_cycles = %ld, num_inst_retired = %ld)\n", num_cycles, num_retired); + + passed = passed ? 1 : 2; // if it passed, return 1 + + exit(); +} + +void setStats( int enable ) +{ +#if ( !HOST_DEBUG && SET_STATS ) + //asm( "mtpcr %0, cr10" : : "r" (enable) ); +#endif +} + +long long getCycles() +{ + long long cycles = 1337; +#if ( !HOST_DEBUG && SET_STATS ) + __asm__ __volatile__( "rdcycle %0" : "=r" (cycles) ); +#endif + return cycles; +} + +long long getInstRetired() +{ + long long inst_retired = 1338; +#if ( !HOST_DEBUG && SET_STATS ) + __asm__ __volatile__( "rdinstret %0" : "=r" (inst_retired) ); +#endif + return inst_retired; +} + +#endif /* !MINIMAL */ + +//-------------------------------------------------------------------------- +// Main +#define HWACHA_RADIX 2 + +#ifdef DATA_IN_UNPERMUTED +void permute(fftval_t workspace_real[], fftval_t workspace_imag[]) +{ + const int logradix = log2down(HWACHA_RADIX); + const int term_mask = HWACHA_RADIX-1; + const int num_term = log2down(FFT_SIZE)/logradix; + for(int i = 0; i < FFT_SIZE; i++) + { + // Get permuted address + int i_left = i; + int permuted = 0; + for(int cur_fft_size=HWACHA_RADIX; cur_fft_size <= FFT_SIZE; cur_fft_size = cur_fft_size << logradix) + { + permuted = (permuted << logradix) | (i_left & term_mask); + i_left = i_left >> logradix; + } + // If addresses are different and i < permuted (so we only do permutation once) + if(i < permuted) + { + fftval_t t = workspace_real[i]; + fftval_t u = workspace_imag[i]; + workspace_real[i] = workspace_real[permuted]; + workspace_imag[i] = workspace_imag[permuted]; + workspace_real[permuted] = t; + workspace_imag[permuted] = u; + } + } +} +#endif /* DATA_IN_UNPERMUTED */ + +#if MINIMAL + +int main(void) +{ +#ifdef DATA_IN_UNPERMUTED + permute(input_data_real, input_data_imag); +#endif + fft(input_data_real, input_data_imag, tf_real, tf_imag); +// calculate_error(FFT_SIZE, input_data_real, input_data_imag); + exit(); +} + +#else /* !MINIMAL */ + +int main(void) +{ + static fftval_t workspace_real[FFT_SIZE]; + static fftval_t workspace_imag[FFT_SIZE]; + static fftval_t warm_tf_real[FFT_SIZE]; + static fftval_t warm_tf_imag[FFT_SIZE]; + setup_input(FFT_SIZE, workspace_real, workspace_imag); + setup_warm_tf(FFT_SIZE, warm_tf_real, warm_tf_imag); + +#if PREALLOCATE + fft(workspace_real, workspace_imag, warm_tf_real, warm_tf_imag); + setup_input(FFT_SIZE, workspace_real, workspace_imag); +#endif + + long long start_cycles, start_retired, stop_cycles, stop_retired; + start_cycles = getCycles(); + start_retired = getInstRetired(); + +#ifdef DATA_IN_UNPERMUTED + permute(workspace_real, workspace_imag); +#endif + setStats(1); + fft(workspace_real, workspace_imag, warm_tf_real, warm_tf_imag); + setStats(0); + + stop_cycles = getCycles(); + stop_retired = getInstRetired(); + long long num_cycles = stop_cycles - start_cycles; + long long num_retired = stop_retired - start_retired; + + const double max_sq_error = calculate_error(FFT_SIZE, workspace_real, workspace_imag); + + // Check the results + finishTest(max_sq_error, num_cycles, num_retired); +} + +#endif /* MINIMAL */ diff --git a/benchmarks/vec-fft/vec-vfft.S b/benchmarks/vec-fft/vec-vfft.S new file mode 100644 index 0000000..1e6b992 --- /dev/null +++ b/benchmarks/vec-fft/vec-vfft.S @@ -0,0 +1,243 @@ + .text + .align 2 + +#include "fft_const.h" + +#if defined(FFT_FIXED) + #define PTR_SHIFT 2 + #define PTR_SIZE 4 + + #define DATA_LOAD lw + #define DATA_STORE sw + + #define FFT_MUL mul + #define FFT_ADD add + #define FFT_SUB sub + + #define REG0 x3 + #define REG1 x4 + #define REG2 x5 + #define REG3 x6 + #define REG4 x7 + #define REG5 x8 +#elif defined(FFT_FLOATING) + #if defined(FP_HALF) + #define PTR_SHIFT 1 + #define PTR_SIZE 2 + + #define DATA_LOAD flh + #define DATA_STORE fsh + + #define FFT_MUL fmul.h + #define FFT_ADD fadd.h + #define FFT_SUB fsub.h + #elif defined(FP_SINGLE) + #define PTR_SHIFT 2 + #define PTR_SIZE 4 + + #define DATA_LOAD flw + #define DATA_STORE fsw + + #define FFT_MUL fmul.s + #define FFT_ADD fadd.s + #define FFT_SUB fsub.s + #elif defined(FP_DOUBLE) + #define PTR_SHIFT 3 + #define PTR_SIZE 8 + + #define DATA_LOAD fld + #define DATA_STORE fsd + + #define FFT_MUL fmul.d + #define FFT_ADD fadd.d + #define FFT_SUB fsub.d + #endif + + #define REG0 f0 + #define REG1 f1 + #define REG2 f2 + #define REG3 f3 + #define REG4 f4 + #define REG5 f5 +#else + #error FFT_FIXED or FFT_FLOATING not defined +#endif + + .globl vf_test +vf_test: + utidx x2 + add x1, x1, x2 + add x1, x1, x1 + stop + + .globl vf_fft_init +vf_fft_init: +# IN: +# x1: lane start (utidx=0 actually has this pos due to stripmining) +# x2: bit mask to select FFT block from op idx +# x3: bit mask to select operand in FFT block from op idx +# x4: necessary shift to adjust TF appropriately ( REMOVED ) +# x5: half the current FFT size (add to get the second op) +# OUT: +# x1: Has the first operand pos = (opid & i_x2) << 1 + (opid & i_x3) +# x2: Has the second operand pos = o_x1 + i_x5 +# x3: Has the twiddle factor pos = (opid & i_x3) << i_x4 + utidx x6 + add x6, x1, x6 # x6 <= opid + and x2, x2, x6 # x2 <= opid & i_x2 + and x3, x3, x6 # x3 <= opid & i_x3 + slli x2, x2, 1 # x2 <= (opid & i_x2) << 1 + + add x1, x2, x3 # x1 is now the proper result + add x2, x1, x5 # x2 is now the proper result + sll x3, x3, x4 + + stop + + .globl vf_fft_scale +vf_fft_scale: +# IN: +# x1: Has the first operand pos (reused) +# x2: Has the second operand pos (reused) +# x3: Has the twiddle factor pos (reused) +# x4: Has the tf real ptr +# x5: Has the tf imag ptr +# x6: Has the workspace real ptr +# x7: Has the workspace imag ptr +# x8: Has the fixed point shift ( REMOVED ) +# OUT: +# x1: Has the first operand offset = i_x1 << 3 +# x2: Has the second operand offset = i_x2 << 3 +# x3: Has the scale factor real +# x4: Has the scale factor imag + # Convert positions into actual memory offsets from table start + slli x1, x1, PTR_SHIFT # x1 <= i_x1 << 3 (proper result) + slli x2, x2, PTR_SHIFT # x2 <= i_x2 << 3 (proper result) + slli x3, x3, PTR_SHIFT # x3 <= i_x3 << 3 (tf offset) + + # Compute memory locations + add x4, x4, x3 # x4 <= load address for tf real + add x5, x5, x3 # x5 <= load address for tf imag + add x6, x6, x2 # x6 <= load address for op2 real + add x7, x7, x2 # x7 <= load address for op2 imag + + # Actually read memory + DATA_LOAD REG1, 0(x4) # tf real (a) + DATA_LOAD REG2, 0(x5) # tf imag (bi) + DATA_LOAD REG3, 0(x6) # op2 real (c) + DATA_LOAD REG4, 0(x7) # op2 imag (di) + + # Do the math using 3 multiplies + FFT_ADD REG0, REG1, REG2 # REG0 <= a + b + FFT_SUB REG2, REG2, REG1 # REG2 <= b - a + FFT_MUL REG0, REG0, REG4 # REG0 <= (a+b)d +#ifdef FFT_FIXED + sra REG0, REG0, REG5 # DO NOT SHIFT FOR FLOATING +#endif + FFT_MUL REG2, REG2, REG3 # REG2 <= (b-a)c +#ifdef FFT_FIXED + sra REG2, REG2, REG5 # DO NOT SHIFT FOR FLOATING +#endif + FFT_ADD REG3, REG3, REG4 # REG3 <= c + d + FFT_MUL REG4, REG1, REG3 # REG4 <= a(c+d) +#ifdef FFT_FIXED + sra REG4, REG4, REG5 # DO NOT SHIFT FOR FLOATING +#endif + + # Prepare final result + FFT_SUB REG0, REG4, REG0 # REG0 <= a(c+d) - (a+b)d (scale real) + FFT_ADD REG1, REG4, REG2 # REG1 <= a(c+d) + (b-a)c (scale imag) + + stop +/* + # Four multiply version + # Do the multiplications (a+bi)(c+di) needs ac ad bc bd + mul x3, x4, x6 # x3 <= ac + mul x4, x4, x7 # x4 <= adi + mul x6, x5, x6 # x6 <= bc + mul x5, x5, x7 # x5 <= bdi + sra x3, x3, x8 # These 4 shifts make sure the fixed pt properly aligned + sra x4, x4, x8 + sra x5, x5, x8 + sra x6, x6, x8 + + # Do the additions (ac - bd) and (bc + ad) + sub x3, x3, x5 # x3 <= ac - bd (proper result) + add x4, x4, x6 # x4 <= bc + ad (proper result) +*/ + + .globl vf_fft_exec +vf_fft_exec: +# IN: +# x1: Has the first operand offset (reused) +# x2: Has the second operand offset (reused) +# x3: Has the scale factor real (reused) +# x4: Has the scale factor imag (reused) +# x5: Has the workspace real ptr +# x6: Has the workspace imag ptr +# OUT: +# x1: Has the first operand offset (carry) +# x2: Has the second operand offset (carry) +# x5: Has the first result real +# x6: Has the first result imag +# x7: Has the second result real +# x8: Has the second result imag + # Compute first operand memory locations + add x5, x5, x1 # x5 <= load address for op1 real + add x6, x6, x1 # x6 <= load address for op1 imag + + #actually read memory + DATA_LOAD REG2, 0(x5) # op1 real + DATA_LOAD REG3, 0(x6) # op1 imag + + # Do the add/subs (res1=op1+scale), (res2=op1-scale) + FFT_SUB REG4, REG2, REG0 # res2 real + FFT_SUB REG5, REG3, REG1 # res2 imag + FFT_ADD REG2, REG2, REG0 # res1 real + FFT_ADD REG3, REG3, REG1 # res1 imag + + stop + + .globl vf_fft_store1 +vf_fft_store1: +# IN: +# x1: Has the first operand offset (reused) +# x2: Has the second operand offset (reused) +# x3: Has the workspace real ptr +# x4: Has the workspace imag ptr +# x5: Has the first result real (reused) +# x6: Has the first result imag (reused) +# x7: Has the second result real (reused) +# x8: Has the second result imag (reused) +# OUT: +# x2: Has the second operand offset (carry) +# x7: Has the second result real (carry) +# x8: Has the second result imag (carry) + # Compute first result memory locations + add x3, x3, x1 + add x4, x4, x1 + + # actually write memory + DATA_STORE REG2, 0(x3) + DATA_STORE REG3, 0(x4) + + stop + + .globl vf_fft_store2 +vf_fft_store2: +# IN: +# x2: Has the second operand offset +# x3: Has the workspace real ptr +# x4: Has the workspace imag ptr +# x7: Has the second result real +# x8: Has the second result imag +# OUT: (none) + # Compute second result memory locations + add x3, x3, x2 + add x4, x4, x2 + + # actually write memory + DATA_STORE REG4, 0(x3) + DATA_STORE REG5, 0(x4) + + stop diff --git a/benchmarks/vec-matmul/vec_matmul_main.c b/benchmarks/vec-matmul/vec_matmul_main.c index 5de377e..6613902 100644 --- a/benchmarks/vec-matmul/vec_matmul_main.c +++ b/benchmarks/vec-matmul/vec_matmul_main.c @@ -5,13 +5,9 @@ // This benchmark multiplies two 2-D arrays together and writes the results to // a third vector. The input data (and reference data) should be generated // using the matmul_gendata.pl perl script and dumped to a file named -// dataset.h. The riscv-gcc toolchain does not support system calls so printf's -// can only be used on a host system, not on the riscv-v processor simulator -// itself. -// -// HOWEVER: printstr() and printhex() are provided, for a primitive form of -// printing strings and hexadecimal values to stdout. +// dataset.h. +#include "util.h" // Choose which implementation you wish to test... but leave only one on! // (only the first one will be executed). @@ -19,45 +15,6 @@ //#define SCALAR_ASM #define VT_ASM -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif - -//-------------------------------------------------------------------------- -// Host Platform Includes - -#if HOST_DEBUG - #include - #include -#else -void printstr(const char*); -void exit(); -#endif - - //-------------------------------------------------------------------------- // Input/Reference Data @@ -86,18 +43,6 @@ int verify( int n, float test[], float correct[] ) return 1; } -#if HOST_DEBUG -void printArray( char name[], int n, float arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %03.2f ", arr[i] ); - printf( "\n" ); -} -#endif - - void finishTest( int correct, long long num_cycles, long long num_retired ) { int toHostValue = correct; diff --git a/benchmarks/vec-vvadd/vec_vvadd_main.c b/benchmarks/vec-vvadd/vec_vvadd_main.c index c08e41a..850bec6 100644 --- a/benchmarks/vec-vvadd/vec_vvadd_main.c +++ b/benchmarks/vec-vvadd/vec_vvadd_main.c @@ -4,13 +4,7 @@ // // This benchmark uses adds to vectors and writes the results to a third // vector. The input data (and reference data) should be generated using the -// vvadd_gendata.pl perl script and dumped to a file named dataset.h. The -// riscv-gcc toolchain does not support system calls so printf's can only be -// used on a host system, not on the riscv-v processor simulator itself. -// -// HOWEVER: printstr() and printhex() are provided, for a primitive form of -// printing strings and hexadecimal values to stdout. - +// vvadd_gendata.pl perl script and dumped to a file named dataset.h. // Choose which implementation you wish to test... but leave only one on! // (only the first one will be executed). @@ -18,45 +12,6 @@ //#define SCALAR_ASM #define VT_ASM -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif - -//-------------------------------------------------------------------------- -// Platform Specific Includes - -#if HOST_DEBUG - #include - #include -#else -void printstr(const char*); -void exit(); -#endif - - //-------------------------------------------------------------------------- // Input/Reference Data @@ -86,18 +41,6 @@ int verify( int n, float test[], float correct[] ) } return 1; } - -#if HOST_DEBUG -void printArray( char name[], int n, float arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %03.2f ", arr[i] ); - printf( "\n" ); -} -#endif - void finishTest( int correct, long long num_cycles, long long num_retired ) { diff --git a/benchmarks/vvadd/bmark.mk b/benchmarks/vvadd/bmark.mk index d03cb96..5ab99de 100644 --- a/benchmarks/vvadd/bmark.mk +++ b/benchmarks/vvadd/bmark.mk @@ -10,6 +10,7 @@ vvadd_c_src = \ vvadd_main.c \ + syscalls.c \ vvadd_riscv_src = \ crt.S \ @@ -23,7 +24,7 @@ $(vvadd_host_bin) : $(vvadd_c_src) vvadd_riscv_bin = vvadd.riscv $(vvadd_riscv_bin) : $(vvadd_c_objs) $(vvadd_riscv_objs) - $(RISCV_LINK) $(vvadd_c_objs) $(vvadd_riscv_objs) -o $(vvadd_riscv_bin) + $(RISCV_LINK) $(vvadd_c_objs) $(vvadd_riscv_objs) -o $(vvadd_riscv_bin) $(RISCV_LINK_OPTS) junk += $(vvadd_c_objs) $(vvadd_riscv_objs) \ $(vvadd_host_bin) $(vvadd_riscv_bin) diff --git a/benchmarks/vvadd/vvadd_main.c b/benchmarks/vvadd/vvadd_main.c index 0be3051..9c47617 100644 --- a/benchmarks/vvadd/vvadd_main.c +++ b/benchmarks/vvadd/vvadd_main.c @@ -11,87 +11,13 @@ // anything except the HOST_DEBUG and PREALLOCATE macros for your timing // runs. -int ncores = 1; #include "util.h" - -//-------------------------------------------------------------------------- -// Macros - -// Set HOST_DEBUG to 1 if you are going to compile this for a host -// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG -// to 0 if you are compiling with the smips-gcc toolchain. - -#ifndef HOST_DEBUG -#define HOST_DEBUG 0 -#endif - -// Set PREALLOCATE to 1 if you want to preallocate the benchmark -// function before starting stats. If you have instruction/data -// caches and you don't want to count the overhead of misses, then -// you will need to use preallocation. - -#ifndef PREALLOCATE -#define PREALLOCATE 0 -#endif - -// Set SET_STATS to 1 if you want to carve out the piece that actually -// does the computation. - -#ifndef SET_STATS -#define SET_STATS 0 -#endif //-------------------------------------------------------------------------- // Input/Reference Data #include "dataset1.h" -//-------------------------------------------------------------------------- -// Helper functions - -int verify( int n, int test[], int correct[] ) -{ - int i; - for ( i = 0; i < n; i++ ) { - if ( test[i] != correct[i] ) { - return 2; - } - } - return 1; -} - -#if HOST_DEBUG -void printArray( char name[], int n, int arr[] ) -{ - int i; - printf( " %10s :", name ); - for ( i = 0; i < n; i++ ) - printf( " %3d ", arr[i] ); - printf( "\n" ); -} -#endif - -//void finishTest( int toHostValue ) -//{ -//#if HOST_DEBUG -// if ( toHostValue == 1 ) -// printf( "*** PASSED ***\n" ); -// else -// printf( "*** FAILED *** (tohost = %d)\n", toHostValue ); -// exit(0); -//#else -// asm( "mtpcr %0, tohost" : : "r" (toHostValue) ); -// while ( 1 ) { } -//#endif -//} - -void setStats( int enable ) -{ -#if ( !HOST_DEBUG && SET_STATS ) - asm( "mtpcr %0, cr10" : : "r" (enable) ); -#endif -} - //-------------------------------------------------------------------------- // vvadd function @@ -110,33 +36,23 @@ int main( int argc, char* argv[] ) int results_data[DATA_SIZE]; // Output the input array - -#if HOST_DEBUG printArray( "input1", DATA_SIZE, input1_data ); printArray( "input2", DATA_SIZE, input2_data ); printArray( "verify", DATA_SIZE, verify_data ); -#endif - - // If needed we preallocate everything in the caches #if PREALLOCATE + // If needed we preallocate everything in the caches vvadd( DATA_SIZE, input1_data, input2_data, results_data ); #endif // Do the vvadd - setStats(1); vvadd( DATA_SIZE, input1_data, input2_data, results_data ); setStats(0); // Print out the results - -#if HOST_DEBUG printArray( "results", DATA_SIZE, results_data ); -#endif // Check the results - - finishTest(verify( DATA_SIZE, results_data, verify_data )); - + return verify( DATA_SIZE, results_data, verify_data ); } diff --git a/env b/env index 7463619..fba067f 160000 --- a/env +++ b/env @@ -1 +1 @@ -Subproject commit 746361936518f56549726c3e661606e5f28a1b96 +Subproject commit fba067ffed05ffff662cb280df822da2eaf12a0b diff --git a/isa/Makefile b/isa/Makefile index 1009c27..b876406 100644 --- a/isa/Makefile +++ b/isa/Makefile @@ -10,6 +10,7 @@ include $(isa_src_dir)/rv64uv/Makefrag include $(isa_src_dir)/rv64si/Makefrag include $(isa_src_dir)/rv64sv/Makefrag include $(isa_src_dir)/rv32ui/Makefrag +include $(isa_src_dir)/rv32si/Makefrag default: all @@ -18,7 +19,7 @@ default: all #-------------------------------------------------------------------- RISCV_GCC = riscv-gcc -RISCV_GCC_OPTS = -nostdlib -nostartfiles -Wa,-march=RVIMAFDXhwacha +RISCV_GCC_OPTS = -fpic -nostdlib -nostartfiles -Wa,-march=RVIMAFDXhwacha RISCV_OBJDUMP = riscv-objdump --disassemble-all --section=.text --section=.data --section=.bss RISCV_SIM = spike --extension=hwacha @@ -28,7 +29,7 @@ vpath %.S $(isa_src_dir) # Build assembly tests %.hex: % - elf2hex 16 16384 $< > $@ + (elf2hex 16 8192 $< 2> /dev/null || elf2hex 16 16384 $<) > $@ %.dump: % $(RISCV_OBJDUMP) $< > $@ @@ -69,6 +70,7 @@ tests += $$($(1)_v_vec_tests) endef $(eval $(call compile_template,rv32ui,-m32)) +$(eval $(call compile_template,rv32si,-m32)) $(eval $(call compile_template,rv64ui)) $(eval $(call compile_template,rv64uf)) $(eval $(call compile_template,rv64uv)) diff --git a/isa/macros/scalar/test_macros.h b/isa/macros/scalar/test_macros.h index 10680d4..dca9a92 100644 --- a/isa/macros/scalar/test_macros.h +++ b/isa/macros/scalar/test_macros.h @@ -10,14 +10,14 @@ test_ ## testnum: \ code; \ li x29, correctval; \ - li x28, testnum; \ + li TESTNUM, testnum; \ bne testreg, x29, fail; #define TEST_CASE_JUMP( testnum, testreg, correctval, code... ) \ test_ ## testnum: \ code; \ li x29, correctval; \ - li x28, testnum; \ + li TESTNUM, testnum; \ beq testreg, x29, pass_ ## testnum; \ j fail; \ pass_ ## testnum: \ @@ -264,7 +264,7 @@ pass_ ## testnum: \ #define TEST_LD_DEST_BYPASS( testnum, nop_cycles, inst, result, offset, base ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: la x1, base; \ inst x3, offset(x1); \ @@ -278,7 +278,7 @@ test_ ## testnum: \ #define TEST_LD_SRC1_BYPASS( testnum, nop_cycles, inst, result, offset, base ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: la x1, base; \ TEST_INSERT_NOPS_ ## nop_cycles \ @@ -291,7 +291,7 @@ test_ ## testnum: \ #define TEST_ST_SRC12_BYPASS( testnum, src1_nops, src2_nops, load_inst, store_inst, result, offset, base ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: la x1, result; \ TEST_INSERT_NOPS_ ## src1_nops \ @@ -307,7 +307,7 @@ test_ ## testnum: \ #define TEST_ST_SRC21_BYPASS( testnum, src1_nops, src2_nops, load_inst, store_inst, result, offset, base ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: la x2, base; \ TEST_INSERT_NOPS_ ## src1_nops \ @@ -327,28 +327,28 @@ test_ ## testnum: \ #define TEST_BR1_OP_TAKEN( testnum, inst, val1 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x1, val1; \ inst x1, 2f; \ - bne x0, x28, fail; \ -1: bne x0, x28, 3f; \ + bne x0, TESTNUM, fail; \ +1: bne x0, TESTNUM, 3f; \ 2: inst x1, 1b; \ - bne x0, x28, fail; \ + bne x0, TESTNUM, fail; \ 3: #define TEST_BR1_OP_NOTTAKEN( testnum, inst, val1 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x1, val1; \ inst x1, 1f; \ - bne x0, x28, 2f; \ -1: bne x0, x28, fail; \ + bne x0, TESTNUM, 2f; \ +1: bne x0, TESTNUM, fail; \ 2: inst x1, 1b; \ 3: #define TEST_BR1_SRC1_BYPASS( testnum, nop_cycles, inst, val1 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: li x1, val1; \ TEST_INSERT_NOPS_ ## nop_cycles \ @@ -359,30 +359,30 @@ test_ ## testnum: \ #define TEST_BR2_OP_TAKEN( testnum, inst, val1, val2 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x1, val1; \ li x2, val2; \ inst x1, x2, 2f; \ - bne x0, x28, fail; \ -1: bne x0, x28, 3f; \ + bne x0, TESTNUM, fail; \ +1: bne x0, TESTNUM, 3f; \ 2: inst x1, x2, 1b; \ - bne x0, x28, fail; \ + bne x0, TESTNUM, fail; \ 3: #define TEST_BR2_OP_NOTTAKEN( testnum, inst, val1, val2 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x1, val1; \ li x2, val2; \ inst x1, x2, 1f; \ - bne x0, x28, 2f; \ -1: bne x0, x28, fail; \ + bne x0, TESTNUM, 2f; \ +1: bne x0, TESTNUM, fail; \ 2: inst x1, x2, 1b; \ 3: #define TEST_BR2_SRC12_BYPASS( testnum, src1_nops, src2_nops, inst, val1, val2 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: li x1, val1; \ TEST_INSERT_NOPS_ ## src1_nops \ @@ -395,7 +395,7 @@ test_ ## testnum: \ #define TEST_BR2_SRC21_BYPASS( testnum, src1_nops, src2_nops, inst, val1, val2 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: li x2, val2; \ TEST_INSERT_NOPS_ ## src1_nops \ @@ -412,24 +412,24 @@ test_ ## testnum: \ #define TEST_JR_SRC1_BYPASS( testnum, nop_cycles, inst ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: la x6, 2f; \ TEST_INSERT_NOPS_ ## nop_cycles \ inst x6; \ - bne x0, x28, fail; \ + bne x0, TESTNUM, fail; \ 2: addi x4, x4, 1; \ li x5, 2; \ bne x4, x5, 1b \ #define TEST_JALR_SRC1_BYPASS( testnum, nop_cycles, inst ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ li x4, 0; \ 1: la x6, 2f; \ TEST_INSERT_NOPS_ ## nop_cycles \ inst x19, x6, 0; \ - bne x0, x28, fail; \ + bne x0, TESTNUM, fail; \ 2: addi x4, x4, 1; \ li x5, 2; \ bne x4, x5, 1b \ @@ -445,7 +445,7 @@ test_ ## testnum: \ #define TEST_FP_OP_S_INTERNAL( testnum, result, val1, val2, val3, code... ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ la a0, test_ ## testnum ## _data ;\ flw f0, 0(a0); \ flw f1, 4(a0); \ @@ -464,7 +464,7 @@ test_ ## testnum: \ #define TEST_FP_OP_D_INTERNAL( testnum, result, val1, val2, val3, code... ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ la a0, test_ ## testnum ## _data ;\ fld f0, 0(a0); \ fld f1, 8(a0); \ @@ -531,7 +531,7 @@ test_ ## testnum: \ #define TEST_INT_FP_OP_S( testnum, inst, result, val1 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ la a0, test_ ## testnum ## _data ;\ lw a3, 0(a0); \ li a0, val1; \ @@ -546,7 +546,7 @@ test_ ## testnum: \ #define TEST_INT_FP_OP_D( testnum, inst, result, val1 ) \ test_ ## testnum: \ - li x28, testnum; \ + li TESTNUM, testnum; \ la a0, test_ ## testnum ## _data ;\ ld a3, 0(a0); \ li a0, val1; \ @@ -591,7 +591,7 @@ vtcode2 ## testnum: \ stop; \ handler ## testnum: \ vxcptkill; \ - li x28,2; \ + li TESTNUM,2; \ vxcptcause a0; \ li a1,HWACHA_CAUSE_TVEC_ILLEGAL_REGID; \ bne a0,a1,fail; \ @@ -613,16 +613,16 @@ handler ## testnum: \ fence; \ ld a1,0(a3); \ li a2,5; \ - li x28,2; \ + li TESTNUM,2; \ bne a1,a2,fail; \ ld a1,8(a3); \ - li x28,3; \ + li TESTNUM,3; \ bne a1,a2,fail; \ ld a1,16(a3); \ - li x28,4; \ + li TESTNUM,4; \ bne a1,a2,fail; \ ld a1,24(a3); \ - li x28,5; \ + li TESTNUM,5; \ bne a1,a2,fail; \ #define TEST_ILLEGAL_VT_REGID( testnum, nxreg, nfreg, inst, reg1, reg2, reg3) \ @@ -651,7 +651,7 @@ vtcode2 ## testnum: \ stop; \ handler ## testnum: \ vxcptkill; \ - li x28,2; \ + li TESTNUM,2; \ vxcptcause a0; \ li a1,HWACHA_CAUSE_VF_ILLEGAL_REGID; \ bne a0,a1,fail; \ @@ -672,24 +672,24 @@ handler ## testnum: \ fence; \ ld a1,0(a3); \ li a2,5; \ - li x28,2; \ + li TESTNUM,2; \ bne a1,a2,fail; \ ld a1,8(a3); \ - li x28,3; \ + li TESTNUM,3; \ bne a1,a2,fail; \ ld a1,16(a3); \ - li x28,4; \ + li TESTNUM,4; \ bne a1,a2,fail; \ ld a1,24(a3); \ - li x28,5; \ + li TESTNUM,5; \ bne a1,a2,fail; \ #----------------------------------------------------------------------- -# Pass and fail code (assumes test num is in x28) +# Pass and fail code (assumes test num is in TESTNUM) #----------------------------------------------------------------------- #define TEST_PASSFAIL \ - bne x0, x28, pass; \ + bne x0, TESTNUM, pass; \ fail: \ RVTEST_FAIL \ pass: \ diff --git a/isa/macros/vector/test_macros.h b/isa/macros/vector/test_macros.h index 932aba3..5a8f0a1 100644 --- a/isa/macros/vector/test_macros.h +++ b/isa/macros/vector/test_macros.h @@ -25,7 +25,7 @@ test_ ## testnum: \ fence; \ li a1,correctval; \ li a2,0; \ - li x28, testnum; \ + li TESTNUM, testnum; \ test_loop ## testnum: \ ld a0,0(a4); \ beq a0,a1,skip ## testnum; \ @@ -238,7 +238,7 @@ test_ ## testnum: \ fence; \ lw a1, 0(a5); \ li a2, 0; \ - li x28, testnum; \ + li TESTNUM, testnum; \ test_loop ## testnum: \ lw a0,0(a4); \ beq a0,a1,skip ## testnum; \ @@ -278,7 +278,7 @@ test_ ## testnum: \ fence; \ ld a1, 0(a5); \ li a2, 0; \ - li x28, testnum; \ + li TESTNUM, testnum; \ test_loop ## testnum: \ ld a0,0(a4); \ beq a0,a1,skip ## testnum; \ @@ -352,7 +352,7 @@ test_ ## testnum: \ la a5, test_ ## testnum ## _data ;\ lw a1, 0(a5); \ li a2, 0; \ - li x28, testnum; \ + li TESTNUM, testnum; \ test_loop ## testnum: \ lw a0,0(a4); \ beq a0,a1,skip ## testnum; \ @@ -385,7 +385,7 @@ test_ ## testnum: \ la a5, test_ ## testnum ## _data ;\ ld a1, 0(a5); \ li a2, 0; \ - li x28, testnum; \ + li TESTNUM, testnum; \ test_loop ## testnum: \ ld a0,0(a4); \ beq a0,a1,skip ## testnum; \ @@ -533,7 +533,7 @@ test_ ## testnum: \ fence; \ li a1,correctval; \ li a2,0; \ - li x28, testnum; \ + li TESTNUM, testnum; \ test_loop ## testnum: \ ld a0,0(a4); \ beq a0,a1,skip ## testnum; \ @@ -591,11 +591,11 @@ next ## testnum : ) #----------------------------------------------------------------------- -# Pass and fail code (assumes test num is in x28) +# Pass and fail code (assumes test num is in TESTNUM) #----------------------------------------------------------------------- #define TEST_PASSFAIL \ - bne x0, x28, pass; \ + bne x0, TESTNUM, pass; \ fail: \ RVTEST_FAIL \ pass: \ diff --git a/isa/rv32si/Makefrag b/isa/rv32si/Makefrag new file mode 100644 index 0000000..7ffc060 --- /dev/null +++ b/isa/rv32si/Makefrag @@ -0,0 +1,15 @@ +#======================================================================= +# Makefrag for rv32si tests +#----------------------------------------------------------------------- + +rv32si_sc_tests = \ + csr \ + shamt \ + +rv32si_mc_tests = \ + ipi \ + +rv32si_p_tests = $(addprefix rv32si-p-, $(rv32si_sc_tests)) +rv32si_pm_tests = $(addprefix rv32si-pm-, $(rv32si_mc_tests)) + +spike_tests += $(rv32si_p_tests) $(rv32si_pm_tests) diff --git a/isa/rv32si/csr.S b/isa/rv32si/csr.S new file mode 100644 index 0000000..c229b50 --- /dev/null +++ b/isa/rv32si/csr.S @@ -0,0 +1,14 @@ +#***************************************************************************** +# csr.S +#----------------------------------------------------------------------------- +# +# Test CSRRx and CSRRxI instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +#undef RVTEST_RV64S +#define RVTEST_RV64S RVTEST_RV32S + +#include "../rv64si/csr.S" diff --git a/isa/rv32si/ipi.S b/isa/rv32si/ipi.S new file mode 100644 index 0000000..4682bee --- /dev/null +++ b/isa/rv32si/ipi.S @@ -0,0 +1,14 @@ +#***************************************************************************** +# ipi.S +#----------------------------------------------------------------------------- +# +# Test interprocessor interrupts. +# + +#include "riscv_test.h" +#include "test_macros.h" + +#undef RVTEST_RV64S +#define RVTEST_RV64S RVTEST_RV32S + +#include "../rv64si/ipi.S" diff --git a/isa/rv32si/shamt.S b/isa/rv32si/shamt.S new file mode 100644 index 0000000..df97287 --- /dev/null +++ b/isa/rv32si/shamt.S @@ -0,0 +1,44 @@ +#***************************************************************************** +# csr.S +#----------------------------------------------------------------------------- +# +# Test CSRRx and CSRRxI instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32S +RVTEST_CODE_BEGIN + + la t0, evec + csrw evec, t0 + + # Make sure slli with shamt[4] set is legal. + TEST_CASE( 2, a0, 65536, li a0, 1; slli a0, a0, 16); + + # Make sure slli with shamt[4] set is not legal. + TEST_CASE( 3, x0, 1, slli a0, a0, 32); + + TEST_PASSFAIL + +evec: + # Trapping on test 3 is good. + # Note that since the test didn't complete, TESTNUM is smaller by 1. + li t0, 2 + bne TESTNUM, t0, fail + + # Make sure CAUSE indicates an illegal instructino. + csrr t0, cause + li t1, CAUSE_ILLEGAL_INSTRUCTION + bne t0, t1, fail + j pass + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/Makefrag b/isa/rv32ui/Makefrag index f01c0e1..d487463 100644 --- a/isa/rv32ui/Makefrag +++ b/isa/rv32ui/Makefrag @@ -5,27 +5,27 @@ rv32ui_sc_tests = \ add addi \ amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoswap_w \ - #and andi \ - #auipc \ - #beq bge bgeu blt bltu bne \ - #div divu \ - #fence_i \ - #j jal jalr \ - #lb lbu lh lhu lw \ - #lui \ - #mul mulh mulhsu mulhu \ - #or ori \ - #rem remu \ - #sb sh sw \ - #sll slli \ - #slt slti \ - #sra srai \ - #srl srli \ - #sub \ - #xor xori \ + and andi \ + auipc \ + beq bge bgeu blt bltu bne \ + div divu \ + fence_i \ + j jal jalr \ + lb lbu lh lhu lw \ + lui \ + mul mulh mulhu mulhsu \ + or ori \ + rem remu \ + sb sh sw \ + sll slli \ + slt slti \ + sra srai \ + srl srli \ + sub \ + xor xori \ rv32ui_mc_tests = \ - #lrsc + lrsc rv32ui_p_tests = $(addprefix rv32ui-p-, $(rv32ui_sc_tests)) rv32ui_pm_tests = $(addprefix rv32ui-pm-, $(rv32ui_mc_tests)) diff --git a/isa/rv32ui/amoadd_w.S b/isa/rv32ui/amoadd_w.S index 30d3f79..5f331c5 100644 --- a/isa/rv32ui/amoadd_w.S +++ b/isa/rv32ui/amoadd_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amoand_w.S b/isa/rv32ui/amoand_w.S index 3204f1c..37cb46a 100644 --- a/isa/rv32ui/amoand_w.S +++ b/isa/rv32ui/amoand_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amomax_w.S b/isa/rv32ui/amomax_w.S index a7fc95a..d71baa0 100644 --- a/isa/rv32ui/amomax_w.S +++ b/isa/rv32ui/amomax_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amomaxu_w.S b/isa/rv32ui/amomaxu_w.S index ca8045d..8295b73 100644 --- a/isa/rv32ui/amomaxu_w.S +++ b/isa/rv32ui/amomaxu_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amomin_w.S b/isa/rv32ui/amomin_w.S index 3cbf08c..40fd769 100644 --- a/isa/rv32ui/amomin_w.S +++ b/isa/rv32ui/amomin_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amominu_w.S b/isa/rv32ui/amominu_w.S index 3809d1c..1f8abb1 100644 --- a/isa/rv32ui/amominu_w.S +++ b/isa/rv32ui/amominu_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amoor_w.S b/isa/rv32ui/amoor_w.S index 6df4da4..ece7a91 100644 --- a/isa/rv32ui/amoor_w.S +++ b/isa/rv32ui/amoor_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/amoswap_w.S b/isa/rv32ui/amoswap_w.S index bf034d1..118c92d 100644 --- a/isa/rv32ui/amoswap_w.S +++ b/isa/rv32ui/amoswap_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv32ui/and.S b/isa/rv32ui/and.S new file mode 100644 index 0000000..3558546 --- /dev/null +++ b/isa/rv32ui/and.S @@ -0,0 +1,67 @@ +#***************************************************************************** +# and.S +#----------------------------------------------------------------------------- +# +# Test and instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Logical tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_OP( 3, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_OP( 4, and, 0x000f000f, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_OP( 5, and, 0xf000f000, 0xf00ff00f, 0xf0f0f0f0 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 6, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC2_EQ_DEST( 7, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_EQ_DEST( 8, and, 0xff00ff00, 0xff00ff00 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 9, 0, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_DEST_BYPASS( 10, 1, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_DEST_BYPASS( 11, 2, and, 0x000f000f, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_SRC12_BYPASS( 12, 0, 0, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 13, 0, 1, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_BYPASS( 14, 0, 2, and, 0x000f000f, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 15, 1, 0, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 16, 1, 1, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_BYPASS( 17, 2, 0, and, 0x000f000f, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_SRC21_BYPASS( 18, 0, 0, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 19, 0, 1, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC21_BYPASS( 20, 0, 2, and, 0x000f000f, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 21, 1, 0, and, 0x0f000f00, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 22, 1, 1, and, 0x00f000f0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC21_BYPASS( 23, 2, 0, and, 0x000f000f, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_ZEROSRC1( 24, and, 0, 0xff00ff00 ); + TEST_RR_ZEROSRC2( 25, and, 0, 0x00ff00ff ); + TEST_RR_ZEROSRC12( 26, and, 0 ); + TEST_RR_ZERODEST( 27, and, 0x11111111, 0x22222222 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/andi.S b/isa/rv32ui/andi.S new file mode 100644 index 0000000..ab65449 --- /dev/null +++ b/isa/rv32ui/andi.S @@ -0,0 +1,53 @@ +#***************************************************************************** +# andi.S +#----------------------------------------------------------------------------- +# +# Test andi instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Logical tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, andi, 0xff00ff00, 0xff00ff00, 0xf0f ); + TEST_IMM_OP( 3, andi, 0x000000f0, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_OP( 4, andi, 0x0000000f, 0x00ff00ff, 0x70f ); + TEST_IMM_OP( 5, andi, 0x00000000, 0xf00ff00f, 0x0f0 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 6, andi, 0x00000000, 0xff00ff00, 0x0f0 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 7, 0, andi, 0x00000700, 0x0ff00ff0, 0x70f ); + TEST_IMM_DEST_BYPASS( 8, 1, andi, 0x000000f0, 0x00ff00ff, 0x0f0 ); + TEST_IMM_DEST_BYPASS( 9, 2, andi, 0xf00ff00f, 0xf00ff00f, 0xf0f ); + + TEST_IMM_SRC1_BYPASS( 10, 0, andi, 0x00000700, 0x0ff00ff0, 0x70f ); + TEST_IMM_SRC1_BYPASS( 11, 1, andi, 0x000000f0, 0x00ff00ff, 0x0f0 ); + TEST_IMM_SRC1_BYPASS( 12, 2, andi, 0x0000000f, 0xf00ff00f, 0x70f ); + + TEST_IMM_ZEROSRC1( 13, andi, 0, 0x0f0 ); + TEST_IMM_ZERODEST( 14, andi, 0x00ff00ff, 0x70f ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/auipc.S b/isa/rv32ui/auipc.S new file mode 100644 index 0000000..cca7781 --- /dev/null +++ b/isa/rv32ui/auipc.S @@ -0,0 +1,37 @@ +#***************************************************************************** +# auipc.S +#----------------------------------------------------------------------------- +# +# Test auipc instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + TEST_CASE(2, a0, 10000, \ + .align 3; \ + lla a0, 1f + 10000; \ + jal a1, 1f; \ + 1: sub a0, a0, a1; \ + ) + + TEST_CASE(3, a0, -10000, \ + .align 3; \ + lla a0, 1f - 10000; \ + jal a1, 1f; \ + 1: sub a0, a0, a1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/beq.S b/isa/rv32ui/beq.S new file mode 100644 index 0000000..2f7064b --- /dev/null +++ b/isa/rv32ui/beq.S @@ -0,0 +1,71 @@ +#***************************************************************************** +# beq.S +#----------------------------------------------------------------------------- +# +# Test beq instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Branch tests + #------------------------------------------------------------- + + # Each test checks both forward and backward branches + + TEST_BR2_OP_TAKEN( 2, beq, 0, 0 ); + TEST_BR2_OP_TAKEN( 3, beq, 1, 1 ); + TEST_BR2_OP_TAKEN( 4, beq, -1, -1 ); + + TEST_BR2_OP_NOTTAKEN( 5, beq, 0, 1 ); + TEST_BR2_OP_NOTTAKEN( 6, beq, 1, 0 ); + TEST_BR2_OP_NOTTAKEN( 7, beq, -1, 1 ); + TEST_BR2_OP_NOTTAKEN( 8, beq, 1, -1 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_BR2_SRC12_BYPASS( 9, 0, 0, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 10, 0, 1, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 11, 0, 2, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 12, 1, 0, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 13, 1, 1, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 14, 2, 0, beq, 0, -1 ); + + TEST_BR2_SRC12_BYPASS( 15, 0, 0, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 16, 0, 1, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 17, 0, 2, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 18, 1, 0, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 19, 1, 1, beq, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 20, 2, 0, beq, 0, -1 ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 21, x1, 3, \ + li x1, 1; \ + beq x0, x0, 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/bge.S b/isa/rv32ui/bge.S new file mode 100644 index 0000000..126c418 --- /dev/null +++ b/isa/rv32ui/bge.S @@ -0,0 +1,74 @@ +#***************************************************************************** +# bge.S +#----------------------------------------------------------------------------- +# +# Test bge instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Branch tests + #------------------------------------------------------------- + + # Each test checks both forward and backward branches + + TEST_BR2_OP_TAKEN( 2, bge, 0, 0 ); + TEST_BR2_OP_TAKEN( 3, bge, 1, 1 ); + TEST_BR2_OP_TAKEN( 4, bge, -1, -1 ); + TEST_BR2_OP_TAKEN( 5, bge, 1, 0 ); + TEST_BR2_OP_TAKEN( 6, bge, 1, -1 ); + TEST_BR2_OP_TAKEN( 7, bge, -1, -2 ); + + TEST_BR2_OP_NOTTAKEN( 8, bge, 0, 1 ); + TEST_BR2_OP_NOTTAKEN( 9, bge, -1, 1 ); + TEST_BR2_OP_NOTTAKEN( 10, bge, -2, -1 ); + TEST_BR2_OP_NOTTAKEN( 11, bge, -2, 1 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_BR2_SRC12_BYPASS( 12, 0, 0, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 13, 0, 1, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 14, 0, 2, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 15, 1, 0, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 16, 1, 1, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 17, 2, 0, bge, -1, 0 ); + + TEST_BR2_SRC12_BYPASS( 18, 0, 0, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 19, 0, 1, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 20, 0, 2, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 21, 1, 0, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 22, 1, 1, bge, -1, 0 ); + TEST_BR2_SRC12_BYPASS( 23, 2, 0, bge, -1, 0 ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 24, x1, 3, \ + li x1, 1; \ + bge x1, x0, 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/bgeu.S b/isa/rv32ui/bgeu.S new file mode 100644 index 0000000..b1f8fcf --- /dev/null +++ b/isa/rv32ui/bgeu.S @@ -0,0 +1,74 @@ +#***************************************************************************** +# bgeu.S +#----------------------------------------------------------------------------- +# +# Test bgeu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Branch tests + #------------------------------------------------------------- + + # Each test checks both forward and backward branches + + TEST_BR2_OP_TAKEN( 2, bgeu, 0x00000000, 0x00000000 ); + TEST_BR2_OP_TAKEN( 3, bgeu, 0x00000001, 0x00000001 ); + TEST_BR2_OP_TAKEN( 4, bgeu, 0xffffffff, 0xffffffff ); + TEST_BR2_OP_TAKEN( 5, bgeu, 0x00000001, 0x00000000 ); + TEST_BR2_OP_TAKEN( 6, bgeu, 0xffffffff, 0xfffffffe ); + TEST_BR2_OP_TAKEN( 7, bgeu, 0xffffffff, 0x00000000 ); + + TEST_BR2_OP_NOTTAKEN( 8, bgeu, 0x00000000, 0x00000001 ); + TEST_BR2_OP_NOTTAKEN( 9, bgeu, 0xfffffffe, 0xffffffff ); + TEST_BR2_OP_NOTTAKEN( 10, bgeu, 0x00000000, 0xffffffff ); + TEST_BR2_OP_NOTTAKEN( 11, bgeu, 0x7fffffff, 0x80000000 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_BR2_SRC12_BYPASS( 12, 0, 0, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 13, 0, 1, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 14, 0, 2, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 15, 1, 0, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 16, 1, 1, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 17, 2, 0, bgeu, 0xefffffff, 0xf0000000 ); + + TEST_BR2_SRC12_BYPASS( 18, 0, 0, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 19, 0, 1, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 20, 0, 2, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 21, 1, 0, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 22, 1, 1, bgeu, 0xefffffff, 0xf0000000 ); + TEST_BR2_SRC12_BYPASS( 23, 2, 0, bgeu, 0xefffffff, 0xf0000000 ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 24, x1, 3, \ + li x1, 1; \ + bgeu x1, x0, 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/blt.S b/isa/rv32ui/blt.S new file mode 100644 index 0000000..16b81f3 --- /dev/null +++ b/isa/rv32ui/blt.S @@ -0,0 +1,71 @@ +#***************************************************************************** +# blt.S +#----------------------------------------------------------------------------- +# +# Test blt instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Branch tests + #------------------------------------------------------------- + + # Each test checks both forward and backward branches + + TEST_BR2_OP_TAKEN( 2, blt, 0, 1 ); + TEST_BR2_OP_TAKEN( 3, blt, -1, 1 ); + TEST_BR2_OP_TAKEN( 4, blt, -2, -1 ); + + TEST_BR2_OP_NOTTAKEN( 5, blt, 1, 0 ); + TEST_BR2_OP_NOTTAKEN( 6, blt, 1, -1 ); + TEST_BR2_OP_NOTTAKEN( 7, blt, -1, -2 ); + TEST_BR2_OP_NOTTAKEN( 8, blt, 1, -2 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_BR2_SRC12_BYPASS( 9, 0, 0, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 10, 0, 1, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 11, 0, 2, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 12, 1, 0, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 13, 1, 1, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 14, 2, 0, blt, 0, -1 ); + + TEST_BR2_SRC12_BYPASS( 15, 0, 0, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 16, 0, 1, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 17, 0, 2, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 18, 1, 0, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 19, 1, 1, blt, 0, -1 ); + TEST_BR2_SRC12_BYPASS( 20, 2, 0, blt, 0, -1 ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 21, x1, 3, \ + li x1, 1; \ + blt x0, x1, 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/bltu.S b/isa/rv32ui/bltu.S new file mode 100644 index 0000000..6e7dc2c --- /dev/null +++ b/isa/rv32ui/bltu.S @@ -0,0 +1,71 @@ +#***************************************************************************** +# bltu.S +#----------------------------------------------------------------------------- +# +# Test bltu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Branch tests + #------------------------------------------------------------- + + # Each test checks both forward and backward branches + + TEST_BR2_OP_TAKEN( 2, bltu, 0x00000000, 0x00000001 ); + TEST_BR2_OP_TAKEN( 3, bltu, 0xfffffffe, 0xffffffff ); + TEST_BR2_OP_TAKEN( 4, bltu, 0x00000000, 0xffffffff ); + + TEST_BR2_OP_NOTTAKEN( 5, bltu, 0x00000001, 0x00000000 ); + TEST_BR2_OP_NOTTAKEN( 6, bltu, 0xffffffff, 0xfffffffe ); + TEST_BR2_OP_NOTTAKEN( 7, bltu, 0xffffffff, 0x00000000 ); + TEST_BR2_OP_NOTTAKEN( 8, bltu, 0x80000000, 0x7fffffff ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_BR2_SRC12_BYPASS( 9, 0, 0, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 10, 0, 1, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 11, 0, 2, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 12, 1, 0, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 13, 1, 1, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 14, 2, 0, bltu, 0xf0000000, 0xefffffff ); + + TEST_BR2_SRC12_BYPASS( 15, 0, 0, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 16, 0, 1, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 17, 0, 2, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 18, 1, 0, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 19, 1, 1, bltu, 0xf0000000, 0xefffffff ); + TEST_BR2_SRC12_BYPASS( 20, 2, 0, bltu, 0xf0000000, 0xefffffff ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 21, x1, 3, \ + li x1, 1; \ + bltu x0, x1, 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/bne.S b/isa/rv32ui/bne.S new file mode 100644 index 0000000..b6db725 --- /dev/null +++ b/isa/rv32ui/bne.S @@ -0,0 +1,71 @@ +#***************************************************************************** +# bne.S +#----------------------------------------------------------------------------- +# +# Test bne instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Branch tests + #------------------------------------------------------------- + + # Each test checks both forward and backward branches + + TEST_BR2_OP_TAKEN( 2, bne, 0, 1 ); + TEST_BR2_OP_TAKEN( 3, bne, 1, 0 ); + TEST_BR2_OP_TAKEN( 4, bne, -1, 1 ); + TEST_BR2_OP_TAKEN( 5, bne, 1, -1 ); + + TEST_BR2_OP_NOTTAKEN( 6, bne, 0, 0 ); + TEST_BR2_OP_NOTTAKEN( 7, bne, 1, 1 ); + TEST_BR2_OP_NOTTAKEN( 8, bne, -1, -1 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_BR2_SRC12_BYPASS( 9, 0, 0, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 10, 0, 1, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 11, 0, 2, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 12, 1, 0, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 13, 1, 1, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 14, 2, 0, bne, 0, 0 ); + + TEST_BR2_SRC12_BYPASS( 15, 0, 0, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 16, 0, 1, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 17, 0, 2, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 18, 1, 0, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 19, 1, 1, bne, 0, 0 ); + TEST_BR2_SRC12_BYPASS( 20, 2, 0, bne, 0, 0 ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 21, x1, 3, \ + li x1, 1; \ + bne x1, x0, 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/div.S b/isa/rv32ui/div.S new file mode 100644 index 0000000..6fe9bc9 --- /dev/null +++ b/isa/rv32ui/div.S @@ -0,0 +1,39 @@ +#***************************************************************************** +# div.S +#----------------------------------------------------------------------------- +# +# Test div instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, div, 3, 20, 6 ); + TEST_RR_OP( 3, div, -3, -20, 6 ); + TEST_RR_OP( 4, div, -3, 20, -6 ); + TEST_RR_OP( 5, div, 3, -20, -6 ); + + TEST_RR_OP( 6, div, -1<<63, -1<<63, 1 ); + TEST_RR_OP( 7, div, -1<<63, -1<<63, -1 ); + + TEST_RR_OP( 8, div, -1, -1<<63, 0 ); + TEST_RR_OP( 9, div, -1, 1, 0 ); + TEST_RR_OP(10, div, -1, 0, 0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/divu.S b/isa/rv32ui/divu.S new file mode 100644 index 0000000..c060101 --- /dev/null +++ b/isa/rv32ui/divu.S @@ -0,0 +1,39 @@ +#***************************************************************************** +# divu.S +#----------------------------------------------------------------------------- +# +# Test divu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, divu, 3, 20, 6 ); + TEST_RR_OP( 3, divu, 715827879, -20, 6 ); + TEST_RR_OP( 4, divu, 0, 20, -6 ); + TEST_RR_OP( 5, divu, 0, -20, -6 ); + + TEST_RR_OP( 6, divu, -1<<31, -1<<31, 1 ); + TEST_RR_OP( 7, divu, 0, -1<<31, -1 ); + + TEST_RR_OP( 8, divu, -1, -1<<31, 0 ); + TEST_RR_OP( 9, divu, -1, 1, 0 ); + TEST_RR_OP(10, divu, -1, 0, 0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/divuw.S b/isa/rv32ui/divuw.S new file mode 100644 index 0000000..27d6eb7 --- /dev/null +++ b/isa/rv32ui/divuw.S @@ -0,0 +1,39 @@ +#***************************************************************************** +# divuw.S +#----------------------------------------------------------------------------- +# +# Test divuw instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, divuw, 3, 20, 6 ); + TEST_RR_OP( 3, divuw, 715827879, -20 << 32 >> 32, 6 ); + TEST_RR_OP( 4, divuw, 0, 20, -6 ); + TEST_RR_OP( 5, divuw, 0, -20, -6 ); + + TEST_RR_OP( 6, divuw, -1<<31, -1<<31, 1 ); + TEST_RR_OP( 7, divuw, 0, -1<<31, -1 ); + + TEST_RR_OP( 8, divuw, -1, -1<<31, 0 ); + TEST_RR_OP( 9, divuw, -1, 1, 0 ); + TEST_RR_OP(10, divuw, -1, 0, 0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/divw.S b/isa/rv32ui/divw.S new file mode 100644 index 0000000..6c05b24 --- /dev/null +++ b/isa/rv32ui/divw.S @@ -0,0 +1,39 @@ +#***************************************************************************** +# divw.S +#----------------------------------------------------------------------------- +# +# Test divw instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, divw, 3, 20, 6 ); + TEST_RR_OP( 3, divw, -3, -20, 6 ); + TEST_RR_OP( 4, divw, -3, 20, -6 ); + TEST_RR_OP( 5, divw, 3, -20, -6 ); + + TEST_RR_OP( 6, divw, -1<<31, -1<<31, 1 ); + TEST_RR_OP( 7, divw, -1<<31, -1<<31, -1 ); + + TEST_RR_OP( 8, divw, -1, -1<<31, 0 ); + TEST_RR_OP( 9, divw, -1, 1, 0 ); + TEST_RR_OP(10, divw, -1, 0, 0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/fence_i.S b/isa/rv32ui/fence_i.S new file mode 100644 index 0000000..41a1a38 --- /dev/null +++ b/isa/rv32ui/fence_i.S @@ -0,0 +1,51 @@ +#***************************************************************************** +# fence_i.S +#----------------------------------------------------------------------------- +# +# Test self-modifying code and the fence.i instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + +li a3, 111 +la a0, 3f +la a1, 1f +la a2, 2f +lw a0, 0(a0) + +# test I$ hit +.align 6 +sw a0, 0(a1) +fence.i + +1: addi a3, a3, 222 +TEST_CASE( 2, a3, 444, nop ) + +# test prefetcher hit +li a4, 100 +1: addi a4, a4, -1 +bnez a4, 1b + +sw a0, 0(a2) +fence.i + +.align 6 +2: addi a3, a3, 555 +TEST_CASE( 3, a3, 777, nop ) + +3: addi a3, a3, 333 + +TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/j.S b/isa/rv32ui/j.S new file mode 100644 index 0000000..ff1de65 --- /dev/null +++ b/isa/rv32ui/j.S @@ -0,0 +1,47 @@ +#***************************************************************************** +# j.S +#----------------------------------------------------------------------------- +# +# Test j instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Test basic + #------------------------------------------------------------- + + li TESTNUM, 2; + j test_2; + j fail; +test_2: + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 3, x1, 3, \ + li x1, 1; \ + j 1f; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/jal.S b/isa/rv32ui/jal.S new file mode 100644 index 0000000..6055000 --- /dev/null +++ b/isa/rv32ui/jal.S @@ -0,0 +1,58 @@ +#***************************************************************************** +# jal.S +#----------------------------------------------------------------------------- +# +# Test jal instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Test 2: Basic test + #------------------------------------------------------------- + +test_2: + li TESTNUM, 2 + li ra, 0 + +linkaddr_2: + jal target_2 + nop + nop + + j fail + +target_2: + la x2, linkaddr_2 + addi x2, x2, 4 + bne x2, ra, fail + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 3, x2, 3, \ + li x2, 1; \ + jal 1f; \ + addi x2, x2, 1; \ + addi x2, x2, 1; \ + addi x2, x2, 1; \ + addi x2, x2, 1; \ +1: addi x2, x2, 1; \ + addi x2, x2, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/jalr.S b/isa/rv32ui/jalr.S new file mode 100644 index 0000000..e65fd79 --- /dev/null +++ b/isa/rv32ui/jalr.S @@ -0,0 +1,86 @@ +#***************************************************************************** +# jalr.S +#----------------------------------------------------------------------------- +# +# Test jalr instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Test 2: Basic test + #------------------------------------------------------------- + +test_2: + li TESTNUM, 2 + li x31, 0 + la x2, target_2 + +linkaddr_2: + jalr x19, x2, 0 + nop + nop + + j fail + +target_2: + la x1, linkaddr_2 + addi x1, x1, 4 + bne x1, x19, fail + + #------------------------------------------------------------- + # Test 3: Check r0 target and that r31 is not modified + #------------------------------------------------------------- + +test_3: + li TESTNUM, 3 + li x31, 0 + la x3, target_3 + +linkaddr_3: + jalr x0, x3, 0 + nop + + j fail + +target_3: + bne x31, x0, fail + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_JALR_SRC1_BYPASS( 4, 0, jalr ); + TEST_JALR_SRC1_BYPASS( 5, 1, jalr ); + TEST_JALR_SRC1_BYPASS( 6, 2, jalr ); + + #------------------------------------------------------------- + # Test delay slot instructions not executed nor bypassed + #------------------------------------------------------------- + + TEST_CASE( 7, x1, 4, \ + li x1, 1; \ + la x2, 1f; + jalr x19, x2, -4; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ + addi x1, x1, 1; \ +1: addi x1, x1, 1; \ + addi x1, x1, 1; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/lb.S b/isa/rv32ui/lb.S new file mode 100644 index 0000000..1d12186 --- /dev/null +++ b/isa/rv32ui/lb.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# lb.S +#----------------------------------------------------------------------------- +# +# Test lb instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, lb, 0xffffffff, 0, tdat ); + TEST_LD_OP( 3, lb, 0x00000000, 1, tdat ); + TEST_LD_OP( 4, lb, 0xfffffff0, 2, tdat ); + TEST_LD_OP( 5, lb, 0x0000000f, 3, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, lb, 0xffffffff, -3, tdat4 ); + TEST_LD_OP( 7, lb, 0x00000000, -2, tdat4 ); + TEST_LD_OP( 8, lb, 0xfffffff0, -1, tdat4 ); + TEST_LD_OP( 9, lb, 0x0000000f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0xffffffff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + lb x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0x00000000, \ + la x1, tdat; \ + addi x1, x1, -6; \ + lb x3, 7(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, lb, 0xfffffff0, 1, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, lb, 0x0000000f, 1, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, lb, 0x00000000, 1, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, lb, 0xfffffff0, 1, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, lb, 0x0000000f, 1, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, lb, 0x00000000, 1, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + lb x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + lb x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .byte 0xff +tdat2: .byte 0x00 +tdat3: .byte 0xf0 +tdat4: .byte 0x0f + +RVTEST_DATA_END diff --git a/isa/rv32ui/lbu.S b/isa/rv32ui/lbu.S new file mode 100644 index 0000000..d4192fb --- /dev/null +++ b/isa/rv32ui/lbu.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# lbu.S +#----------------------------------------------------------------------------- +# +# Test lbu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, lbu, 0x000000ff, 0, tdat ); + TEST_LD_OP( 3, lbu, 0x00000000, 1, tdat ); + TEST_LD_OP( 4, lbu, 0x000000f0, 2, tdat ); + TEST_LD_OP( 5, lbu, 0x0000000f, 3, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, lbu, 0x000000ff, -3, tdat4 ); + TEST_LD_OP( 7, lbu, 0x00000000, -2, tdat4 ); + TEST_LD_OP( 8, lbu, 0x000000f0, -1, tdat4 ); + TEST_LD_OP( 9, lbu, 0x0000000f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x000000ff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + lbu x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0x00000000, \ + la x1, tdat; \ + addi x1, x1, -6; \ + lbu x3, 7(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, lbu, 0x000000f0, 1, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, lbu, 0x0000000f, 1, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, lbu, 0x00000000, 1, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, lbu, 0x000000f0, 1, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, lbu, 0x0000000f, 1, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, lbu, 0x00000000, 1, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + lbu x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + lbu x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .byte 0xff +tdat2: .byte 0x00 +tdat3: .byte 0xf0 +tdat4: .byte 0x0f + +RVTEST_DATA_END diff --git a/isa/rv32ui/ld.S b/isa/rv32ui/ld.S new file mode 100644 index 0000000..7c98e9e --- /dev/null +++ b/isa/rv32ui/ld.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# ld.S +#----------------------------------------------------------------------------- +# +# Test ld instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, ld, 0x00ff00ff, 0, tdat ); + TEST_LD_OP( 3, ld, 0xff00ff00, 8, tdat ); + TEST_LD_OP( 4, ld, 0x0ff00ff0, 16, tdat ); + TEST_LD_OP( 5, ld, 0xf00ff00f, 24, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, ld, 0x00ff00ff, -24, tdat4 ); + TEST_LD_OP( 7, ld, 0xff00ff00, -16, tdat4 ); + TEST_LD_OP( 8, ld, 0x0ff00ff0, -8, tdat4 ); + TEST_LD_OP( 9, ld, 0xf00ff00f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x00ff00ff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + ld x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0xff00ff00, \ + la x1, tdat; \ + addi x1, x1, -3; \ + ld x3, 11(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, ld, 0x0ff00ff0, 8, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, ld, 0xf00ff00f, 8, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, ld, 0xff00ff00, 8, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, ld, 0x0ff00ff0, 8, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, ld, 0xf00ff00f, 8, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, ld, 0xff00ff00, 8, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + ld x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + ld x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .dword 0x00ff00ff +tdat2: .dword 0xff00ff00 +tdat3: .dword 0x0ff00ff0 +tdat4: .dword 0xf00ff00f + +RVTEST_DATA_END diff --git a/isa/rv32ui/lh.S b/isa/rv32ui/lh.S new file mode 100644 index 0000000..3389ef7 --- /dev/null +++ b/isa/rv32ui/lh.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# lh.S +#----------------------------------------------------------------------------- +# +# Test lh instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, lh, 0x000000ff, 0, tdat ); + TEST_LD_OP( 3, lh, 0xffffff00, 2, tdat ); + TEST_LD_OP( 4, lh, 0x00000ff0, 4, tdat ); + TEST_LD_OP( 5, lh, 0xfffff00f, 6, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, lh, 0x000000ff, -6, tdat4 ); + TEST_LD_OP( 7, lh, 0xffffff00, -4, tdat4 ); + TEST_LD_OP( 8, lh, 0x00000ff0, -2, tdat4 ); + TEST_LD_OP( 9, lh, 0xfffff00f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x000000ff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + lh x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0xffffff00, \ + la x1, tdat; \ + addi x1, x1, -5; \ + lh x3, 7(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, lh, 0x00000ff0, 2, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, lh, 0xfffff00f, 2, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, lh, 0xffffff00, 2, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, lh, 0x00000ff0, 2, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, lh, 0xfffff00f, 2, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, lh, 0xffffff00, 2, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + lh x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + lh x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .half 0x00ff +tdat2: .half 0xff00 +tdat3: .half 0x0ff0 +tdat4: .half 0xf00f + +RVTEST_DATA_END diff --git a/isa/rv32ui/lhu.S b/isa/rv32ui/lhu.S new file mode 100644 index 0000000..e8cc073 --- /dev/null +++ b/isa/rv32ui/lhu.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# lhu.S +#----------------------------------------------------------------------------- +# +# Test lhu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, lhu, 0x000000ff, 0, tdat ); + TEST_LD_OP( 3, lhu, 0x0000ff00, 2, tdat ); + TEST_LD_OP( 4, lhu, 0x00000ff0, 4, tdat ); + TEST_LD_OP( 5, lhu, 0x0000f00f, 6, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, lhu, 0x000000ff, -6, tdat4 ); + TEST_LD_OP( 7, lhu, 0x0000ff00, -4, tdat4 ); + TEST_LD_OP( 8, lhu, 0x00000ff0, -2, tdat4 ); + TEST_LD_OP( 9, lhu, 0x0000f00f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x000000ff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + lhu x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0x0000ff00, \ + la x1, tdat; \ + addi x1, x1, -5; \ + lhu x3, 7(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, lhu, 0x00000ff0, 2, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, lhu, 0x0000f00f, 2, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, lhu, 0x0000ff00, 2, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, lhu, 0x00000ff0, 2, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, lhu, 0x0000f00f, 2, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, lhu, 0x0000ff00, 2, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + lhu x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + lhu x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .half 0x00ff +tdat2: .half 0xff00 +tdat3: .half 0x0ff0 +tdat4: .half 0xf00f + +RVTEST_DATA_END diff --git a/isa/rv32ui/lrsc.S b/isa/rv32ui/lrsc.S new file mode 100644 index 0000000..2332ae0 --- /dev/null +++ b/isa/rv32ui/lrsc.S @@ -0,0 +1,77 @@ +#***************************************************************************** +# lrsr.S +#----------------------------------------------------------------------------- +# +# Test LR/SC instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + +# wait for all cores to boot +la a0, coreid +li a1, 1 +amoadd.w a2, a1, (a0) +lw a3, 4(x0) +1: lw a1, (a0) +blt a1, a3, 1b + +# make sure that sc without a reservation fails. +TEST_CASE( 2, a4, 1, \ + la a0, foo; \ + sc.w a4, x0, (a0); \ +) + +# make sure that sc with the wrong reservation fails. +TEST_CASE( 3, a4, 1, \ + la a0, foo; \ + add a1, a0, 1024; \ + lr.w a1, (a1); \ + sc.w a4, a1, (a0); \ +) + +# have each core add its coreid to foo 1000 times +la a0, foo +li a1, 1000 +1: lr.w a4, (a0) +add a4, a4, a2 +sc.w a4, a4, (a0) +bnez a4, 1b +add a1, a1, -1 +bnez a1, 1b + +# wait for all cores to finish +la a0, barrier +li a1, 1 +amoadd.w x0, a1, (a0) +1: lw a1, (a0) +blt a1, a3, 1b +fence + +# expected result is 1000*ncores*(ncores-1)/2 +TEST_CASE( 4, a2, 0, \ + la a0, foo; \ + li a1, 500; \ + mul a1, a1, a3; \ + add a2, a3, -1; \ + mul a1, a1, a2; \ + lw a2, (a0); \ + sub a2, a2, a1; \ +) + +TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +coreid: .word 0 +barrier: .word 0 +foo: .word 0 +RVTEST_DATA_END diff --git a/isa/rv32ui/lui.S b/isa/rv32ui/lui.S new file mode 100644 index 0000000..52b2ff6 --- /dev/null +++ b/isa/rv32ui/lui.S @@ -0,0 +1,34 @@ +#***************************************************************************** +# lui.S +#----------------------------------------------------------------------------- +# +# Test lui instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_CASE( 2, x1, 0x00000000, lui x1, 0x00000 ); + TEST_CASE( 3, x1, 0xfffff800, lui x1, 0xfffff;sra x1,x1,1); + TEST_CASE( 4, x1, 0x000007ff, lui x1, 0x7ffff;sra x1,x1,20); + TEST_CASE( 5, x1, 0xfffff800, lui x1, 0x80000;sra x1,x1,20); + + TEST_CASE( 6, x0, 0, lui x0, 0x80000 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/lw.S b/isa/rv32ui/lw.S new file mode 100644 index 0000000..2696382 --- /dev/null +++ b/isa/rv32ui/lw.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# lw.S +#----------------------------------------------------------------------------- +# +# Test lw instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, lw, 0x00ff00ff, 0, tdat ); + TEST_LD_OP( 3, lw, 0xff00ff00, 4, tdat ); + TEST_LD_OP( 4, lw, 0x0ff00ff0, 8, tdat ); + TEST_LD_OP( 5, lw, 0xf00ff00f, 12, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, lw, 0x00ff00ff, -12, tdat4 ); + TEST_LD_OP( 7, lw, 0xff00ff00, -8, tdat4 ); + TEST_LD_OP( 8, lw, 0x0ff00ff0, -4, tdat4 ); + TEST_LD_OP( 9, lw, 0xf00ff00f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x00ff00ff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + lw x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0xff00ff00, \ + la x1, tdat; \ + addi x1, x1, -3; \ + lw x3, 7(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, lw, 0x0ff00ff0, 4, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, lw, 0xf00ff00f, 4, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, lw, 0xff00ff00, 4, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, lw, 0x0ff00ff0, 4, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, lw, 0xf00ff00f, 4, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, lw, 0xff00ff00, 4, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + lw x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + lw x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .word 0x00ff00ff +tdat2: .word 0xff00ff00 +tdat3: .word 0x0ff00ff0 +tdat4: .word 0xf00ff00f + +RVTEST_DATA_END diff --git a/isa/rv32ui/lwu.S b/isa/rv32ui/lwu.S new file mode 100644 index 0000000..5804680 --- /dev/null +++ b/isa/rv32ui/lwu.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# lwu.S +#----------------------------------------------------------------------------- +# +# Test lwu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_LD_OP( 2, lwu, 0x00ff00ff, 0, tdat ); + TEST_LD_OP( 3, lwu, 0xff00ff00, 4, tdat ); + TEST_LD_OP( 4, lwu, 0x0ff00ff0, 8, tdat ); + TEST_LD_OP( 5, lwu, 0xf00ff00f, 12, tdat ); + + # Test with negative offset + + TEST_LD_OP( 6, lwu, 0x00ff00ff, -12, tdat4 ); + TEST_LD_OP( 7, lwu, 0xff00ff00, -8, tdat4 ); + TEST_LD_OP( 8, lwu, 0x0ff00ff0, -4, tdat4 ); + TEST_LD_OP( 9, lwu, 0xf00ff00f, 0, tdat4 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x00ff00ff, \ + la x1, tdat; \ + addi x1, x1, -32; \ + lwu x3, 32(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0xff00ff00, \ + la x1, tdat; \ + addi x1, x1, -3; \ + lwu x3, 7(x1); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_LD_DEST_BYPASS( 12, 0, lwu, 0x0ff00ff0, 4, tdat2 ); + TEST_LD_DEST_BYPASS( 13, 1, lwu, 0xf00ff00f, 4, tdat3 ); + TEST_LD_DEST_BYPASS( 14, 2, lwu, 0xff00ff00, 4, tdat1 ); + + TEST_LD_SRC1_BYPASS( 15, 0, lwu, 0x0ff00ff0, 4, tdat2 ); + TEST_LD_SRC1_BYPASS( 16, 1, lwu, 0xf00ff00f, 4, tdat3 ); + TEST_LD_SRC1_BYPASS( 17, 2, lwu, 0xff00ff00, 4, tdat1 ); + + #------------------------------------------------------------- + # Test write-after-write hazard + #------------------------------------------------------------- + + TEST_CASE( 18, x2, 2, \ + la x3, tdat; \ + lwu x2, 0(x3); \ + li x2, 2; \ + ) + + TEST_CASE( 19, x2, 2, \ + la x3, tdat; \ + lwu x2, 0(x3); \ + nop; \ + li x2, 2; \ + ) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .word 0x00ff00ff +tdat2: .word 0xff00ff00 +tdat3: .word 0x0ff00ff0 +tdat4: .word 0xf00ff00f + +RVTEST_DATA_END diff --git a/isa/rv32ui/mul.S b/isa/rv32ui/mul.S new file mode 100644 index 0000000..11c248b --- /dev/null +++ b/isa/rv32ui/mul.S @@ -0,0 +1,76 @@ +#***************************************************************************** +# mul.S +#----------------------------------------------------------------------------- +# +# Test mul instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP(32, mul, 0x00001200, 0x00007e00, 0xb6db6db7 ); + TEST_RR_OP(33, mul, 0x00001240, 0x00007fc0, 0xb6db6db7 ); + + TEST_RR_OP( 2, mul, 0x00000000, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, mul, 0x00000001, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, mul, 0x00000015, 0x00000003, 0x00000007 ); + + TEST_RR_OP( 5, mul, 0x00000000, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 6, mul, 0x00000000, 0x80000000, 0x00000000 ); + TEST_RR_OP( 7, mul, 0x00000000, 0x80000000, 0xffff8000 ); + + TEST_RR_OP(30, mul, 0x0000ff7f, 0xaaaaaaab, 0x0002fe7d ); + TEST_RR_OP(31, mul, 0x0000ff7f, 0x0002fe7d, 0xaaaaaaab ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 8, mul, 143, 13, 11 ); + TEST_RR_SRC2_EQ_DEST( 9, mul, 154, 14, 11 ); + TEST_RR_SRC12_EQ_DEST( 10, mul, 169, 13 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 11, 0, mul, 143, 13, 11 ); + TEST_RR_DEST_BYPASS( 12, 1, mul, 154, 14, 11 ); + TEST_RR_DEST_BYPASS( 13, 2, mul, 165, 15, 11 ); + + TEST_RR_SRC12_BYPASS( 14, 0, 0, mul, 143, 13, 11 ); + TEST_RR_SRC12_BYPASS( 15, 0, 1, mul, 154, 14, 11 ); + TEST_RR_SRC12_BYPASS( 16, 0, 2, mul, 165, 15, 11 ); + TEST_RR_SRC12_BYPASS( 17, 1, 0, mul, 143, 13, 11 ); + TEST_RR_SRC12_BYPASS( 18, 1, 1, mul, 154, 14, 11 ); + TEST_RR_SRC12_BYPASS( 19, 2, 0, mul, 165, 15, 11 ); + + TEST_RR_SRC21_BYPASS( 20, 0, 0, mul, 143, 13, 11 ); + TEST_RR_SRC21_BYPASS( 21, 0, 1, mul, 154, 14, 11 ); + TEST_RR_SRC21_BYPASS( 22, 0, 2, mul, 165, 15, 11 ); + TEST_RR_SRC21_BYPASS( 23, 1, 0, mul, 143, 13, 11 ); + TEST_RR_SRC21_BYPASS( 24, 1, 1, mul, 154, 14, 11 ); + TEST_RR_SRC21_BYPASS( 25, 2, 0, mul, 165, 15, 11 ); + + TEST_RR_ZEROSRC1( 26, mul, 0, 31 ); + TEST_RR_ZEROSRC2( 27, mul, 0, 32 ); + TEST_RR_ZEROSRC12( 28, mul, 0 ); + TEST_RR_ZERODEST( 29, mul, 33, 34 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/mulh.S b/isa/rv32ui/mulh.S new file mode 100644 index 0000000..ef695c0 --- /dev/null +++ b/isa/rv32ui/mulh.S @@ -0,0 +1,70 @@ +#***************************************************************************** +# mulh.S +#----------------------------------------------------------------------------- +# +# Test mulh instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, mulh, 0x00000000, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, mulh, 0x00000000, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, mulh, 0x00000000, 0x00000003, 0x00000007 ); + + TEST_RR_OP( 5, mulh, 0x00000000, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 6, mulh, 0x00000000, 0x80000000, 0x00000000 ); + TEST_RR_OP( 7, mulh, 0x00000000, 0x80000000, 0x00000000 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 8, mulh, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC2_EQ_DEST( 9, mulh, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_EQ_DEST( 10, mulh, 43264, 13<<20 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 11, 0, mulh, 36608, 13<<20, 11<<20 ); + TEST_RR_DEST_BYPASS( 12, 1, mulh, 39424, 14<<20, 11<<20 ); + TEST_RR_DEST_BYPASS( 13, 2, mulh, 42240, 15<<20, 11<<20 ); + + TEST_RR_SRC12_BYPASS( 14, 0, 0, mulh, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 15, 0, 1, mulh, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 16, 0, 2, mulh, 42240, 15<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 17, 1, 0, mulh, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 18, 1, 1, mulh, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 19, 2, 0, mulh, 42240, 15<<20, 11<<20 ); + + TEST_RR_SRC21_BYPASS( 20, 0, 0, mulh, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 21, 0, 1, mulh, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 22, 0, 2, mulh, 42240, 15<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 23, 1, 0, mulh, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 24, 1, 1, mulh, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 25, 2, 0, mulh, 42240, 15<<20, 11<<20 ); + + TEST_RR_ZEROSRC1( 26, mulh, 0, 31<<26 ); + TEST_RR_ZEROSRC2( 27, mulh, 0, 32<<26 ); + TEST_RR_ZEROSRC12( 28, mulh, 0 ); + TEST_RR_ZERODEST( 29, mulh, 33<<20, 34<<20 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/mulhsu.S b/isa/rv32ui/mulhsu.S new file mode 100644 index 0000000..e2d5789 --- /dev/null +++ b/isa/rv32ui/mulhsu.S @@ -0,0 +1,72 @@ +#***************************************************************************** +# mulhsu.S +#----------------------------------------------------------------------------- +# +# Test mulhsu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, mulhsu, 0x00000000, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, mulhsu, 0x00000000, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, mulhsu, 0x00000000, 0x00000003, 0x00000007 ); + + TEST_RR_OP( 5, mulhsu, 0x00000000, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 6, mulhsu, 0x00000000, 0x80000000, 0x00000000 ); + TEST_RR_OP( 7, mulhsu, 0x80004000, 0x80000000, 0xffff8000 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 8, mulhsu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC2_EQ_DEST( 9, mulhsu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_EQ_DEST( 10, mulhsu, 43264, 13<<20 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 11, 0, mulhsu, 36608, 13<<20, 11<<20 ); + TEST_RR_DEST_BYPASS( 12, 1, mulhsu, 39424, 14<<20, 11<<20 ); + TEST_RR_DEST_BYPASS( 13, 2, mulhsu, 42240, 15<<20, 11<<20 ); + + TEST_RR_SRC12_BYPASS( 14, 0, 0, mulhsu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 15, 0, 1, mulhsu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 16, 0, 2, mulhsu, 42240, 15<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 17, 1, 0, mulhsu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 18, 1, 1, mulhsu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 19, 2, 0, mulhsu, 42240, 15<<20, 11<<20 ); + + TEST_RR_SRC21_BYPASS( 20, 0, 0, mulhsu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 21, 0, 1, mulhsu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 22, 0, 2, mulhsu, 42240, 15<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 23, 1, 0, mulhsu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 24, 1, 1, mulhsu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 25, 2, 0, mulhsu, 42240, 15<<20, 11<<20 ); + + TEST_RR_ZEROSRC1( 26, mulhsu, 0, 31<<26 ); + TEST_RR_ZEROSRC2( 27, mulhsu, 0, 32<<26 ); + TEST_RR_ZEROSRC12( 28, mulhsu, 0 ); + TEST_RR_ZERODEST( 29, mulhsu, 33<<20, 34<<20 ); + + + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/mulhu.S b/isa/rv32ui/mulhu.S new file mode 100644 index 0000000..288029b --- /dev/null +++ b/isa/rv32ui/mulhu.S @@ -0,0 +1,74 @@ +#***************************************************************************** +# mulhu.S +#----------------------------------------------------------------------------- +# +# Test mulhu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, mulhu, 0x00000000, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, mulhu, 0x00000000, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, mulhu, 0x00000000, 0x00000003, 0x00000007 ); + + TEST_RR_OP( 5, mulhu, 0x00000000, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 6, mulhu, 0x00000000, 0x80000000, 0x00000000 ); + TEST_RR_OP( 7, mulhu, 0x7fffc000, 0x80000000, 0xffff8000 ); + + TEST_RR_OP(30, mulhu, 0x0001fefe, 0xaaaaaaab, 0x0002fe7d ); + TEST_RR_OP(31, mulhu, 0x0001fefe, 0x0002fe7d, 0xaaaaaaab ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 8, mulhu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC2_EQ_DEST( 9, mulhu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_EQ_DEST( 10, mulhu, 43264, 13<<20 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 11, 0, mulhu, 36608, 13<<20, 11<<20 ); + TEST_RR_DEST_BYPASS( 12, 1, mulhu, 39424, 14<<20, 11<<20 ); + TEST_RR_DEST_BYPASS( 13, 2, mulhu, 42240, 15<<20, 11<<20 ); + + TEST_RR_SRC12_BYPASS( 14, 0, 0, mulhu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 15, 0, 1, mulhu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 16, 0, 2, mulhu, 42240, 15<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 17, 1, 0, mulhu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 18, 1, 1, mulhu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC12_BYPASS( 19, 2, 0, mulhu, 42240, 15<<20, 11<<20 ); + + TEST_RR_SRC21_BYPASS( 20, 0, 0, mulhu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 21, 0, 1, mulhu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 22, 0, 2, mulhu, 42240, 15<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 23, 1, 0, mulhu, 36608, 13<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 24, 1, 1, mulhu, 39424, 14<<20, 11<<20 ); + TEST_RR_SRC21_BYPASS( 25, 2, 0, mulhu, 42240, 15<<20, 11<<20 ); + + TEST_RR_ZEROSRC1( 26, mulhu, 0, 31<<26 ); + TEST_RR_ZEROSRC2( 27, mulhu, 0, 32<<26 ); + TEST_RR_ZEROSRC12( 28, mulhu, 0 ); + TEST_RR_ZERODEST( 29, mulhu, 33<<20, 34<<20 ); + + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/mulw.S b/isa/rv32ui/mulw.S new file mode 100644 index 0000000..fdd0690 --- /dev/null +++ b/isa/rv32ui/mulw.S @@ -0,0 +1,70 @@ +#***************************************************************************** +# mulw.S +#----------------------------------------------------------------------------- +# +# Test mulw instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, mulw, 0x00000000, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, mulw, 0x00000001, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, mulw, 0x00000015, 0x00000003, 0x00000007 ); + + TEST_RR_OP( 5, mulw, 0x00000000, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 6, mulw, 0x00000000, 0x80000000, 0x00000000 ); + TEST_RR_OP( 7, mulw, 0x00000000, 0x80000000, 0xffff8000 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 8, mulw, 143, 13, 11 ); + TEST_RR_SRC2_EQ_DEST( 9, mulw, 154, 14, 11 ); + TEST_RR_SRC12_EQ_DEST( 10, mulw, 169, 13 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 11, 0, mulw, 143, 13, 11 ); + TEST_RR_DEST_BYPASS( 12, 1, mulw, 154, 14, 11 ); + TEST_RR_DEST_BYPASS( 13, 2, mulw, 165, 15, 11 ); + + TEST_RR_SRC12_BYPASS( 14, 0, 0, mulw, 143, 13, 11 ); + TEST_RR_SRC12_BYPASS( 15, 0, 1, mulw, 154, 14, 11 ); + TEST_RR_SRC12_BYPASS( 16, 0, 2, mulw, 165, 15, 11 ); + TEST_RR_SRC12_BYPASS( 17, 1, 0, mulw, 143, 13, 11 ); + TEST_RR_SRC12_BYPASS( 18, 1, 1, mulw, 154, 14, 11 ); + TEST_RR_SRC12_BYPASS( 19, 2, 0, mulw, 165, 15, 11 ); + + TEST_RR_SRC21_BYPASS( 20, 0, 0, mulw, 143, 13, 11 ); + TEST_RR_SRC21_BYPASS( 21, 0, 1, mulw, 154, 14, 11 ); + TEST_RR_SRC21_BYPASS( 22, 0, 2, mulw, 165, 15, 11 ); + TEST_RR_SRC21_BYPASS( 23, 1, 0, mulw, 143, 13, 11 ); + TEST_RR_SRC21_BYPASS( 24, 1, 1, mulw, 154, 14, 11 ); + TEST_RR_SRC21_BYPASS( 25, 2, 0, mulw, 165, 15, 11 ); + + TEST_RR_ZEROSRC1( 26, mulw, 0, 31 ); + TEST_RR_ZEROSRC2( 27, mulw, 0, 32 ); + TEST_RR_ZEROSRC12( 28, mulw, 0 ); + TEST_RR_ZERODEST( 29, mulw, 33, 34 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/or.S b/isa/rv32ui/or.S new file mode 100644 index 0000000..6d3bbfb --- /dev/null +++ b/isa/rv32ui/or.S @@ -0,0 +1,67 @@ +#***************************************************************************** +# or.S +#----------------------------------------------------------------------------- +# +# Test or instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Logical tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_OP( 3, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_OP( 4, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_OP( 5, or, 0xf0fff0ff, 0xf00ff00f, 0xf0f0f0f0 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 6, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC2_EQ_DEST( 7, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_EQ_DEST( 8, or, 0xff00ff00, 0xff00ff00 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 9, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_DEST_BYPASS( 10, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_DEST_BYPASS( 11, 2, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_SRC12_BYPASS( 12, 0, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 13, 0, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_BYPASS( 14, 0, 2, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 15, 1, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 16, 1, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_BYPASS( 17, 2, 0, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_SRC21_BYPASS( 18, 0, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 19, 0, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC21_BYPASS( 20, 0, 2, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 21, 1, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 22, 1, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC21_BYPASS( 23, 2, 0, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_ZEROSRC1( 24, or, 0xff00ff00, 0xff00ff00 ); + TEST_RR_ZEROSRC2( 25, or, 0x00ff00ff, 0x00ff00ff ); + TEST_RR_ZEROSRC12( 26, or, 0 ); + TEST_RR_ZERODEST( 27, or, 0x11111111, 0x22222222 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/ori.S b/isa/rv32ui/ori.S new file mode 100644 index 0000000..9e57e84 --- /dev/null +++ b/isa/rv32ui/ori.S @@ -0,0 +1,53 @@ +#***************************************************************************** +# ori.S +#----------------------------------------------------------------------------- +# +# Test ori instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Logical tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, ori, 0xffffff0f, 0xff00ff00, 0xf0f ); + TEST_IMM_OP( 3, ori, 0x0ff00ff0, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_OP( 4, ori, 0x00ff07ff, 0x00ff00ff, 0x70f ); + TEST_IMM_OP( 5, ori, 0xf00ff0ff, 0xf00ff00f, 0x0f0 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 6, ori, 0xff00fff0, 0xff00ff00, 0x0f0 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 7, 0, ori, 0x0ff00ff0, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_DEST_BYPASS( 8, 1, ori, 0x00ff07ff, 0x00ff00ff, 0x70f ); + TEST_IMM_DEST_BYPASS( 9, 2, ori, 0xf00ff0ff, 0xf00ff00f, 0x0f0 ); + + TEST_IMM_SRC1_BYPASS( 10, 0, ori, 0x0ff00ff0, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_SRC1_BYPASS( 11, 1, ori, 0xffffffff, 0x00ff00ff, 0xf0f ); + TEST_IMM_SRC1_BYPASS( 12, 2, ori, 0xf00ff0ff, 0xf00ff00f, 0x0f0 ); + + TEST_IMM_ZEROSRC1( 13, ori, 0x0f0, 0x0f0 ); + TEST_IMM_ZERODEST( 14, ori, 0x00ff00ff, 0x70f ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/rem.S b/isa/rv32ui/rem.S new file mode 100644 index 0000000..316f06a --- /dev/null +++ b/isa/rv32ui/rem.S @@ -0,0 +1,39 @@ +#***************************************************************************** +# rem.S +#----------------------------------------------------------------------------- +# +# Test rem instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, rem, 2, 20, 6 ); + TEST_RR_OP( 3, rem, -2, -20, 6 ); + TEST_RR_OP( 4, rem, 2, 20, -6 ); + TEST_RR_OP( 5, rem, -2, -20, -6 ); + + TEST_RR_OP( 6, rem, 0, -1<<63, 1 ); + TEST_RR_OP( 7, rem, 0, -1<<63, -1 ); + + TEST_RR_OP( 8, rem, -1<<63, -1<<63, 0 ); + TEST_RR_OP( 9, rem, 1, 1, 0 ); + TEST_RR_OP(10, rem, 0, 0, 0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/remu.S b/isa/rv32ui/remu.S new file mode 100644 index 0000000..cc0f72c --- /dev/null +++ b/isa/rv32ui/remu.S @@ -0,0 +1,39 @@ +#***************************************************************************** +# remu.S +#----------------------------------------------------------------------------- +# +# Test remu instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, remu, 2, 20, 6 ); + TEST_RR_OP( 3, remu, 2, -20, 6 ); + TEST_RR_OP( 4, remu, 20, 20, -6 ); + TEST_RR_OP( 5, remu, -20, -20, -6 ); + + TEST_RR_OP( 6, remu, 0, -1<<63, 1 ); + TEST_RR_OP( 7, remu, -1<<63, -1<<63, -1 ); + + TEST_RR_OP( 8, remu, -1<<63, -1<<63, 0 ); + TEST_RR_OP( 9, remu, 1, 1, 0 ); + TEST_RR_OP(10, remu, 0, 0, 0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/sb.S b/isa/rv32ui/sb.S new file mode 100644 index 0000000..9d6830b --- /dev/null +++ b/isa/rv32ui/sb.S @@ -0,0 +1,100 @@ +#***************************************************************************** +# sb.S +#----------------------------------------------------------------------------- +# +# Test sb instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_ST_OP( 2, lb, sb, 0xffffffaa, 0, tdat ); + TEST_ST_OP( 3, lb, sb, 0x00000000, 1, tdat ); +#ifdef __RISCVEL + TEST_ST_OP( 4, lh, sb, 0xffffefa0, 2, tdat ); +#elif defined(__RISCVEB) +#else + TEST_ST_OP( 4, lh, sb, 0xffffa0ef, 2, tdat ); +#error unknown endianness! +#endif + TEST_ST_OP( 5, lb, sb, 0x0000000a, 3, tdat ); + + # Test with negative offset + + TEST_ST_OP( 6, lb, sb, 0xffffffaa, -3, tdat8 ); + TEST_ST_OP( 7, lb, sb, 0x00000000, -2, tdat8 ); + TEST_ST_OP( 8, lb, sb, 0xffffffa0, -1, tdat8 ); + TEST_ST_OP( 9, lb, sb, 0x0000000a, 0, tdat8 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x78, \ + la x1, tdat9; \ + li x2, 0x12345678; \ + addi x4, x1, -32; \ + sb x2, 32(x4); \ + lb x3, 0(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0xffffff98, \ + la x1, tdat9; \ + li x2, 0x00003098; \ + addi x1, x1, -6; \ + sb x2, 7(x1); \ + la x4, tdat10; \ + lb x3, 0(x4); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_ST_SRC12_BYPASS( 12, 0, 0, lb, sb, 0xffffffdd, 0, tdat ); + TEST_ST_SRC12_BYPASS( 13, 0, 1, lb, sb, 0xffffffcd, 1, tdat ); + TEST_ST_SRC12_BYPASS( 14, 0, 2, lb, sb, 0xffffffcc, 2, tdat ); + TEST_ST_SRC12_BYPASS( 15, 1, 0, lb, sb, 0xffffffbc, 3, tdat ); + TEST_ST_SRC12_BYPASS( 16, 1, 1, lb, sb, 0xffffffbb, 4, tdat ); + TEST_ST_SRC12_BYPASS( 17, 2, 0, lb, sb, 0xffffffab, 5, tdat ); + + TEST_ST_SRC21_BYPASS( 18, 0, 0, lb, sb, 0x33, 0, tdat ); + TEST_ST_SRC21_BYPASS( 19, 0, 1, lb, sb, 0x23, 1, tdat ); + TEST_ST_SRC21_BYPASS( 20, 0, 2, lb, sb, 0x22, 2, tdat ); + TEST_ST_SRC21_BYPASS( 21, 1, 0, lb, sb, 0x12, 3, tdat ); + TEST_ST_SRC21_BYPASS( 22, 1, 1, lb, sb, 0x11, 4, tdat ); + TEST_ST_SRC21_BYPASS( 23, 2, 0, lb, sb, 0x01, 5, tdat ); + + li a0, 0xef + la a1, tdat + sb a0, 3(a1) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .byte 0xef +tdat2: .byte 0xef +tdat3: .byte 0xef +tdat4: .byte 0xef +tdat5: .byte 0xef +tdat6: .byte 0xef +tdat7: .byte 0xef +tdat8: .byte 0xef +tdat9: .byte 0xef +tdat10: .byte 0xef + +RVTEST_DATA_END diff --git a/isa/rv32ui/sh.S b/isa/rv32ui/sh.S new file mode 100644 index 0000000..1da7a83 --- /dev/null +++ b/isa/rv32ui/sh.S @@ -0,0 +1,100 @@ +#***************************************************************************** +# sh.S +#----------------------------------------------------------------------------- +# +# Test sh instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_ST_OP( 2, lh, sh, 0x000000aa, 0, tdat ); + TEST_ST_OP( 3, lh, sh, 0xffffaa00, 2, tdat ); +#ifdef __RISCVEL + TEST_ST_OP( 4, lw, sh, 0xbeef0aa0, 4, tdat ); +#elif defined(__RISCVEB) +#else + TEST_ST_OP( 4, lw, sh, 0x0aa0beef, 4, tdat ); +#error unknown endianness! +#endif + TEST_ST_OP( 5, lh, sh, 0xffffa00a, 6, tdat ); + + # Test with negative offset + + TEST_ST_OP( 6, lh, sh, 0x000000aa, -6, tdat8 ); + TEST_ST_OP( 7, lh, sh, 0xffffaa00, -4, tdat8 ); + TEST_ST_OP( 8, lh, sh, 0x00000aa0, -2, tdat8 ); + TEST_ST_OP( 9, lh, sh, 0xffffa00a, 0, tdat8 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x5678, \ + la x1, tdat9; \ + li x2, 0x12345678; \ + addi x4, x1, -32; \ + sh x2, 32(x4); \ + lh x3, 0(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0x3098, \ + la x1, tdat9; \ + li x2, 0x00003098; \ + addi x1, x1, -5; \ + sh x2, 7(x1); \ + la x4, tdat10; \ + lh x3, 0(x4); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_ST_SRC12_BYPASS( 12, 0, 0, lh, sh, 0xffffccdd, 0, tdat ); + TEST_ST_SRC12_BYPASS( 13, 0, 1, lh, sh, 0xffffbccd, 2, tdat ); + TEST_ST_SRC12_BYPASS( 14, 0, 2, lh, sh, 0xffffbbcc, 4, tdat ); + TEST_ST_SRC12_BYPASS( 15, 1, 0, lh, sh, 0xffffabbc, 6, tdat ); + TEST_ST_SRC12_BYPASS( 16, 1, 1, lh, sh, 0xffffaabb, 8, tdat ); + TEST_ST_SRC12_BYPASS( 17, 2, 0, lh, sh, 0xffffdaab, 10, tdat ); + + TEST_ST_SRC21_BYPASS( 18, 0, 0, lh, sh, 0x2233, 0, tdat ); + TEST_ST_SRC21_BYPASS( 19, 0, 1, lh, sh, 0x1223, 2, tdat ); + TEST_ST_SRC21_BYPASS( 20, 0, 2, lh, sh, 0x1122, 4, tdat ); + TEST_ST_SRC21_BYPASS( 21, 1, 0, lh, sh, 0x0112, 6, tdat ); + TEST_ST_SRC21_BYPASS( 22, 1, 1, lh, sh, 0x0011, 8, tdat ); + TEST_ST_SRC21_BYPASS( 23, 2, 0, lh, sh, 0x3001, 10, tdat ); + + li a0, 0xbeef + la a1, tdat + sh a0, 6(a1) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .half 0xbeef +tdat2: .half 0xbeef +tdat3: .half 0xbeef +tdat4: .half 0xbeef +tdat5: .half 0xbeef +tdat6: .half 0xbeef +tdat7: .half 0xbeef +tdat8: .half 0xbeef +tdat9: .half 0xbeef +tdat10: .half 0xbeef + +RVTEST_DATA_END diff --git a/isa/rv32ui/sll.S b/isa/rv32ui/sll.S new file mode 100644 index 0000000..9408f14 --- /dev/null +++ b/isa/rv32ui/sll.S @@ -0,0 +1,88 @@ +#***************************************************************************** +# sll.S +#----------------------------------------------------------------------------- +# +# Test sll instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, sll, 0x00000001, 0x00000001, 0 ); + TEST_RR_OP( 3, sll, 0x00000002, 0x00000001, 1 ); + TEST_RR_OP( 4, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_OP( 5, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_OP( 6, sll, 0x80000000, 0x00000001, 31 ); + + TEST_RR_OP( 7, sll, 0xffffffff, 0xffffffff, 0 ); + TEST_RR_OP( 8, sll, 0xfffffffe, 0xffffffff, 1 ); + TEST_RR_OP( 9, sll, 0xffffff80, 0xffffffff, 7 ); + TEST_RR_OP( 10, sll, 0xffffc000, 0xffffffff, 14 ); + TEST_RR_OP( 11, sll, 0x80000000, 0xffffffff, 31 ); + + TEST_RR_OP( 12, sll, 0x21212121, 0x21212121, 0 ); + TEST_RR_OP( 13, sll, 0x42424242, 0x21212121, 1 ); + TEST_RR_OP( 14, sll, 0x90909080, 0x21212121, 7 ); + TEST_RR_OP( 15, sll, 0x48484000, 0x21212121, 14 ); + TEST_RR_OP( 16, sll, 0x80000000, 0x21212121, 31 ); + + # Verify that shifts only use bottom five bits + + TEST_RR_OP( 17, sll, 0x21212121, 0x21212121, 0xffffffe0 ); + TEST_RR_OP( 18, sll, 0x42424242, 0x21212121, 0xffffffe1 ); + TEST_RR_OP( 19, sll, 0x90909080, 0x21212121, 0xffffffe7 ); + TEST_RR_OP( 20, sll, 0x48484000, 0x21212121, 0xffffffee ); + TEST_RR_OP( 21, sll, 0x00000000, 0x21212120, 0xffffffff ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 22, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_SRC2_EQ_DEST( 23, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_SRC12_EQ_DEST( 24, sll, 24, 3 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 25, 0, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_DEST_BYPASS( 26, 1, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_DEST_BYPASS( 27, 2, sll, 0x80000000, 0x00000001, 31 ); + + TEST_RR_SRC12_BYPASS( 28, 0, 0, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_SRC12_BYPASS( 29, 0, 1, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_SRC12_BYPASS( 30, 0, 2, sll, 0x80000000, 0x00000001, 31 ); + TEST_RR_SRC12_BYPASS( 31, 1, 0, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_SRC12_BYPASS( 32, 1, 1, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_SRC12_BYPASS( 33, 2, 0, sll, 0x80000000, 0x00000001, 31 ); + + TEST_RR_SRC21_BYPASS( 34, 0, 0, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_SRC21_BYPASS( 35, 0, 1, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_SRC21_BYPASS( 36, 0, 2, sll, 0x80000000, 0x00000001, 31 ); + TEST_RR_SRC21_BYPASS( 37, 1, 0, sll, 0x00000080, 0x00000001, 7 ); + TEST_RR_SRC21_BYPASS( 38, 1, 1, sll, 0x00004000, 0x00000001, 14 ); + TEST_RR_SRC21_BYPASS( 39, 2, 0, sll, 0x80000000, 0x00000001, 31 ); + + TEST_RR_ZEROSRC1( 40, sll, 0, 15 ); + TEST_RR_ZEROSRC2( 41, sll, 32, 32 ); + TEST_RR_ZEROSRC12( 42, sll, 0 ); + TEST_RR_ZERODEST( 43, sll, 1024, 2048 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/slli.S b/isa/rv32ui/slli.S new file mode 100644 index 0000000..0d8a874 --- /dev/null +++ b/isa/rv32ui/slli.S @@ -0,0 +1,66 @@ +#***************************************************************************** +# slli.S +#----------------------------------------------------------------------------- +# +# Test slli instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, slli, 0x00000001, 0x00000001, 0 ); + TEST_IMM_OP( 3, slli, 0x00000002, 0x00000001, 1 ); + TEST_IMM_OP( 4, slli, 0x00000080, 0x00000001, 7 ); + TEST_IMM_OP( 5, slli, 0x00004000, 0x00000001, 14 ); + TEST_IMM_OP( 6, slli, 0x80000000, 0x00000001, 31 ); + + TEST_IMM_OP( 7, slli, 0xffffffff, 0xffffffff, 0 ); + TEST_IMM_OP( 8, slli, 0xfffffffe, 0xffffffff, 1 ); + TEST_IMM_OP( 9, slli, 0xffffff80, 0xffffffff, 7 ); + TEST_IMM_OP( 10, slli, 0xffffc000, 0xffffffff, 14 ); + TEST_IMM_OP( 11, slli, 0x80000000, 0xffffffff, 31 ); + + TEST_IMM_OP( 12, slli, 0x21212121, 0x21212121, 0 ); + TEST_IMM_OP( 13, slli, 0x42424242, 0x21212121, 1 ); + TEST_IMM_OP( 14, slli, 0x90909080, 0x21212121, 7 ); + TEST_IMM_OP( 15, slli, 0x48484000, 0x21212121, 14 ); + TEST_IMM_OP( 16, slli, 0x80000000, 0x21212121, 31 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 17, slli, 0x00000080, 0x00000001, 7 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 18, 0, slli, 0x00000080, 0x00000001, 7 ); + TEST_IMM_DEST_BYPASS( 19, 1, slli, 0x00004000, 0x00000001, 14 ); + TEST_IMM_DEST_BYPASS( 20, 2, slli, 0x80000000, 0x00000001, 31 ); + + TEST_IMM_SRC1_BYPASS( 21, 0, slli, 0x00000080, 0x00000001, 7 ); + TEST_IMM_SRC1_BYPASS( 22, 1, slli, 0x00004000, 0x00000001, 14 ); + TEST_IMM_SRC1_BYPASS( 23, 2, slli, 0x80000000, 0x00000001, 31 ); + + TEST_IMM_ZEROSRC1( 24, slli, 0, 31 ); + TEST_IMM_ZERODEST( 25, slli, 33, 20 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/slt.S b/isa/rv32ui/slt.S new file mode 100644 index 0000000..b4f9252 --- /dev/null +++ b/isa/rv32ui/slt.S @@ -0,0 +1,82 @@ +#***************************************************************************** +# slt.S +#----------------------------------------------------------------------------- +# +# Test slt instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, slt, 0, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, slt, 0, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, slt, 1, 0x00000003, 0x00000007 ); + TEST_RR_OP( 5, slt, 0, 0x00000007, 0x00000003 ); + + TEST_RR_OP( 6, slt, 0, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 7, slt, 1, 0x80000000, 0x00000000 ); + TEST_RR_OP( 8, slt, 1, 0x80000000, 0xffff8000 ); + + TEST_RR_OP( 9, slt, 1, 0x00000000, 0x00007fff ); + TEST_RR_OP( 10, slt, 0, 0x7fffffff, 0x00000000 ); + TEST_RR_OP( 11, slt, 0, 0x7fffffff, 0x00007fff ); + + TEST_RR_OP( 12, slt, 1, 0x80000000, 0x00007fff ); + TEST_RR_OP( 13, slt, 0, 0x7fffffff, 0xffff8000 ); + + TEST_RR_OP( 14, slt, 0, 0x00000000, 0xffffffff ); + TEST_RR_OP( 15, slt, 1, 0xffffffff, 0x00000001 ); + TEST_RR_OP( 16, slt, 0, 0xffffffff, 0xffffffff ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 17, slt, 0, 14, 13 ); + TEST_RR_SRC2_EQ_DEST( 18, slt, 1, 11, 13 ); + TEST_RR_SRC12_EQ_DEST( 19, slt, 0, 13 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 20, 0, slt, 1, 11, 13 ); + TEST_RR_DEST_BYPASS( 21, 1, slt, 0, 14, 13 ); + TEST_RR_DEST_BYPASS( 22, 2, slt, 1, 12, 13 ); + + TEST_RR_SRC12_BYPASS( 23, 0, 0, slt, 0, 14, 13 ); + TEST_RR_SRC12_BYPASS( 24, 0, 1, slt, 1, 11, 13 ); + TEST_RR_SRC12_BYPASS( 25, 0, 2, slt, 0, 15, 13 ); + TEST_RR_SRC12_BYPASS( 26, 1, 0, slt, 1, 10, 13 ); + TEST_RR_SRC12_BYPASS( 27, 1, 1, slt, 0, 16, 13 ); + TEST_RR_SRC12_BYPASS( 28, 2, 0, slt, 1, 9, 13 ); + + TEST_RR_SRC21_BYPASS( 29, 0, 0, slt, 0, 17, 13 ); + TEST_RR_SRC21_BYPASS( 30, 0, 1, slt, 1, 8, 13 ); + TEST_RR_SRC21_BYPASS( 31, 0, 2, slt, 0, 18, 13 ); + TEST_RR_SRC21_BYPASS( 32, 1, 0, slt, 1, 7, 13 ); + TEST_RR_SRC21_BYPASS( 33, 1, 1, slt, 0, 19, 13 ); + TEST_RR_SRC21_BYPASS( 34, 2, 0, slt, 1, 6, 13 ); + + TEST_RR_ZEROSRC1( 35, slt, 0, -1 ); + TEST_RR_ZEROSRC2( 36, slt, 1, -1 ); + TEST_RR_ZEROSRC12( 37, slt, 0 ); + TEST_RR_ZERODEST( 38, slt, 16, 30 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/slti.S b/isa/rv32ui/slti.S new file mode 100644 index 0000000..9ee97bb --- /dev/null +++ b/isa/rv32ui/slti.S @@ -0,0 +1,68 @@ +#***************************************************************************** +# slti.S +#----------------------------------------------------------------------------- +# +# Test slti instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, slti, 0, 0x00000000, 0x000 ); + TEST_IMM_OP( 3, slti, 0, 0x00000001, 0x001 ); + TEST_IMM_OP( 4, slti, 1, 0x00000003, 0x007 ); + TEST_IMM_OP( 5, slti, 0, 0x00000007, 0x003 ); + + TEST_IMM_OP( 6, slti, 0, 0x00000000, 0x800 ); + TEST_IMM_OP( 7, slti, 1, 0x80000000, 0x000 ); + TEST_IMM_OP( 8, slti, 1, 0x80000000, 0x800 ); + + TEST_IMM_OP( 9, slti, 1, 0x00000000, 0x7ff ); + TEST_IMM_OP( 10, slti, 0, 0x7fffffff, 0x000 ); + TEST_IMM_OP( 11, slti, 0, 0x7fffffff, 0x7ff ); + + TEST_IMM_OP( 12, slti, 1, 0x80000000, 0x7ff ); + TEST_IMM_OP( 13, slti, 0, 0x7fffffff, 0x800 ); + + TEST_IMM_OP( 14, slti, 0, 0x00000000, 0xfff ); + TEST_IMM_OP( 15, slti, 1, 0xffffffff, 0x001 ); + TEST_IMM_OP( 16, slti, 0, 0xffffffff, 0xfff ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 17, sltiu, 1, 11, 13 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 18, 0, slti, 0, 15, 10 ); + TEST_IMM_DEST_BYPASS( 19, 1, slti, 1, 10, 16 ); + TEST_IMM_DEST_BYPASS( 20, 2, slti, 0, 16, 9 ); + + TEST_IMM_SRC1_BYPASS( 21, 0, slti, 1, 11, 15 ); + TEST_IMM_SRC1_BYPASS( 22, 1, slti, 0, 17, 8 ); + TEST_IMM_SRC1_BYPASS( 23, 2, slti, 1, 12, 14 ); + + TEST_IMM_ZEROSRC1( 24, slti, 0, 0xfff ); + TEST_IMM_ZERODEST( 25, slti, 0x00ff00ff, 0xfff ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/sra.S b/isa/rv32ui/sra.S new file mode 100644 index 0000000..3cdbdcd --- /dev/null +++ b/isa/rv32ui/sra.S @@ -0,0 +1,88 @@ +#***************************************************************************** +# sra.S +#----------------------------------------------------------------------------- +# +# Test sra instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, sra, 0x80000000, 0x80000000, 0 ); + TEST_RR_OP( 3, sra, 0xc0000000, 0x80000000, 1 ); + TEST_RR_OP( 4, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_OP( 5, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_OP( 6, sra, 0xffffffff, 0x80000001, 31 ); + + TEST_RR_OP( 7, sra, 0x7fffffff, 0x7fffffff, 0 ); + TEST_RR_OP( 8, sra, 0x3fffffff, 0x7fffffff, 1 ); + TEST_RR_OP( 9, sra, 0x00ffffff, 0x7fffffff, 7 ); + TEST_RR_OP( 10, sra, 0x0001ffff, 0x7fffffff, 14 ); + TEST_RR_OP( 11, sra, 0x00000000, 0x7fffffff, 31 ); + + TEST_RR_OP( 12, sra, 0x81818181, 0x81818181, 0 ); + TEST_RR_OP( 13, sra, 0xc0c0c0c0, 0x81818181, 1 ); + TEST_RR_OP( 14, sra, 0xff030303, 0x81818181, 7 ); + TEST_RR_OP( 15, sra, 0xfffe0606, 0x81818181, 14 ); + TEST_RR_OP( 16, sra, 0xffffffff, 0x81818181, 31 ); + + # Verify that shifts only use bottom five bits + + TEST_RR_OP( 17, sra, 0x81818181, 0x81818181, 0xffffffc0 ); + TEST_RR_OP( 18, sra, 0xc0c0c0c0, 0x81818181, 0xffffffc1 ); + TEST_RR_OP( 19, sra, 0xff030303, 0x81818181, 0xffffffc7 ); + TEST_RR_OP( 20, sra, 0xfffe0606, 0x81818181, 0xffffffce ); + TEST_RR_OP( 21, sra, 0xffffffff, 0x81818181, 0xffffffff ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 22, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_SRC2_EQ_DEST( 23, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_SRC12_EQ_DEST( 24, sra, 0, 7 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 25, 0, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_DEST_BYPASS( 26, 1, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_DEST_BYPASS( 27, 2, sra, 0xffffffff, 0x80000000, 31 ); + + TEST_RR_SRC12_BYPASS( 28, 0, 0, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_SRC12_BYPASS( 29, 0, 1, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_SRC12_BYPASS( 30, 0, 2, sra, 0xffffffff, 0x80000000, 31 ); + TEST_RR_SRC12_BYPASS( 31, 1, 0, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_SRC12_BYPASS( 32, 1, 1, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_SRC12_BYPASS( 33, 2, 0, sra, 0xffffffff, 0x80000000, 31 ); + + TEST_RR_SRC21_BYPASS( 34, 0, 0, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_SRC21_BYPASS( 35, 0, 1, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_SRC21_BYPASS( 36, 0, 2, sra, 0xffffffff, 0x80000000, 31 ); + TEST_RR_SRC21_BYPASS( 37, 1, 0, sra, 0xff000000, 0x80000000, 7 ); + TEST_RR_SRC21_BYPASS( 38, 1, 1, sra, 0xfffe0000, 0x80000000, 14 ); + TEST_RR_SRC21_BYPASS( 39, 2, 0, sra, 0xffffffff, 0x80000000, 31 ); + + TEST_RR_ZEROSRC1( 40, sra, 0, 15 ); + TEST_RR_ZEROSRC2( 41, sra, 32, 32 ); + TEST_RR_ZEROSRC12( 42, sra, 0 ); + TEST_RR_ZERODEST( 43, sra, 1024, 2048 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/srai.S b/isa/rv32ui/srai.S new file mode 100644 index 0000000..e1adbbb --- /dev/null +++ b/isa/rv32ui/srai.S @@ -0,0 +1,66 @@ +#***************************************************************************** +# srai.S +#----------------------------------------------------------------------------- +# +# Test srai instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, srai, 0x00000000, 0x00000000, 0 ); + TEST_IMM_OP( 3, srai, 0xc0000000, 0x80000000, 1 ); + TEST_IMM_OP( 4, srai, 0xff000000, 0x80000000, 7 ); + TEST_IMM_OP( 5, srai, 0xfffe0000, 0x80000000, 14 ); + TEST_IMM_OP( 6, srai, 0xffffffff, 0x80000001, 31 ); + + TEST_IMM_OP( 7, srai, 0x7fffffff, 0x7fffffff, 0 ); + TEST_IMM_OP( 8, srai, 0x3fffffff, 0x7fffffff, 1 ); + TEST_IMM_OP( 9, srai, 0x00ffffff, 0x7fffffff, 7 ); + TEST_IMM_OP( 10, srai, 0x0001ffff, 0x7fffffff, 14 ); + TEST_IMM_OP( 11, srai, 0x00000000, 0x7fffffff, 31 ); + + TEST_IMM_OP( 12, srai, 0x81818181, 0x81818181, 0 ); + TEST_IMM_OP( 13, srai, 0xc0c0c0c0, 0x81818181, 1 ); + TEST_IMM_OP( 14, srai, 0xff030303, 0x81818181, 7 ); + TEST_IMM_OP( 15, srai, 0xfffe0606, 0x81818181, 14 ); + TEST_IMM_OP( 16, srai, 0xffffffff, 0x81818181, 31 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 17, srai, 0xff000000, 0x80000000, 7 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 18, 0, srai, 0xff000000, 0x80000000, 7 ); + TEST_IMM_DEST_BYPASS( 19, 1, srai, 0xfffe0000, 0x80000000, 14 ); + TEST_IMM_DEST_BYPASS( 20, 2, srai, 0xffffffff, 0x80000001, 31 ); + + TEST_IMM_SRC1_BYPASS( 21, 0, srai, 0xff000000, 0x80000000, 7 ); + TEST_IMM_SRC1_BYPASS( 22, 1, srai, 0xfffe0000, 0x80000000, 14 ); + TEST_IMM_SRC1_BYPASS( 23, 2, srai, 0xffffffff, 0x80000001, 31 ); + + TEST_IMM_ZEROSRC1( 24, srai, 0, 31 ); + TEST_IMM_ZERODEST( 25, srai, 33, 20 ); +# + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/srl.S b/isa/rv32ui/srl.S new file mode 100644 index 0000000..d1de5ce --- /dev/null +++ b/isa/rv32ui/srl.S @@ -0,0 +1,88 @@ +#***************************************************************************** +# srl.S +#----------------------------------------------------------------------------- +# +# Test srl instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, srl, 0xffff8000, 0xffff8000, 0 ); + TEST_RR_OP( 3, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_OP( 4, srl, 0x01ffff00, 0xffff8000, 7 ); + TEST_RR_OP( 5, srl, 0x0003fffe, 0xffff8000, 14 ); + TEST_RR_OP( 6, srl, 0x0001ffff, 0xffff8001, 15 ); + + TEST_RR_OP( 7, srl, 0xffffffff, 0xffffffff, 0 ); + TEST_RR_OP( 8, srl, 0x7fffffff, 0xffffffff, 1 ); + TEST_RR_OP( 9, srl, 0x01ffffff, 0xffffffff, 7 ); + TEST_RR_OP( 10, srl, 0x0003ffff, 0xffffffff, 14 ); + TEST_RR_OP( 11, srl, 0x00000001, 0xffffffff, 31 ); + + TEST_RR_OP( 12, srl, 0x21212121, 0x21212121, 0 ); + TEST_RR_OP( 13, srl, 0x10909090, 0x21212121, 1 ); + TEST_RR_OP( 14, srl, 0x00424242, 0x21212121, 7 ); + TEST_RR_OP( 15, srl, 0x00008484, 0x21212121, 14 ); + TEST_RR_OP( 16, srl, 0x00000000, 0x21212121, 31 ); + + # Verify that shifts only use bottom five bits + + TEST_RR_OP( 17, srl, 0x21212121, 0x21212121, 0xffffffe0 ); + TEST_RR_OP( 18, srl, 0x10909090, 0x21212121, 0xffffffe1 ); + TEST_RR_OP( 19, srl, 0x00424242, 0x21212121, 0xffffffe7 ); + TEST_RR_OP( 20, srl, 0x00008484, 0x21212121, 0xffffffee ); + TEST_RR_OP( 21, srl, 0x00000000, 0x21212121, 0xffffffff ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 22, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_SRC2_EQ_DEST( 23, srl, 0x0003fffe, 0xffff8000, 14 ); + TEST_RR_SRC12_EQ_DEST( 24, srl, 0, 7 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 25, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_DEST_BYPASS( 26, 1, srl, 0x0003fffe, 0xffff8000, 14 ); + TEST_RR_DEST_BYPASS( 27, 2, srl, 0x0001ffff, 0xffff8000, 15 ); + + TEST_RR_SRC12_BYPASS( 28, 0, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_SRC12_BYPASS( 29, 0, 1, srl, 0x01ffff00, 0xffff8000, 7 ); + TEST_RR_SRC12_BYPASS( 30, 0, 2, srl, 0x0001ffff, 0xffff8000, 15 ); + TEST_RR_SRC12_BYPASS( 31, 1, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_SRC12_BYPASS( 32, 1, 1, srl, 0x01ffff00, 0xffff8000, 7 ); + TEST_RR_SRC12_BYPASS( 33, 2, 0, srl, 0x0001ffff, 0xffff8000, 15 ); + + TEST_RR_SRC21_BYPASS( 34, 0, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_SRC21_BYPASS( 35, 0, 1, srl, 0x01ffff00, 0xffff8000, 7 ); + TEST_RR_SRC21_BYPASS( 36, 0, 2, srl, 0x0001ffff, 0xffff8000, 15 ); + TEST_RR_SRC21_BYPASS( 37, 1, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_RR_SRC21_BYPASS( 38, 1, 1, srl, 0x01ffff00, 0xffff8000, 7 ); + TEST_RR_SRC21_BYPASS( 39, 2, 0, srl, 0x0001ffff, 0xffff8000, 15 ); + + TEST_RR_ZEROSRC1( 40, srl, 0, 15 ); + TEST_RR_ZEROSRC2( 41, srl, 32, 32 ); + TEST_RR_ZEROSRC12( 42, srl, 0 ); + TEST_RR_ZERODEST( 43, srl, 1024, 2048 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/srli.S b/isa/rv32ui/srli.S new file mode 100644 index 0000000..a8ae06d --- /dev/null +++ b/isa/rv32ui/srli.S @@ -0,0 +1,67 @@ +#***************************************************************************** +# srli.S +#----------------------------------------------------------------------------- +# +# Test srli instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, srli, 0xffff8000, 0xffff8000, 0 ); + TEST_IMM_OP( 3, srli, 0x7fffc000, 0xffff8000, 1 ); + TEST_IMM_OP( 4, srli, 0x01ffff00, 0xffff8000, 7 ); + TEST_IMM_OP( 5, srli, 0x0003fffe, 0xffff8000, 14 ); + TEST_IMM_OP( 6, srli, 0x0001ffff, 0xffff8001, 15 ); + + TEST_IMM_OP( 7, srli, 0xffffffff, 0xffffffff, 0 ); + TEST_IMM_OP( 8, srli, 0x7fffffff, 0xffffffff, 1 ); + TEST_IMM_OP( 9, srli, 0x01ffffff, 0xffffffff, 7 ); + TEST_IMM_OP( 10, srli, 0x0003ffff, 0xffffffff, 14 ); + TEST_IMM_OP( 11, srli, 0x00000001, 0xffffffff, 31 ); + + TEST_IMM_OP( 12, srli, 0x21212121, 0x21212121, 0 ); + TEST_IMM_OP( 13, srli, 0x10909090, 0x21212121, 1 ); + TEST_IMM_OP( 14, srli, 0x00424242, 0x21212121, 7 ); + TEST_IMM_OP( 15, srli, 0x00008484, 0x21212121, 14 ); + TEST_IMM_OP( 16, srli, 0x00000000, 0x21212121, 31 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 21, srli, 0x7fffc000, 0xffff8000, 1 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 22, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_IMM_DEST_BYPASS( 23, 1, srl, 0x0003fffe, 0xffff8000, 14 ); + TEST_IMM_DEST_BYPASS( 24, 2, srl, 0x0001ffff, 0xffff8000, 15 ); + + TEST_IMM_SRC1_BYPASS( 25, 0, srl, 0x7fffc000, 0xffff8000, 1 ); + TEST_IMM_SRC1_BYPASS( 26, 1, srl, 0x0003fffe, 0xffff8000, 14 ); + TEST_IMM_SRC1_BYPASS( 27, 2, srl, 0x0001ffff, 0xffff8000, 15 ); + + + TEST_IMM_ZEROSRC1( 28, srli, 0, 31 ); + TEST_IMM_ZERODEST( 29, srli, 33, 20 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/sub.S b/isa/rv32ui/sub.S new file mode 100644 index 0000000..925d46e --- /dev/null +++ b/isa/rv32ui/sub.S @@ -0,0 +1,81 @@ +#***************************************************************************** +# sub.S +#----------------------------------------------------------------------------- +# +# Test sub instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, sub, 0x00000000, 0x00000000, 0x00000000 ); + TEST_RR_OP( 3, sub, 0x00000000, 0x00000001, 0x00000001 ); + TEST_RR_OP( 4, sub, 0xfffffffc, 0x00000003, 0x00000007 ); + + TEST_RR_OP( 5, sub, 0x00008000, 0x00000000, 0xffff8000 ); + TEST_RR_OP( 6, sub, 0x80000000, 0x80000000, 0x00000000 ); + TEST_RR_OP( 7, sub, 0x80008000, 0x80000000, 0xffff8000 ); + + TEST_RR_OP( 8, sub, 0xffff8001, 0x00000000, 0x00007fff ); + TEST_RR_OP( 9, sub, 0x7fffffff, 0x7fffffff, 0x00000000 ); + TEST_RR_OP( 10, sub, 0x7fff8000, 0x7fffffff, 0x00007fff ); + + TEST_RR_OP( 11, sub, 0x7fff8001, 0x80000000, 0x00007fff ); + TEST_RR_OP( 12, sub, 0x80007fff, 0x7fffffff, 0xffff8000 ); + + TEST_RR_OP( 13, sub, 0x00000001, 0x00000000, 0xffffffff ); + TEST_RR_OP( 14, sub, 0xfffffffe, 0xffffffff, 0x00000001 ); + TEST_RR_OP( 15, sub, 0x00000000, 0xffffffff, 0xffffffff ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 16, sub, 2, 13, 11 ); + TEST_RR_SRC2_EQ_DEST( 17, sub, 3, 14, 11 ); + TEST_RR_SRC12_EQ_DEST( 18, sub, 0, 13 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 19, 0, sub, 2, 13, 11 ); + TEST_RR_DEST_BYPASS( 20, 1, sub, 3, 14, 11 ); + TEST_RR_DEST_BYPASS( 21, 2, sub, 4, 15, 11 ); + + TEST_RR_SRC12_BYPASS( 22, 0, 0, sub, 2, 13, 11 ); + TEST_RR_SRC12_BYPASS( 23, 0, 1, sub, 3, 14, 11 ); + TEST_RR_SRC12_BYPASS( 24, 0, 2, sub, 4, 15, 11 ); + TEST_RR_SRC12_BYPASS( 25, 1, 0, sub, 2, 13, 11 ); + TEST_RR_SRC12_BYPASS( 26, 1, 1, sub, 3, 14, 11 ); + TEST_RR_SRC12_BYPASS( 27, 2, 0, sub, 4, 15, 11 ); + + TEST_RR_SRC21_BYPASS( 28, 0, 0, sub, 2, 13, 11 ); + TEST_RR_SRC21_BYPASS( 29, 0, 1, sub, 3, 14, 11 ); + TEST_RR_SRC21_BYPASS( 30, 0, 2, sub, 4, 15, 11 ); + TEST_RR_SRC21_BYPASS( 31, 1, 0, sub, 2, 13, 11 ); + TEST_RR_SRC21_BYPASS( 32, 1, 1, sub, 3, 14, 11 ); + TEST_RR_SRC21_BYPASS( 33, 2, 0, sub, 4, 15, 11 ); + + TEST_RR_ZEROSRC1( 34, sub, 15, -15 ); + TEST_RR_ZEROSRC2( 35, sub, 32, 32 ); + TEST_RR_ZEROSRC12( 36, sub, 0 ); + TEST_RR_ZERODEST( 37, sub, 16, 30 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/sw.S b/isa/rv32ui/sw.S new file mode 100644 index 0000000..2d82b5f --- /dev/null +++ b/isa/rv32ui/sw.S @@ -0,0 +1,90 @@ +#***************************************************************************** +# sw.S +#----------------------------------------------------------------------------- +# +# Test sw instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Basic tests + #------------------------------------------------------------- + + TEST_ST_OP( 2, lw, sw, 0x00aa00aa, 0, tdat ); + TEST_ST_OP( 3, lw, sw, 0xaa00aa00, 4, tdat ); + TEST_ST_OP( 4, lw, sw, 0x0aa00aa0, 8, tdat ); + TEST_ST_OP( 5, lw, sw, 0xa00aa00a, 12, tdat ); + + # Test with negative offset + + TEST_ST_OP( 6, lw, sw, 0x00aa00aa, -12, tdat8 ); + TEST_ST_OP( 7, lw, sw, 0xaa00aa00, -8, tdat8 ); + TEST_ST_OP( 8, lw, sw, 0x0aa00aa0, -4, tdat8 ); + TEST_ST_OP( 9, lw, sw, 0xa00aa00a, 0, tdat8 ); + + # Test with a negative base + + TEST_CASE( 10, x3, 0x12345678, \ + la x1, tdat9; \ + li x2, 0x12345678; \ + addi x4, x1, -32; \ + sw x2, 32(x4); \ + lw x3, 0(x1); \ + ) + + # Test with unaligned base + + TEST_CASE( 11, x3, 0x58213098, \ + la x1, tdat9; \ + li x2, 0x58213098; \ + addi x1, x1, -3; \ + sw x2, 7(x1); \ + la x4, tdat10; \ + lw x3, 0(x4); \ + ) + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_ST_SRC12_BYPASS( 12, 0, 0, lw, sw, 0xaabbccdd, 0, tdat ); + TEST_ST_SRC12_BYPASS( 13, 0, 1, lw, sw, 0xdaabbccd, 4, tdat ); + TEST_ST_SRC12_BYPASS( 14, 0, 2, lw, sw, 0xddaabbcc, 8, tdat ); + TEST_ST_SRC12_BYPASS( 15, 1, 0, lw, sw, 0xcddaabbc, 12, tdat ); + TEST_ST_SRC12_BYPASS( 16, 1, 1, lw, sw, 0xccddaabb, 16, tdat ); + TEST_ST_SRC12_BYPASS( 17, 2, 0, lw, sw, 0xbccddaab, 20, tdat ); + + TEST_ST_SRC21_BYPASS( 18, 0, 0, lw, sw, 0x00112233, 0, tdat ); + TEST_ST_SRC21_BYPASS( 19, 0, 1, lw, sw, 0x30011223, 4, tdat ); + TEST_ST_SRC21_BYPASS( 20, 0, 2, lw, sw, 0x33001122, 8, tdat ); + TEST_ST_SRC21_BYPASS( 21, 1, 0, lw, sw, 0x23300112, 12, tdat ); + TEST_ST_SRC21_BYPASS( 22, 1, 1, lw, sw, 0x22330011, 16, tdat ); + TEST_ST_SRC21_BYPASS( 23, 2, 0, lw, sw, 0x12233001, 20, tdat ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +tdat: +tdat1: .word 0xdeadbeef +tdat2: .word 0xdeadbeef +tdat3: .word 0xdeadbeef +tdat4: .word 0xdeadbeef +tdat5: .word 0xdeadbeef +tdat6: .word 0xdeadbeef +tdat7: .word 0xdeadbeef +tdat8: .word 0xdeadbeef +tdat9: .word 0xdeadbeef +tdat10: .word 0xdeadbeef + +RVTEST_DATA_END diff --git a/isa/rv32ui/xor.S b/isa/rv32ui/xor.S new file mode 100644 index 0000000..5bf675e --- /dev/null +++ b/isa/rv32ui/xor.S @@ -0,0 +1,67 @@ +#***************************************************************************** +# xor.S +#----------------------------------------------------------------------------- +# +# Test xor instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Logical tests + #------------------------------------------------------------- + + TEST_RR_OP( 2, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_OP( 3, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_OP( 4, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_OP( 5, xor, 0x00ff00ff, 0xf00ff00f, 0xf0f0f0f0 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_RR_SRC1_EQ_DEST( 6, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC2_EQ_DEST( 7, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_EQ_DEST( 8, xor, 0x00000000, 0xff00ff00 ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_RR_DEST_BYPASS( 9, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_DEST_BYPASS( 10, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_DEST_BYPASS( 11, 2, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_SRC12_BYPASS( 12, 0, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 13, 0, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_BYPASS( 14, 0, 2, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 15, 1, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC12_BYPASS( 16, 1, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC12_BYPASS( 17, 2, 0, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_SRC21_BYPASS( 18, 0, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 19, 0, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC21_BYPASS( 20, 0, 2, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 21, 1, 0, xor, 0xf00ff00f, 0xff00ff00, 0x0f0f0f0f ); + TEST_RR_SRC21_BYPASS( 22, 1, 1, xor, 0xff00ff00, 0x0ff00ff0, 0xf0f0f0f0 ); + TEST_RR_SRC21_BYPASS( 23, 2, 0, xor, 0x0ff00ff0, 0x00ff00ff, 0x0f0f0f0f ); + + TEST_RR_ZEROSRC1( 24, xor, 0xff00ff00, 0xff00ff00 ); + TEST_RR_ZEROSRC2( 25, xor, 0x00ff00ff, 0x00ff00ff ); + TEST_RR_ZEROSRC12( 26, xor, 0 ); + TEST_RR_ZERODEST( 27, xor, 0x11111111, 0x22222222 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv32ui/xori.S b/isa/rv32ui/xori.S new file mode 100644 index 0000000..ab5c6ae --- /dev/null +++ b/isa/rv32ui/xori.S @@ -0,0 +1,53 @@ +#***************************************************************************** +# xori.S +#----------------------------------------------------------------------------- +# +# Test xori instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV32U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Logical tests + #------------------------------------------------------------- + + TEST_IMM_OP( 2, xori, 0xff00f00f, 0x00ff0f00, 0xf0f ); + TEST_IMM_OP( 3, xori, 0x0ff00f00, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_OP( 4, xori, 0x00ff0ff0, 0x00ff08ff, 0x70f ); + TEST_IMM_OP( 5, xori, 0xf00ff0ff, 0xf00ff00f, 0x0f0 ); + + #------------------------------------------------------------- + # Source/Destination tests + #------------------------------------------------------------- + + TEST_IMM_SRC1_EQ_DEST( 6, xori, 0xff00f00f, 0xff00f700, 0x70f ); + + #------------------------------------------------------------- + # Bypassing tests + #------------------------------------------------------------- + + TEST_IMM_DEST_BYPASS( 7, 0, xori, 0x0ff00f00, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_DEST_BYPASS( 8, 1, xori, 0x00ff0ff0, 0x00ff08ff, 0x70f ); + TEST_IMM_DEST_BYPASS( 9, 2, xori, 0xf00ff0ff, 0xf00ff00f, 0x0f0 ); + + TEST_IMM_SRC1_BYPASS( 10, 0, xori, 0x0ff00f00, 0x0ff00ff0, 0x0f0 ); + TEST_IMM_SRC1_BYPASS( 11, 1, xori, 0x00ff0ff0, 0x00ff0fff, 0x00f ); + TEST_IMM_SRC1_BYPASS( 12, 2, xori, 0xf00ff0ff, 0xf00ff00f, 0x0f0 ); + + TEST_IMM_ZEROSRC1( 13, xori, 0x0f0, 0x0f0 ); + TEST_IMM_ZERODEST( 14, xori, 0x00ff00ff, 0x70f ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END diff --git a/isa/rv64si/csr.S b/isa/rv64si/csr.S index 26031bc..389280d 100644 --- a/isa/rv64si/csr.S +++ b/isa/rv64si/csr.S @@ -11,6 +11,11 @@ RVTEST_RV64S RVTEST_CODE_BEGIN + # Set up evec in case we trap. + la t0, evec + csrw evec, t0 + csrwi count, 0 + csrwi sup0, 3 TEST_CASE( 2, a0, 3, csrr a0, sup0); TEST_CASE( 3, a1, 3, csrrci a1, sup0, 1); @@ -21,8 +26,55 @@ RVTEST_CODE_BEGIN TEST_CASE( 8, a0, 0xbad0000, li a0, 0x000beef; csrrs a0, sup0, a0); TEST_CASE( 9, a0, 0xbadbeef, csrr a0, sup0); + # Make sure writing the cycle counter causes an exception. + TEST_CASE(10, a0, 255, li a0, 255; csrrw a0, cycle, x0); + + # Make sure reading status in user mode causes an exception. + csrci status, SR_S|SR_PS + TEST_CASE(11, a0, 255, li a0, 255; csrr a0, status); + + # Make sure rdcycle is legal in user mode. + TEST_CASE(12, x0, 0, rdcycle a0) + + # Exit by doing a syscall. + TEST_CASE(13, x0, 1, scall) + + # We should only fall through to this if scall failed. TEST_PASSFAIL +evec: + # Trapping on tests 10, 11, and 13 is usually good news. + # Note that since the test didn't complete, TESTNUM is smaller by 1. + li t0, 9 + beq TESTNUM, t0, privileged + li t0, 10 + beq TESTNUM, t0, privileged + li t0, 12 + beq TESTNUM, t0, syscall + + # Trapping on other tests is bad news. + j fail + +privileged: + # Make sure CAUSE indicates a lack of privilege. + csrr t0, cause + li t1, CAUSE_PRIVILEGED_INSTRUCTION + bne t0, t1, fail + # Return to user mode, but skip the trapping instruction. + csrr t0, epc + addi t0, t0, 4 + csrw epc, t0 + sret + +syscall: + # Make sure CAUSE indicates a syscall. + csrr t0, cause + li t1, CAUSE_SYSCALL + bne t0, t1, fail + + # We're done. + j pass + RVTEST_CODE_END .data diff --git a/isa/rv64sv/illegal_cfg_nfpr.S b/isa/rv64sv/illegal_cfg_nfpr.S index a636a36..fba7e78 100644 --- a/isa/rv64sv/illegal_cfg_nfpr.S +++ b/isa/rv64sv/illegal_cfg_nfpr.S @@ -34,7 +34,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -63,16 +63,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/illegal_cfg_nxpr.S b/isa/rv64sv/illegal_cfg_nxpr.S index e6190c9..f03b443 100644 --- a/isa/rv64sv/illegal_cfg_nxpr.S +++ b/isa/rv64sv/illegal_cfg_nxpr.S @@ -33,7 +33,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -62,16 +62,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/illegal_inst.S b/isa/rv64sv/illegal_inst.S index c16086e..6896b89 100644 --- a/isa/rv64sv/illegal_inst.S +++ b/isa/rv64sv/illegal_inst.S @@ -40,7 +40,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -69,16 +69,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/illegal_vt_inst.S b/isa/rv64sv/illegal_vt_inst.S index ce4fe82..c240076 100644 --- a/isa/rv64sv/illegal_vt_inst.S +++ b/isa/rv64sv/illegal_vt_inst.S @@ -48,7 +48,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -77,16 +77,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/ma_utld.S b/isa/rv64sv/ma_utld.S index c48e134..b139edf 100644 --- a/isa/rv64sv/ma_utld.S +++ b/isa/rv64sv/ma_utld.S @@ -44,7 +44,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -73,16 +73,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/ma_utsd.S b/isa/rv64sv/ma_utsd.S index 3879d51..56ece92 100644 --- a/isa/rv64sv/ma_utsd.S +++ b/isa/rv64sv/ma_utsd.S @@ -45,7 +45,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -74,16 +74,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/ma_vld.S b/isa/rv64sv/ma_vld.S index d66c42f..57b6bf9 100644 --- a/isa/rv64sv/ma_vld.S +++ b/isa/rv64sv/ma_vld.S @@ -45,7 +45,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -74,16 +74,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/ma_vsd.S b/isa/rv64sv/ma_vsd.S index 715e6a2..90eb792 100644 --- a/isa/rv64sv/ma_vsd.S +++ b/isa/rv64sv/ma_vsd.S @@ -48,7 +48,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -77,16 +77,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/ma_vt_inst.S b/isa/rv64sv/ma_vt_inst.S index c8ef5ad..cd7762d 100644 --- a/isa/rv64sv/ma_vt_inst.S +++ b/isa/rv64sv/ma_vt_inst.S @@ -38,7 +38,7 @@ vtcode1: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -67,16 +67,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64sv/privileged_inst.S b/isa/rv64sv/privileged_inst.S index 1a88ca3..ef50188 100644 --- a/isa/rv64sv/privileged_inst.S +++ b/isa/rv64sv/privileged_inst.S @@ -37,7 +37,7 @@ vtcode2: handler: vxcptkill - li x28,2 + li TESTNUM,2 # check cause vxcptcause a3 @@ -67,16 +67,16 @@ handler: ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail TEST_PASSFAIL diff --git a/isa/rv64ui/amoadd_d.S b/isa/rv64ui/amoadd_d.S index 21d534c..92b7bb6 100644 --- a/isa/rv64ui/amoadd_d.S +++ b/isa/rv64ui/amoadd_d.S @@ -58,5 +58,4 @@ RVTEST_DATA_END .bss .align 3 amo_operand: - .dword 0 - .skip 65536 + .dword 0 \ No newline at end of file diff --git a/isa/rv64ui/amoadd_w.S b/isa/rv64ui/amoadd_w.S index 4c71ac8..b46628b 100644 --- a/isa/rv64ui/amoadd_w.S +++ b/isa/rv64ui/amoadd_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoand_d.S b/isa/rv64ui/amoand_d.S index 0c4985c..ad0d3d2 100644 --- a/isa/rv64ui/amoand_d.S +++ b/isa/rv64ui/amoand_d.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoand_w.S b/isa/rv64ui/amoand_w.S index 0433860..f141d02 100644 --- a/isa/rv64ui/amoand_w.S +++ b/isa/rv64ui/amoand_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amomax_d.S b/isa/rv64ui/amomax_d.S index a0dc2aa..1d1a7cb 100644 --- a/isa/rv64ui/amomax_d.S +++ b/isa/rv64ui/amomax_d.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amomax_w.S b/isa/rv64ui/amomax_w.S index 0fe3352..c91f5b3 100644 --- a/isa/rv64ui/amomax_w.S +++ b/isa/rv64ui/amomax_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amomaxu_d.S b/isa/rv64ui/amomaxu_d.S index 9dc13e4..7bd8ba2 100644 --- a/isa/rv64ui/amomaxu_d.S +++ b/isa/rv64ui/amomaxu_d.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amomaxu_w.S b/isa/rv64ui/amomaxu_w.S index 8e774b6..6ff2213 100644 --- a/isa/rv64ui/amomaxu_w.S +++ b/isa/rv64ui/amomaxu_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amomin_d.S b/isa/rv64ui/amomin_d.S index 168ae3c..99ca009 100644 --- a/isa/rv64ui/amomin_d.S +++ b/isa/rv64ui/amomin_d.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amomin_w.S b/isa/rv64ui/amomin_w.S index e6822d8..1c68f11 100644 --- a/isa/rv64ui/amomin_w.S +++ b/isa/rv64ui/amomin_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amominu_d.S b/isa/rv64ui/amominu_d.S index 9572d95..b1e7e3e 100644 --- a/isa/rv64ui/amominu_d.S +++ b/isa/rv64ui/amominu_d.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amominu_w.S b/isa/rv64ui/amominu_w.S index cf2f516..b23049f 100644 --- a/isa/rv64ui/amominu_w.S +++ b/isa/rv64ui/amominu_w.S @@ -44,4 +44,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoor_d.S b/isa/rv64ui/amoor_d.S index ce1a843..31cf612 100644 --- a/isa/rv64ui/amoor_d.S +++ b/isa/rv64ui/amoor_d.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoor_w.S b/isa/rv64ui/amoor_w.S index 784aee7..8902c17 100644 --- a/isa/rv64ui/amoor_w.S +++ b/isa/rv64ui/amoor_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoswap_d.S b/isa/rv64ui/amoswap_d.S index b78e653..cd8d269 100644 --- a/isa/rv64ui/amoswap_d.S +++ b/isa/rv64ui/amoswap_d.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoswap_w.S b/isa/rv64ui/amoswap_w.S index 174676b..6e4d77b 100644 --- a/isa/rv64ui/amoswap_w.S +++ b/isa/rv64ui/amoswap_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoxor_d.S b/isa/rv64ui/amoxor_d.S index 81ebe00..9c31b70 100644 --- a/isa/rv64ui/amoxor_d.S +++ b/isa/rv64ui/amoxor_d.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/amoxor_w.S b/isa/rv64ui/amoxor_w.S index 79579d2..d199047 100644 --- a/isa/rv64ui/amoxor_w.S +++ b/isa/rv64ui/amoxor_w.S @@ -60,4 +60,3 @@ RVTEST_DATA_END .align 3 amo_operand: .dword 0 - .skip 65536 diff --git a/isa/rv64ui/auipc.S b/isa/rv64ui/auipc.S index c2b5157..f5d28ec 100644 --- a/isa/rv64ui/auipc.S +++ b/isa/rv64ui/auipc.S @@ -11,22 +11,18 @@ RVTEST_RV64U RVTEST_CODE_BEGIN - TEST_CASE(2, a0, 1<<12, \ + TEST_CASE(2, a0, 10000, \ .align 3; \ - auipc a0, 0x00001; \ + lla a0, 1f + 10000; \ jal a1, 1f; \ - 1: srl a1, a1, 12; \ - sll a1, a1, 12; \ - sub a0, a0, a1; \ + 1: sub a0, a0, a1; \ ) - TEST_CASE(3, a0, -1<<12, \ + TEST_CASE(3, a0, -10000, \ .align 3; \ - auipc a0, 0xfffff; \ + lla a0, 1f - 10000; \ jal a1, 1f; \ - 1: srl a1, a1, 12; \ - sll a1, a1, 12; \ - sub a0, a0, a1; \ + 1: sub a0, a0, a1; \ ) TEST_PASSFAIL diff --git a/isa/rv64ui/j.S b/isa/rv64ui/j.S index 5b0ea3d..3c15dd3 100644 --- a/isa/rv64ui/j.S +++ b/isa/rv64ui/j.S @@ -15,7 +15,7 @@ RVTEST_CODE_BEGIN # Test basic #------------------------------------------------------------- - li x28, 2; + li TESTNUM, 2; j test_2; j fail; test_2: diff --git a/isa/rv64ui/jal.S b/isa/rv64ui/jal.S index f51ce1b..4881f90 100644 --- a/isa/rv64ui/jal.S +++ b/isa/rv64ui/jal.S @@ -16,7 +16,7 @@ RVTEST_CODE_BEGIN #------------------------------------------------------------- test_2: - li x28, 2 + li TESTNUM, 2 li ra, 0 linkaddr_2: diff --git a/isa/rv64ui/jalr.S b/isa/rv64ui/jalr.S index 9eef93b..cdf71e9 100644 --- a/isa/rv64ui/jalr.S +++ b/isa/rv64ui/jalr.S @@ -16,7 +16,7 @@ RVTEST_CODE_BEGIN #------------------------------------------------------------- test_2: - li x28, 2 + li TESTNUM, 2 li x31, 0 la x2, target_2 @@ -37,7 +37,7 @@ target_2: #------------------------------------------------------------- test_3: - li x28, 3 + li TESTNUM, 3 li x31, 0 la x3, target_3 diff --git a/isa/rv64uv/Makefrag b/isa/rv64uv/Makefrag index b251942..affbdaf 100644 --- a/isa/rv64uv/Makefrag +++ b/isa/rv64uv/Makefrag @@ -6,6 +6,7 @@ rv64uv_sc_tests = \ wakeup fence \ vsetcfgi vsetcfg vsetvl \ vmvv vmsv \ + vfmvv vfmsv \ utidx \ lb lbu lh lhu lw lwu ld \ sb sh sw sd \ diff --git a/isa/rv64uv/amoadd_d.S b/isa/rv64uv/amoadd_d.S index 68b0ba1..64386b2 100644 --- a/isa/rv64uv/amoadd_d.S +++ b/isa/rv64uv/amoadd_d.S @@ -28,7 +28,7 @@ RVTEST_CODE_BEGIN li a1,0 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amoadd_w.S b/isa/rv64uv/amoadd_w.S index ba798ef..3fcf25f 100644 --- a/isa/rv64uv/amoadd_w.S +++ b/isa/rv64uv/amoadd_w.S @@ -28,7 +28,7 @@ RVTEST_CODE_BEGIN li a1,0 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amoand_d.S b/isa/rv64uv/amoand_d.S index b2dc699..f997ab0 100644 --- a/isa/rv64uv/amoand_d.S +++ b/isa/rv64uv/amoand_d.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amoand_w.S b/isa/rv64uv/amoand_w.S index 726033d..7cc39ea 100644 --- a/isa/rv64uv/amoand_w.S +++ b/isa/rv64uv/amoand_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amomax_d.S b/isa/rv64uv/amomax_d.S index aafdf75..c376b0e 100644 --- a/isa/rv64uv/amomax_d.S +++ b/isa/rv64uv/amomax_d.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amomax_w.S b/isa/rv64uv/amomax_w.S index 0308991..ec1c098 100644 --- a/isa/rv64uv/amomax_w.S +++ b/isa/rv64uv/amomax_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amomaxu_d.S b/isa/rv64uv/amomaxu_d.S index 95d8fce..696fb85 100644 --- a/isa/rv64uv/amomaxu_d.S +++ b/isa/rv64uv/amomaxu_d.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,-1 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amomaxu_w.S b/isa/rv64uv/amomaxu_w.S index feac563..3d7fd63 100644 --- a/isa/rv64uv/amomaxu_w.S +++ b/isa/rv64uv/amomaxu_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,-1 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amomin_d.S b/isa/rv64uv/amomin_d.S index 6fd9d27..5215c3b 100644 --- a/isa/rv64uv/amomin_d.S +++ b/isa/rv64uv/amomin_d.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,-1 loop: ld a0,0(a5) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a5,a5,8 addi a1,a1,1 diff --git a/isa/rv64uv/amomin_w.S b/isa/rv64uv/amomin_w.S index 44260f2..0b822fa 100644 --- a/isa/rv64uv/amomin_w.S +++ b/isa/rv64uv/amomin_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amominu_d.S b/isa/rv64uv/amominu_d.S index 3f5f7ab..4c0b31f 100644 --- a/isa/rv64uv/amominu_d.S +++ b/isa/rv64uv/amominu_d.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amominu_w.S b/isa/rv64uv/amominu_w.S index 56f3a7d..1cc8b24 100644 --- a/isa/rv64uv/amominu_w.S +++ b/isa/rv64uv/amominu_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amoor_d.S b/isa/rv64uv/amoor_d.S index 76d553c..833f056 100644 --- a/isa/rv64uv/amoor_d.S +++ b/isa/rv64uv/amoor_d.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,-1 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amoor_w.S b/isa/rv64uv/amoor_w.S index 9d0bd2f..c948c32 100644 --- a/isa/rv64uv/amoor_w.S +++ b/isa/rv64uv/amoor_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,-1 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amoswap_d.S b/isa/rv64uv/amoswap_d.S index df98556..0e3db8f 100644 --- a/isa/rv64uv/amoswap_d.S +++ b/isa/rv64uv/amoswap_d.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a1,0 loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amoswap_w.S b/isa/rv64uv/amoswap_w.S index c068569..6a5b1fb 100644 --- a/isa/rv64uv/amoswap_w.S +++ b/isa/rv64uv/amoswap_w.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a1,0 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/amoxor_d.S b/isa/rv64uv/amoxor_d.S index f67bccf..7f84fd5 100644 --- a/isa/rv64uv/amoxor_d.S +++ b/isa/rv64uv/amoxor_d.S @@ -28,7 +28,7 @@ RVTEST_CODE_BEGIN li t0,0xaaaaaaaaaaaaaaaa loop: ld a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,8 addi a1,a1,1 diff --git a/isa/rv64uv/amoxor_w.S b/isa/rv64uv/amoxor_w.S index fac070f..602634d 100644 --- a/isa/rv64uv/amoxor_w.S +++ b/isa/rv64uv/amoxor_w.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN li a2,-1 loop: lw a0,0(a6) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a2,fail addi a6,a6,4 addi a1,a1,1 diff --git a/isa/rv64uv/fcvt.S b/isa/rv64uv/fcvt.S index 227a154..cb8e98c 100644 --- a/isa/rv64uv/fcvt.S +++ b/isa/rv64uv/fcvt.S @@ -25,19 +25,19 @@ RVTEST_CODE_BEGIN la a5,result ld a1,0(a4) ld a2,0(a5) - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a4) ld a2,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a4) ld a2,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a4) ld a2,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail j pass diff --git a/isa/rv64uv/fld.S b/isa/rv64uv/fld.S index d41e761..37e05e0 100644 --- a/isa/rv64uv/fld.S +++ b/isa/rv64uv/fld.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: ld a0,0(a6) - addi x28,a2,2 + addi TESTNUM,a2,2 ld a1,0(a5) bne a0,a1,fail addi a6,a6,8 diff --git a/isa/rv64uv/flw.S b/isa/rv64uv/flw.S index 7e940f6..0284489 100644 --- a/isa/rv64uv/flw.S +++ b/isa/rv64uv/flw.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: lw a0,0(a6) - addi x28,a2,2 + addi TESTNUM,a2,2 lw a1,0(a5) bne a0,a1,fail addi a6,a6,4 diff --git a/isa/rv64uv/fma.S b/isa/rv64uv/fma.S index e875c61..c4489ae 100644 --- a/isa/rv64uv/fma.S +++ b/isa/rv64uv/fma.S @@ -40,13 +40,13 @@ wait: la s3,result ld s4,0(s3) - li x28,2 + li TESTNUM,2 bne s2,s4,fail li a2,0 loop: ld a0,0(a5) - addi x28,a2,3 + addi TESTNUM,a2,3 bne a0,s4,fail addi a5,a5,8 addi a2,a2,1 diff --git a/isa/rv64uv/fmovn.S b/isa/rv64uv/fmovn.S index 47a6a39..6c54b5e 100644 --- a/isa/rv64uv/fmovn.S +++ b/isa/rv64uv/fmovn.S @@ -29,7 +29,7 @@ loop: slli a4,a4,63 srai a4,a4,63 and a5,a2,a4 - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a5,fail addi a7,a7,8 addi a1,a1,1 diff --git a/isa/rv64uv/fmovz.S b/isa/rv64uv/fmovz.S index f3e09b6..4f55cdc 100644 --- a/isa/rv64uv/fmovz.S +++ b/isa/rv64uv/fmovz.S @@ -30,7 +30,7 @@ loop: srai a4,a4,63 xori a4,a4,-1 and a5,a2,a4 - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a5,fail addi a7,a7,8 addi a1,a1,1 diff --git a/isa/rv64uv/fsd.S b/isa/rv64uv/fsd.S index f220679..c871e09 100644 --- a/isa/rv64uv/fsd.S +++ b/isa/rv64uv/fsd.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: ld a0,0(a6) - addi x28,a2,2 + addi TESTNUM,a2,2 ld a1,0(a5) bne a0,a1,fail addi a6,a6,8 diff --git a/isa/rv64uv/fsw.S b/isa/rv64uv/fsw.S index 71c1d2f..7c78df5 100644 --- a/isa/rv64uv/fsw.S +++ b/isa/rv64uv/fsw.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a2,0 loop: lw a0,0(a6) - addi x28,a2,2 + addi TESTNUM,a2,2 lw a1,0(a5) bne a0,a1,fail addi a6,a6,4 diff --git a/isa/rv64uv/imul.S b/isa/rv64uv/imul.S index 1b3a2dd..554374d 100644 --- a/isa/rv64uv/imul.S +++ b/isa/rv64uv/imul.S @@ -48,14 +48,14 @@ RVTEST_CODE_BEGIN fence li s2,40 - li x28,2 + li TESTNUM,2 bne s1,s2,fail li a1,0 li a2,0 loop: ld a0,0(a5) - addi x28,a2,3 + addi TESTNUM,a2,3 bne a0,a1,fail addi a5,a5,8 addi a1,a1,20 diff --git a/isa/rv64uv/lb.S b/isa/rv64uv/lb.S index 46ca639..471199a 100644 --- a/isa/rv64uv/lb.S +++ b/isa/rv64uv/lb.S @@ -29,7 +29,7 @@ loop: ld a1,0(a5) sll a3,a1,56 sra a3,a3,56 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/lbu.S b/isa/rv64uv/lbu.S index 47c2261..2aa5ee8 100644 --- a/isa/rv64uv/lbu.S +++ b/isa/rv64uv/lbu.S @@ -29,7 +29,7 @@ loop: ld a1,0(a5) sll a3,a1,56 srl a3,a3,56 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/ld.S b/isa/rv64uv/ld.S index 354ee38..0794192 100644 --- a/isa/rv64uv/ld.S +++ b/isa/rv64uv/ld.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN loop: ld a0,0(a6) ld a1,0(a5) - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a1,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/lh.S b/isa/rv64uv/lh.S index e4ff176..a24146c 100644 --- a/isa/rv64uv/lh.S +++ b/isa/rv64uv/lh.S @@ -29,7 +29,7 @@ loop: ld a1,0(a5) sll a3,a1,48 sra a3,a3,48 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/lhu.S b/isa/rv64uv/lhu.S index dadf99b..e20d56d 100644 --- a/isa/rv64uv/lhu.S +++ b/isa/rv64uv/lhu.S @@ -29,7 +29,7 @@ loop: ld a1,0(a5) sll a3,a1,48 srl a3,a3,48 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/lw.S b/isa/rv64uv/lw.S index 182dc89..b40ec47 100644 --- a/isa/rv64uv/lw.S +++ b/isa/rv64uv/lw.S @@ -29,7 +29,7 @@ loop: ld a1,0(a5) sll a3,a1,32 sra a3,a3,32 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/lwu.S b/isa/rv64uv/lwu.S index d6df839..0b3591a 100644 --- a/isa/rv64uv/lwu.S +++ b/isa/rv64uv/lwu.S @@ -29,7 +29,7 @@ loop: ld a1,0(a5) sll a3,a1,32 srl a3,a3,32 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/movz.S b/isa/rv64uv/movz.S index 374b271..790edce 100644 --- a/isa/rv64uv/movz.S +++ b/isa/rv64uv/movz.S @@ -30,7 +30,7 @@ loop: srai a4,a4,63 xori a4,a4,-1 and a5,a2,a4 - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a5,fail addi a7,a7,8 addi a1,a1,1 diff --git a/isa/rv64uv/sb.S b/isa/rv64uv/sb.S index 5cbe76a..b9954ed 100644 --- a/isa/rv64uv/sb.S +++ b/isa/rv64uv/sb.S @@ -39,7 +39,7 @@ loop: ld a1,0(a5) sll a3,a1,56 srl a3,a3,56 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/sd.S b/isa/rv64uv/sd.S index 053c401..5ec8051 100644 --- a/isa/rv64uv/sd.S +++ b/isa/rv64uv/sd.S @@ -27,7 +27,7 @@ RVTEST_CODE_BEGIN loop: ld a0,0(a6) ld a1,0(a5) - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a1,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/sh.S b/isa/rv64uv/sh.S index 25bb258..0177010 100644 --- a/isa/rv64uv/sh.S +++ b/isa/rv64uv/sh.S @@ -39,7 +39,7 @@ loop: ld a1,0(a5) sll a3,a1,48 srl a3,a3,48 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/sw.S b/isa/rv64uv/sw.S index 8f1599b..6196720 100644 --- a/isa/rv64uv/sw.S +++ b/isa/rv64uv/sw.S @@ -39,7 +39,7 @@ loop: ld a1,0(a5) sll a3,a1,32 srl a3,a3,32 - addi x28,a2,2 + addi TESTNUM,a2,2 bne a0,a3,fail addi a6,a6,8 addi a5,a5,8 diff --git a/isa/rv64uv/utidx.S b/isa/rv64uv/utidx.S index 0439115..a672776 100644 --- a/isa/rv64uv/utidx.S +++ b/isa/rv64uv/utidx.S @@ -24,7 +24,7 @@ RVTEST_CODE_BEGIN li a1,1 loop: ld a0,0(a4) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a4,a4,8 addi a1,a1,1 diff --git a/isa/rv64uv/vfmsv.S b/isa/rv64uv/vfmsv.S new file mode 100644 index 0000000..5a8dbeb --- /dev/null +++ b/isa/rv64uv/vfmsv.S @@ -0,0 +1,55 @@ +#***************************************************************************** +# vfmsv.S +#----------------------------------------------------------------------------- +# +# Test vfmsv instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UV +RVTEST_CODE_BEGIN + + vsetcfg 3,1 + li a2,680 + vsetvl a2,a2 + + li a3,-1 + vfmsv vf0,a3 + lui a0,%hi(vtcode) + vf %lo(vtcode)(a0) + la a4,dest + vsd vx2,a4 + fence + + li a1,0 +loop: + ld a0,0(a4) + addi x28,a1,2 + bne a0,a1,fail + addi a4,a4,8 + addi a1,a1,1 + bne a1,a2,loop + j pass + +vtcode: + utidx x1 + addi x1,x1,1 + fmv.x.d x2, f0 + add x2,x1,x2 + stop + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +dest: + .skip 16384 + +RVTEST_DATA_END diff --git a/isa/rv64uv/vfmvv.S b/isa/rv64uv/vfmvv.S index 68e085e..cb97dee 100644 --- a/isa/rv64uv/vfmvv.S +++ b/isa/rv64uv/vfmvv.S @@ -25,7 +25,7 @@ RVTEST_CODE_BEGIN li a1,1 loop: ld a0,0(a3) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a3,a3,8 addi a1,a1,1 diff --git a/isa/rv64uv/vmsv.S b/isa/rv64uv/vmsv.S index d469e59..773188d 100644 --- a/isa/rv64uv/vmsv.S +++ b/isa/rv64uv/vmsv.S @@ -26,7 +26,7 @@ RVTEST_CODE_BEGIN li a1,0 loop: ld a0,0(a4) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a4,a4,8 addi a1,a1,1 diff --git a/isa/rv64uv/vmvv.S b/isa/rv64uv/vmvv.S index be1adb3..b546f05 100644 --- a/isa/rv64uv/vmvv.S +++ b/isa/rv64uv/vmvv.S @@ -25,7 +25,7 @@ RVTEST_CODE_BEGIN li a1,1 loop: ld a0,0(a4) - addi x28,a1,2 + addi TESTNUM,a1,2 bne a0,a1,fail addi a4,a4,8 addi a1,a1,1 diff --git a/isa/rv64uv/vvadd_branch.S b/isa/rv64uv/vvadd_branch.S index 5f9f3a4..4c3fefe 100644 --- a/isa/rv64uv/vvadd_branch.S +++ b/isa/rv64uv/vvadd_branch.S @@ -27,19 +27,19 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,8 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) li a2, 6 - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) li a2, 4 - li x28,4 + li TESTNUM,4 bne a1,a2,fail li a2, 2 ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail la a3,src1 @@ -54,19 +54,19 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,1 - li x28,6 + li TESTNUM,6 bne a1,a2,fail ld a1,8(a5) li a2,2 - li x28,7 + li TESTNUM,7 bne a1,a2,fail ld a1,16(a5) li a2,0 - li x28,8 + li TESTNUM,8 bne a1,a2,fail ld a1,24(a5) li a2,0 - li x28,9 + li TESTNUM,9 bne a1,a2,fail la a3,src2 @@ -79,19 +79,19 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,4 - li x28,6 + li TESTNUM,6 bne a1,a2,fail ld a1,8(a5) li a2,3 - li x28,7 + li TESTNUM,7 bne a1,a2,fail ld a1,16(a5) li a2,2 - li x28,8 + li TESTNUM,8 bne a1,a2,fail ld a1,24(a5) li a2,1 - li x28,9 + li TESTNUM,9 bne a1,a2,fail j pass diff --git a/isa/rv64uv/vvadd_d.S b/isa/rv64uv/vvadd_d.S index 8875b95..e1acea7 100644 --- a/isa/rv64uv/vvadd_d.S +++ b/isa/rv64uv/vvadd_d.S @@ -27,16 +27,16 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,5 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail la a3,src1 @@ -49,19 +49,19 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,1 - li x28,6 + li TESTNUM,6 bne a1,a2,fail ld a1,8(a5) li a2,2 - li x28,7 + li TESTNUM,7 bne a1,a2,fail ld a1,16(a5) li a2,3 - li x28,8 + li TESTNUM,8 bne a1,a2,fail ld a1,24(a5) li a2,4 - li x28,9 + li TESTNUM,9 bne a1,a2,fail la a3,src2 @@ -74,19 +74,19 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,4 - li x28,6 + li TESTNUM,6 bne a1,a2,fail ld a1,8(a5) li a2,3 - li x28,7 + li TESTNUM,7 bne a1,a2,fail ld a1,16(a5) li a2,2 - li x28,8 + li TESTNUM,8 bne a1,a2,fail ld a1,24(a5) li a2,1 - li x28,9 + li TESTNUM,9 bne a1,a2,fail j pass diff --git a/isa/rv64uv/vvadd_fd.S b/isa/rv64uv/vvadd_fd.S index 62161ef..a9961af 100644 --- a/isa/rv64uv/vvadd_fd.S +++ b/isa/rv64uv/vvadd_fd.S @@ -27,16 +27,16 @@ RVTEST_CODE_BEGIN la a6,result ld a1,0(a5) ld a2,0(a6) - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail j pass diff --git a/isa/rv64uv/vvadd_fw.S b/isa/rv64uv/vvadd_fw.S index 916002f..e40fd01 100644 --- a/isa/rv64uv/vvadd_fw.S +++ b/isa/rv64uv/vvadd_fw.S @@ -27,16 +27,16 @@ RVTEST_CODE_BEGIN la a6,result lw a1,0(a5) lw a2,0(a6) - li x28,2 + li TESTNUM,2 bne a1,a2,fail lw a1,4(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail lw a1,8(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail lw a1,12(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail j pass diff --git a/isa/rv64uv/vvadd_packed.S b/isa/rv64uv/vvadd_packed.S index a4ba982..5a5760d 100644 --- a/isa/rv64uv/vvadd_packed.S +++ b/isa/rv64uv/vvadd_packed.S @@ -13,8 +13,8 @@ RVTEST_CODE_BEGIN li x1, 12 # number of test elements move x10, x1 - vsetcfg 3, 1 - vsetprec 16 + vsetucfg x2, 0x2 + vsetcfg x2, 3, 1 loop: vsetvl x4, x1 la x2, addr diff --git a/isa/rv64uv/vvadd_w.S b/isa/rv64uv/vvadd_w.S index f81c42e..9fbcf49 100644 --- a/isa/rv64uv/vvadd_w.S +++ b/isa/rv64uv/vvadd_w.S @@ -26,16 +26,16 @@ RVTEST_CODE_BEGIN fence lw a1,0(a5) li a2,10 - li x28,2 + li TESTNUM,2 bne a1,a2,fail lw a1,4(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail lw a1,8(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail lw a1,12(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail j pass diff --git a/isa/rv64uv/vvmul_d.S b/isa/rv64uv/vvmul_d.S index a6a9d4a..ae995c9 100644 --- a/isa/rv64uv/vvmul_d.S +++ b/isa/rv64uv/vvmul_d.S @@ -26,19 +26,19 @@ RVTEST_CODE_BEGIN fence ld a1,0(a5) li a2,4 - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) li a2,6 - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) li a2,6 - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) li a2,4 - li x28,5 + li TESTNUM,5 bne a1,a2,fail j pass diff --git a/isa/rv64uv/wakeup.S b/isa/rv64uv/wakeup.S index 008423a..958f668 100644 --- a/isa/rv64uv/wakeup.S +++ b/isa/rv64uv/wakeup.S @@ -29,35 +29,35 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,0xdeadbeefcafebabe - li x28,2 + li TESTNUM,2 bne a1,a2,fail ld a1,8(a5) - li x28,3 + li TESTNUM,3 bne a1,a2,fail ld a1,16(a5) - li x28,4 + li TESTNUM,4 bne a1,a2,fail ld a1,24(a5) - li x28,5 + li TESTNUM,5 bne a1,a2,fail # check default hw vector length, which is 32 li a3, 32 vsetvl a3, a3 li a0, 32 - li x28, 6 + li TESTNUM, 6 bne a3, a0, fail li a3, 33 vsetvl a3, a3 li a0, 32 - li x28, 7 + li TESTNUM, 7 bne a3, a0, fail li a3, 31 vsetvl a3, a3 li a0, 31 - li x28, 8 + li TESTNUM, 8 bne a3, a0, fail # now do some vector stuff without vsetcfg @@ -77,16 +77,16 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,5 - li x28,9 + li TESTNUM,9 bne a1,a2,fail ld a1,8(a5) - li x28,10 + li TESTNUM,10 bne a1,a2,fail ld a1,16(a5) - li x28,11 + li TESTNUM,11 bne a1,a2,fail ld a1,24(a5) - li x28,12 + li TESTNUM,12 bne a1,a2,fail # initialize dest memory @@ -112,16 +112,16 @@ RVTEST_CODE_BEGIN ld a1,0(a5) li a2,0xdeadbeefcafebabe - li x28,13 + li TESTNUM,13 bne a1,a2,fail ld a1,8(a5) - li x28,14 + li TESTNUM,14 bne a1,a2,fail ld a1,16(a5) - li x28,15 + li TESTNUM,15 bne a1,a2,fail ld a1,24(a5) - li x28,16 + li TESTNUM,16 bne a1,a2,fail j pass diff --git a/mt/Makefile b/mt/Makefile index 21f75f9..455f066 100755 --- a/mt/Makefile +++ b/mt/Makefile @@ -93,14 +93,14 @@ RISCV_GCC_OPTS = -std=gnu99 -T common/test.ld -O3 -nostdlib -nostartfiles -funro RISCV_LINK = riscv-gcc -T $(common)/test.ld RISCV_LINK_MT = riscv-gcc -T $(common)/test-mt.ld RISCV_LINK_OPTS = -lc -RISCV_LINK_SYSCALL = $(common)/syscalls.c -lc +RISCV_LINK_SYSCALL = -I$(bmarkdir)/../env $(common)/syscalls.c -lc RISCV_OBJDUMP = riscv-objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.data RISCV_SIM = spike -p2 VPATH += $(addprefix $(bmarkdir)/, $(bmarks)) VPATH += $(common) -incs += -I. -I$(common) $(addprefix -I$(bmarkdir)/, $(bmarks)) +incs += -I. -I$(bmarkdir)/../env -I$(common) $(addprefix -I$(bmarkdir)/, $(bmarks)) objs := #include $(patsubst %, $(bmarkdir)/%/bmark.mk, $(bmarks))