summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2008-11-14 10:12:16 +0000
committerRichard Osborne <richard@xmos.com>2008-11-14 10:12:16 +0000
commitd16b37efae97b15d85513568597b942c8720b268 (patch)
tree6a4725a400a85b633e564953e9f13d43974bbb03 /llvm/lib/Target/XCore
parentc967d035288c27d82e620a8c200002f640ff6178 (diff)
downloadbcm5719-llvm-d16b37efae97b15d85513568597b942c8720b268.tar.gz
bcm5719-llvm-d16b37efae97b15d85513568597b942c8720b268.zip
Add XCore intrinsics for getid (returns thread id) and bitrev (reverses
bits in a word). llvm-svn: 59296
Diffstat (limited to 'llvm/lib/Target/XCore')
-rw-r--r--llvm/lib/Target/XCore/XCoreISelLowering.cpp5
-rw-r--r--llvm/lib/Target/XCore/XCoreInstrInfo.td4
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
index 96b1ae7c5d3..765e6182b84 100644
--- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
@@ -226,9 +226,8 @@ LowerGlobalAddress(SDValue Op, SelectionDAG &DAG)
}
static inline SDValue BuildGetId(SelectionDAG &DAG) {
- // TODO
- assert(0 && "Unimplemented");
- return SDValue();
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, MVT::i32,
+ DAG.getConstant(Intrinsic::xcore_getid, MVT::i32));
}
static inline bool isZeroLengthArray(const Type *Ty) {
diff --git a/llvm/lib/Target/XCore/XCoreInstrInfo.td b/llvm/lib/Target/XCore/XCoreInstrInfo.td
index 15e51f51b11..031ad875fa8 100644
--- a/llvm/lib/Target/XCore/XCoreInstrInfo.td
+++ b/llvm/lib/Target/XCore/XCoreInstrInfo.td
@@ -750,7 +750,7 @@ def MKMSK_2r : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$size),
// getd, testlcl, tinitlr, getps, setps
def BITREV_l2r : _FL2R<(outs GRRegs:$dst), (ins GRRegs:$src),
"bitrev $dst, $src",
- []>;
+ [(set GRRegs:$dst, (int_xcore_bitrev GRRegs:$src))]>;
def BYTEREV_l2r : _FL2R<(outs GRRegs:$dst), (ins GRRegs:$src),
"byterev $dst, $src",
@@ -790,7 +790,7 @@ def BLA_1r : _F1R<(outs), (ins GRRegs:$addr, variable_ops),
let Defs = [R11] in
def GETID_0R : _F0R<(outs), (ins),
"get r11, id",
- []>;
+ [(set R11, (int_xcore_getid))]>;
//===----------------------------------------------------------------------===//
// Non-Instruction Patterns
OpenPOWER on IntegriCloud