1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=fiji -verify-machineinstrs | FileCheck -check-prefix=VI %s
3 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx900 -verify-machineinstrs | FileCheck -check-prefix=GFX9 %s
4 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1010 -verify-machineinstrs | FileCheck -check-prefix=GFX10 %s
5 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -verify-machineinstrs | FileCheck -check-prefix=GFX10 %s
7 ; ===================================================================================
9 ; ===================================================================================
11 define amdgpu_ps float @shl_or(i32 %a, i32 %b, i32 %c) {
14 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
15 ; VI-NEXT: v_or_b32_e32 v0, v0, v2
16 ; VI-NEXT: ; return to shader part epilog
20 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
21 ; GFX9-NEXT: ; return to shader part epilog
23 ; GFX10-LABEL: shl_or:
25 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, v2
26 ; GFX10-NEXT: ; return to shader part epilog
28 %result = or i32 %x, %c
29 %bc = bitcast i32 %result to float
33 define amdgpu_ps float @shl_or_vgpr_c(i32 inreg %a, i32 inreg %b, i32 %c) {
34 ; VI-LABEL: shl_or_vgpr_c:
36 ; VI-NEXT: s_lshl_b32 s0, s2, s3
37 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
38 ; VI-NEXT: ; return to shader part epilog
40 ; GFX9-LABEL: shl_or_vgpr_c:
42 ; GFX9-NEXT: s_lshl_b32 s0, s2, s3
43 ; GFX9-NEXT: v_or_b32_e32 v0, s0, v0
44 ; GFX9-NEXT: ; return to shader part epilog
46 ; GFX10-LABEL: shl_or_vgpr_c:
48 ; GFX10-NEXT: v_lshl_or_b32 v0, s2, s3, v0
49 ; GFX10-NEXT: ; return to shader part epilog
51 %result = or i32 %x, %c
52 %bc = bitcast i32 %result to float
56 define amdgpu_ps float @shl_or_vgpr_all2(i32 %a, i32 %b, i32 %c) {
57 ; VI-LABEL: shl_or_vgpr_all2:
59 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
60 ; VI-NEXT: v_or_b32_e32 v0, v2, v0
61 ; VI-NEXT: ; return to shader part epilog
63 ; GFX9-LABEL: shl_or_vgpr_all2:
65 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
66 ; GFX9-NEXT: ; return to shader part epilog
68 ; GFX10-LABEL: shl_or_vgpr_all2:
70 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, v2
71 ; GFX10-NEXT: ; return to shader part epilog
73 %result = or i32 %c, %x
74 %bc = bitcast i32 %result to float
78 define amdgpu_ps float @shl_or_vgpr_ac(i32 %a, i32 inreg %b, i32 %c) {
79 ; VI-LABEL: shl_or_vgpr_ac:
81 ; VI-NEXT: v_lshlrev_b32_e32 v0, s2, v0
82 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
83 ; VI-NEXT: ; return to shader part epilog
85 ; GFX9-LABEL: shl_or_vgpr_ac:
87 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, s2, v1
88 ; GFX9-NEXT: ; return to shader part epilog
90 ; GFX10-LABEL: shl_or_vgpr_ac:
92 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, s2, v1
93 ; GFX10-NEXT: ; return to shader part epilog
95 %result = or i32 %x, %c
96 %bc = bitcast i32 %result to float
100 define amdgpu_ps float @shl_or_vgpr_const(i32 %a, i32 %b) {
101 ; VI-LABEL: shl_or_vgpr_const:
103 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
104 ; VI-NEXT: v_or_b32_e32 v0, 6, v0
105 ; VI-NEXT: ; return to shader part epilog
107 ; GFX9-LABEL: shl_or_vgpr_const:
109 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, 6
110 ; GFX9-NEXT: ; return to shader part epilog
112 ; GFX10-LABEL: shl_or_vgpr_const:
114 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, 6
115 ; GFX10-NEXT: ; return to shader part epilog
117 %result = or i32 %x, 6
118 %bc = bitcast i32 %result to float
122 define amdgpu_ps float @shl_or_vgpr_const2(i32 %a, i32 %b) {
123 ; VI-LABEL: shl_or_vgpr_const2:
125 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
126 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
127 ; VI-NEXT: ; return to shader part epilog
129 ; GFX9-LABEL: shl_or_vgpr_const2:
131 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, v1
132 ; GFX9-NEXT: ; return to shader part epilog
134 ; GFX10-LABEL: shl_or_vgpr_const2:
136 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, 6, v1
137 ; GFX10-NEXT: ; return to shader part epilog
139 %result = or i32 %x, %b
140 %bc = bitcast i32 %result to float
144 define amdgpu_ps float @shl_or_vgpr_const_scalar1(i32 inreg %a, i32 %b) {
145 ; VI-LABEL: shl_or_vgpr_const_scalar1:
147 ; VI-NEXT: s_lshl_b32 s0, s2, 6
148 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
149 ; VI-NEXT: ; return to shader part epilog
151 ; GFX9-LABEL: shl_or_vgpr_const_scalar1:
153 ; GFX9-NEXT: v_lshl_or_b32 v0, s2, 6, v0
154 ; GFX9-NEXT: ; return to shader part epilog
156 ; GFX10-LABEL: shl_or_vgpr_const_scalar1:
158 ; GFX10-NEXT: v_lshl_or_b32 v0, s2, 6, v0
159 ; GFX10-NEXT: ; return to shader part epilog
161 %result = or i32 %x, %b
162 %bc = bitcast i32 %result to float
166 define amdgpu_ps float @shl_or_vgpr_const_scalar2(i32 %a, i32 inreg %b) {
167 ; VI-LABEL: shl_or_vgpr_const_scalar2:
169 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
170 ; VI-NEXT: v_or_b32_e32 v0, s2, v0
171 ; VI-NEXT: ; return to shader part epilog
173 ; GFX9-LABEL: shl_or_vgpr_const_scalar2:
175 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, s2
176 ; GFX9-NEXT: ; return to shader part epilog
178 ; GFX10-LABEL: shl_or_vgpr_const_scalar2:
180 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, 6, s2
181 ; GFX10-NEXT: ; return to shader part epilog
183 %result = or i32 %x, %b
184 %bc = bitcast i32 %result to float