diff options
author | Bob Wilson <bob.wilson@apple.com> | 2011-06-09 17:03:27 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2011-06-09 17:03:27 +0000 |
commit | 8b51f19ec1525f926e97b7f70c9afbf7ac09b7ae (patch) | |
tree | 66162d5f0308054ceec8246f3bd3c338cce268ba | |
parent | 6b03ec7581e08f34be39294bafd9bdcdc30e060a (diff) | |
download | bcm5719-llvm-8b51f19ec1525f926e97b7f70c9afbf7ac09b7ae.tar.gz bcm5719-llvm-8b51f19ec1525f926e97b7f70c9afbf7ac09b7ae.zip |
Add isVCVT_N flag to identify Neon VCVT_N intrinsics, which require special
range checking for immediate operands. Radar 9558930.
llvm-svn: 132783
-rw-r--r-- | clang/include/clang/Basic/arm_neon.td | 7 | ||||
-rw-r--r-- | clang/test/Sema/arm-neon-types.c | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/arm_neon.td b/clang/include/clang/Basic/arm_neon.td index 6d6c7c7bede..b3da12254a8 100644 --- a/clang/include/clang/Basic/arm_neon.td +++ b/clang/include/clang/Basic/arm_neon.td @@ -75,6 +75,7 @@ class Inst <string n, string p, string t, Op o> { string Types = t; Op Operand = o; bit isShift = 0; + bit isVCVT_N = 0; } // Used to generate Builtins.def: @@ -297,11 +298,13 @@ def VGET_LOW : Inst<"vget_low", "dk", "csilhfUcUsUiUlPcPs", OP_LO>; def VCVT_S32 : SInst<"vcvt_s32", "xd", "fQf">; def VCVT_U32 : SInst<"vcvt_u32", "ud", "fQf">; def VCVT_F16 : SInst<"vcvt_f16", "hk", "f">; -def VCVT_N_S32 : SInst<"vcvt_n_s32", "xdi", "fQf">; -def VCVT_N_U32 : SInst<"vcvt_n_u32", "udi", "fQf">; def VCVT_F32 : SInst<"vcvt_f32", "fd", "iUiQiQUi">; def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "fd", "h">; +let isVCVT_N = 1 in { +def VCVT_N_S32 : SInst<"vcvt_n_s32", "xdi", "fQf">; +def VCVT_N_U32 : SInst<"vcvt_n_u32", "udi", "fQf">; def VCVT_N_F32 : SInst<"vcvt_n_f32", "fdi", "iUiQiQUi">; +} def VMOVN : IInst<"vmovn", "hk", "silUsUiUl">; def VMOVL : SInst<"vmovl", "wd", "csiUcUsUi">; def VQMOVN : SInst<"vqmovn", "hk", "silUsUiUl">; diff --git a/clang/test/Sema/arm-neon-types.c b/clang/test/Sema/arm-neon-types.c index 152d4c9b9a7..1e8c9bf051e 100644 --- a/clang/test/Sema/arm-neon-types.c +++ b/clang/test/Sema/arm-neon-types.c @@ -9,5 +9,12 @@ int32x2_t test(int32x2_t x) { // ...but should warn when the types really do not match. float32x2_t test2(uint32x2_t x) { - return vcvt_n_f32_s32(x, 0); // expected-warning {{incompatible vector types}} + return vcvt_n_f32_s32(x, 9); // expected-warning {{incompatible vector types}} +} + +// Check immediate range for vcvt_n intrinsics is 1 to 32. Radar 9558930. +float32x2_t test3(uint32x2_t x) { + // FIXME: The "incompatible result type" error is due to pr10112 and should be + // removed when that is fixed. + return vcvt_n_f32_u32(x, 0); // expected-error {{argument should be a value from 1 to 32}} expected-error {{incompatible result type}} } |