diff options
author | 2018-03-26 11:25:07 -0400 | |
---|---|---|
committer | 2018-03-26 16:35:23 +0000 | |
commit | b468ddcc743289e18186b6ec45c22a241a627888 (patch) | |
tree | 89141f9bf56662b51d1cb6797b134aad478025a8 /src | |
parent | 809183efca6f72c2e93edba158c460ff9d84ce78 (diff) |
detect ASIMDHP on ARM64
(ASIMDHP == "advanced SIMD half-precision" == NEON half-float compute.)
Testing: printed features after detection
Pixel 1: 0x08
Galaxy S9: 0x18
(All as expected.)
Change-Id: I3c6987d9ad50b0eb244c2be4354c1c13fdd24815
Reviewed-on: https://skia-review.googlesource.com/116480
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCpu.cpp | 6 | ||||
-rw-r--r-- | src/core/SkCpu.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/core/SkCpu.cpp b/src/core/SkCpu.cpp index e9777c0b3b..b4b2d6802b 100644 --- a/src/core/SkCpu.cpp +++ b/src/core/SkCpu.cpp @@ -78,11 +78,13 @@ #include <sys/auxv.h> static uint32_t read_cpu_features() { - const uint32_t kHWCAP_CRC32 = (1<<7); + const uint32_t kHWCAP_CRC32 = (1<< 7), + kHWCAP_ASIMDHP = (1<<10); uint32_t features = 0; uint32_t hwcaps = getauxval(AT_HWCAP); - if (hwcaps & kHWCAP_CRC32) { features |= SkCpu::CRC32; } + if (hwcaps & kHWCAP_CRC32 ) { features |= SkCpu::CRC32; } + if (hwcaps & kHWCAP_ASIMDHP) { features |= SkCpu::ASIMDHP; } return features; } diff --git a/src/core/SkCpu.h b/src/core/SkCpu.h index 34af7fd497..8d2e4fb030 100644 --- a/src/core/SkCpu.h +++ b/src/core/SkCpu.h @@ -44,6 +44,7 @@ struct SkCpu { NEON_FMA = 1 << 1, VFP_FP16 = 1 << 2, CRC32 = 1 << 3, + ASIMDHP = 1 << 4, }; static void CacheRuntimeFeatures(); |