1 ; RUN: llc < %s -mtriple=i386-apple-darwin10 -mattr=+fma,-fma4 | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -mattr=+fma,-fma4 | FileCheck %s
3 ; RUN: llc < %s -mtriple=i686-- -mcpu=bdver2 -mattr=-fma4 | FileCheck %s
5 ; Test FMA3 variant selection
7 ; CHECK-LABEL: fma3_select231ssX:
8 ; CHECK: vfmadd231ss %xmm
9 define float @fma3_select231ssX(float %x, float %y) {
13 %acc.01 = phi float [ 0.000000e+00, %entry ], [ %acc, %while.body ]
14 %acc = call float @llvm.fma.f32(float %x, float %y, float %acc.01)
15 %b = fcmp ueq float %acc, 0.0
16 br i1 %b, label %while.body, label %while.end
21 ; CHECK-LABEL: fma3_select231pdY:
22 ; CHECK: vfmadd231pd %ymm
23 define <4 x double> @fma3_select231pdY(<4 x double> %x, <4 x double> %y) {
27 %acc.04 = phi <4 x double> [ zeroinitializer, %entry ], [ %add, %while.body ]
28 %add = call <4 x double> @llvm.fma.v4f64(<4 x double> %x, <4 x double> %y, <4 x double> %acc.04)
29 %vecext = extractelement <4 x double> %add, i32 0
30 %cmp = fcmp oeq double %vecext, 0.000000e+00
31 br i1 %cmp, label %while.body, label %while.end
36 declare float @llvm.fma.f32(float, float, float)
37 declare <4 x double> @llvm.fma.v4f64(<4 x double>, <4 x double>, <4 x double>)