sbaranga updated this revision to Diff 55555. sbaranga added a comment. Don't change the AArch64 intrinsics and move the test to Sema.
http://reviews.llvm.org/D19665 Files: include/clang/Basic/arm_neon.td test/Sema/arm-no-fp16.c Index: include/clang/Basic/arm_neon.td =================================================================== --- include/clang/Basic/arm_neon.td +++ include/clang/Basic/arm_neon.td @@ -704,8 +704,10 @@ //////////////////////////////////////////////////////////////////////////////// // E.3.22 Converting vectors -def VCVT_F16_F32 : SInst<"vcvt_f16_f32", "md", "Hf">; -def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "wd", "h">; +let ArchGuard = "(__ARM_FP & 2)" in { + def VCVT_F16_F32 : SInst<"vcvt_f16_f32", "md", "Hf">; + def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "wd", "h">; +} def VCVT_S32 : SInst<"vcvt_s32", "xd", "fQf">; def VCVT_U32 : SInst<"vcvt_u32", "ud", "fQf">; Index: test/Sema/arm-no-fp16.c =================================================================== --- /dev/null +++ test/Sema/arm-no-fp16.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple thumbv7-none-eabi %s -target-feature +neon -target-feature -fp16 -fsyntax-only -verify + +#include <arm_neon.h> + +float16x4_t test_vcvt_f16_f32(float32x4_t a) { + return vcvt_f16_f32(a); // expected-warning{{implicit declaration of function 'vcvt_f16_f32'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}} +} + +float32x4_t test_vcvt_f32_f16(float16x4_t a) { + return vcvt_f32_f16(a); // expected-warning{{implicit declaration of function 'vcvt_f32_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float32x4_t'}} +}
Index: include/clang/Basic/arm_neon.td =================================================================== --- include/clang/Basic/arm_neon.td +++ include/clang/Basic/arm_neon.td @@ -704,8 +704,10 @@ //////////////////////////////////////////////////////////////////////////////// // E.3.22 Converting vectors -def VCVT_F16_F32 : SInst<"vcvt_f16_f32", "md", "Hf">; -def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "wd", "h">; +let ArchGuard = "(__ARM_FP & 2)" in { + def VCVT_F16_F32 : SInst<"vcvt_f16_f32", "md", "Hf">; + def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "wd", "h">; +} def VCVT_S32 : SInst<"vcvt_s32", "xd", "fQf">; def VCVT_U32 : SInst<"vcvt_u32", "ud", "fQf">; Index: test/Sema/arm-no-fp16.c =================================================================== --- /dev/null +++ test/Sema/arm-no-fp16.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple thumbv7-none-eabi %s -target-feature +neon -target-feature -fp16 -fsyntax-only -verify + +#include <arm_neon.h> + +float16x4_t test_vcvt_f16_f32(float32x4_t a) { + return vcvt_f16_f32(a); // expected-warning{{implicit declaration of function 'vcvt_f16_f32'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}} +} + +float32x4_t test_vcvt_f32_f16(float16x4_t a) { + return vcvt_f32_f16(a); // expected-warning{{implicit declaration of function 'vcvt_f32_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float32x4_t'}} +}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits