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_fadd_f64_fpexcept_strict(double %x, double %y) #0 {
6 ; GCN-LABEL: v_constained_fadd_f64_fpexcept_strict:
8 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
10 ; GCN-NEXT: s_setpc_b64 s[30:31]
12 ; GFX10-LABEL: v_constained_fadd_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_add_f64 v[0:1], v[0:1], v[2:3]
17 ; GFX10-NEXT: s_setpc_b64 s[30:31]
18 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
22 define double @v_constained_fadd_f64_fpexcept_ignore(double %x, double %y) #0 {
23 ; GCN-LABEL: v_constained_fadd_f64_fpexcept_ignore:
25 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
26 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
27 ; GCN-NEXT: s_setpc_b64 s[30:31]
29 ; GFX10-LABEL: v_constained_fadd_f64_fpexcept_ignore:
31 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
32 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
33 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
34 ; GFX10-NEXT: s_setpc_b64 s[30:31]
35 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.ignore")
39 define double @v_constained_fadd_f64_fpexcept_maytrap(double %x, double %y) #0 {
40 ; GCN-LABEL: v_constained_fadd_f64_fpexcept_maytrap:
42 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
43 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
44 ; GCN-NEXT: s_setpc_b64 s[30:31]
46 ; GFX10-LABEL: v_constained_fadd_f64_fpexcept_maytrap:
48 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
49 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
50 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
51 ; GFX10-NEXT: s_setpc_b64 s[30:31]
52 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
56 define <2 x double> @v_constained_fadd_v2f64_fpexcept_strict(<2 x double> %x, <2 x double> %y) #0 {
57 ; GCN-LABEL: v_constained_fadd_v2f64_fpexcept_strict:
59 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
60 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
61 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
62 ; GCN-NEXT: s_setpc_b64 s[30:31]
64 ; GFX10-LABEL: v_constained_fadd_v2f64_fpexcept_strict:
66 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
67 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
68 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
69 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
70 ; GFX10-NEXT: s_setpc_b64 s[30:31]
71 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
75 define <2 x double> @v_constained_fadd_v2f64_fpexcept_ignore(<2 x double> %x, <2 x double> %y) #0 {
76 ; GCN-LABEL: v_constained_fadd_v2f64_fpexcept_ignore:
78 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
79 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
80 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
81 ; GCN-NEXT: s_setpc_b64 s[30:31]
83 ; GFX10-LABEL: v_constained_fadd_v2f64_fpexcept_ignore:
85 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
86 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
87 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
88 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
89 ; GFX10-NEXT: s_setpc_b64 s[30:31]
90 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.ignore")
94 define <2 x double> @v_constained_fadd_v2f64_fpexcept_maytrap(<2 x double> %x, <2 x double> %y) #0 {
95 ; GCN-LABEL: v_constained_fadd_v2f64_fpexcept_maytrap:
97 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
98 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
99 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
100 ; GCN-NEXT: s_setpc_b64 s[30:31]
102 ; GFX10-LABEL: v_constained_fadd_v2f64_fpexcept_maytrap:
104 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
105 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
106 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
107 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
108 ; GFX10-NEXT: s_setpc_b64 s[30:31]
109 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
110 ret <2 x double> %val
113 define <3 x double> @v_constained_fadd_v3f64_fpexcept_strict(<3 x double> %x, <3 x double> %y) #0 {
114 ; GCN-LABEL: v_constained_fadd_v3f64_fpexcept_strict:
116 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
117 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[6:7]
118 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[8:9]
119 ; GCN-NEXT: v_add_f64 v[4:5], v[4:5], v[10:11]
120 ; GCN-NEXT: s_setpc_b64 s[30:31]
122 ; GFX10-LABEL: v_constained_fadd_v3f64_fpexcept_strict:
124 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
125 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
126 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[6:7]
127 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[8:9]
128 ; GFX10-NEXT: v_add_f64 v[4:5], v[4:5], v[10:11]
129 ; GFX10-NEXT: s_setpc_b64 s[30:31]
130 %val = call <3 x double> @llvm.experimental.constrained.fadd.v3f64(<3 x double> %x, <3 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
131 ret <3 x double> %val
134 define amdgpu_ps <2 x float> @s_constained_fadd_f64_fpexcept_strict(double inreg %x, double inreg %y) #0 {
135 ; GCN-LABEL: s_constained_fadd_f64_fpexcept_strict:
137 ; GCN-NEXT: v_mov_b32_e32 v0, s4
138 ; GCN-NEXT: v_mov_b32_e32 v1, s5
139 ; GCN-NEXT: v_add_f64 v[0:1], s[2:3], v[0:1]
140 ; GCN-NEXT: ; return to shader part epilog
142 ; GFX10-LABEL: s_constained_fadd_f64_fpexcept_strict:
144 ; GFX10-NEXT: v_add_f64 v[0:1], s[2:3], s[4:5]
145 ; GFX10-NEXT: ; return to shader part epilog
146 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
147 %cast = bitcast double %val to <2 x float>
148 ret <2 x float> %cast
151 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) #1
152 declare <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double>, <2 x double>, metadata, metadata) #1
153 declare <3 x double> @llvm.experimental.constrained.fadd.v3f64(<3 x double>, <3 x double>, metadata, metadata) #1
155 attributes #0 = { strictfp }
156 attributes #1 = { inaccessiblememonly nounwind willreturn }