blob: 69cedb269ab40f711074725f59f765b4d23531e9 [file] [log] [blame]
reed@google.comeeb02bc2011-04-27 11:48:58 +00001/***************************************************************************
epoger@google.comfd03db02011-07-28 14:24:55 +00002 * 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.comeeb02bc2011-04-27 11:48:58 +00007 ***************************************************************************/
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.org21417a72010-08-13 17:05:28 +000014 */
15
tomhudson@google.com6c5ccd92012-03-19 14:20:56 +000016#include "SkBlitRow.h"
agl@chromium.org21417a72010-08-13 17:05:28 +000017#include "SkUtils.h"
18
digit@google.comeec9dbc2012-05-30 13:54:41 +000019#include "SkUtilsArm.h"
20
21#if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE
reed@google.comeeb02bc2011-04-27 11:48:58 +000022extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count);
23extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count);
reed@google.com5a0920c2011-10-21 14:05:33 +000024#endif
reed@google.comeeb02bc2011-04-27 11:48:58 +000025
reed@google.com5a0920c2011-10-21 14:05:33 +000026#if defined(SK_CPU_LENDIAN)
reed@google.comeeb02bc2011-04-27 11:48:58 +000027extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count);
28extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count);
reed@google.comeeb02bc2011-04-27 11:48:58 +000029#endif
agl@chromium.org21417a72010-08-13 17:05:28 +000030
31SkMemset16Proc SkMemset16GetPlatformProc() {
caryclark@google.com867cbd82012-09-20 15:45:41 +000032 // FIXME: memset.arm.S is using syntax incompatible with XCode
33#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
reed@google.com5a0920c2011-10-21 14:05:33 +000034 return NULL;
digit@google.comeec9dbc2012-05-30 13:54:41 +000035#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.comeeb02bc2011-04-27 11:48:58 +000045#endif
agl@chromium.org21417a72010-08-13 17:05:28 +000046}
47
48SkMemset32Proc SkMemset32GetPlatformProc() {
caryclark@google.com867cbd82012-09-20 15:45:41 +000049 // FIXME: memset.arm.S is using syntax incompatible with XCode
50#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
reed@google.com5a0920c2011-10-21 14:05:33 +000051 return NULL;
digit@google.comeec9dbc2012-05-30 13:54:41 +000052#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.comeeb02bc2011-04-27 11:48:58 +000062#endif
agl@chromium.org21417a72010-08-13 17:05:28 +000063}
tomhudson@google.com6c5ccd92012-03-19 14:20:56 +000064
65SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
66 return NULL;
67}
68