diff options
author | Amaury Le Leyzour <amaury.leleyzour@arm.com> | 2017-03-06 13:00:49 -0800 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-06 22:16:17 +0000 |
commit | 90165c2269bc33ca3d6aaa73d528194daf48da4e (patch) | |
tree | a9346123c84a3b73d0d1e75a0ce7c84c08d04f62 /include/private/SkFixed.h | |
parent | d94abc5330a9332ca7bdb98f20d3d3b085bf623b (diff) |
Fix new IT blocks ARMv8
ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
* SkFloatToFix is back to a C implementation that mirrors the assembly code.
* S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
the compiler choose what is best in the context of the IT block. And replaced
'keep_dst' by 'ip' where low register or high register does not matter.
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I096759841c972e9300c1d0293bc80d3c3ff2747b
Reviewed-on: https://skia-review.googlesource.com/9340
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'include/private/SkFixed.h')
-rw-r--r-- | include/private/SkFixed.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/include/private/SkFixed.h b/include/private/SkFixed.h index b2eea5f624..526b7d4509 100644 --- a/include/private/SkFixed.h +++ b/include/private/SkFixed.h @@ -102,19 +102,9 @@ inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) { */ SK_ALWAYS_INLINE SkFixed SkFloatToFixed_arm(float x) { - int32_t y, z; - asm("movs %1, %3, lsl #1 \n" - "mov %2, #0x8E \n" - "sub %1, %2, %1, lsr #24 \n" - "mov %2, %3, lsl #8 \n" - "orr %2, %2, #0x80000000 \n" - "mov %1, %2, lsr %1 \n" - "it cs \n" - "rsbcs %1, %1, #0 \n" - : "=r"(x), "=&r"(y), "=&r"(z) - : "r"(x) - : "cc" - ); + int32_t y; + asm("vcvt.s32.f32 %0, %0, #16": "+t"(x)); + memcpy(&y, &x, sizeof(y)); return y; } inline SkFixed SkFixedMul_arm(SkFixed x, SkFixed y) |