• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /***************************************************************************
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.
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
14  */
15 
16 #include "SkUtils.h"
17 
18 #if defined(__ARM_HAVE_NEON) && defined(SK_CPU_LENDIAN)
19 extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count);
20 extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count);
21 #endif
22 
23 #if defined(SK_CPU_LENDIAN)
24 extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count);
25 extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count);
26 #endif
27 
SkMemset16GetPlatformProc()28 SkMemset16Proc SkMemset16GetPlatformProc() {
29 #if defined(__ARM_HAVE_NEON) && defined(SK_CPU_LENDIAN)
30     return memset16_neon;
31 #elif defined(SK_CPU_LENDIAN)
32     return arm_memset16;
33 #else
34     return NULL;
35 #endif
36 }
37 
SkMemset32GetPlatformProc()38 SkMemset32Proc SkMemset32GetPlatformProc() {
39 #if defined(__ARM_HAVE_NEON) && defined(SK_CPU_LENDIAN)
40     return memset32_neon;
41 #elif defined(SK_CPU_LENDIAN)
42     return arm_memset32;
43 #else
44     return NULL;
45 #endif
46 }
47