1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 < %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 < %s | FileCheck -check-prefix=GFX10 %s
4 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 < %s | FileCheck -check-prefix=GFX10 %s
6 define float @v_constained_fma_f32_fpexcept_strict(float %x, float %y, float %z) #0 {
7 ; GCN-LABEL: v_constained_fma_f32_fpexcept_strict:
9 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10 ; GCN-NEXT: v_fma_f32 v0, v0, v1, v2
11 ; GCN-NEXT: s_setpc_b64 s[30:31]
13 ; GFX10-LABEL: v_constained_fma_f32_fpexcept_strict:
15 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
16 ; GFX10-NEXT: v_fma_f32 v0, v0, v1, v2
17 ; GFX10-NEXT: s_setpc_b64 s[30:31]
18 %val = call float @llvm.experimental.constrained.fma.f32(float %x, float %y, float %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
22 define <2 x float> @v_constained_fma_v2f32_fpexcept_strict(<2 x float> %x, <2 x float> %y, <2 x float> %z) #0 {
23 ; GCN-LABEL: v_constained_fma_v2f32_fpexcept_strict:
25 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
26 ; GCN-NEXT: v_fma_f32 v0, v0, v2, v4
27 ; GCN-NEXT: v_fma_f32 v1, v1, v3, v5
28 ; GCN-NEXT: s_setpc_b64 s[30:31]
30 ; GFX10-LABEL: v_constained_fma_v2f32_fpexcept_strict:
32 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
33 ; GFX10-NEXT: v_fma_f32 v0, v0, v2, v4
34 ; GFX10-NEXT: v_fma_f32 v1, v1, v3, v5
35 ; GFX10-NEXT: s_setpc_b64 s[30:31]
36 %val = call <2 x float> @llvm.experimental.constrained.fma.v2f32(<2 x float> %x, <2 x float> %y, <2 x float> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
40 define <3 x float> @v_constained_fma_v3f32_fpexcept_strict(<3 x float> %x, <3 x float> %y, <3 x float> %z) #0 {
41 ; GCN-LABEL: v_constained_fma_v3f32_fpexcept_strict:
43 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
44 ; GCN-NEXT: v_fma_f32 v0, v0, v3, v6
45 ; GCN-NEXT: v_fma_f32 v1, v1, v4, v7
46 ; GCN-NEXT: v_fma_f32 v2, v2, v5, v8
47 ; GCN-NEXT: s_setpc_b64 s[30:31]
49 ; GFX10-LABEL: v_constained_fma_v3f32_fpexcept_strict:
51 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
52 ; GFX10-NEXT: v_fma_f32 v0, v0, v3, v6
53 ; GFX10-NEXT: v_fma_f32 v1, v1, v4, v7
54 ; GFX10-NEXT: v_fma_f32 v2, v2, v5, v8
55 ; GFX10-NEXT: s_setpc_b64 s[30:31]
56 %val = call <3 x float> @llvm.experimental.constrained.fma.v3f32(<3 x float> %x, <3 x float> %y, <3 x float> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
60 define <4 x float> @v_constained_fma_v4f32_fpexcept_strict(<4 x float> %x, <4 x float> %y, <4 x float> %z) #0 {
61 ; GCN-LABEL: v_constained_fma_v4f32_fpexcept_strict:
63 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
64 ; GCN-NEXT: v_fma_f32 v0, v0, v4, v8
65 ; GCN-NEXT: v_fma_f32 v1, v1, v5, v9
66 ; GCN-NEXT: v_fma_f32 v2, v2, v6, v10
67 ; GCN-NEXT: v_fma_f32 v3, v3, v7, v11
68 ; GCN-NEXT: s_setpc_b64 s[30:31]
70 ; GFX10-LABEL: v_constained_fma_v4f32_fpexcept_strict:
72 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
73 ; GFX10-NEXT: v_fma_f32 v0, v0, v4, v8
74 ; GFX10-NEXT: v_fma_f32 v1, v1, v5, v9
75 ; GFX10-NEXT: v_fma_f32 v2, v2, v6, v10
76 ; GFX10-NEXT: v_fma_f32 v3, v3, v7, v11
77 ; GFX10-NEXT: s_setpc_b64 s[30:31]
78 %val = call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %x, <4 x float> %y, <4 x float> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
82 define float @v_constained_fma_f32_fpexcept_strict_fneg(float %x, float %y, float %z) #0 {
83 ; GCN-LABEL: v_constained_fma_f32_fpexcept_strict_fneg:
85 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
86 ; GCN-NEXT: v_fma_f32 v0, v0, v1, -v2
87 ; GCN-NEXT: s_setpc_b64 s[30:31]
89 ; GFX10-LABEL: v_constained_fma_f32_fpexcept_strict_fneg:
91 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
92 ; GFX10-NEXT: v_fma_f32 v0, v0, v1, -v2
93 ; GFX10-NEXT: s_setpc_b64 s[30:31]
94 %neg.z = fneg float %z
95 %val = call float @llvm.experimental.constrained.fma.f32(float %x, float %y, float %neg.z, metadata !"round.tonearest", metadata !"fpexcept.strict")
99 define float @v_constained_fma_f32_fpexcept_strict_fneg_fneg(float %x, float %y, float %z) #0 {
100 ; GCN-LABEL: v_constained_fma_f32_fpexcept_strict_fneg_fneg:
102 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
103 ; GCN-NEXT: v_fma_f32 v0, -v0, -v1, v2
104 ; GCN-NEXT: s_setpc_b64 s[30:31]
106 ; GFX10-LABEL: v_constained_fma_f32_fpexcept_strict_fneg_fneg:
108 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
109 ; GFX10-NEXT: v_fma_f32 v0, -v0, -v1, v2
110 ; GFX10-NEXT: s_setpc_b64 s[30:31]
111 %neg.x = fneg float %x
112 %neg.y = fneg float %y
113 %val = call float @llvm.experimental.constrained.fma.f32(float %neg.x, float %neg.y, float %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
117 define float @v_constained_fma_f32_fpexcept_strict_fabs_fabs(float %x, float %y, float %z) #0 {
118 ; GCN-LABEL: v_constained_fma_f32_fpexcept_strict_fabs_fabs:
120 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
121 ; GCN-NEXT: v_fma_f32 v0, |v0|, |v1|, v2
122 ; GCN-NEXT: s_setpc_b64 s[30:31]
124 ; GFX10-LABEL: v_constained_fma_f32_fpexcept_strict_fabs_fabs:
126 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
127 ; GFX10-NEXT: v_fma_f32 v0, |v0|, |v1|, v2
128 ; GFX10-NEXT: s_setpc_b64 s[30:31]
129 %neg.x = call float @llvm.fabs.f32(float %x) #0
130 %neg.y = call float @llvm.fabs.f32(float %y) #0
131 %val = call float @llvm.experimental.constrained.fma.f32(float %neg.x, float %neg.y, float %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
135 define <2 x float> @v_constained_fma_v2f32_fpexcept_strict_fneg_fneg(<2 x float> %x, <2 x float> %y, <2 x float> %z) #0 {
136 ; GCN-LABEL: v_constained_fma_v2f32_fpexcept_strict_fneg_fneg:
138 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
139 ; GCN-NEXT: v_fma_f32 v0, -v0, -v2, v4
140 ; GCN-NEXT: v_fma_f32 v1, -v1, -v3, v5
141 ; GCN-NEXT: s_setpc_b64 s[30:31]
143 ; GFX10-LABEL: v_constained_fma_v2f32_fpexcept_strict_fneg_fneg:
145 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
146 ; GFX10-NEXT: v_fma_f32 v0, -v0, -v2, v4
147 ; GFX10-NEXT: v_fma_f32 v1, -v1, -v3, v5
148 ; GFX10-NEXT: s_setpc_b64 s[30:31]
149 %neg.x = fneg <2 x float> %x
150 %neg.y = fneg <2 x float> %y
151 %val = call <2 x float> @llvm.experimental.constrained.fma.v2f32(<2 x float> %neg.x, <2 x float> %neg.y, <2 x float> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
155 declare float @llvm.fabs.f32(float)
156 declare float @llvm.experimental.constrained.fma.f32(float, float, float, metadata, metadata)
157 declare <2 x float> @llvm.experimental.constrained.fma.v2f32(<2 x float>, <2 x float>, <2 x float>, metadata, metadata)
158 declare <3 x float> @llvm.experimental.constrained.fma.v3f32(<3 x float>, <3 x float>, <3 x float>, metadata, metadata)
159 declare <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float>, <4 x float>, <4 x float>, metadata, metadata)
161 attributes #0 = { strictfp }