R600/SI: Enable all tests that pass on VI without changes
[oota-llvm.git] / test / CodeGen / R600 / rotr.i64.ll
1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3
4 ; FUNC-LABEL: {{^}}s_rotr_i64:
5 ; SI-DAG: s_sub_i32
6 ; SI-DAG: s_lshr_b64
7 ; SI-DAG: s_lshl_b64
8 ; SI: s_or_b64
9 define void @s_rotr_i64(i64 addrspace(1)* %in, i64 %x, i64 %y) {
10 entry:
11   %tmp0 = sub i64 64, %y
12   %tmp1 = shl i64 %x, %tmp0
13   %tmp2 = lshr i64 %x, %y
14   %tmp3 = or i64 %tmp1, %tmp2
15   store i64 %tmp3, i64 addrspace(1)* %in
16   ret void
17 }
18
19 ; FUNC-LABEL: {{^}}v_rotr_i64:
20 ; SI-DAG: v_sub_i32
21 ; SI-DAG: v_lshr_b64
22 ; SI-DAG: v_lshl_b64
23 ; SI: v_or_b32
24 ; SI: v_or_b32
25 define void @v_rotr_i64(i64 addrspace(1)* %in, i64 addrspace(1)* %xptr, i64 addrspace(1)* %yptr) {
26 entry:
27   %x = load i64 addrspace(1)* %xptr, align 8
28   %y = load i64 addrspace(1)* %yptr, align 8
29   %tmp0 = sub i64 64, %y
30   %tmp1 = shl i64 %x, %tmp0
31   %tmp2 = lshr i64 %x, %y
32   %tmp3 = or i64 %tmp1, %tmp2
33   store i64 %tmp3, i64 addrspace(1)* %in
34   ret void
35 }
36
37 ; FUNC-LABEL: {{^}}s_rotr_v2i64:
38 define void @s_rotr_v2i64(<2 x i64> addrspace(1)* %in, <2 x i64> %x, <2 x i64> %y) {
39 entry:
40   %tmp0 = sub <2 x i64> <i64 64, i64 64>, %y
41   %tmp1 = shl <2 x i64> %x, %tmp0
42   %tmp2 = lshr <2 x i64> %x, %y
43   %tmp3 = or <2 x i64> %tmp1, %tmp2
44   store <2 x i64> %tmp3, <2 x i64> addrspace(1)* %in
45   ret void
46 }
47
48 ; FUNC-LABEL: {{^}}v_rotr_v2i64:
49 define void @v_rotr_v2i64(<2 x i64> addrspace(1)* %in, <2 x i64> addrspace(1)* %xptr, <2 x i64> addrspace(1)* %yptr) {
50 entry:
51   %x = load <2 x i64> addrspace(1)* %xptr, align 8
52   %y = load <2 x i64> addrspace(1)* %yptr, align 8
53   %tmp0 = sub <2 x i64> <i64 64, i64 64>, %y
54   %tmp1 = shl <2 x i64> %x, %tmp0
55   %tmp2 = lshr <2 x i64> %x, %y
56   %tmp3 = or <2 x i64> %tmp1, %tmp2
57   store <2 x i64> %tmp3, <2 x i64> addrspace(1)* %in
58   ret void
59 }