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 double @v_constained_fadd_f64_fpexcept_strict(double %x, double %y) #0 {
7 ; GCN-LABEL: v_constained_fadd_f64_fpexcept_strict:
9 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
11 ; GCN-NEXT: s_setpc_b64 s[30:31]
13 ; GFX10-LABEL: v_constained_fadd_f64_fpexcept_strict:
15 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
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: v_add_f64 v[0:1], v[0:1], v[2:3]
33 ; GFX10-NEXT: s_setpc_b64 s[30:31]
34 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.ignore")
38 define double @v_constained_fadd_f64_fpexcept_maytrap(double %x, double %y) #0 {
39 ; GCN-LABEL: v_constained_fadd_f64_fpexcept_maytrap:
41 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
42 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
43 ; GCN-NEXT: s_setpc_b64 s[30:31]
45 ; GFX10-LABEL: v_constained_fadd_f64_fpexcept_maytrap:
47 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
48 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[2:3]
49 ; GFX10-NEXT: s_setpc_b64 s[30:31]
50 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
54 define <2 x double> @v_constained_fadd_v2f64_fpexcept_strict(<2 x double> %x, <2 x double> %y) #0 {
55 ; GCN-LABEL: v_constained_fadd_v2f64_fpexcept_strict:
57 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
58 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
59 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
60 ; GCN-NEXT: s_setpc_b64 s[30:31]
62 ; GFX10-LABEL: v_constained_fadd_v2f64_fpexcept_strict:
64 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
65 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
66 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
67 ; GFX10-NEXT: s_setpc_b64 s[30:31]
68 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
72 define <2 x double> @v_constained_fadd_v2f64_fpexcept_ignore(<2 x double> %x, <2 x double> %y) #0 {
73 ; GCN-LABEL: v_constained_fadd_v2f64_fpexcept_ignore:
75 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
76 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
77 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
78 ; GCN-NEXT: s_setpc_b64 s[30:31]
80 ; GFX10-LABEL: v_constained_fadd_v2f64_fpexcept_ignore:
82 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
83 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
84 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
85 ; GFX10-NEXT: s_setpc_b64 s[30:31]
86 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.ignore")
90 define <2 x double> @v_constained_fadd_v2f64_fpexcept_maytrap(<2 x double> %x, <2 x double> %y) #0 {
91 ; GCN-LABEL: v_constained_fadd_v2f64_fpexcept_maytrap:
93 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
94 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
95 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
96 ; GCN-NEXT: s_setpc_b64 s[30:31]
98 ; GFX10-LABEL: v_constained_fadd_v2f64_fpexcept_maytrap:
100 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
101 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[4:5]
102 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[6:7]
103 ; GFX10-NEXT: s_setpc_b64 s[30:31]
104 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
105 ret <2 x double> %val
108 define <3 x double> @v_constained_fadd_v3f64_fpexcept_strict(<3 x double> %x, <3 x double> %y) #0 {
109 ; GCN-LABEL: v_constained_fadd_v3f64_fpexcept_strict:
111 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
112 ; GCN-NEXT: v_add_f64 v[0:1], v[0:1], v[6:7]
113 ; GCN-NEXT: v_add_f64 v[2:3], v[2:3], v[8:9]
114 ; GCN-NEXT: v_add_f64 v[4:5], v[4:5], v[10:11]
115 ; GCN-NEXT: s_setpc_b64 s[30:31]
117 ; GFX10-LABEL: v_constained_fadd_v3f64_fpexcept_strict:
119 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
120 ; GFX10-NEXT: v_add_f64 v[0:1], v[0:1], v[6:7]
121 ; GFX10-NEXT: v_add_f64 v[2:3], v[2:3], v[8:9]
122 ; GFX10-NEXT: v_add_f64 v[4:5], v[4:5], v[10:11]
123 ; GFX10-NEXT: s_setpc_b64 s[30:31]
124 %val = call <3 x double> @llvm.experimental.constrained.fadd.v3f64(<3 x double> %x, <3 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
125 ret <3 x double> %val
128 define amdgpu_ps <2 x float> @s_constained_fadd_f64_fpexcept_strict(double inreg %x, double inreg %y) #0 {
129 ; GCN-LABEL: s_constained_fadd_f64_fpexcept_strict:
131 ; GCN-NEXT: v_mov_b32_e32 v0, s4
132 ; GCN-NEXT: v_mov_b32_e32 v1, s5
133 ; GCN-NEXT: v_add_f64 v[0:1], s[2:3], v[0:1]
134 ; GCN-NEXT: ; return to shader part epilog
136 ; GFX10-LABEL: s_constained_fadd_f64_fpexcept_strict:
138 ; GFX10-NEXT: v_add_f64 v[0:1], s[2:3], s[4:5]
139 ; GFX10-NEXT: ; return to shader part epilog
140 %val = call double @llvm.experimental.constrained.fadd.f64(double %x, double %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
141 %cast = bitcast double %val to <2 x float>
142 ret <2 x float> %cast
145 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) #1
146 declare <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double>, <2 x double>, metadata, metadata) #1
147 declare <3 x double> @llvm.experimental.constrained.fadd.v3f64(<3 x double>, <3 x double>, metadata, metadata) #1
149 attributes #0 = { strictfp }
150 attributes #1 = { inaccessiblememonly nounwind willreturn }