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
6 ; ===================================================================================
8 ; ===================================================================================
10 define amdgpu_ps float @shl_or(i32 %a, i32 %b, i32 %c) {
13 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
14 ; VI-NEXT: v_or_b32_e32 v0, v0, v2
15 ; VI-NEXT: ; return to shader part epilog
19 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
20 ; GFX9-NEXT: ; return to shader part epilog
22 ; GFX10-LABEL: shl_or:
24 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, v2
25 ; GFX10-NEXT: ; implicit-def: $vcc_hi
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: ; implicit-def: $vcc_hi
50 ; GFX10-NEXT: ; return to shader part epilog
52 %result = or i32 %x, %c
53 %bc = bitcast i32 %result to float
57 define amdgpu_ps float @shl_or_vgpr_all2(i32 %a, i32 %b, i32 %c) {
58 ; VI-LABEL: shl_or_vgpr_all2:
60 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
61 ; VI-NEXT: v_or_b32_e32 v0, v2, v0
62 ; VI-NEXT: ; return to shader part epilog
64 ; GFX9-LABEL: shl_or_vgpr_all2:
66 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
67 ; GFX9-NEXT: ; return to shader part epilog
69 ; GFX10-LABEL: shl_or_vgpr_all2:
71 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, v2
72 ; GFX10-NEXT: ; implicit-def: $vcc_hi
73 ; GFX10-NEXT: ; return to shader part epilog
75 %result = or i32 %c, %x
76 %bc = bitcast i32 %result to float
80 define amdgpu_ps float @shl_or_vgpr_ac(i32 %a, i32 inreg %b, i32 %c) {
81 ; VI-LABEL: shl_or_vgpr_ac:
83 ; VI-NEXT: v_lshlrev_b32_e32 v0, s2, v0
84 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
85 ; VI-NEXT: ; return to shader part epilog
87 ; GFX9-LABEL: shl_or_vgpr_ac:
89 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, s2, v1
90 ; GFX9-NEXT: ; return to shader part epilog
92 ; GFX10-LABEL: shl_or_vgpr_ac:
94 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, s2, v1
95 ; GFX10-NEXT: ; implicit-def: $vcc_hi
96 ; GFX10-NEXT: ; return to shader part epilog
98 %result = or i32 %x, %c
99 %bc = bitcast i32 %result to float
103 define amdgpu_ps float @shl_or_vgpr_const(i32 %a, i32 %b) {
104 ; VI-LABEL: shl_or_vgpr_const:
106 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
107 ; VI-NEXT: v_or_b32_e32 v0, 6, v0
108 ; VI-NEXT: ; return to shader part epilog
110 ; GFX9-LABEL: shl_or_vgpr_const:
112 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, 6
113 ; GFX9-NEXT: ; return to shader part epilog
115 ; GFX10-LABEL: shl_or_vgpr_const:
117 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, 6
118 ; GFX10-NEXT: ; implicit-def: $vcc_hi
119 ; GFX10-NEXT: ; return to shader part epilog
121 %result = or i32 %x, 6
122 %bc = bitcast i32 %result to float
126 define amdgpu_ps float @shl_or_vgpr_const2(i32 %a, i32 %b) {
127 ; VI-LABEL: shl_or_vgpr_const2:
129 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
130 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
131 ; VI-NEXT: ; return to shader part epilog
133 ; GFX9-LABEL: shl_or_vgpr_const2:
135 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, v1
136 ; GFX9-NEXT: ; return to shader part epilog
138 ; GFX10-LABEL: shl_or_vgpr_const2:
140 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, 6, v1
141 ; GFX10-NEXT: ; implicit-def: $vcc_hi
142 ; GFX10-NEXT: ; return to shader part epilog
144 %result = or i32 %x, %b
145 %bc = bitcast i32 %result to float
149 define amdgpu_ps float @shl_or_vgpr_const_scalar1(i32 inreg %a, i32 %b) {
150 ; VI-LABEL: shl_or_vgpr_const_scalar1:
152 ; VI-NEXT: s_lshl_b32 s0, s2, 6
153 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
154 ; VI-NEXT: ; return to shader part epilog
156 ; GFX9-LABEL: shl_or_vgpr_const_scalar1:
158 ; GFX9-NEXT: v_lshl_or_b32 v0, s2, 6, v0
159 ; GFX9-NEXT: ; return to shader part epilog
161 ; GFX10-LABEL: shl_or_vgpr_const_scalar1:
163 ; GFX10-NEXT: v_lshl_or_b32 v0, s2, 6, v0
164 ; GFX10-NEXT: ; implicit-def: $vcc_hi
165 ; GFX10-NEXT: ; return to shader part epilog
167 %result = or i32 %x, %b
168 %bc = bitcast i32 %result to float
172 define amdgpu_ps float @shl_or_vgpr_const_scalar2(i32 %a, i32 inreg %b) {
173 ; VI-LABEL: shl_or_vgpr_const_scalar2:
175 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
176 ; VI-NEXT: v_or_b32_e32 v0, s2, v0
177 ; VI-NEXT: ; return to shader part epilog
179 ; GFX9-LABEL: shl_or_vgpr_const_scalar2:
181 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, s2
182 ; GFX9-NEXT: ; return to shader part epilog
184 ; GFX10-LABEL: shl_or_vgpr_const_scalar2:
186 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, 6, s2
187 ; GFX10-NEXT: ; implicit-def: $vcc_hi
188 ; GFX10-NEXT: ; return to shader part epilog
190 %result = or i32 %x, %b
191 %bc = bitcast i32 %result to float