2017-07-05 01:32:00 +08:00
|
|
|
; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=BOTH %s
|
|
|
|
; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=VI -check-prefix=BOTH %s
|
2014-06-16 05:09:00 +08:00
|
|
|
|
2015-02-04 05:53:01 +08:00
|
|
|
; BOTH-LABEL: {{^}}s_rotr_i64:
|
|
|
|
; BOTH-DAG: s_sub_i32
|
|
|
|
; BOTH-DAG: s_lshr_b64
|
|
|
|
; BOTH-DAG: s_lshl_b64
|
|
|
|
; BOTH: s_or_b64
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_rotr_i64(i64 addrspace(1)* %in, i64 %x, i64 %y) {
|
2014-06-16 05:09:00 +08:00
|
|
|
entry:
|
|
|
|
%tmp0 = sub i64 64, %y
|
|
|
|
%tmp1 = shl i64 %x, %tmp0
|
|
|
|
%tmp2 = lshr i64 %x, %y
|
|
|
|
%tmp3 = or i64 %tmp1, %tmp2
|
|
|
|
store i64 %tmp3, i64 addrspace(1)* %in
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-02-04 05:53:01 +08:00
|
|
|
; BOTH-LABEL: {{^}}v_rotr_i64:
|
2017-11-21 02:24:21 +08:00
|
|
|
; BOTH-DAG: v_sub_{{[iu]}}32
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI-DAG: v_lshr_b64
|
|
|
|
; SI-DAG: v_lshl_b64
|
2015-02-04 05:53:01 +08:00
|
|
|
; VI-DAG: v_lshrrev_b64
|
|
|
|
; VI-DAG: v_lshlrev_b64
|
|
|
|
; BOTH: v_or_b32
|
|
|
|
; BOTH: v_or_b32
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @v_rotr_i64(i64 addrspace(1)* %in, i64 addrspace(1)* %xptr, i64 addrspace(1)* %yptr) {
|
2014-06-16 05:09:00 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%x = load i64, i64 addrspace(1)* %xptr, align 8
|
|
|
|
%y = load i64, i64 addrspace(1)* %yptr, align 8
|
2014-06-16 05:09:00 +08:00
|
|
|
%tmp0 = sub i64 64, %y
|
|
|
|
%tmp1 = shl i64 %x, %tmp0
|
|
|
|
%tmp2 = lshr i64 %x, %y
|
|
|
|
%tmp3 = or i64 %tmp1, %tmp2
|
|
|
|
store i64 %tmp3, i64 addrspace(1)* %in
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-02-04 05:53:01 +08:00
|
|
|
; BOTH-LABEL: {{^}}s_rotr_v2i64:
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_rotr_v2i64(<2 x i64> addrspace(1)* %in, <2 x i64> %x, <2 x i64> %y) {
|
2014-06-16 05:09:00 +08:00
|
|
|
entry:
|
|
|
|
%tmp0 = sub <2 x i64> <i64 64, i64 64>, %y
|
|
|
|
%tmp1 = shl <2 x i64> %x, %tmp0
|
|
|
|
%tmp2 = lshr <2 x i64> %x, %y
|
|
|
|
%tmp3 = or <2 x i64> %tmp1, %tmp2
|
|
|
|
store <2 x i64> %tmp3, <2 x i64> addrspace(1)* %in
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-02-04 05:53:01 +08:00
|
|
|
; BOTH-LABEL: {{^}}v_rotr_v2i64:
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @v_rotr_v2i64(<2 x i64> addrspace(1)* %in, <2 x i64> addrspace(1)* %xptr, <2 x i64> addrspace(1)* %yptr) {
|
2014-06-16 05:09:00 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%x = load <2 x i64>, <2 x i64> addrspace(1)* %xptr, align 8
|
|
|
|
%y = load <2 x i64>, <2 x i64> addrspace(1)* %yptr, align 8
|
2014-06-16 05:09:00 +08:00
|
|
|
%tmp0 = sub <2 x i64> <i64 64, i64 64>, %y
|
|
|
|
%tmp1 = shl <2 x i64> %x, %tmp0
|
|
|
|
%tmp2 = lshr <2 x i64> %x, %y
|
|
|
|
%tmp3 = or <2 x i64> %tmp1, %tmp2
|
|
|
|
store <2 x i64> %tmp3, <2 x i64> addrspace(1)* %in
|
|
|
|
ret void
|
|
|
|
}
|