1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s
4 declare double @llvm.sqrt.f64(double)
6 ; Test several VSX FMA mutation opportunities.
8 ; This is reasonable transformation since it eliminates extra register copy.
9 define double @foo3_fmf(double %a) nounwind {
10 ; CHECK-LABEL: foo3_fmf:
12 ; CHECK-NEXT: xstsqrtdp 0, 1
13 ; CHECK-NEXT: bc 12, 2, .LBB0_2
14 ; CHECK-NEXT: # %bb.1:
15 ; CHECK-NEXT: vspltisw 2, -3
16 ; CHECK-NEXT: xsrsqrtedp 0, 1
17 ; CHECK-NEXT: addis 3, 2, .LCPI0_0@toc@ha
18 ; CHECK-NEXT: lfs 4, .LCPI0_0@toc@l(3)
19 ; CHECK-NEXT: xvcvsxwdp 2, 34
20 ; CHECK-NEXT: xsmuldp 3, 1, 0
21 ; CHECK-NEXT: fmr 5, 2
22 ; CHECK-NEXT: xsmaddadp 5, 3, 0
23 ; CHECK-NEXT: xsmuldp 0, 0, 4
24 ; CHECK-NEXT: xsmuldp 0, 0, 5
25 ; CHECK-NEXT: xsmuldp 1, 1, 0
26 ; CHECK-NEXT: xsmaddadp 2, 1, 0
27 ; CHECK-NEXT: xsmuldp 0, 1, 4
28 ; CHECK-NEXT: xsmuldp 1, 0, 2
30 ; CHECK-NEXT: .LBB0_2:
31 ; CHECK-NEXT: xssqrtdp 1, 1
33 %r = call contract reassoc afn ninf double @llvm.sqrt.f64(double %a)
37 define double @foo3_safe(double %a) nounwind {
38 ; CHECK-LABEL: foo3_safe:
40 ; CHECK-NEXT: xssqrtdp 1, 1
42 %r = call double @llvm.sqrt.f64(double %a)