aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkHalf.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-04-19 17:19:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-20 12:49:03 +0000
commitd0ce148ed4945aa75fb7eeaaffcfd345dd9f85fb (patch)
treed6987bfeab8c995de846989d1c56bae3ed685365 /src/core/SkHalf.h
parent544e0ad49c11bd349782618de6430bdf8cec0106 (diff)
test and fix f16<->f32 conversion stages
This refactors from_half() and to_half() a bit, totally reimplementing the non-hardware cases to be more clearly correct. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Android-Clang-Ci20-CPU-IngenicJZ4780-mipsel-Release-Android,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android,Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug Change-Id: I439463cf90935c5e8fe2369cbcf45e07f3af62c7 Reviewed-on: https://skia-review.googlesource.com/13921 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/core/SkHalf.h')
-rw-r--r--src/core/SkHalf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/SkHalf.h b/src/core/SkHalf.h
index dd978a2347..f6c7615677 100644
--- a/src/core/SkHalf.h
+++ b/src/core/SkHalf.h
@@ -16,7 +16,7 @@
// only used for storage
typedef uint16_t SkHalf;
-static constexpr uint16_t SK_HalfMin = 0x0400; // 2^-24 (minimum positive normal value)
+static constexpr uint16_t SK_HalfMin = 0x0400; // 2^-14 (minimum positive normal value)
static constexpr uint16_t SK_HalfMax = 0x7bff; // 65504
static constexpr uint16_t SK_HalfEpsilon = 0x1400; // 2^-10
static constexpr uint16_t SK_Half1 = 0x3C00; // 1