diff options
| author | James Molloy <james.molloy@arm.com> | 2014-06-27 11:53:35 +0000 |
|---|---|---|
| committer | James Molloy <james.molloy@arm.com> | 2014-06-27 11:53:35 +0000 |
| commit | f19ae3247706388b82b1732fcb567f2981bda7af (patch) | |
| tree | e5a2cf8aab09145c4379380f423c4765789c3ceb /include | |
| parent | e1a4af78d7653289672c5f0b67faf99679c0be02 (diff) | |
| download | clang-f19ae3247706388b82b1732fcb567f2981bda7af.tar.gz clang-f19ae3247706388b82b1732fcb567f2981bda7af.tar.bz2 clang-f19ae3247706388b82b1732fcb567f2981bda7af.tar.xz | |
[ARM-BE] Generate correct NEON intrinsics for big endian systems.
The NEON intrinsics in arm_neon.h are designed to work on vectors
"as-if" loaded by (V)LDR. We load vectors "as-if" (V)LD1, so the
intrinsics are currently incorrect.
This patch adds big-endian versions of the intrinsics that does the
"obvious but dumb" thing of reversing all vector inputs and all
vector outputs. This will produce extra REVs, but we trust the
optimizer to remove them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/clang/Basic/arm_neon.td | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td index 4dba0f1058..f68ccea655 100644 --- a/include/clang/Basic/arm_neon.td +++ b/include/clang/Basic/arm_neon.td @@ -261,6 +261,7 @@ class Inst <string n, string p, string t, Operation o> { Operation Operation = o; bit CartesianProductOfTypes = 0; + bit BigEndianSafe = 0; bit isShift = 0; bit isScalarShift = 0; bit isScalarNarrowShift = 0; @@ -654,7 +655,9 @@ def VSET_LANE : IInst<"vset_lane", "dsdi", //////////////////////////////////////////////////////////////////////////////// // E.3.18 Initialize a vector from bit pattern -def VCREATE : NoTestOpInst<"vcreate", "dl", "csihfUcUsUiUlPcPsl", OP_CAST>; +def VCREATE : NoTestOpInst<"vcreate", "dl", "csihfUcUsUiUlPcPsl", OP_CAST> { + let BigEndianSafe = 1; +} //////////////////////////////////////////////////////////////////////////////// // E.3.19 Set all lanes to same value @@ -791,6 +794,7 @@ def VREINTERPRET "csilUcUsUiUlhfPcPsQcQsQiQlQUcQUsQUiQUlQhQfQPcQPs", OP_REINT> { let CartesianProductOfTypes = 1; let ArchGuard = "!defined(__aarch64__)"; + let BigEndianSafe = 1; } //////////////////////////////////////////////////////////////////////////////// @@ -1092,7 +1096,9 @@ def COMBINE : NoTestOpInst<"vcombine", "kdd", "dPl", OP_CONC>; //////////////////////////////////////////////////////////////////////////////// //Initialize a vector from bit pattern -def CREATE : NoTestOpInst<"vcreate", "dl", "dPl", OP_CAST>; +def CREATE : NoTestOpInst<"vcreate", "dl", "dPl", OP_CAST> { + let BigEndianSafe = 1; +} //////////////////////////////////////////////////////////////////////////////// @@ -1256,6 +1262,7 @@ def VVREINTERPRET : NoTestOpInst<"vreinterpret", "dd", "csilUcUsUiUlhfdPcPsPlQcQsQiQlQUcQUsQUiQUlQhQfQdQPcQPsQPlQPk", OP_REINT> { let CartesianProductOfTypes = 1; + let BigEndianSafe = 1; let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__)"; } |
