• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=armv8-eabi %s -o - | FileCheck %s
2
3; CHECK-LABEL: rbit
4; CHECK: rbit r0, r0
5define i32 @rbit(i32 %t) {
6entry:
7  %rbit = call i32 @llvm.arm.rbit(i32 %t)
8  ret i32 %rbit
9}
10
11; CHECK-LABEL: rbit_constant
12; CHECK: mov r0, #0
13; CHECK-NOT: rbit
14; CHECK: bx lr
15define i32 @rbit_constant() {
16entry:
17  %rbit.i = call i32 @llvm.arm.rbit(i32 0)
18  ret i32 %rbit.i
19}
20
21declare i32 @llvm.arm.rbit(i32)
22
23declare i32 @llvm.bitreverse.i32(i32) readnone
24
25; CHECK-LABEL: rbit_generic
26; CHECK: rbit r0, r0
27define i32 @rbit_generic(i32 %t) {
28entry:
29  %rbit = call i32 @llvm.bitreverse.i32(i32 %t)
30  ret i32 %rbit
31}
32
33