OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkUtils_DEFINED | 8 #ifndef SkUtils_DEFINED |
9 #define SkUtils_DEFINED | 9 #define SkUtils_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 #include "../private/SkOpts.h" | 12 |
| 13 namespace SkOpts { |
| 14 extern void (*memset16)(uint16_t[], uint16_t, int); |
| 15 extern void (*memset32)(uint32_t[], uint32_t, int); |
| 16 } |
13 | 17 |
14 /////////////////////////////////////////////////////////////////////////////// | 18 /////////////////////////////////////////////////////////////////////////////// |
15 | 19 |
16 // The inlining heuristics below were determined using bench/MemsetBench.cpp | 20 // The inlining heuristics below were determined using bench/MemsetBench.cpp |
17 // on a x86 desktop, a Nexus 7 with and without NEON, and a Nexus 9: | 21 // on a x86 desktop, a Nexus 7 with and without NEON, and a Nexus 9: |
18 // - on x86, inlining was never faster, | 22 // - on x86, inlining was never faster, |
19 // - on ARMv7, inlining was faster for N<=10. Putting this check inside the N
EON | 23 // - on ARMv7, inlining was faster for N<=10. Putting this check inside the N
EON |
20 // code was not helpful; it's got to be here outside. | 24 // code was not helpful; it's got to be here outside. |
21 // - NEON code generation for ARMv8 with GCC 4.9 is terrible, | 25 // - NEON code generation for ARMv8 with GCC 4.9 is terrible, |
22 // making the NEON code ~8x slower that just a serial loop. | 26 // making the NEON code ~8x slower that just a serial loop. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 124 } |
121 ~SkAutoTrace() { | 125 ~SkAutoTrace() { |
122 SkDebugf("--- trace: %s Leave\n", fLabel); | 126 SkDebugf("--- trace: %s Leave\n", fLabel); |
123 } | 127 } |
124 private: | 128 private: |
125 const char* fLabel; | 129 const char* fLabel; |
126 }; | 130 }; |
127 #define SkAutoTrace(...) SK_REQUIRE_LOCAL_VAR(SkAutoTrace) | 131 #define SkAutoTrace(...) SK_REQUIRE_LOCAL_VAR(SkAutoTrace) |
128 | 132 |
129 #endif | 133 #endif |
OLD | NEW |