summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2013-09-30 12:15:06 +0300
committerPetri Hintukainen <phintuka@users.sourceforge.net>2013-09-30 12:15:06 +0300
commit81bf5516c000d89a2fbc8da89bc6df0256032f0e (patch)
treed81c2a53623d3bf95f86d282b49b77132f9e16ed
parentd4f4833db71a2566b79ed343070854a1bd4c916b (diff)
downloadxine-lib-81bf5516c000d89a2fbc8da89bc6df0256032f0e.tar.gz
xine-lib-81bf5516c000d89a2fbc8da89bc6df0256032f0e.tar.bz2
Fix READ_PREFETCH_2048 so that it won't be optimized out, re-ordered or interleaved by compiler. Simplify generated code (no add).
-rw-r--r--src/post/deinterlace/speedtools.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/post/deinterlace/speedtools.h b/src/post/deinterlace/speedtools.h
index 94ab1918d..b4cddee6b 100644
--- a/src/post/deinterlace/speedtools.h
+++ b/src/post/deinterlace/speedtools.h
@@ -31,16 +31,21 @@
prefetchnta( pfetcha + 128 ); \
prefetchnta( pfetcha + 192 ); }
+static inline unsigned int read_pf(volatile unsigned int *addr)
+{
+ return *addr;
+}
+
#define READ_PREFETCH_2048(x) \
- { int *pfetcha = (int *) x; int pfetchtmp; \
- pfetchtmp = pfetcha[ 0 ] + pfetcha[ 16 ] + pfetcha[ 32 ] + pfetcha[ 48 ] + \
- pfetcha[ 64 ] + pfetcha[ 80 ] + pfetcha[ 96 ] + pfetcha[ 112 ] + \
- pfetcha[ 128 ] + pfetcha[ 144 ] + pfetcha[ 160 ] + pfetcha[ 176 ] + \
- pfetcha[ 192 ] + pfetcha[ 208 ] + pfetcha[ 224 ] + pfetcha[ 240 ]; \
- pfetcha += 256; \
- pfetchtmp = pfetcha[ 0 ] + pfetcha[ 16 ] + pfetcha[ 32 ] + pfetcha[ 48 ] + \
- pfetcha[ 64 ] + pfetcha[ 80 ] + pfetcha[ 96 ] + pfetcha[ 112 ] + \
- pfetcha[ 128 ] + pfetcha[ 144 ] + pfetcha[ 160 ] + pfetcha[ 176 ] + \
- pfetcha[ 192 ] + pfetcha[ 208 ] + pfetcha[ 224 ] + pfetcha[ 240 ]; }
+ { int * pfetcha = (int *) x; \
+ read_pf(pfetcha); read_pf(pfetcha + 16); read_pf(pfetcha + 32); read_pf(pfetcha + 48); \
+ read_pf(pfetcha + 64); read_pf(pfetcha + 80); read_pf(pfetcha + 96); read_pf(pfetcha + 112); \
+ read_pf(pfetcha + 128); read_pf(pfetcha + 144); read_pf(pfetcha + 160); read_pf(pfetcha + 176); \
+ read_pf(pfetcha + 192); read_pf(pfetcha + 208); read_pf(pfetcha + 224); read_pf(pfetcha + 240); \
+ pfetcha += 256; \
+ read_pf(pfetcha); read_pf(pfetcha + 16); read_pf(pfetcha + 32); read_pf(pfetcha + 48); \
+ read_pf(pfetcha + 64); read_pf(pfetcha + 80); read_pf(pfetcha + 96); read_pf(pfetcha + 112); \
+ read_pf(pfetcha + 128); read_pf(pfetcha + 144); read_pf(pfetcha + 160); read_pf(pfetcha + 176); \
+ read_pf(pfetcha + 192); read_pf(pfetcha + 208); read_pf(pfetcha + 224); read_pf(pfetcha + 240); }
#endif /* SPEEDTOOLS_H_INCLUDED */