From: bdemsky Date: Tue, 10 Mar 2009 20:16:58 +0000 (+0000) Subject: changes to pipeline prefetches for fft2d X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75af599017c0dd1a5cbf9b28a06b3312af4df24c;p=IRC.git changes to pipeline prefetches for fft2d --- diff --git a/Robust/src/Benchmarks/Prefetch/ManualPrefetch/2DFFT/fft2d.java b/Robust/src/Benchmarks/Prefetch/ManualPrefetch/2DFFT/fft2d.java index 6f919586..ce15815c 100644 --- a/Robust/src/Benchmarks/Prefetch/ManualPrefetch/2DFFT/fft2d.java +++ b/Robust/src/Benchmarks/Prefetch/ManualPrefetch/2DFFT/fft2d.java @@ -65,7 +65,7 @@ public class fft2d extends Thread { //input of FFT if ((l&127)==0) { offsets2[0] = (short) l+x0; - if ((x1-l-x0)<128) { + if ((l+x0+128)>= x1) { int t=x1-l-x0-1; if (t>0) { offsets2[1] = (short) t; @@ -109,20 +109,32 @@ public class fft2d extends Thread { Object o1 = data2.dataRe; short[] offsets1 = new short[2]; offsets1[0] = (short) start; - offsets1[1] = (short) (start - end - 1); + offsets1[1] = (short) 127; System.rangePrefetch(o1, offsets1); - // prefetch data2.dataIm[start -> end] - o1 = data2.dataIm; - offsets1[0] = (short) start; - offsets1[1] = (short) (start - end - 1); System.rangePrefetch(o1, offsets1); ///////////////////// transtempRe = data2.dataRe; transtempIm = data2.dataIm; - for (int j = start; j < end; j++) { + int l=64; + for (int j = start; j < end; j++,l++) { + if ((l&127)==0) { + offsets1[0]=(short) (l+start); + if ((start+l+128)>=end) { + int t=end-start-l-1; + if (t>0) { + offsets1[1]=(short)t; + System.rangePrefetch(transtempRe, offsets1); + System.rangePrefetch(transtempIm, offsets1); + } + } else { + offsets1[1]=(short) 127; + System.rangePrefetch(transtempRe, offsets1); + System.rangePrefetch(transtempIm, offsets1); + } + } //input of FFT double inputRe[] = transtempRe[j]; //local array double inputIm[] = transtempIm[j];