annotate llvm/test/CodeGen/AMDGPU/and_or.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
anatofuz
parents:
diff changeset
2 ;RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=fiji -verify-machineinstrs | FileCheck -check-prefix=VI %s
anatofuz
parents:
diff changeset
3 ;RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx900 -verify-machineinstrs | FileCheck -check-prefix=GFX9 %s
anatofuz
parents:
diff changeset
4 ;RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1010 -verify-machineinstrs | FileCheck -check-prefix=GFX10 %s
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 ; ===================================================================================
anatofuz
parents:
diff changeset
7 ; V_AND_OR_B32
anatofuz
parents:
diff changeset
8 ; ===================================================================================
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 define amdgpu_ps float @and_or(i32 %a, i32 %b, i32 %c) {
anatofuz
parents:
diff changeset
11 ; VI-LABEL: and_or:
anatofuz
parents:
diff changeset
12 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
13 ; VI-NEXT: v_and_b32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
14 ; VI-NEXT: v_or_b32_e32 v0, v0, v2
anatofuz
parents:
diff changeset
15 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
16 ;
anatofuz
parents:
diff changeset
17 ; GFX9-LABEL: and_or:
anatofuz
parents:
diff changeset
18 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
19 ; GFX9-NEXT: v_and_or_b32 v0, v0, v1, v2
anatofuz
parents:
diff changeset
20 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
21 ;
anatofuz
parents:
diff changeset
22 ; GFX10-LABEL: and_or:
anatofuz
parents:
diff changeset
23 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
24 ; GFX10-NEXT: v_and_or_b32 v0, v0, v1, v2
anatofuz
parents:
diff changeset
25 ; GFX10-NEXT: ; implicit-def: $vcc_hi
anatofuz
parents:
diff changeset
26 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
27 %x = and i32 %a, %b
anatofuz
parents:
diff changeset
28 %result = or i32 %x, %c
anatofuz
parents:
diff changeset
29 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
30 ret float %bc
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 ; ThreeOp instruction variant not used due to Constant Bus Limitations
anatofuz
parents:
diff changeset
34 define amdgpu_ps float @and_or_vgpr_b(i32 inreg %a, i32 %b, i32 inreg %c) {
anatofuz
parents:
diff changeset
35 ; VI-LABEL: and_or_vgpr_b:
anatofuz
parents:
diff changeset
36 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
37 ; VI-NEXT: v_and_b32_e32 v0, s2, v0
anatofuz
parents:
diff changeset
38 ; VI-NEXT: v_or_b32_e32 v0, s3, v0
anatofuz
parents:
diff changeset
39 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
40 ;
anatofuz
parents:
diff changeset
41 ; GFX9-LABEL: and_or_vgpr_b:
anatofuz
parents:
diff changeset
42 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
43 ; GFX9-NEXT: v_and_b32_e32 v0, s2, v0
anatofuz
parents:
diff changeset
44 ; GFX9-NEXT: v_or_b32_e32 v0, s3, v0
anatofuz
parents:
diff changeset
45 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
46 ;
anatofuz
parents:
diff changeset
47 ; GFX10-LABEL: and_or_vgpr_b:
anatofuz
parents:
diff changeset
48 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
49 ; GFX10-NEXT: v_and_or_b32 v0, s2, v0, s3
anatofuz
parents:
diff changeset
50 ; GFX10-NEXT: ; implicit-def: $vcc_hi
anatofuz
parents:
diff changeset
51 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
52 %x = and i32 %a, %b
anatofuz
parents:
diff changeset
53 %result = or i32 %x, %c
anatofuz
parents:
diff changeset
54 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
55 ret float %bc
anatofuz
parents:
diff changeset
56 }
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 define amdgpu_ps float @and_or_vgpr_ab(i32 %a, i32 %b, i32 inreg %c) {
anatofuz
parents:
diff changeset
59 ; VI-LABEL: and_or_vgpr_ab:
anatofuz
parents:
diff changeset
60 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
61 ; VI-NEXT: v_and_b32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
62 ; VI-NEXT: v_or_b32_e32 v0, s2, v0
anatofuz
parents:
diff changeset
63 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
64 ;
anatofuz
parents:
diff changeset
65 ; GFX9-LABEL: and_or_vgpr_ab:
anatofuz
parents:
diff changeset
66 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
67 ; GFX9-NEXT: v_and_or_b32 v0, v0, v1, s2
anatofuz
parents:
diff changeset
68 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
69 ;
anatofuz
parents:
diff changeset
70 ; GFX10-LABEL: and_or_vgpr_ab:
anatofuz
parents:
diff changeset
71 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
72 ; GFX10-NEXT: v_and_or_b32 v0, v0, v1, s2
anatofuz
parents:
diff changeset
73 ; GFX10-NEXT: ; implicit-def: $vcc_hi
anatofuz
parents:
diff changeset
74 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
75 %x = and i32 %a, %b
anatofuz
parents:
diff changeset
76 %result = or i32 %x, %c
anatofuz
parents:
diff changeset
77 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
78 ret float %bc
anatofuz
parents:
diff changeset
79 }
anatofuz
parents:
diff changeset
80
anatofuz
parents:
diff changeset
81 define amdgpu_ps float @and_or_vgpr_const(i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
82 ; VI-LABEL: and_or_vgpr_const:
anatofuz
parents:
diff changeset
83 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
84 ; VI-NEXT: v_and_b32_e32 v0, 4, v0
anatofuz
parents:
diff changeset
85 ; VI-NEXT: v_or_b32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
86 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
87 ;
anatofuz
parents:
diff changeset
88 ; GFX9-LABEL: and_or_vgpr_const:
anatofuz
parents:
diff changeset
89 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
90 ; GFX9-NEXT: v_and_or_b32 v0, v0, 4, v1
anatofuz
parents:
diff changeset
91 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
92 ;
anatofuz
parents:
diff changeset
93 ; GFX10-LABEL: and_or_vgpr_const:
anatofuz
parents:
diff changeset
94 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
95 ; GFX10-NEXT: v_and_or_b32 v0, v0, 4, v1
anatofuz
parents:
diff changeset
96 ; GFX10-NEXT: ; implicit-def: $vcc_hi
anatofuz
parents:
diff changeset
97 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
98 %x = and i32 4, %a
anatofuz
parents:
diff changeset
99 %result = or i32 %x, %b
anatofuz
parents:
diff changeset
100 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
101 ret float %bc
anatofuz
parents:
diff changeset
102 }
anatofuz
parents:
diff changeset
103
anatofuz
parents:
diff changeset
104 define amdgpu_ps float @and_or_vgpr_const_inline_const(i32 %a) {
anatofuz
parents:
diff changeset
105 ; VI-LABEL: and_or_vgpr_const_inline_const:
anatofuz
parents:
diff changeset
106 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
107 ; VI-NEXT: v_and_b32_e32 v0, 20, v0
anatofuz
parents:
diff changeset
108 ; VI-NEXT: v_or_b32_e32 v0, 0x808, v0
anatofuz
parents:
diff changeset
109 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
110 ;
anatofuz
parents:
diff changeset
111 ; GFX9-LABEL: and_or_vgpr_const_inline_const:
anatofuz
parents:
diff changeset
112 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
113 ; GFX9-NEXT: v_mov_b32_e32 v1, 0x808
anatofuz
parents:
diff changeset
114 ; GFX9-NEXT: v_and_or_b32 v0, v0, 20, v1
anatofuz
parents:
diff changeset
115 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
116 ;
anatofuz
parents:
diff changeset
117 ; GFX10-LABEL: and_or_vgpr_const_inline_const:
anatofuz
parents:
diff changeset
118 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
119 ; GFX10-NEXT: v_and_or_b32 v0, v0, 20, 0x808
anatofuz
parents:
diff changeset
120 ; GFX10-NEXT: ; implicit-def: $vcc_hi
anatofuz
parents:
diff changeset
121 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
122 %x = and i32 20, %a
anatofuz
parents:
diff changeset
123 %result = or i32 %x, 2056
anatofuz
parents:
diff changeset
124 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
125 ret float %bc
anatofuz
parents:
diff changeset
126 }
anatofuz
parents:
diff changeset
127
anatofuz
parents:
diff changeset
128 define amdgpu_ps float @and_or_vgpr_inline_const_x2(i32 %a) {
anatofuz
parents:
diff changeset
129 ; VI-LABEL: and_or_vgpr_inline_const_x2:
anatofuz
parents:
diff changeset
130 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
131 ; VI-NEXT: v_and_b32_e32 v0, 4, v0
anatofuz
parents:
diff changeset
132 ; VI-NEXT: v_or_b32_e32 v0, 1, v0
anatofuz
parents:
diff changeset
133 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
134 ;
anatofuz
parents:
diff changeset
135 ; GFX9-LABEL: and_or_vgpr_inline_const_x2:
anatofuz
parents:
diff changeset
136 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
137 ; GFX9-NEXT: v_and_or_b32 v0, v0, 4, 1
anatofuz
parents:
diff changeset
138 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
139 ;
anatofuz
parents:
diff changeset
140 ; GFX10-LABEL: and_or_vgpr_inline_const_x2:
anatofuz
parents:
diff changeset
141 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
142 ; GFX10-NEXT: v_and_or_b32 v0, v0, 4, 1
anatofuz
parents:
diff changeset
143 ; GFX10-NEXT: ; implicit-def: $vcc_hi
anatofuz
parents:
diff changeset
144 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
145 %x = and i32 4, %a
anatofuz
parents:
diff changeset
146 %result = or i32 %x, 1
anatofuz
parents:
diff changeset
147 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
148 ret float %bc
anatofuz
parents:
diff changeset
149 }