| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 ARM Ltd. | 2 * Copyright 2014 ARM Ltd. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkUtils.h" | 8 #include "SkUtils.h" |
| 9 #include "SkUtilsArm.h" | 9 #include "SkUtilsArm.h" |
| 10 | 10 |
| 11 #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE | |
| 12 extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); | 11 extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); |
| 13 extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count); | 12 extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count); |
| 14 #endif | |
| 15 | |
| 16 #if defined(SK_CPU_LENDIAN) | |
| 17 extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count); | |
| 18 extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count); | |
| 19 #endif | |
| 20 | 13 |
| 21 SkMemset16Proc SkMemset16GetPlatformProc() { | 14 SkMemset16Proc SkMemset16GetPlatformProc() { |
| 22 // FIXME: memset.arm.S is using syntax incompatible with XCode | 15 #if SK_ARM_NEON_IS_ALWAYS |
| 23 #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) | 16 return memset16_neon; |
| 24 return NULL; | |
| 25 #elif SK_ARM_NEON_IS_DYNAMIC | 17 #elif SK_ARM_NEON_IS_DYNAMIC |
| 26 if (sk_cpu_arm_has_neon()) { | 18 return sk_cpu_arm_has_neon() ? memset16_neon : nullptr; |
| 27 return memset16_neon; | |
| 28 } else { | |
| 29 return arm_memset16; | |
| 30 } | |
| 31 #elif SK_ARM_NEON_IS_ALWAYS | |
| 32 return memset16_neon; | |
| 33 #else | 19 #else |
| 34 return arm_memset16; | 20 return nullptr; |
| 35 #endif | 21 #endif |
| 36 } | 22 } |
| 37 | 23 |
| 38 SkMemset32Proc SkMemset32GetPlatformProc() { | 24 SkMemset32Proc SkMemset32GetPlatformProc() { |
| 39 // FIXME: memset.arm.S is using syntax incompatible with XCode | 25 #if SK_ARM_NEON_IS_ALWAYS |
| 40 #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) | 26 return memset32_neon; |
| 41 return NULL; | |
| 42 #elif SK_ARM_NEON_IS_DYNAMIC | 27 #elif SK_ARM_NEON_IS_DYNAMIC |
| 43 if (sk_cpu_arm_has_neon()) { | 28 return sk_cpu_arm_has_neon() ? memset32_neon : nullptr; |
| 44 return memset32_neon; | |
| 45 } else { | |
| 46 return arm_memset32; | |
| 47 } | |
| 48 #elif SK_ARM_NEON_IS_ALWAYS | |
| 49 return memset32_neon; | |
| 50 #else | 29 #else |
| 51 return arm_memset32; | 30 return nullptr; |
| 52 #endif | 31 #endif |
| 53 } | 32 } |
| 54 | 33 |
| 55 SkMemcpy32Proc SkMemcpy32GetPlatformProc() { | 34 SkMemcpy32Proc SkMemcpy32GetPlatformProc() { |
| 56 return NULL; | 35 return NULL; |
| 57 } | 36 } |
| OLD | NEW |