Work around GCC ICE on arm
authorMike Hommey <mh@glandium.org>
Fri, 6 Dec 2019 23:30:58 +0000 (08:30 +0900)
committerMike Hommey <glandium@debian.org>
Fri, 3 Apr 2020 21:41:17 +0000 (22:41 +0100)
from https://skia.googlesource.com/skcms.git/+/180042c5461086b6868fa6b40c73473b1f1baf1c%5E%21/

Gbp-Pq: Topic porting
Gbp-Pq: Name Work-around-GCC-ICE-on-arm.patch

gfx/skia/skia/third_party/skcms/src/Transform_inl.h

index 735852075ee45fbdd5212a43e34de8bd4aace280..568270a71d18fb05431ff1a8b77c6f1611053dd6 100644 (file)
@@ -499,8 +499,9 @@ SI F F_from_U8(U8 v) {
 SI F F_from_U16_BE(U16 v) {
     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-    v = (U16)( ((v<<8)|(v>>8)) & 0xffff );
-    return cast<F>(v) * (1/65535.0f);
+    U16 lo = (v >> 8),
+        hi = (v << 8) & 0xffff;
+    return cast<F>(lo|hi) * (1/65535.0f);
 }
 
 SI F minus_1_ulp(F v) {