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
5 define double @v_constained_fma_f64_fpexcept_strict(double %x, double %y, double %z) #0 {
6 ; GCN-LABEL: v_constained_fma_f64_fpexcept_strict:
8 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; GCN-NEXT: v_fma_f64 v[0:1], v[0:1], v[2:3], v[4:5]
10 ; GCN-NEXT: s_setpc_b64 s[30:31]
12 ; GFX10-LABEL: v_constained_fma_f64_fpexcept_strict:
14 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
15 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
16 ; GFX10-NEXT: v_fma_f64 v[0:1], v[0:1], v[2:3], v[4:5]
17 ; GFX10-NEXT: s_setpc_b64 s[30:31]
18 %val = call double @llvm.experimental.constrained.fma.f64(double %x, double %y, double %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
22 define <2 x double> @v_constained_fma_v2f64_fpexcept_strict(<2 x double> %x, <2 x double> %y, <2 x double> %z) #0 {
23 ; GCN-LABEL: v_constained_fma_v2f64_fpexcept_strict:
25 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
26 ; GCN-NEXT: v_fma_f64 v[0:1], v[0:1], v[4:5], v[8:9]
27 ; GCN-NEXT: v_fma_f64 v[2:3], v[2:3], v[6:7], v[10:11]
28 ; GCN-NEXT: s_setpc_b64 s[30:31]
30 ; GFX10-LABEL: v_constained_fma_v2f64_fpexcept_strict:
32 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
33 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
34 ; GFX10-NEXT: v_fma_f64 v[0:1], v[0:1], v[4:5], v[8:9]
35 ; GFX10-NEXT: v_fma_f64 v[2:3], v[2:3], v[6:7], v[10:11]
36 ; GFX10-NEXT: s_setpc_b64 s[30:31]
37 %val = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %x, <2 x double> %y, <2 x double> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
41 define <3 x double> @v_constained_fma_v3f64_fpexcept_strict(<3 x double> %x, <3 x double> %y, <3 x double> %z) #0 {
42 ; GCN-LABEL: v_constained_fma_v3f64_fpexcept_strict:
44 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
45 ; GCN-NEXT: v_fma_f64 v[0:1], v[0:1], v[6:7], v[12:13]
46 ; GCN-NEXT: v_fma_f64 v[2:3], v[2:3], v[8:9], v[14:15]
47 ; GCN-NEXT: v_fma_f64 v[4:5], v[4:5], v[10:11], v[16:17]
48 ; GCN-NEXT: s_setpc_b64 s[30:31]
50 ; GFX10-LABEL: v_constained_fma_v3f64_fpexcept_strict:
52 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
53 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
54 ; GFX10-NEXT: v_fma_f64 v[0:1], v[0:1], v[6:7], v[12:13]
55 ; GFX10-NEXT: v_fma_f64 v[2:3], v[2:3], v[8:9], v[14:15]
56 ; GFX10-NEXT: v_fma_f64 v[4:5], v[4:5], v[10:11], v[16:17]
57 ; GFX10-NEXT: s_setpc_b64 s[30:31]
58 %val = call <3 x double> @llvm.experimental.constrained.fma.v3f64(<3 x double> %x, <3 x double> %y, <3 x double> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
62 define <4 x double> @v_constained_fma_v4f64_fpexcept_strict(<4 x double> %x, <4 x double> %y, <4 x double> %z) #0 {
63 ; GCN-LABEL: v_constained_fma_v4f64_fpexcept_strict:
65 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
66 ; GCN-NEXT: v_fma_f64 v[0:1], v[0:1], v[8:9], v[16:17]
67 ; GCN-NEXT: v_fma_f64 v[2:3], v[2:3], v[10:11], v[18:19]
68 ; GCN-NEXT: v_fma_f64 v[4:5], v[4:5], v[12:13], v[20:21]
69 ; GCN-NEXT: v_fma_f64 v[6:7], v[6:7], v[14:15], v[22:23]
70 ; GCN-NEXT: s_setpc_b64 s[30:31]
72 ; GFX10-LABEL: v_constained_fma_v4f64_fpexcept_strict:
74 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
75 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
76 ; GFX10-NEXT: v_fma_f64 v[0:1], v[0:1], v[8:9], v[16:17]
77 ; GFX10-NEXT: v_fma_f64 v[2:3], v[2:3], v[10:11], v[18:19]
78 ; GFX10-NEXT: v_fma_f64 v[4:5], v[4:5], v[12:13], v[20:21]
79 ; GFX10-NEXT: v_fma_f64 v[6:7], v[6:7], v[14:15], v[22:23]
80 ; GFX10-NEXT: s_setpc_b64 s[30:31]
81 %val = call <4 x double> @llvm.experimental.constrained.fma.v4f64(<4 x double> %x, <4 x double> %y, <4 x double> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
85 define double @v_constained_fma_f64_fpexcept_strict_fneg(double %x, double %y, double %z) #0 {
86 ; GCN-LABEL: v_constained_fma_f64_fpexcept_strict_fneg:
88 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
89 ; GCN-NEXT: v_fma_f64 v[0:1], v[0:1], v[2:3], -v[4:5]
90 ; GCN-NEXT: s_setpc_b64 s[30:31]
92 ; GFX10-LABEL: v_constained_fma_f64_fpexcept_strict_fneg:
94 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
95 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
96 ; GFX10-NEXT: v_fma_f64 v[0:1], v[0:1], v[2:3], -v[4:5]
97 ; GFX10-NEXT: s_setpc_b64 s[30:31]
98 %neg.z = fneg double %z
99 %val = call double @llvm.experimental.constrained.fma.f64(double %x, double %y, double %neg.z, metadata !"round.tonearest", metadata !"fpexcept.strict")
103 define double @v_constained_fma_f64_fpexcept_strict_fneg_fneg(double %x, double %y, double %z) #0 {
104 ; GCN-LABEL: v_constained_fma_f64_fpexcept_strict_fneg_fneg:
106 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
107 ; GCN-NEXT: v_fma_f64 v[0:1], -v[0:1], -v[2:3], v[4:5]
108 ; GCN-NEXT: s_setpc_b64 s[30:31]
110 ; GFX10-LABEL: v_constained_fma_f64_fpexcept_strict_fneg_fneg:
112 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
113 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
114 ; GFX10-NEXT: v_fma_f64 v[0:1], -v[0:1], -v[2:3], v[4:5]
115 ; GFX10-NEXT: s_setpc_b64 s[30:31]
116 %neg.x = fneg double %x
117 %neg.y = fneg double %y
118 %val = call double @llvm.experimental.constrained.fma.f64(double %neg.x, double %neg.y, double %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
122 define double @v_constained_fma_f64_fpexcept_strict_fabs_fabs(double %x, double %y, double %z) #0 {
123 ; GCN-LABEL: v_constained_fma_f64_fpexcept_strict_fabs_fabs:
125 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
126 ; GCN-NEXT: v_fma_f64 v[0:1], |v[0:1]|, |v[2:3]|, v[4:5]
127 ; GCN-NEXT: s_setpc_b64 s[30:31]
129 ; GFX10-LABEL: v_constained_fma_f64_fpexcept_strict_fabs_fabs:
131 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
132 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
133 ; GFX10-NEXT: v_fma_f64 v[0:1], |v[0:1]|, |v[2:3]|, v[4:5]
134 ; GFX10-NEXT: s_setpc_b64 s[30:31]
135 %neg.x = call double @llvm.fabs.f64(double %x)
136 %neg.y = call double @llvm.fabs.f64(double %y)
137 %val = call double @llvm.experimental.constrained.fma.f64(double %neg.x, double %neg.y, double %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
141 define <2 x double> @v_constained_fma_v2f64_fpexcept_strict_fneg_fneg(<2 x double> %x, <2 x double> %y, <2 x double> %z) #0 {
142 ; GCN-LABEL: v_constained_fma_v2f64_fpexcept_strict_fneg_fneg:
144 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
145 ; GCN-NEXT: v_fma_f64 v[0:1], -v[0:1], -v[4:5], v[8:9]
146 ; GCN-NEXT: v_fma_f64 v[2:3], -v[2:3], -v[6:7], v[10:11]
147 ; GCN-NEXT: s_setpc_b64 s[30:31]
149 ; GFX10-LABEL: v_constained_fma_v2f64_fpexcept_strict_fneg_fneg:
151 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
152 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
153 ; GFX10-NEXT: v_fma_f64 v[0:1], -v[0:1], -v[4:5], v[8:9]
154 ; GFX10-NEXT: v_fma_f64 v[2:3], -v[2:3], -v[6:7], v[10:11]
155 ; GFX10-NEXT: s_setpc_b64 s[30:31]
156 %neg.x = fneg <2 x double> %x
157 %neg.y = fneg <2 x double> %y
158 %val = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %neg.x, <2 x double> %neg.y, <2 x double> %z, metadata !"round.tonearest", metadata !"fpexcept.strict")
159 ret <2 x double> %val
162 declare double @llvm.fabs.f64(double) #1
163 declare double @llvm.experimental.constrained.fma.f64(double, double, double, metadata, metadata) #1
164 declare <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double>, <2 x double>, <2 x double>, metadata, metadata) #1
165 declare <3 x double> @llvm.experimental.constrained.fma.v3f64(<3 x double>, <3 x double>, <3 x double>, metadata, metadata) #1
166 declare <4 x double> @llvm.experimental.constrained.fma.v4f64(<4 x double>, <4 x double>, <4 x double>, metadata, metadata) #1
168 attributes #0 = { strictfp }
169 attributes #1 = { inaccessiblememonly nounwind willreturn }