|
1 |
|
2 # HG changeset patch |
|
3 # User Andrew Osmond <aosmond@mozilla.com> |
|
4 # Date 1579706360 0 |
|
5 # Node ID b3d8b08265b800165d684281d19ac845a8ff9a66 |
|
6 # Parent 50c371b37a9fcd994a5866db73bd0d078e19f95d |
|
7 Bug 1610814 - Fix NEON compile error with gcc and RGB unpacking. r=lsalzman |
|
8 |
|
9 This patch makes us use the correct intrinsic for loading a uint8x16 |
|
10 register. It is not entirely clear why clang accepts this without |
|
11 complaint but beyond the types, it should be equivalent. |
|
12 |
|
13 Differential Revision: https://phabricator.services.mozilla.com/D60667 |
|
14 |
|
15 diff --git a/gfx/2d/SwizzleNEON.cpp b/gfx/2d/SwizzleNEON.cpp |
|
16 --- a/gfx/2d/SwizzleNEON.cpp |
|
17 +++ b/gfx/2d/SwizzleNEON.cpp |
|
18 @@ -407,25 +407,25 @@ void UnpackRowRGB24_NEON(const uint8_t* |
|
19 } |
|
20 |
|
21 uint8x16_t alpha = vreinterpretq_u8_u32(vdupq_n_u32(0xFF000000)); |
|
22 |
|
23 // Process all 4-pixel chunks as one vector. |
|
24 src -= 4 * 3; |
|
25 dst -= 4 * 4; |
|
26 while (src >= aSrc) { |
|
27 - uint8x16_t px = vld1q_u16(reinterpret_cast<const uint16_t*>(src)); |
|
28 + uint8x16_t px = vld1q_u8(src); |
|
29 // G2R2B1G1 R1B0G0R0 -> X1R1G1B1 X0R0G0B0 |
|
30 uint8x8_t pxlo = vtbl1_u8(vget_low_u8(px), masklo); |
|
31 // B3G3R3B2 G2R2B1G1 -> X3R3G3B3 X2R2G2B2 |
|
32 uint8x8_t pxhi = |
|
33 vtbl1_u8(vext_u8(vget_low_u8(px), vget_high_u8(px), 4), maskhi); |
|
34 px = vcombine_u8(pxlo, pxhi); |
|
35 px = vorrq_u8(px, alpha); |
|
36 - vst1q_u16(reinterpret_cast<uint16_t*>(dst), px); |
|
37 + vst1q_u8(dst, px); |
|
38 src -= 4 * 3; |
|
39 dst -= 4 * 4; |
|
40 } |
|
41 } |
|
42 |
|
43 // Force instantiation of swizzle variants here. |
|
44 template void UnpackRowRGB24_NEON<false>(const uint8_t*, uint8_t*, int32_t); |
|
45 template void UnpackRowRGB24_NEON<true>(const uint8_t*, uint8_t*, int32_t); |
|
46 |