michael@0: /* michael@0: * Copyright 2014 ARM Ltd. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #include "SkUtils.h" michael@0: #include "SkUtilsArm.h" michael@0: michael@0: #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE michael@0: extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); michael@0: extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count); michael@0: #endif michael@0: michael@0: #if defined(SK_CPU_LENDIAN) michael@0: extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count); michael@0: extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count); michael@0: #endif michael@0: michael@0: SkMemset16Proc SkMemset16GetPlatformProc() { michael@0: // FIXME: memset.arm.S is using syntax incompatible with XCode michael@0: #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) michael@0: return NULL; michael@0: #elif SK_ARM_NEON_IS_DYNAMIC michael@0: if (sk_cpu_arm_has_neon()) { michael@0: return memset16_neon; michael@0: } else { michael@0: return arm_memset16; michael@0: } michael@0: #elif SK_ARM_NEON_IS_ALWAYS michael@0: return memset16_neon; michael@0: #else michael@0: return arm_memset16; michael@0: #endif michael@0: } michael@0: michael@0: SkMemset32Proc SkMemset32GetPlatformProc() { michael@0: // FIXME: memset.arm.S is using syntax incompatible with XCode michael@0: #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) michael@0: return NULL; michael@0: #elif SK_ARM_NEON_IS_DYNAMIC michael@0: if (sk_cpu_arm_has_neon()) { michael@0: return memset32_neon; michael@0: } else { michael@0: return arm_memset32; michael@0: } michael@0: #elif SK_ARM_NEON_IS_ALWAYS michael@0: return memset32_neon; michael@0: #else michael@0: return arm_memset32; michael@0: #endif michael@0: }