1 /* 2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 * 4 * This source code is subject to the terms of the BSD 2 Clause License and 5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 * was not distributed with this source code in the LICENSE file, you can 7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 * Media Patent License 1.0 was not distributed with this source code in the 9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 */ 11 12 #ifndef AOM_AOM_DSP_MIPS_COMMON_DSPR2_H_ 13 #define AOM_AOM_DSP_MIPS_COMMON_DSPR2_H_ 14 15 #include <assert.h> 16 17 #include "config/aom_config.h" 18 19 #include "aom/aom_integer.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 #if HAVE_DSPR2 25 #define CROP_WIDTH 512 26 27 extern uint8_t *aom_ff_cropTbl; // From "aom_dsp/mips/intrapred4_dspr2.c" 28 prefetch_load(const unsigned char * src)29static INLINE void prefetch_load(const unsigned char *src) { 30 __asm__ __volatile__("pref 0, 0(%[src]) \n\t" : : [src] "r"(src)); 31 } 32 33 /* prefetch data for store */ prefetch_store(unsigned char * dst)34static INLINE void prefetch_store(unsigned char *dst) { 35 __asm__ __volatile__("pref 1, 0(%[dst]) \n\t" : : [dst] "r"(dst)); 36 } 37 prefetch_load_streamed(const unsigned char * src)38static INLINE void prefetch_load_streamed(const unsigned char *src) { 39 __asm__ __volatile__("pref 4, 0(%[src]) \n\t" : : [src] "r"(src)); 40 } 41 42 /* prefetch data for store */ prefetch_store_streamed(unsigned char * dst)43static INLINE void prefetch_store_streamed(unsigned char *dst) { 44 __asm__ __volatile__("pref 5, 0(%[dst]) \n\t" : : [dst] "r"(dst)); 45 } 46 #endif // #if HAVE_DSPR2 47 #ifdef __cplusplus 48 } // extern "C" 49 #endif 50 51 #endif // AOM_AOM_DSP_MIPS_COMMON_DSPR2_H_ 52