1 ; RUN: llc -mtriple=aarch64-eabi %s -o - | FileCheck %s 2 3 ; The llvm.aarch64.rbit intrinsic should be auto-upgraded to the 4 ; target-independent bitreverse intrinsic. 5 6 ; CHECK-LABEL: rbit32 7 ; CHECK: rbit w0, w0 8 define i32 @rbit32(i32 %t) { 9 entry: 10 %rbit.i = call i32 @llvm.aarch64.rbit.i32(i32 %t) 11 ret i32 %rbit.i 12 } 13 14 ; CHECK-LABEL: rbit64 15 ; CHECK: rbit x0, x0 16 define i64 @rbit64(i64 %t) { 17 entry: 18 %rbit.i = call i64 @llvm.aarch64.rbit.i64(i64 %t) 19 ret i64 %rbit.i 20 } 21 22 declare i64 @llvm.aarch64.rbit.i64(i64) 23 declare i32 @llvm.aarch64.rbit.i32(i32) 24 25 ; CHECK-LABEL: rbit_generic32 26 ; CHECK: rbit w0, w0 27 define i32 @rbit_generic32(i32 %t) { 28 entry: 29 %rbit = call i32 @llvm.bitreverse.i32(i32 %t) 30 ret i32 %rbit 31 } 32 33 ; CHECK-LABEL: rbit_generic64 34 ; CHECK: rbit x0, x0 35 define i64 @rbit_generic64(i64 %t) { 36 entry: 37 %rbit = call i64 @llvm.bitreverse.i64(i64 %t) 38 ret i64 %rbit 39 } 40 41 declare i32 @llvm.bitreverse.i32(i32) readnone 42 declare i64 @llvm.bitreverse.i64(i64) readnone 43