aboutsummaryrefslogtreecommitdiff
path: root/wrrle.c
diff options
context:
space:
mode:
authorMatt Sarett <msarett@google.com>2016-07-13 16:43:05 -0400
committerMatt Sarett <msarett@google.com>2016-10-21 18:03:23 +0000
commite7bf3c56cadcd76c624a9bd1798d64c03c2a1210 (patch)
treedc70acf69ac3d2dd550732958b2d6ec5816324c1 /wrrle.c
parent42d044c63d601c0eba1f066a94cadb376a781529 (diff)
downloadlibjpeg-turbo-e7bf3c56cadcd76c624a9bd1798d64c03c2a1210.tar.gz
Cherry-pick of "Fix AArch64 ABI conformance issue in SIMD code"
In the AArch64 ABI, the high (unused) DWORD of a 32-bit argument's register is undefined, so it was incorrect to use 64-bit instructions to transfer a JDIMENSION argument in the 64-bit NEON SIMD functions. The code worked thus far only because the existing compiler optimizers weren't smart enough to do anything else with the register in question, so the upper 32 bits happened to be all zeroes. The latest builds of Clang/LLVM have a smarter optimizer, and under certain circumstances, it will attempt to load-combine adjacent 32-bit integers from one of the libjpeg structures into a single 64-bit integer and pass that 64-bit integer as a 32-bit argument to one of the SIMD functions (which is allowed by the ABI, since the upper 32 bits of the 32-bit argument's register are undefined.) This caused the libjpeg-turbo regression tests to crash. This patch tries to use the Wn registers whenever possible. Otherwise, it uses a zero-extend instruction to avoid using the upper 32 bits of the 64-bit registers, which are not guaranteed to be valid for 32-bit arguments. Based on sebpop@1fbae13 Closes #91. Refer also to android-ndk/ndk#110 and https://llvm.org/bugs/show_bug.cgi?id=28393 BUG:31780857 Change-Id: Id80143ac13ba8d427196daf04f00be2214f85c86
Diffstat (limited to 'wrrle.c')
0 files changed, 0 insertions, 0 deletions