Revert rGe6ccb57bb3f6b761f2310e97fd6ca99eff42f73e "[SLP] Add cost model for `llvm...
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / llvm.amdgcn.fma.legacy.ll
blobe89fa4424baba42908f0482b966361bdda479e0a
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1030 < %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1030 < %s | FileCheck -check-prefix=GCN %s
5 define float @v_fma(float %a, float %b, float %c)  {
6 ; GCN-LABEL: v_fma:
7 ; GCN:       ; %bb.0:
8 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; GCN-NEXT:    s_waitcnt_vscnt null, 0x0
10 ; GCN-NEXT:    v_fma_legacy_f32 v0, v0, v1, v2
11 ; GCN-NEXT:    s_setpc_b64 s[30:31]
12   %fma = call float @llvm.amdgcn.fma.legacy(float %a, float %b, float %c)
13   ret float %fma
16 define float @v_fma_imm(float %a, float %c)  {
17 ; GCN-LABEL: v_fma_imm:
18 ; GCN:       ; %bb.0:
19 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
20 ; GCN-NEXT:    s_waitcnt_vscnt null, 0x0
21 ; GCN-NEXT:    v_fmac_legacy_f32_e32 v1, 0x41200000, v0
22 ; GCN-NEXT:    v_mov_b32_e32 v0, v1
23 ; GCN-NEXT:    s_setpc_b64 s[30:31]
24   %fma = call float @llvm.amdgcn.fma.legacy(float %a, float 10.0, float %c)
25   ret float %fma
28 define float @v_fabs_fma(float %a, float %b, float %c)  {
29 ; GCN-LABEL: v_fabs_fma:
30 ; GCN:       ; %bb.0:
31 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
32 ; GCN-NEXT:    s_waitcnt_vscnt null, 0x0
33 ; GCN-NEXT:    v_fma_legacy_f32 v0, |v0|, v1, v2
34 ; GCN-NEXT:    s_setpc_b64 s[30:31]
35   %fabs.a = call float @llvm.fabs.f32(float %a)
36   %fma = call float @llvm.amdgcn.fma.legacy(float %fabs.a, float %b, float %c)
37   ret float %fma
40 define float @v_fneg_fabs_fma(float %a, float %b, float %c)  {
41 ; GCN-LABEL: v_fneg_fabs_fma:
42 ; GCN:       ; %bb.0:
43 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
44 ; GCN-NEXT:    s_waitcnt_vscnt null, 0x0
45 ; GCN-NEXT:    v_fma_legacy_f32 v0, v0, -|v1|, v2
46 ; GCN-NEXT:    s_setpc_b64 s[30:31]
47   %fabs.b = call float @llvm.fabs.f32(float %b)
48   %neg.fabs.b = fneg float %fabs.b
49   %fma = call float @llvm.amdgcn.fma.legacy(float %a, float %neg.fabs.b, float %c)
50   ret float %fma
53 define float @v_fneg_fma(float %a, float %b, float %c)  {
54 ; GCN-LABEL: v_fneg_fma:
55 ; GCN:       ; %bb.0:
56 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
57 ; GCN-NEXT:    s_waitcnt_vscnt null, 0x0
58 ; GCN-NEXT:    v_fma_legacy_f32 v0, v0, v1, -v2
59 ; GCN-NEXT:    s_setpc_b64 s[30:31]
60   %neg.c = fneg float %c
61   %fma = call float @llvm.amdgcn.fma.legacy(float %a, float %b, float %neg.c)
62   ret float %fma
65 define float @v_fma_const_const(float %a)  {
66 ; GCN-LABEL: v_fma_const_const:
67 ; GCN:       ; %bb.0:
68 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
69 ; GCN-NEXT:    s_waitcnt_vscnt null, 0x0
70 ; GCN-NEXT:    v_fma_legacy_f32 v0, v0, 2.0, -1.0
71 ; GCN-NEXT:    s_setpc_b64 s[30:31]
72   %fma = call float @llvm.amdgcn.fma.legacy(float %a, float 2.0, float -1.0)
73   ret float %fma
76 declare float @llvm.amdgcn.fma.legacy(float, float, float)
77 declare float @llvm.fabs.f32(float)