| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkFloatingPoint_DEFINED | 10 #ifndef SkFloatingPoint_DEFINED |
| 11 #define SkFloatingPoint_DEFINED | 11 #define SkFloatingPoint_DEFINED |
| 12 | 12 |
| 13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
| 14 | 14 |
| 15 #include <math.h> | 15 #include <math.h> |
| 16 #include <float.h> | 16 #include <float.h> |
| 17 | 17 |
| 18 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1 | |
| 19 #include <xmmintrin.h> | |
| 20 #elif defined(SK_ARM_HAS_NEON) | |
| 21 #include <arm_neon.h> | |
| 22 #endif | |
| 23 | |
| 24 // For _POSIX_VERSION | 18 // For _POSIX_VERSION |
| 25 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) | 19 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) |
| 26 #include <unistd.h> | 20 #include <unistd.h> |
| 27 #endif | 21 #endif |
| 28 | 22 |
| 29 #include "SkFloatBits.h" | 23 #include "SkFloatBits.h" |
| 30 | 24 |
| 31 // C++98 cmath std::pow seems to be the earliest portable way to get float pow. | 25 // C++98 cmath std::pow seems to be the earliest portable way to get float pow. |
| 32 // However, on Linux including cmath undefines isfinite. | 26 // However, on Linux including cmath undefines isfinite. |
| 33 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14608 | 27 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14608 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // This is the number of significant digits we can print in a string such that w
hen we read that | 143 // This is the number of significant digits we can print in a string such that w
hen we read that |
| 150 // string back we get the floating point number we expect. The minimum value C
requires is 6, but | 144 // string back we get the floating point number we expect. The minimum value C
requires is 6, but |
| 151 // most compilers support 9 | 145 // most compilers support 9 |
| 152 #ifdef FLT_DECIMAL_DIG | 146 #ifdef FLT_DECIMAL_DIG |
| 153 #define SK_FLT_DECIMAL_DIG FLT_DECIMAL_DIG | 147 #define SK_FLT_DECIMAL_DIG FLT_DECIMAL_DIG |
| 154 #else | 148 #else |
| 155 #define SK_FLT_DECIMAL_DIG 9 | 149 #define SK_FLT_DECIMAL_DIG 9 |
| 156 #endif | 150 #endif |
| 157 | 151 |
| 158 #endif | 152 #endif |
| OLD | NEW |