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: ; return to shader part epilog
27 %result = or i32 %x, %c
28 %bc = bitcast i32 %result to float
32 define amdgpu_ps float @shl_or_vgpr_c(i32 inreg %a, i32 inreg %b, i32 %c) {
33 ; VI-LABEL: shl_or_vgpr_c:
35 ; VI-NEXT: s_lshl_b32 s0, s2, s3
36 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
37 ; VI-NEXT: ; return to shader part epilog
39 ; GFX9-LABEL: shl_or_vgpr_c:
41 ; GFX9-NEXT: s_lshl_b32 s0, s2, s3
42 ; GFX9-NEXT: v_or_b32_e32 v0, s0, v0
43 ; GFX9-NEXT: ; return to shader part epilog
45 ; GFX10-LABEL: shl_or_vgpr_c:
47 ; GFX10-NEXT: v_lshl_or_b32 v0, s2, s3, v0
48 ; GFX10-NEXT: ; return to shader part epilog
50 %result = or i32 %x, %c
51 %bc = bitcast i32 %result to float
55 define amdgpu_ps float @shl_or_vgpr_all2(i32 %a, i32 %b, i32 %c) {
56 ; VI-LABEL: shl_or_vgpr_all2:
58 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
59 ; VI-NEXT: v_or_b32_e32 v0, v2, v0
60 ; VI-NEXT: ; return to shader part epilog
62 ; GFX9-LABEL: shl_or_vgpr_all2:
64 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
65 ; GFX9-NEXT: ; return to shader part epilog
67 ; GFX10-LABEL: shl_or_vgpr_all2:
69 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, v2
70 ; GFX10-NEXT: ; return to shader part epilog
72 %result = or i32 %c, %x
73 %bc = bitcast i32 %result to float
77 define amdgpu_ps float @shl_or_vgpr_ac(i32 %a, i32 inreg %b, i32 %c) {
78 ; VI-LABEL: shl_or_vgpr_ac:
80 ; VI-NEXT: v_lshlrev_b32_e32 v0, s2, v0
81 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
82 ; VI-NEXT: ; return to shader part epilog
84 ; GFX9-LABEL: shl_or_vgpr_ac:
86 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, s2, v1
87 ; GFX9-NEXT: ; return to shader part epilog
89 ; GFX10-LABEL: shl_or_vgpr_ac:
91 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, s2, v1
92 ; GFX10-NEXT: ; return to shader part epilog
94 %result = or i32 %x, %c
95 %bc = bitcast i32 %result to float
99 define amdgpu_ps float @shl_or_vgpr_const(i32 %a, i32 %b) {
100 ; VI-LABEL: shl_or_vgpr_const:
102 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
103 ; VI-NEXT: v_or_b32_e32 v0, 6, v0
104 ; VI-NEXT: ; return to shader part epilog
106 ; GFX9-LABEL: shl_or_vgpr_const:
108 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, 6
109 ; GFX9-NEXT: ; return to shader part epilog
111 ; GFX10-LABEL: shl_or_vgpr_const:
113 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, v1, 6
114 ; GFX10-NEXT: ; return to shader part epilog
116 %result = or i32 %x, 6
117 %bc = bitcast i32 %result to float
121 define amdgpu_ps float @shl_or_vgpr_const2(i32 %a, i32 %b) {
122 ; VI-LABEL: shl_or_vgpr_const2:
124 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
125 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
126 ; VI-NEXT: ; return to shader part epilog
128 ; GFX9-LABEL: shl_or_vgpr_const2:
130 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, v1
131 ; GFX9-NEXT: ; return to shader part epilog
133 ; GFX10-LABEL: shl_or_vgpr_const2:
135 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, 6, v1
136 ; GFX10-NEXT: ; return to shader part epilog
138 %result = or i32 %x, %b
139 %bc = bitcast i32 %result to float
143 define amdgpu_ps float @shl_or_vgpr_const_scalar1(i32 inreg %a, i32 %b) {
144 ; VI-LABEL: shl_or_vgpr_const_scalar1:
146 ; VI-NEXT: s_lshl_b32 s0, s2, 6
147 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
148 ; VI-NEXT: ; return to shader part epilog
150 ; GFX9-LABEL: shl_or_vgpr_const_scalar1:
152 ; GFX9-NEXT: v_lshl_or_b32 v0, s2, 6, v0
153 ; GFX9-NEXT: ; return to shader part epilog
155 ; GFX10-LABEL: shl_or_vgpr_const_scalar1:
157 ; GFX10-NEXT: v_lshl_or_b32 v0, s2, 6, v0
158 ; GFX10-NEXT: ; return to shader part epilog
160 %result = or i32 %x, %b
161 %bc = bitcast i32 %result to float
165 define amdgpu_ps float @shl_or_vgpr_const_scalar2(i32 %a, i32 inreg %b) {
166 ; VI-LABEL: shl_or_vgpr_const_scalar2:
168 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
169 ; VI-NEXT: v_or_b32_e32 v0, s2, v0
170 ; VI-NEXT: ; return to shader part epilog
172 ; GFX9-LABEL: shl_or_vgpr_const_scalar2:
174 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, s2
175 ; GFX9-NEXT: ; return to shader part epilog
177 ; GFX10-LABEL: shl_or_vgpr_const_scalar2:
179 ; GFX10-NEXT: v_lshl_or_b32 v0, v0, 6, s2
180 ; GFX10-NEXT: ; return to shader part epilog
182 %result = or i32 %x, %b
183 %bc = bitcast i32 %result to float