Matt Arsenault | f302c94 | 2014-06-15 21:09:00 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s |
| 2 | |
| 3 | ; FUNC-LABEL: @s_rotr_i64 |
| 4 | ; SI: S_LSHR_B64 |
| 5 | ; SI: S_SUB_I32 |
| 6 | ; SI: S_LSHL_B64 |
| 7 | ; SI: S_OR_B64 |
| 8 | define void @s_rotr_i64(i64 addrspace(1)* %in, i64 %x, i64 %y) { |
| 9 | entry: |
| 10 | %tmp0 = sub i64 64, %y |
| 11 | %tmp1 = shl i64 %x, %tmp0 |
| 12 | %tmp2 = lshr i64 %x, %y |
| 13 | %tmp3 = or i64 %tmp1, %tmp2 |
| 14 | store i64 %tmp3, i64 addrspace(1)* %in |
| 15 | ret void |
| 16 | } |
| 17 | |
| 18 | ; FUNC-LABEL: @v_rotr_i64 |
| 19 | ; SI: V_LSHR_B64 |
| 20 | ; SI: V_SUB_I32 |
| 21 | ; SI: V_LSHL_B64 |
| 22 | ; SI: V_OR_B32 |
| 23 | ; SI: V_OR_B32 |
| 24 | define void @v_rotr_i64(i64 addrspace(1)* %in, i64 addrspace(1)* %xptr, i64 addrspace(1)* %yptr) { |
| 25 | entry: |
| 26 | %x = load i64 addrspace(1)* %xptr, align 8 |
| 27 | %y = load i64 addrspace(1)* %yptr, align 8 |
| 28 | %tmp0 = sub i64 64, %y |
| 29 | %tmp1 = shl i64 %x, %tmp0 |
| 30 | %tmp2 = lshr i64 %x, %y |
| 31 | %tmp3 = or i64 %tmp1, %tmp2 |
| 32 | store i64 %tmp3, i64 addrspace(1)* %in |
| 33 | ret void |
| 34 | } |
| 35 | |
| 36 | ; FUNC-LABEL: @s_rotr_v2i64 |
| 37 | define void @s_rotr_v2i64(<2 x i64> addrspace(1)* %in, <2 x i64> %x, <2 x i64> %y) { |
| 38 | entry: |
| 39 | %tmp0 = sub <2 x i64> <i64 64, i64 64>, %y |
| 40 | %tmp1 = shl <2 x i64> %x, %tmp0 |
| 41 | %tmp2 = lshr <2 x i64> %x, %y |
| 42 | %tmp3 = or <2 x i64> %tmp1, %tmp2 |
| 43 | store <2 x i64> %tmp3, <2 x i64> addrspace(1)* %in |
| 44 | ret void |
| 45 | } |
| 46 | |
| 47 | ; FUNC-LABEL: @v_rotr_v2i64 |
| 48 | define void @v_rotr_v2i64(<2 x i64> addrspace(1)* %in, <2 x i64> addrspace(1)* %xptr, <2 x i64> addrspace(1)* %yptr) { |
| 49 | entry: |
| 50 | %x = load <2 x i64> addrspace(1)* %xptr, align 8 |
| 51 | %y = load <2 x i64> addrspace(1)* %yptr, align 8 |
| 52 | %tmp0 = sub <2 x i64> <i64 64, i64 64>, %y |
| 53 | %tmp1 = shl <2 x i64> %x, %tmp0 |
| 54 | %tmp2 = lshr <2 x i64> %x, %y |
| 55 | %tmp3 = or <2 x i64> %tmp1, %tmp2 |
| 56 | store <2 x i64> %tmp3, <2 x i64> addrspace(1)* %in |
| 57 | ret void |
| 58 | } |