Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: include/core/SkFixed.h

Issue 314643004: SK_CPU_ARM --> SK_CPU_ARM32 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/core/SkMath.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkFixed_DEFINED 8 #ifndef SkFixed_DEFINED
9 #define SkFixed_DEFINED 9 #define SkFixed_DEFINED
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Now look for ASM overrides for our portable versions (should consider putting this in its own file) 98 // Now look for ASM overrides for our portable versions (should consider putting this in its own file)
99 99
100 #ifdef SkLONGLONG 100 #ifdef SkLONGLONG
101 inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) 101 inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b)
102 { 102 {
103 return (SkFixed)((int64_t)a * b >> 16); 103 return (SkFixed)((int64_t)a * b >> 16);
104 } 104 }
105 #define SkFixedMul(a,b) SkFixedMul_longlong(a,b) 105 #define SkFixedMul(a,b) SkFixedMul_longlong(a,b)
106 #endif 106 #endif
107 107
108 #if defined(SK_CPU_ARM) 108 #if defined(SK_CPU_ARM32)
109 /* This guy does not handle NaN or other obscurities, but is faster than 109 /* This guy does not handle NaN or other obscurities, but is faster than
110 than (int)(x*65536). When built on Android with -Os, needs forcing 110 than (int)(x*65536). When built on Android with -Os, needs forcing
111 to inline or we lose the speed benefit. 111 to inline or we lose the speed benefit.
112 */ 112 */
113 SK_ALWAYS_INLINE SkFixed SkFloatToFixed_arm(float x) 113 SK_ALWAYS_INLINE SkFixed SkFloatToFixed_arm(float x)
114 { 114 {
115 int32_t y, z; 115 int32_t y, z;
116 asm("movs %1, %3, lsl #1 \n" 116 asm("movs %1, %3, lsl #1 \n"
117 "mov %2, #0x8E \n" 117 "mov %2, #0x8E \n"
118 "sub %1, %2, %1, lsr #24 \n" 118 "sub %1, %2, %1, lsr #24 \n"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 #define SkIntToFixed48(x) ((SkFixed48)(x) << 48) 157 #define SkIntToFixed48(x) ((SkFixed48)(x) << 48)
158 #define SkFixed48ToInt(x) ((int)((x) >> 48)) 158 #define SkFixed48ToInt(x) ((int)((x) >> 48))
159 #define SkFixedToFixed48(x) ((SkFixed48)(x) << 32) 159 #define SkFixedToFixed48(x) ((SkFixed48)(x) << 32)
160 #define SkFixed48ToFixed(x) ((SkFixed)((x) >> 32)) 160 #define SkFixed48ToFixed(x) ((SkFixed)((x) >> 32))
161 #define SkFloatToFixed48(x) ((SkFixed48)((x) * (65536.0f * 65536.0f * 65536. 0f))) 161 #define SkFloatToFixed48(x) ((SkFixed48)((x) * (65536.0f * 65536.0f * 65536. 0f)))
162 162
163 #define SkScalarToFixed48(x) SkFloatToFixed48(x) 163 #define SkScalarToFixed48(x) SkFloatToFixed48(x)
164 164
165 #endif 165 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkMath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698