Mercurial > libavcodec.hg
comparison ppc/dsputil_ppc.c @ 4003:38ccf93476a1 libavcodec
ppc generic prefetch
author | lu_zero |
---|---|
date | Thu, 12 Oct 2006 10:26:07 +0000 |
parents | b28edd190fc0 |
children | daae66c03857 |
comparison
equal
deleted
inserted
replaced
4002:ec426fa57dfe | 4003:38ccf93476a1 |
---|---|
247 { | 247 { |
248 return 0; | 248 return 0; |
249 } | 249 } |
250 #endif | 250 #endif |
251 | 251 |
252 static void prefetch_ppc(void *mem, int stride, int h) | |
253 { | |
254 register const uint8_t *p = mem; | |
255 do { | |
256 asm volatile ("dcbt 0,%0" : : "r" (p)); | |
257 p+= stride; | |
258 } while(--h); | |
259 } | |
260 | |
252 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) | 261 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) |
253 { | 262 { |
254 // Common optimizations whether Altivec is available or not | 263 // Common optimizations whether Altivec is available or not |
255 | 264 c->prefetch = prefetch_ppc; |
256 switch (check_dcbzl_effect()) { | 265 switch (check_dcbzl_effect()) { |
257 case 32: | 266 case 32: |
258 c->clear_blocks = clear_blocks_dcbz32_ppc; | 267 c->clear_blocks = clear_blocks_dcbz32_ppc; |
259 break; | 268 break; |
260 case 128: | 269 case 128: |