xref: /llvm-project/llvm/test/CodeGen/PowerPC/fdiv.ll (revision 67a3d1e2755152608fcb1737f7d0519121e037b7)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
3; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-ibm-aix-xcoff -mcpu=pwr8 -vec-extabi | FileCheck %s
4
5define dso_local float @foo_nosw(float %0, float %1) local_unnamed_addr {
6; CHECK-LABEL: foo_nosw:
7; CHECK:       # %bb.0:
8; CHECK-NEXT:    xsdivsp 1, 1, 2
9; CHECK-NEXT:    blr
10  %3 = fdiv contract reassoc arcp nsz float %0, %1
11  ret float %3
12}
13
14define dso_local float @foo(float %0, float %1) local_unnamed_addr {
15; CHECK-LABEL: foo:
16; CHECK:       # %bb.0:
17; CHECK-NEXT:    xsresp 3, 2
18; CHECK-NEXT:    xsmulsp 0, 1, 3
19; CHECK-NEXT:    xsnmsubasp 1, 2, 0
20; CHECK-NEXT:    xsmaddasp 0, 3, 1
21; CHECK-NEXT:    fmr 1, 0
22; CHECK-NEXT:    blr
23  %3 = fdiv contract reassoc arcp nsz ninf float %0, %1
24  ret float %3
25}
26
27define dso_local float @fdiv_fast(float %0, float %1) local_unnamed_addr {
28; CHECK-LABEL: fdiv_fast:
29; CHECK:       # %bb.0:
30; CHECK-NEXT:    xsresp 3, 2
31; CHECK-NEXT:    xsmulsp 0, 1, 3
32; CHECK-NEXT:    xsnmsubasp 1, 2, 0
33; CHECK-NEXT:    xsmaddasp 0, 3, 1
34; CHECK-NEXT:    fmr 1, 0
35; CHECK-NEXT:    blr
36  %3 = fdiv fast float %0, %1
37  ret float %3
38}
39