1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -ppc-asm-full-reg-names | FileCheck %s
4 define double @test1(double %a, double %b, double %c, double %d) {
7 ; CHECK-NEXT: fmul f0, f3, f4
8 ; CHECK-NEXT: fmul f1, f1, f2
9 ; CHECK-NEXT: fadd f1, f1, f0
11 %tmp2 = fsub double -0.000000e+00, %c
12 %tmp4 = fmul double %tmp2, %d
13 %tmp7 = fmul double %a, %b
14 %tmp9 = fsub double %tmp7, %tmp4
18 declare float @llvm.fmuladd.f32(float, float, float) #4
20 define float @fma_fneg_fneg(float %x, float %y, float %z) {
21 ; CHECK-LABEL: fma_fneg_fneg:
23 ; CHECK-NEXT: fmadds f1, f1, f2, f3
27 %r = call float @llvm.fmuladd.f32(float %negx, float %negy, float %z)
31 define float @fma_fneg_fsub(float %x, float %y0, float %y1, float %z) {
32 ; CHECK-LABEL: fma_fneg_fsub:
34 ; CHECK-NEXT: fsubs f0, f3, f2
35 ; CHECK-NEXT: fmadds f1, f1, f0, f4
38 %negy = fsub nsz float %y0, %y1
39 %r = call float @llvm.fmuladd.f32(float %negx, float %negy, float %z)
43 ; Verify that we didn't hit assertion for this case.
44 define double @fneg_no_ice(float %x) {
45 ; CHECK-LABEL: fneg_no_ice:
47 ; CHECK-NEXT: lis r3, .LCPI3_0@ha
48 ; CHECK-NEXT: lfs f0, .LCPI3_0@l(r3)
49 ; CHECK-NEXT: fsubs f0, f0, f1
50 ; CHECK-NEXT: fmul f1, f0, f0
51 ; CHECK-NEXT: fmul f1, f0, f1
53 %y = fsub fast float 1.0, %x
54 %e = fpext float %y to double
55 %e2 = fmul double %e, %e
56 %e3 = fmul double %e, %e2
60 define double @fneg_fmul_const(double %x) {
61 ; CHECK-LABEL: fneg_fmul_const:
62 ; CHECK: # %bb.0: # %entry
63 ; CHECK-NEXT: lis r3, .LCPI4_0@ha
64 ; CHECK-NEXT: lfd f0, .LCPI4_0@l(r3)
65 ; CHECK-NEXT: fmul f1, f1, f0
68 %f = fmul double %x, 1.2345