reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
epoger@google.com | fd03db0 | 2011-07-28 14:24:55 +0000 | [diff] [blame] | 2 | * Copyright (c) 2010, Code Aurora Forum. All rights reserved. |
| 3 | * Copyright 2006-2010, The Android Open Source Project |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 7 | ***************************************************************************/ |
| 8 | |
| 9 | /* Changes: |
| 10 | * 2011-04-01 ARM |
| 11 | * Merged the functions from src/opts/opts_check_arm_neon.cpp |
| 12 | * Modified to return ARM version of memset16 and memset32 if no neon |
| 13 | * available in the core |
agl@chromium.org | 21417a7 | 2010-08-13 17:05:28 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
tomhudson@google.com | 6c5ccd9 | 2012-03-19 14:20:56 +0000 | [diff] [blame] | 16 | #include "SkBlitRow.h" |
agl@chromium.org | 21417a7 | 2010-08-13 17:05:28 +0000 | [diff] [blame] | 17 | #include "SkUtils.h" |
| 18 | |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 19 | #include "SkUtilsArm.h" |
| 20 | |
| 21 | #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 22 | extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); |
| 23 | extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count); |
reed@google.com | 5a0920c | 2011-10-21 14:05:33 +0000 | [diff] [blame] | 24 | #endif |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 25 | |
reed@google.com | 5a0920c | 2011-10-21 14:05:33 +0000 | [diff] [blame] | 26 | #if defined(SK_CPU_LENDIAN) |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 27 | extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count); |
| 28 | extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count); |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 29 | #endif |
agl@chromium.org | 21417a7 | 2010-08-13 17:05:28 +0000 | [diff] [blame] | 30 | |
| 31 | SkMemset16Proc SkMemset16GetPlatformProc() { |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 32 | // FIXME: memset.arm.S is using syntax incompatible with XCode |
| 33 | #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) |
reed@google.com | 5a0920c | 2011-10-21 14:05:33 +0000 | [diff] [blame] | 34 | return NULL; |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 35 | #elif SK_ARM_NEON_IS_DYNAMIC |
| 36 | if (sk_cpu_arm_has_neon()) { |
| 37 | return memset16_neon; |
| 38 | } else { |
| 39 | return arm_memset16; |
| 40 | } |
| 41 | #elif SK_ARM_NEON_IS_ALWAYS |
| 42 | return memset16_neon; |
| 43 | #else |
| 44 | return arm_memset16; |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 45 | #endif |
agl@chromium.org | 21417a7 | 2010-08-13 17:05:28 +0000 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | SkMemset32Proc SkMemset32GetPlatformProc() { |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 49 | // FIXME: memset.arm.S is using syntax incompatible with XCode |
| 50 | #if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS) |
reed@google.com | 5a0920c | 2011-10-21 14:05:33 +0000 | [diff] [blame] | 51 | return NULL; |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 52 | #elif SK_ARM_NEON_IS_DYNAMIC |
| 53 | if (sk_cpu_arm_has_neon()) { |
| 54 | return memset32_neon; |
| 55 | } else { |
| 56 | return arm_memset32; |
| 57 | } |
| 58 | #elif SK_ARM_NEON_IS_ALWAYS |
| 59 | return memset32_neon; |
| 60 | #else |
| 61 | return arm_memset32; |
reed@google.com | eeb02bc | 2011-04-27 11:48:58 +0000 | [diff] [blame] | 62 | #endif |
agl@chromium.org | 21417a7 | 2010-08-13 17:05:28 +0000 | [diff] [blame] | 63 | } |
tomhudson@google.com | 6c5ccd9 | 2012-03-19 14:20:56 +0000 | [diff] [blame] | 64 | |
| 65 | SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { |
| 66 | return NULL; |
| 67 | } |
| 68 | |