1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/opts/SkCachePreload_arm.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +/* 1.5 + * Copyright 2012 The Android Open Source Project 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + */ 1.10 +#ifndef SkCachePreload_arm_DEFINED 1.11 +#define SkCachePreload_arm_DEFINED 1.12 + 1.13 +// This file defines macros for preload instructions for ARM. These macros 1.14 +// are designed to be embedded inside GNU inline assembly. 1.15 +// For the use of these macros, __ARM_USE_PLD needs to be enabled. The cache 1.16 +// line size also needs to be known (and needs to be contained inside 1.17 +// __ARM_CACHE_LINE_SIZE). 1.18 +#if defined(__ARM_USE_PLD) 1.19 + 1.20 +#define PLD(x, n) "pld [%["#x"], #("#n")]\n\t" 1.21 + 1.22 +#if __ARM_CACHE_LINE_SIZE == 32 1.23 + #define PLD64(x, n) PLD(x, n) PLD(x, (n) + 32) 1.24 +#elif __ARM_CACHE_LINE_SIZE == 64 1.25 + #define PLD64(x, n) PLD(x, n) 1.26 +#else 1.27 + #error "unknown __ARM_CACHE_LINE_SIZE." 1.28 +#endif 1.29 +#else 1.30 + // PLD is disabled, all macros become empty. 1.31 + #define PLD(x, n) 1.32 + #define PLD64(x, n) 1.33 +#endif 1.34 + 1.35 +#define PLD128(x, n) PLD64(x, n) PLD64(x, (n) + 64) 1.36 + 1.37 +#endif // SkCachePreload_arm_DEFINED