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
5 ; ===================================================================================
7 ; ===================================================================================
9 define amdgpu_ps float @shl_or(i32 %a, i32 %b, i32 %c) {
12 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
13 ; VI-NEXT: v_or_b32_e32 v0, v0, v2
14 ; VI-NEXT: ; return to shader part epilog
18 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
19 ; GFX9-NEXT: ; return to shader part epilog
21 %result = or i32 %x, %c
22 %bc = bitcast i32 %result to float
26 define amdgpu_ps float @shl_or_vgpr_c(i32 inreg %a, i32 inreg %b, i32 %c) {
27 ; VI-LABEL: shl_or_vgpr_c:
29 ; VI-NEXT: s_lshl_b32 s0, s2, s3
30 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
31 ; VI-NEXT: ; return to shader part epilog
33 ; GFX9-LABEL: shl_or_vgpr_c:
35 ; GFX9-NEXT: s_lshl_b32 s0, s2, s3
36 ; GFX9-NEXT: v_or_b32_e32 v0, s0, v0
37 ; GFX9-NEXT: ; return to shader part epilog
39 %result = or i32 %x, %c
40 %bc = bitcast i32 %result to float
44 define amdgpu_ps float @shl_or_vgpr_all2(i32 %a, i32 %b, i32 %c) {
45 ; VI-LABEL: shl_or_vgpr_all2:
47 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
48 ; VI-NEXT: v_or_b32_e32 v0, v2, v0
49 ; VI-NEXT: ; return to shader part epilog
51 ; GFX9-LABEL: shl_or_vgpr_all2:
53 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, v2
54 ; GFX9-NEXT: ; return to shader part epilog
56 %result = or i32 %c, %x
57 %bc = bitcast i32 %result to float
61 define amdgpu_ps float @shl_or_vgpr_ac(i32 %a, i32 inreg %b, i32 %c) {
62 ; VI-LABEL: shl_or_vgpr_ac:
64 ; VI-NEXT: v_lshlrev_b32_e32 v0, s2, v0
65 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
66 ; VI-NEXT: ; return to shader part epilog
68 ; GFX9-LABEL: shl_or_vgpr_ac:
70 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, s2, v1
71 ; GFX9-NEXT: ; return to shader part epilog
73 %result = or i32 %x, %c
74 %bc = bitcast i32 %result to float
78 define amdgpu_ps float @shl_or_vgpr_const(i32 %a, i32 %b) {
79 ; VI-LABEL: shl_or_vgpr_const:
81 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
82 ; VI-NEXT: v_or_b32_e32 v0, 6, v0
83 ; VI-NEXT: ; return to shader part epilog
85 ; GFX9-LABEL: shl_or_vgpr_const:
87 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, v1, 6
88 ; GFX9-NEXT: ; return to shader part epilog
90 %result = or i32 %x, 6
91 %bc = bitcast i32 %result to float
95 define amdgpu_ps float @shl_or_vgpr_const2(i32 %a, i32 %b) {
96 ; VI-LABEL: shl_or_vgpr_const2:
98 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
99 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
100 ; VI-NEXT: ; return to shader part epilog
102 ; GFX9-LABEL: shl_or_vgpr_const2:
104 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, v1
105 ; GFX9-NEXT: ; return to shader part epilog
107 %result = or i32 %x, %b
108 %bc = bitcast i32 %result to float
112 define amdgpu_ps float @shl_or_vgpr_const_scalar1(i32 inreg %a, i32 %b) {
113 ; VI-LABEL: shl_or_vgpr_const_scalar1:
115 ; VI-NEXT: s_lshl_b32 s0, s2, 6
116 ; VI-NEXT: v_or_b32_e32 v0, s0, v0
117 ; VI-NEXT: ; return to shader part epilog
119 ; GFX9-LABEL: shl_or_vgpr_const_scalar1:
121 ; GFX9-NEXT: v_lshl_or_b32 v0, s2, 6, v0
122 ; GFX9-NEXT: ; return to shader part epilog
124 %result = or i32 %x, %b
125 %bc = bitcast i32 %result to float
129 define amdgpu_ps float @shl_or_vgpr_const_scalar2(i32 %a, i32 inreg %b) {
130 ; VI-LABEL: shl_or_vgpr_const_scalar2:
132 ; VI-NEXT: v_lshlrev_b32_e32 v0, 6, v0
133 ; VI-NEXT: v_or_b32_e32 v0, s2, v0
134 ; VI-NEXT: ; return to shader part epilog
136 ; GFX9-LABEL: shl_or_vgpr_const_scalar2:
138 ; GFX9-NEXT: v_lshl_or_b32 v0, v0, 6, s2
139 ; GFX9-NEXT: ; return to shader part epilog
141 %result = or i32 %x, %b
142 %bc = bitcast i32 %result to float