# HG changeset patch # User lu_zero # Date 1160648767 0 # Node ID 38ccf93476a1430c48ceb758df12570a2343f3c8 # Parent ec426fa57dfe4121fdcb10ca46d865da173c3153 ppc generic prefetch diff -r ec426fa57dfe -r 38ccf93476a1 ppc/dsputil_ppc.c --- 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;