[WebAssembly] Implement fma.
[oota-llvm.git] / test / CodeGen / WebAssembly / f32.ll
index a15b37beab84bdb68da47770a7c94f09aa6c1ddf..10fe1856037961fff73235498e36a3ce35a758a5 100644 (file)
@@ -13,6 +13,7 @@ declare float @llvm.floor.f32(float)
 declare float @llvm.trunc.f32(float)
 declare float @llvm.nearbyint.f32(float)
 declare float @llvm.rint.f32(float)
+declare float @llvm.fma.f32(float, float, float)
 
 ; CHECK-LABEL: fadd32:
 ; CHECK-NEXT: .param f32, f32{{$}}
@@ -143,3 +144,11 @@ define float @fmax32(float %x) {
   %b = select i1 %a, float %x, float 0.0
   ret float %b
 }
+
+; CHECK-LABEL: fma32:
+; CHECK: call $push0=, fmaf, $0, $1, $2{{$}}
+; CHECK-NEXT: return $pop0{{$}}
+define float @fma32(float %a, float %b, float %c) {
+  %d = call float @llvm.fma.f32(float %a, float %b, float %c)
+  ret float %d
+}