From b187b797d17ccda6efb853eb93b27aa42474a02a Mon Sep 17 00:00:00 2001 From: Matteo Frigo Date: Sun, 12 Feb 2006 15:30:27 -0500 Subject: [PATCH] Added support for t2-style simd split-complex codelets. --- dft/simd/Makefile.am | 4 ++-- dft/simd/codelets/Makefile.am | 9 +++++++-- dft/simd/{t1s.c => ts.c} | 2 +- dft/simd/{t1s.h => ts.h} | 2 +- genfft/twiddle.ml | 8 +++----- 5 files changed, 14 insertions(+), 11 deletions(-) rename dft/simd/{t1s.c => ts.c} (98%) rename dft/simd/{t1s.h => ts.h} (96%) diff --git a/dft/simd/Makefile.am b/dft/simd/Makefile.am index 27ad0a041..cff784625 100644 --- a/dft/simd/Makefile.am +++ b/dft/simd/Makefile.am @@ -2,5 +2,5 @@ AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/dft -I$(top_srcdir)/simd noinst_LTLIBRARIES = libdft_simd.la SUBDIRS = codelets libdft_simd_la_SOURCES = n1b.c n1f.c n2b.c n2f.c n2s.c q1b.c q1f.c t.c \ -t1s.c n1b.h n1f.h n2b.h n2f.h n2s.h q1b.h q1f.h t1b.h t1f.h t1s.h \ -t2b.h t2f.h +ts.c n1b.h n1f.h n2b.h n2f.h n2s.h q1b.h q1f.h t1b.h t1f.h ts.h t2b.h \ +t2f.h diff --git a/dft/simd/codelets/Makefile.am b/dft/simd/codelets/Makefile.am index e0e0aa016..3ac0e9292 100644 --- a/dft/simd/codelets/Makefile.am +++ b/dft/simd/codelets/Makefile.am @@ -55,6 +55,7 @@ T2B = t2bv_2.c t2bv_4.c t2bv_8.c t2bv_16.c t2bv_32.c t2bv_64.c # split-complex codelets T1S = t1sv_2.c t1sv_4.c t1sv_8.c t1sv_16.c t1sv_32.c #t1sv_64.c +T2S = t2sv_2.c t2sv_4.c t2sv_8.c t2sv_16.c t2sv_32.c #t2sv_64.c ########################################################################### # q1fv_ is twiddle FFTW_FORWARD FFTs of size (DIF step), @@ -69,7 +70,7 @@ Q1B = q1bv_2.c q1bv_4.c q1bv_8.c ########################################################################### SIMD_CODELETS = $(N1F) $(N1B) $(N2F) $(N2B) $(N2S) $(T1F) $(T2F) \ -$(T1B) $(T1S) $(T2B) $(Q1F) $(Q1B) +$(T1B) $(T2B) $(T1S) $(T2S) $(Q1F) $(Q1B) if HAVE_SIMD ALL_CODELETS = $(SIMD_CODELETS) @@ -89,6 +90,7 @@ include $(top_srcdir)/support/Makefile.codelets if MAINTAINER_MODE GFLAGS = -simd $(FLAGS_COMMON) -pipeline-latency 8 +FLAGS_T2S=-twiddle-log3 -precompute-twiddles n1fv_%.c: $(CODELET_DEPS) $(GEN_NOTW_C) ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW_C) $(GFLAGS) -n $* -name n1fv_$* -include "n1f.h") | $(ADD_DATE) | $(INDENT) >$@ @@ -118,7 +120,10 @@ t2bv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t2bv_$* -include "t2b.h" -sign 1) | $(ADD_DATE) | $(INDENT) >$@ t1sv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) - ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(GFLAGS) -n $* -name t1sv_$* -include "t1s.h") | $(ADD_DATE) | $(INDENT) >$@ + ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(GFLAGS) -n $* -name t1sv_$* -include "ts.h") | $(ADD_DATE) | $(INDENT) >$@ + +t2sv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) + ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(GFLAGS) $(FLAGS_T2S) -n $* -name t2sv_$* -include "ts.h") | $(ADD_DATE) | $(INDENT) >$@ q1fv_%.c: $(CODELET_DEPS) $(GEN_TWIDSQ_C) ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDSQ_C) $(GFLAGS) -n $* -dif -name q1fv_$* -include "q1f.h") | $(ADD_DATE) | $(INDENT) >$@ diff --git a/dft/simd/t1s.c b/dft/simd/ts.c similarity index 98% rename from dft/simd/t1s.c rename to dft/simd/ts.c index 1a40ecab6..c020c63de 100644 --- a/dft/simd/t1s.c +++ b/dft/simd/ts.c @@ -21,7 +21,7 @@ #include "codelet-dft.h" #if HAVE_SIMD -#include "t1s.h" +#include "ts.h" static int okp(const ct_desc *d, const R *rio, const R *iio, diff --git a/dft/simd/t1s.h b/dft/simd/ts.h similarity index 96% rename from dft/simd/t1s.h rename to dft/simd/ts.h index 1e497348b..6698c5486 100644 --- a/dft/simd/t1s.h +++ b/dft/simd/ts.h @@ -28,6 +28,6 @@ #define VTW VTWS #define TWVL TWVLS -#define GENUS X(dft_t1ssimd_genus) +#define GENUS X(dft_tssimd_genus) extern const ct_genus GENUS; diff --git a/genfft/twiddle.ml b/genfft/twiddle.ml index 2d52435c4..cead7145d 100644 --- a/genfft/twiddle.ml +++ b/genfft/twiddle.ml @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *) -(* $Id: twiddle.ml,v 1.16 2006-01-05 03:04:27 stevenj Exp $ *) +(* $Id: twiddle.ml,v 1.17 2006-02-12 20:30:27 athena Exp $ *) (* policies for loading/computing twiddle factors *) open Complex @@ -38,8 +38,7 @@ type twinstr = (twop * int * int) let rec unroll_twfull l = match l with | [] -> [] | (TW_FULL, 0, n) :: b -> - (List.flatten - (forall [] cons 1 n (fun i -> [(TW_COS, 0, i); (TW_SIN, 0, i)]))) + (forall [] cons 1 n (fun i -> (TW_CEXP, 0, i))) @ unroll_twfull b | a :: b -> a :: unroll_twfull b @@ -54,8 +53,7 @@ let twinstr_to_simd_string vl l = let one sep = function | (TW_NEXT, 1, 0) -> sep ^ "{TW_NEXT, " ^ vl ^ ", 0}" | (TW_NEXT, _, _) -> failwith "twinstr_to_simd_string" - | (TW_COS, 0, b) -> sep ^ (Printf.sprintf "VTW(%d)" b) - | (TW_SIN, 0, b) -> "" + | (TW_CEXP, 0, b) -> sep ^ (Printf.sprintf "VTW(%d)" b) | _ -> failwith "twinstr_to_simd_string" in let rec loop first = function | [] -> ""