Be careful about types in SkNx_neon.h.
authorMike Klein <mtklein@chromium.org>
Thu, 17 Nov 2016 19:33:11 +0000 (14:33 -0500)
committerMike Klein <mtklein@chromium.org>
Thu, 17 Nov 2016 19:54:10 +0000 (19:54 +0000)
The Google3 Android ARM build is still using GCC, which isn't so loosey-goosey as Clang about bit-casting back and forth between int32x4_t and uint32x4_t.

BUG=skia:

Change-Id: I0d54f6859b8e03be4936c51bbaa1967db4261bd4
Reviewed-on: https://skia-review.googlesource.com/4974
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
src/opts/SkNx_neon.h

index 3f96375..b716cb6 100644 (file)
@@ -516,11 +516,11 @@ template<> AI /*static*/ Sk4b SkNx_cast<uint8_t, float>(const Sk4f& src) {
 
 template<> AI /*static*/ Sk4i SkNx_cast<int32_t, uint8_t>(const Sk4b& src) {
     uint16x8_t _16 = vmovl_u8(src.fVec);
-    return vmovl_u16(vget_low_u16(_16));
+    return vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(_16)));
 }
 
 template<> AI /*static*/ Sk4f SkNx_cast<float, uint8_t>(const Sk4b& src) {
-    return vcvtq_f32_u32(SkNx_cast<int32_t>(src).fVec);
+    return vcvtq_f32_s32(SkNx_cast<int32_t>(src).fVec);
 }
 
 template<> AI /*static*/ Sk16b SkNx_cast<uint8_t, float>(const Sk16f& src) {