summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2019-10-17 21:57:28 +0000
committerEli Friedman <efriedma@quicinc.com>2019-10-17 21:57:28 +0000
commitdbc62eda56d461249db99ce82c28e2891401ffd2 (patch)
treeaddc8d05f6ec910b86476d57b067c8dd41c66463
parent1230879049c3983795d0c6591dff7c66099b83d9 (diff)
downloadclang-dbc62eda56d461249db99ce82c28e2891401ffd2.tar.gz
[ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 3
It's completely impossible to check that I've actually found all the issues, due to the use of macros in arm_neon.h, but hopefully this time it'll take more than a few hours for someone to find another issue. I have no idea why, but apparently there's a rule that some, but not all, builtins which should take an fp16 vector actually take an int8 vector as an argument. Fix this, and add test coverage. Differential Revision: https://reviews.llvm.org/D68838 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375179 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/aarch64-v8.2a-neon-intrinsics.c2
-rw-r--r--utils/TableGen/NeonEmitter.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c b/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
index 55e91c2ca6..fc339faa6c 100644
--- a/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
+++ b/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -target-feature +fullfp16 -target-feature +v8.2a\
-// RUN: -fallow-half-arguments-and-returns -S -disable-O0-optnone -emit-llvm -o - %s \
+// RUN: -fallow-half-arguments-and-returns -flax-vector-conversions=none -S -disable-O0-optnone -emit-llvm -o - %s \
// RUN: | opt -S -mem2reg \
// RUN: | FileCheck %s
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index 2cf7d90291..9d668a2815 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -1442,7 +1442,8 @@ void Intrinsic::emitBodyAsBuiltinCall() {
}
// Check if an explicit cast is needed.
- if (CastToType.isVector() && LocalCK == ClassB) {
+ if (CastToType.isVector() &&
+ (LocalCK == ClassB || (T.isHalf() && !T.isScalarForMangling()))) {
CastToType.makeInteger(8, true);
Arg = "(" + CastToType.str() + ")" + Arg;
} else if (CastToType.isVector() && LocalCK == ClassI) {