Originally committed as revision 6669 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -249,10 +249,19 @@ long check_dcbzl_effect(void) · 248 unmodified lines | ||
| 249 | 249 | } |
| 250 | 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 | 261 | void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) |
| 253 | 262 | { |
| 254 | 263 | // Common optimizations whether Altivec is available or not |
| 255 | − | |
| 264 | + c->prefetch = prefetch_ppc; | |
| 256 | 265 | switch (check_dcbzl_effect()) { |
| 257 | 266 | case 32: |
| 258 | 267 | c->clear_blocks = clear_blocks_dcbz32_ppc; |