Skip to content

Commit

Permalink
Added support for t2-style simd split-complex codelets.
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-frigo committed Feb 12, 2006
1 parent 7828130 commit b187b79
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dft/simd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions dft/simd/codelets/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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_<r> is <r> twiddle FFTW_FORWARD FFTs of size <r> (DIF step),
Expand All @@ -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)
Expand All @@ -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) >$@
Expand Down Expand Up @@ -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) >$@
Expand Down
2 changes: 1 addition & 1 deletion dft/simd/t1s.c → dft/simd/ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion dft/simd/t1s.h → dft/simd/ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

8 changes: 3 additions & 5 deletions genfft/twiddle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
| [] -> ""
Expand Down

0 comments on commit b187b79

Please sign in to comment.