forked from OSchip/llvm-project
[Mips] Add support for llvm.thread.pointer intrinsic.
This will be used to implement __builtin_thread_pointer in clang. Differential Revision: http://reviews.llvm.org/D19569 llvm-svn: 267743
This commit is contained in:
parent
88017c08a6
commit
7efdca5622
|
@ -2166,6 +2166,10 @@ SDValue MipsSETargetLowering::lowerINTRINSIC_WO_CHAIN(SDValue Op,
|
||||||
case Intrinsic::mips_xori_b:
|
case Intrinsic::mips_xori_b:
|
||||||
return DAG.getNode(ISD::XOR, DL, Op->getValueType(0),
|
return DAG.getNode(ISD::XOR, DL, Op->getValueType(0),
|
||||||
Op->getOperand(1), lowerMSASplatImm(Op, 2, DAG));
|
Op->getOperand(1), lowerMSASplatImm(Op, 2, DAG));
|
||||||
|
case Intrinsic::thread_pointer: {
|
||||||
|
EVT PtrVT = getPointerTy(DAG.getDataLayout());
|
||||||
|
return DAG.getNode(MipsISD::ThreadPointer, DL, PtrVT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
; RUN: llc -march=mips < %s | FileCheck %s
|
||||||
|
; RUN: llc -march=mips64 < %s | FileCheck %s
|
||||||
|
; RUN: llc -march=mipsel < %s | FileCheck %s
|
||||||
|
; RUN: llc -march=mips64el < %s | FileCheck %s
|
||||||
|
|
||||||
|
declare i8* @llvm.thread.pointer() nounwind readnone
|
||||||
|
|
||||||
|
define i8* @thread_pointer() {
|
||||||
|
; CHECK: rdhwr $3, $29
|
||||||
|
%1 = tail call i8* @llvm.thread.pointer()
|
||||||
|
ret i8* %1
|
||||||
|
}
|
Loading…
Reference in New Issue