diff options
author | Yuqian Li <liyuqian@google.com> | 2017-07-12 13:36:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-12 20:20:43 +0000 |
commit | 7da6ba2d63cfd5ae6add617f18ba4882e755642b (patch) | |
tree | 99d469a5d4192dc65ab42fb8377e899b1c3c2f8b /src/core/SkNx.h | |
parent | f0ca0e0844021d39466c5b69cc9afd195e353bba (diff) |
Implement Sk4i's abs, min, max
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Bug: skia:
Change-Id: Ia9ec3f72095e1c744f88df7bb990d99e0f87d578
Reviewed-on: https://skia-review.googlesource.com/22720
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkNx.h')
-rw-r--r-- | src/core/SkNx.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/SkNx.h b/src/core/SkNx.h index 5df575342c..65e3fcb8c8 100644 --- a/src/core/SkNx.h +++ b/src/core/SkNx.h @@ -218,6 +218,8 @@ struct SkNx<1,T> { private: // Helper functions to choose the right float/double methods. (In <cmath> madness lies...) + AI static int Abs(int val) { return val < 0 ? -val : val; } + AI static float Abs(float val) { return ::fabsf(val); } AI static float Sqrt(float val) { return ::sqrtf(val); } AI static float Floor(float val) { return ::floorf(val); } |