Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 44d2cdc

Browse files
author
Jim Grosbach
committed
AArch64: Add backend intrinsic for rbit.
Define an intrinsic for the frontend to use and pattern match it to the RBIT instruction. rdar://9283021 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211058 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 5c1a1b2 commit 44d2cdc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/llvm/IR/IntrinsicsAArch64.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ def int_aarch64_sdiv : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
3131
LLVMMatchType<0>], [IntrNoMem]>;
3232
def int_aarch64_udiv : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
3333
LLVMMatchType<0>], [IntrNoMem]>;
34+
35+
//===----------------------------------------------------------------------===//
36+
// RBIT
37+
38+
def int_aarch64_rbit : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>],
39+
[IntrNoMem]>;
40+
3441
}
3542

3643
//===----------------------------------------------------------------------===//

lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ def : Pat<(not GPR64:$Xm), (ORNXrr XZR, GPR64:$Xm)>;
737737
defm CLS : OneOperandData<0b101, "cls">;
738738
defm CLZ : OneOperandData<0b100, "clz", ctlz>;
739739
defm RBIT : OneOperandData<0b000, "rbit">;
740+
741+
def : Pat<(int_aarch64_rbit GPR32:$Rn), (RBITWr $Rn)>;
742+
def : Pat<(int_aarch64_rbit GPR64:$Rn), (RBITXr $Rn)>;
743+
740744
def REV16Wr : OneWRegData<0b001, "rev16",
741745
UnOpFrag<(rotr (bswap node:$LHS), (i64 16))>>;
742746
def REV16Xr : OneXRegData<0b001, "rev16", null_frag>;

0 commit comments

Comments
 (0)