Index: clang/include/clang/Basic/arm_fp16.td =================================================================== --- clang/include/clang/Basic/arm_fp16.td +++ clang/include/clang/Basic/arm_fp16.td @@ -14,7 +14,7 @@ include "arm_neon_incl.td" // ARMv8.2-A FP16 intrinsics. -let ArchGuard = "defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && defined(__aarch64__)" in { +let ArchGuard = "defined(__aarch64__)", TargetGuard = "fullfp16" in { // Negate def VNEGSH : SInst<"vneg", "11", "Sh">; Index: clang/test/Sema/aarch64-fp16-target.c =================================================================== --- clang/test/Sema/aarch64-fp16-target.c +++ clang/test/Sema/aarch64-fp16-target.c @@ -7,19 +7,19 @@ __attribute__((target("fullfp16"))) void test_fullfp16(float16_t f16) { - vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} + vabdh_f16(f16, f16); } __attribute__((target("arch=armv8-a+fp16"))) void test_fp16_arch(float16_t f16) { - vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} + vabdh_f16(f16, f16); } __attribute__((target("+fp16"))) void test_fp16(float16_t f16) { - vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} + vabdh_f16(f16, f16); } void undefined(float16_t f16) { - vabdh_f16(f16, f16); // expected-error {{call to undeclared function 'vabdh_f16'}} + vabdh_f16(f16, f16); // expected-error {{'__builtin_neon_vabdh_f16' needs target feature fullfp16}} }