1 ; RUN: llc -mtriple=amdgcn -mcpu=gfx940 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3 define i64 @lshl_add_u64_v1v(i64 %v, i64 %a) {
4 ; GCN-LABEL: lshl_add_u64_v1v:
5 ; GCN: v_lshl_add_u64 v[{{[0-9:]+}}], v[{{[0-9:]+}}], 1, v[{{[0-9:]+}}]
7 %add = add i64 %shl, %a
11 define i64 @lshl_add_u64_v4v(i64 %v, i64 %a) {
12 ; GCN-LABEL: lshl_add_u64_v4v:
13 ; GCN: v_lshl_add_u64 v[{{[0-9:]+}}], v[{{[0-9:]+}}], 4, v[{{[0-9:]+}}]
15 %add = add i64 %shl, %a
19 define i64 @lshl_add_u64_v5v(i64 %v, i64 %a) {
20 ; GCN-LABEL: lshl_add_u64_v5v:
22 ; GCN-NEXT: v_lshl_add_u64 v[{{[0-9:]+}}], v[{{[0-9:]+}}], 0, v[{{[0-9:]+}}]
24 %add = add i64 %shl, %a
28 define i64 @lshl_add_u64_vvv(i64 %v, i64 %s, i64 %a) {
29 ; GCN-LABEL: lshl_add_u64_vvv:
31 ; GCN-NEXT: v_lshl_add_u64 v[{{[0-9:]+}}], v[{{[0-9:]+}}], 0, v[{{[0-9:]+}}]
33 %add = add i64 %shl, %a
37 define amdgpu_kernel void @lshl_add_u64_s2v(i64 %v) {
38 ; GCN-LABEL: lshl_add_u64_s2v:
39 ; GCN: v_lshl_add_u64 v[{{[0-9:]+}}], s[{{[0-9:]+}}], 2, v[{{[0-9:]+}}]
40 %a = load i64, ptr undef
42 %add = add i64 %shl, %a
43 store i64 %add, ptr undef
47 define amdgpu_kernel void @lshl_add_u64_v2s(i64 %a) {
48 ; GCN-LABEL: lshl_add_u64_v2s:
49 ; GCN: v_lshl_add_u64 v[{{[0-9:]+}}], v[{{[0-9:]+}}], 2, s[{{[0-9:]+}}]
50 %v = load i64, ptr undef
52 %add = add i64 %shl, %a
53 store i64 %add, ptr undef
57 define amdgpu_kernel void @lshl_add_u64_s2s(i64 %v, i64 %a) {
58 ; GCN-LABEL: lshl_add_u64_s2s:
63 %add = add i64 %shl, %a
64 store i64 %add, ptr undef
68 define i64 @add_u64_vv(i64 %v, i64 %a) {
69 ; GCN-LABEL: add_u64_vv:
70 ; GCN: v_lshl_add_u64 v[0:1], v[0:1], 0, v[2:3]
75 define amdgpu_kernel void @add_u64_sv(i64 %v) {
76 ; GCN-LABEL: add_u64_sv:
77 ; GCN: v_lshl_add_u64 v[0:1], s[0:1], 0, v[0:1]
78 %a = load i64, ptr undef
80 store i64 %add, ptr undef
84 define amdgpu_kernel void @add_u64_vs(i64 %a) {
85 ; GCN-LABEL: add_u64_vs:
86 ; GCN: v_lshl_add_u64 v[0:1], v[0:1], 0, s[0:1]
87 %v = load i64, ptr undef
89 store i64 %add, ptr undef
93 define amdgpu_kernel void @add_u64_ss(i64 %v, i64 %a) {
94 ; GCN-LABEL: add_u64_ss:
96 ; GCN: s_addc_u32 s1, s5, s7
98 store i64 %add, ptr undef
102 define i32 @lshl_add_u64_gep(ptr %p, i64 %a) {
103 ; GCN-LABEL: lshl_add_u64_gep:
104 ; GCN: v_lshl_add_u64 v[0:1], v[2:3], 2, v[0:1]
105 %gep = getelementptr inbounds i32, ptr %p, i64 %a
106 %v = load i32, ptr %gep