Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright 2014 ARM Ltd. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #include "SkUtils.h" |
michael@0 | 9 | #include "SkUtilsArm.h" |
michael@0 | 10 | |
michael@0 | 11 | #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE |
michael@0 | 12 | extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); |
michael@0 | 13 | extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count); |
michael@0 | 14 | #endif |
michael@0 | 15 | |
michael@0 | 16 | #if defined(SK_CPU_LENDIAN) |
michael@0 | 17 | extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count); |
michael@0 | 18 | extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count); |
michael@0 | 19 | #endif |
michael@0 | 20 | |
michael@0 | 21 | SkMemset16Proc SkMemset16GetPlatformProc() { |
michael@0 | 22 | // FIXME: memset.arm.S is using syntax incompatible with XCode |
michael@0 | 23 | #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) |
michael@0 | 24 | return NULL; |
michael@0 | 25 | #elif SK_ARM_NEON_IS_DYNAMIC |
michael@0 | 26 | if (sk_cpu_arm_has_neon()) { |
michael@0 | 27 | return memset16_neon; |
michael@0 | 28 | } else { |
michael@0 | 29 | return arm_memset16; |
michael@0 | 30 | } |
michael@0 | 31 | #elif SK_ARM_NEON_IS_ALWAYS |
michael@0 | 32 | return memset16_neon; |
michael@0 | 33 | #else |
michael@0 | 34 | return arm_memset16; |
michael@0 | 35 | #endif |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | SkMemset32Proc SkMemset32GetPlatformProc() { |
michael@0 | 39 | // FIXME: memset.arm.S is using syntax incompatible with XCode |
michael@0 | 40 | #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) |
michael@0 | 41 | return NULL; |
michael@0 | 42 | #elif SK_ARM_NEON_IS_DYNAMIC |
michael@0 | 43 | if (sk_cpu_arm_has_neon()) { |
michael@0 | 44 | return memset32_neon; |
michael@0 | 45 | } else { |
michael@0 | 46 | return arm_memset32; |
michael@0 | 47 | } |
michael@0 | 48 | #elif SK_ARM_NEON_IS_ALWAYS |
michael@0 | 49 | return memset32_neon; |
michael@0 | 50 | #else |
michael@0 | 51 | return arm_memset32; |
michael@0 | 52 | #endif |
michael@0 | 53 | } |