diff --git a/clang/include/clang/Basic/arm_neon.td b/clang/include/clang/Basic/arm_neon.td index 6d95c1ec157a..4863566653bc 100644 --- a/clang/include/clang/Basic/arm_neon.td +++ b/clang/include/clang/Basic/arm_neon.td @@ -824,7 +824,10 @@ def VREINTERPRET //////////////////////////////////////////////////////////////////////////////// // Vector fused multiply-add operations -def VFMA : SInst<"vfma", "dddd", "fQf">; +let ArchGuard = "defined(__ARM_FEATURE_FMA)" in { + def VFMA : SInst<"vfma", "dddd", "fQf">; + def VFMS : SInst<"vfms", "dddd", "fQf">; +} //////////////////////////////////////////////////////////////////////////////// // fp16 vector operations @@ -908,7 +911,7 @@ def FDIV : IOpInst<"vdiv", "ddd", "fdQfQd", OP_DIV>; //////////////////////////////////////////////////////////////////////////////// // Vector fused multiply-add operations def FMLA : SInst<"vfma", "dddd", "dQd">; -def FMLS : SInst<"vfms", "dddd", "fdQfQd">; +def FMLS : SInst<"vfms", "dddd", "dQd">; //////////////////////////////////////////////////////////////////////////////// // MUL, MLA, MLS, FMA, FMS definitions with scalar argument diff --git a/clang/test/Sema/arm_vfma.c b/clang/test/Sema/arm_vfma.c new file mode 100644 index 000000000000..c50a4147b3f4 --- /dev/null +++ b/clang/test/Sema/arm_vfma.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple thumbv7s-apple-ios7.0 -target-feature +neon -fsyntax-only -verify %s +#include + +// expected-no-diagnostics + +void func(float32x2_t v2f32, float32x4_t v4f32) { + vfma_f32(v2f32, v2f32, v2f32); + vfmaq_f32(v4f32, v4f32, v4f32); + + vfms_f32(v2f32, v2f32, v2f32); + vfmsq_f32(v4f32, v4f32, v4f32); +}