teak-llvm/clang/test/Sema/arm_vfma.c
Silviu Baranga 632fdc5919 PR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4
Summary:
According to the ACLE spec, "__ARM_FEATURE_FMA is defined to 1 if
the hardware floating-point architecture supports fused floating-point
multiply-accumulate".

This changes clang's behaviour from emitting this macro for v7-A and v7-R
cores to only emitting it when the target has VFPv4 (and therefore support
for the floating point multiply-accumulate instruction).

Fixes PR27216

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, rengolin, cfe-commits

Differential Revision: http://reviews.llvm.org/D18963

llvm-svn: 267869
2016-04-28 11:29:08 +00:00

13 lines
352 B
C

// RUN: %clang_cc1 -triple thumbv7-none-eabi -target-feature +neon -target-feature +vfp4 -fsyntax-only -verify %s
#include <arm_neon.h>
// 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);
}