mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-16 00:16:50 +00:00
b5ab3ba365
ISD::BITREVERSE matches "rbit" completely, so remove ARMISD::RBIT and mark ISD::BITREVERSE as legal, adding a test for lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253047 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
601 B
LLVM
32 lines
601 B
LLVM
; RUN: llc -mtriple=armv8-eabi %s -o - | FileCheck %s
|
|
|
|
; CHECK-LABEL: rbit
|
|
; CHECK: rbit r0, r0
|
|
define i32 @rbit(i32 %t) {
|
|
entry:
|
|
%rbit = call i32 @llvm.arm.rbit(i32 %t)
|
|
ret i32 %rbit
|
|
}
|
|
|
|
; CHECK-LABEL: rbit_constant
|
|
; CHECK: mov r0, #0
|
|
; CHECK: rbit r0, r0
|
|
define i32 @rbit_constant() {
|
|
entry:
|
|
%rbit.i = call i32 @llvm.arm.rbit(i32 0)
|
|
ret i32 %rbit.i
|
|
}
|
|
|
|
declare i32 @llvm.arm.rbit(i32)
|
|
|
|
declare i32 @llvm.bitreverse.i32(i32) readnone
|
|
|
|
; CHECK-LABEL: rbit_generic
|
|
; CHECK: rbit r0, r0
|
|
define i32 @rbit_generic(i32 %t) {
|
|
entry:
|
|
%rbit = call i32 @llvm.bitreverse.i32(i32 %t)
|
|
ret i32 %rbit
|
|
}
|
|
|