From db1807144a0f76b88fa073558f26972bbea25e05 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 24 Mar 2014 20:08:05 +0000 Subject: R600/SI: Fix 64-bit bit ops that require the VALU. Try to match scalar and first like the other instructions. Expand 64-bit ands to a pair of 32-bit ands since that is not available on the VALU. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204660 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/R600/or.ll | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/CodeGen/R600/or.ll b/test/CodeGen/R600/or.ll index 35fc8b33e0..05d1e0f041 100644 --- a/test/CodeGen/R600/or.ll +++ b/test/CodeGen/R600/or.ll @@ -56,15 +56,34 @@ define void @vector_or_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %a, i32 %b) ret void } -; EG-CHECK-LABEL: @or_i64 +; EG-CHECK-LABEL: @scalar_or_i64 ; EG-CHECK-DAG: OR_INT * T{{[0-9]\.[XYZW]}}, KC0[2].W, KC0[3].Y ; EG-CHECK-DAG: OR_INT * T{{[0-9]\.[XYZW]}}, KC0[3].X, KC0[3].Z -; SI-CHECK-LABEL: @or_i64 +; SI-CHECK-LABEL: @scalar_or_i64 +; SI-CHECK: S_OR_B64 +define void @scalar_or_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) { + %or = or i64 %a, %b + store i64 %or, i64 addrspace(1)* %out + ret void +} + +; SI-CHECK-LABEL: @vector_or_i64 ; SI-CHECK: V_OR_B32_e32 v{{[0-9]}} ; SI-CHECK: V_OR_B32_e32 v{{[0-9]}} -define void @or_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) { -entry: - %0 = or i64 %a, %b - store i64 %0, i64 addrspace(1)* %out - ret void +define void @vector_or_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) { + %loada = load i64 addrspace(1)* %a, align 8 + %loadb = load i64 addrspace(1)* %a, align 8 + %or = or i64 %loada, %loadb + store i64 %or, i64 addrspace(1)* %out + ret void +} + +; SI-CHECK-LABEL: @scalar_vector_or_i64 +; SI-CHECK: V_OR_B32_e32 v{{[0-9]}} +; SI-CHECK: V_OR_B32_e32 v{{[0-9]}} +define void @scalar_vector_or_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 %b) { + %loada = load i64 addrspace(1)* %a + %or = or i64 %loada, %b + store i64 %or, i64 addrspace(1)* %out + ret void } -- cgit v1.2.3