diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-04-20 09:24:18 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-04-20 09:24:18 +0000 |
commit | 34d015fde1fa0cf02a18a07fc362a75617d94e54 (patch) | |
tree | 61d47434603337ddf6ea49d3e8d99dc064117d45 | |
parent | 0c805fe28e5ebdf4890dd42f5c12a85ee61bafc5 (diff) |
Added FFTW benchmark provided by Guillaume Melquiond
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2203 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r-- | test/c/Makefile | 4 | ||||
-rw-r--r-- | test/c/Results/fftw | 16 | ||||
-rw-r--r-- | test/c/fftw.c | 89 |
3 files changed, 107 insertions, 2 deletions
diff --git a/test/c/Makefile b/test/c/Makefile index d3f0d16..dbf3975 100644 --- a/test/c/Makefile +++ b/test/c/Makefile @@ -7,10 +7,10 @@ CFLAGS=-O1 -Wall LIBS=$(LIBMATH) -TIME=xtime -o /dev/null -mintime 1.0 # Xavier's hack +TIME=xtime -o /dev/null -mintime 2.0 # Xavier's hack #TIME=time >/dev/null # Otherwise -PROGS=fib integr qsort fft sha1 aes almabench lists \ +PROGS=fib integr qsort fft fftw sha1 aes almabench lists \ binarytrees fannkuch knucleotide mandelbrot nbody \ nsieve nsievebits spectral vmach \ bisect chomp perlin siphash24 diff --git a/test/c/Results/fftw b/test/c/Results/fftw new file mode 100644 index 0000000..a1b6130 --- /dev/null +++ b/test/c/Results/fftw @@ -0,0 +1,16 @@ +o[0] = 2.918193e+01 +o[1] = -3.230611e+01 +o[2] = 1.271687e+01 +o[3] = -1.099040e+01 +o[4] = 5.728673e+00 +o[5] = -4.918940e+00 +o[6] = 1.880764e+00 +o[7] = -1.292782e+00 +o[8] = 1.104073e+02 +o[9] = -5.867858e+01 +o[10] = 2.768382e+01 +o[11] = -2.073843e+01 +o[12] = 1.229410e+01 +o[13] = -9.195029e+00 +o[14] = 4.307537e+00 +o[15] = -2.080713e+00 diff --git a/test/c/fftw.c b/test/c/fftw.c new file mode 100644 index 0000000..0b41495 --- /dev/null +++ b/test/c/fftw.c @@ -0,0 +1,89 @@ +/* FFT test generated by FFTW */ + +#include <stdio.h> + +typedef long int INT; +typedef double R; +typedef R E; +typedef INT *stride; + +/* Generated by: ../../../genfft/gen_r2r.native -compact -variables 4 -pipeline- +latency 4 -redft01 -n 8 -name e01_8 -include r2r.h */ +void e01_8(const R *I, R *O, stride is, stride os, INT v, INT ivs, INT ovs) +{ +const E KP1_662939224 = ((E) +1.662939224605090474157576755235811513477121624); +const E KP1_111140466 = ((E) +1.111140466039204449485661627897065748749874382); +const E KP390180644 = ((E) +0.390180644032256535696569736954044481855383236); +const E KP1_961570560 = ((E) +1.961570560806460898252364472268478073947867462); +const E KP707106781 = ((E) +0.707106781186547524400844362104849039284835938); +const E KP1_414213562 = ((E) +1.414213562373095048801688724209698078569671875); +const E KP765366864 = ((E) +0.765366864730179543456919968060797733522689125); +const E KP1_847759065 = ((E) +1.847759065022573512256366378793576573644833252); + INT i; + for (i = v; i > 0; i = i - 1, I = I + ivs, O = O + ovs) { + E T7, Tl, T4, Tk, Td, To, Tg, Tn; + { + E T5, T6, T1, T3, T2; + T5 = I[(is[2])]; + T6 = I[(is[6])]; + T7 = (((KP1_847759065) * (T5)) + (KP765366864 * T6)); + Tl = ((KP765366864 * T5) - ((KP1_847759065) * (T6))); + T1 = I[0]; + T2 = I[(is[4])]; + T3 = KP1_414213562 * T2; + T4 = T1 + T3; + Tk = T1 - T3; + { + E T9, Tf, Tc, Te, Ta, Tb; + T9 = I[(is[1])]; + Tf = I[(is[7])]; + Ta = I[(is[5])]; + Tb = I[(is[3])]; + Tc = KP707106781 * (Ta + Tb); + Te = KP707106781 * (Ta - Tb); + Td = T9 + Tc; + To = Te + Tf; + Tg = Te - Tf; + Tn = T9 - Tc; + } + } + { + E T8, Th, Tq, Tr; + T8 = T4 + T7; + Th = ((KP1_961570560 * Td) - ((KP390180644) * (Tg))); + O[(os[7])] = T8 - Th; + O[0] = T8 + Th; + Tq = Tk - Tl; + Tr = (((KP1_111140466) * (Tn)) + (KP1_662939224 * To)); + O[(os[5])] = Tq - Tr; + O[(os[2])] = Tq + Tr; + } + { + E Ti, Tj, Tm, Tp; + Ti = T4 - T7; + Tj = (((KP390180644) * (Td)) + (KP1_961570560 * Tg)); + O[(os[4])] = Ti - Tj; + O[(os[3])] = Ti + Tj; + Tm = Tk + Tl; + Tp = ((KP1_662939224 * Tn) - ((KP1_111140466) * (To))); + O[(os[6])] = Tm - Tp; + O[(os[1])] = Tm + Tp; + } + } +} + +/* Test harness */ + +int main() +{ + INT s[8] = { 0,1,2,3,4,5,6,7 }; + static R i[1024]; + static R o[1024]; + int k; + for (k = 0; k < 1024; ++k) i[k] = k; + for (k = 0; k < 1024 * 1024 * 2; ++k) + e01_8(i, o, s, s, 64, 8, 8); + for (k = 0; k < 16; ++k) + printf("o[%d] = %.6e\n", k, o[k]); + return 0; +} |