changeset 4003:38ccf93476a1 libavcodec

ppc generic prefetch
author lu_zero
date Thu, 12 Oct 2006 10:26:07 +0000
parents ec426fa57dfe
children f7e99d20ef62
files ppc/dsputil_ppc.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ppc/dsputil_ppc.c	Thu Oct 12 07:51:18 2006 +0000
+++ b/ppc/dsputil_ppc.c	Thu Oct 12 10:26:07 2006 +0000
@@ -249,10 +249,19 @@
 }
 #endif
 
+static void prefetch_ppc(void *mem, int stride, int h)
+{
+    register const uint8_t *p = mem;
+    do {
+        asm volatile ("dcbt 0,%0" : : "r" (p));
+        p+= stride;
+    } while(--h);
+}
+
 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
 {
     // Common optimizations whether Altivec is available or not
-
+    c->prefetch = prefetch_ppc;
     switch (check_dcbzl_effect()) {
         case 32:
             c->clear_blocks = clear_blocks_dcbz32_ppc;