annotate llvm/test/CodeGen/AMDGPU/shl_add.ll @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children
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
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
5 ; RUN: llc < %s -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -verify-machineinstrs | FileCheck -check-prefix=GFX10 %s
150
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 ; ===================================================================================
anatofuz
parents:
diff changeset
8 ; V_LSHL_ADD_U32
anatofuz
parents:
diff changeset
9 ; ===================================================================================
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 define amdgpu_ps float @shl_add(i32 %a, i32 %b, i32 %c) {
anatofuz
parents:
diff changeset
12 ; VI-LABEL: shl_add:
anatofuz
parents:
diff changeset
13 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
14 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
anatofuz
parents:
diff changeset
15 ; VI-NEXT: v_add_u32_e32 v0, vcc, v0, v2
anatofuz
parents:
diff changeset
16 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
17 ;
anatofuz
parents:
diff changeset
18 ; GFX9-LABEL: shl_add:
anatofuz
parents:
diff changeset
19 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
20 ; GFX9-NEXT: v_lshl_add_u32 v0, v0, v1, v2
anatofuz
parents:
diff changeset
21 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
22 ;
anatofuz
parents:
diff changeset
23 ; GFX10-LABEL: shl_add:
anatofuz
parents:
diff changeset
24 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
25 ; GFX10-NEXT: v_lshl_add_u32 v0, v0, v1, v2
anatofuz
parents:
diff changeset
26 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
27 %x = shl i32 %a, %b
anatofuz
parents:
diff changeset
28 %result = add 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 @shl_add_vgpr_a(i32 %a, i32 inreg %b, i32 inreg %c) {
anatofuz
parents:
diff changeset
35 ; VI-LABEL: shl_add_vgpr_a:
anatofuz
parents:
diff changeset
36 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
37 ; VI-NEXT: v_lshlrev_b32_e32 v0, s2, v0
anatofuz
parents:
diff changeset
38 ; VI-NEXT: v_add_u32_e32 v0, vcc, 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: shl_add_vgpr_a:
anatofuz
parents:
diff changeset
42 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
43 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, s2, v0
anatofuz
parents:
diff changeset
44 ; GFX9-NEXT: v_add_u32_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: shl_add_vgpr_a:
anatofuz
parents:
diff changeset
48 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
49 ; GFX10-NEXT: v_lshl_add_u32 v0, v0, s2, s3
anatofuz
parents:
diff changeset
50 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
51 %x = shl i32 %a, %b
anatofuz
parents:
diff changeset
52 %result = add i32 %x, %c
anatofuz
parents:
diff changeset
53 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
54 ret float %bc
anatofuz
parents:
diff changeset
55 }
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 define amdgpu_ps float @shl_add_vgpr_all(i32 %a, i32 %b, i32 %c) {
anatofuz
parents:
diff changeset
58 ; VI-LABEL: shl_add_vgpr_all:
anatofuz
parents:
diff changeset
59 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
60 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
anatofuz
parents:
diff changeset
61 ; VI-NEXT: v_add_u32_e32 v0, vcc, v0, v2
anatofuz
parents:
diff changeset
62 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
63 ;
anatofuz
parents:
diff changeset
64 ; GFX9-LABEL: shl_add_vgpr_all:
anatofuz
parents:
diff changeset
65 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
66 ; GFX9-NEXT: v_lshl_add_u32 v0, v0, v1, v2
anatofuz
parents:
diff changeset
67 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
68 ;
anatofuz
parents:
diff changeset
69 ; GFX10-LABEL: shl_add_vgpr_all:
anatofuz
parents:
diff changeset
70 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
71 ; GFX10-NEXT: v_lshl_add_u32 v0, v0, v1, v2
anatofuz
parents:
diff changeset
72 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
73 %x = shl i32 %a, %b
anatofuz
parents:
diff changeset
74 %result = add i32 %x, %c
anatofuz
parents:
diff changeset
75 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
76 ret float %bc
anatofuz
parents:
diff changeset
77 }
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 define amdgpu_ps float @shl_add_vgpr_ab(i32 %a, i32 %b, i32 inreg %c) {
anatofuz
parents:
diff changeset
80 ; VI-LABEL: shl_add_vgpr_ab:
anatofuz
parents:
diff changeset
81 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
82 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
anatofuz
parents:
diff changeset
83 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
anatofuz
parents:
diff changeset
84 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
85 ;
anatofuz
parents:
diff changeset
86 ; GFX9-LABEL: shl_add_vgpr_ab:
anatofuz
parents:
diff changeset
87 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
88 ; GFX9-NEXT: v_lshl_add_u32 v0, v0, v1, s2
anatofuz
parents:
diff changeset
89 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
90 ;
anatofuz
parents:
diff changeset
91 ; GFX10-LABEL: shl_add_vgpr_ab:
anatofuz
parents:
diff changeset
92 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
93 ; GFX10-NEXT: v_lshl_add_u32 v0, v0, v1, s2
anatofuz
parents:
diff changeset
94 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
95 %x = shl i32 %a, %b
anatofuz
parents:
diff changeset
96 %result = add i32 %x, %c
anatofuz
parents:
diff changeset
97 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
98 ret float %bc
anatofuz
parents:
diff changeset
99 }
anatofuz
parents:
diff changeset
100
anatofuz
parents:
diff changeset
101 define amdgpu_ps float @shl_add_vgpr_const(i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
102 ; VI-LABEL: shl_add_vgpr_const:
anatofuz
parents:
diff changeset
103 ; VI: ; %bb.0:
anatofuz
parents:
diff changeset
104 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
anatofuz
parents:
diff changeset
105 ; VI-NEXT: v_add_u32_e32 v0, vcc, v0, v1
anatofuz
parents:
diff changeset
106 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
107 ;
anatofuz
parents:
diff changeset
108 ; GFX9-LABEL: shl_add_vgpr_const:
anatofuz
parents:
diff changeset
109 ; GFX9: ; %bb.0:
anatofuz
parents:
diff changeset
110 ; GFX9-NEXT: v_lshl_add_u32 v0, v0, 3, v1
anatofuz
parents:
diff changeset
111 ; GFX9-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
112 ;
anatofuz
parents:
diff changeset
113 ; GFX10-LABEL: shl_add_vgpr_const:
anatofuz
parents:
diff changeset
114 ; GFX10: ; %bb.0:
anatofuz
parents:
diff changeset
115 ; GFX10-NEXT: v_lshl_add_u32 v0, v0, 3, v1
anatofuz
parents:
diff changeset
116 ; GFX10-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
117 %x = shl i32 %a, 3
anatofuz
parents:
diff changeset
118 %result = add i32 %x, %b
anatofuz
parents:
diff changeset
119 %bc = bitcast i32 %result to float
anatofuz
parents:
diff changeset
120 ret float %bc
anatofuz
parents:
diff changeset
121 }