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

Commit 5c1a1b2

Browse files
author
Jim Grosbach
committed
ARM: intrinsic support for rbit.
We already have an ARMISD node. Create an intrinsic to map to it so we can add support for the frontend __rbit() intrinsic. rdar://9283021 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211057 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 212ec3a commit 5c1a1b2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/llvm/IR/IntrinsicsARM.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ def int_arm_crc32cw : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
125125

126126
def int_arm_hint : Intrinsic<[], [llvm_i32_ty]>;
127127

128+
//===----------------------------------------------------------------------===//
129+
// RBIT
130+
131+
def int_arm_rbit : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
132+
128133
//===----------------------------------------------------------------------===//
129134
// UND (reserved undefined sequence)
130135

lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,11 @@ ARMTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG,
25422542
SDLoc dl(Op);
25432543
switch (IntNo) {
25442544
default: return SDValue(); // Don't custom lower most intrinsics.
2545+
case Intrinsic::arm_rbit: {
2546+
assert(Op.getOperand(0).getValueType() == MVT::i32 &&
2547+
"RBIT intrinsic must have i32 type!");
2548+
return DAG.getNode(ARMISD::RBIT, dl, MVT::i32, Op.getOperand(0));
2549+
}
25452550
case Intrinsic::arm_thread_pointer: {
25462551
EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
25472552
return DAG.getNode(ARMISD::THREAD_POINTER, dl, PtrVT);

0 commit comments

Comments
 (0)