1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/test/CodeGen/R600/bfe_uint.ll
Tom Stellard e8c59f575b R600: Disable the BFE pattern
This pattern uses an SDNodeXForm, which isn't being emitted for some
reason.  I can get it to work by attaching the PatLeaf that has the
XForm to the argument in the output pattern, but this results in an
immediate being used in a register operand, which the backend can't
handle yet.

llvm-svn: 199918
2014-01-23 18:49:33 +00:00

29 lines
758 B
LLVM

; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
; XFAIL: *
; CHECK: @bfe_def
; CHECK: BFE_UINT
define void @bfe_def(i32 addrspace(1)* %out, i32 %x) {
entry:
%0 = lshr i32 %x, 5
%1 = and i32 %0, 15 ; 0xf
store i32 %1, i32 addrspace(1)* %out
ret void
}
; This program could be implemented using a BFE_UINT instruction, however
; since the lshr constant + number of bits in the mask is >= 32, it can also be
; implmented with a LSHR instruction, which is better, because LSHR has less
; operands and requires less constants.
; CHECK: @bfe_shift
; CHECK-NOT: BFE_UINT
define void @bfe_shift(i32 addrspace(1)* %out, i32 %x) {
entry:
%0 = lshr i32 %x, 16
%1 = and i32 %0, 65535 ; 0xffff
store i32 %1, i32 addrspace(1)* %out
ret void
}