1 /* 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef VPX_COMMON_MIPS_DSPR2_H_ 12 #define VPX_COMMON_MIPS_DSPR2_H_ 13 14 #include <assert.h> 15 #include "./vpx_config.h" 16 #include "vpx/vpx_integer.h" 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 #if HAVE_DSPR2 22 #define CROP_WIDTH 512 23 24 extern uint8_t *vpx_ff_cropTbl; // From "vpx_dsp/mips/intrapred4_dspr2.c" 25 prefetch_load(const unsigned char * src)26static INLINE void prefetch_load(const unsigned char *src) { 27 __asm__ __volatile__ ( 28 "pref 0, 0(%[src]) \n\t" 29 : 30 : [src] "r" (src) 31 ); 32 } 33 34 /* prefetch data for store */ prefetch_store(unsigned char * dst)35static INLINE void prefetch_store(unsigned char *dst) { 36 __asm__ __volatile__ ( 37 "pref 1, 0(%[dst]) \n\t" 38 : 39 : [dst] "r" (dst) 40 ); 41 } 42 prefetch_load_streamed(const unsigned char * src)43static INLINE void prefetch_load_streamed(const unsigned char *src) { 44 __asm__ __volatile__ ( 45 "pref 4, 0(%[src]) \n\t" 46 : 47 : [src] "r" (src) 48 ); 49 } 50 51 /* prefetch data for store */ prefetch_store_streamed(unsigned char * dst)52static INLINE void prefetch_store_streamed(unsigned char *dst) { 53 __asm__ __volatile__ ( 54 "pref 5, 0(%[dst]) \n\t" 55 : 56 : [dst] "r" (dst) 57 ); 58 } 59 #endif // #if HAVE_DSPR2 60 #ifdef __cplusplus 61 } // extern "C" 62 #endif 63 64 #endif // VPX_COMMON_MIPS_DSPR2_H_ 65