mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
This is just a clean-up patch that simplifies the initial-exec TLS logic by
avoiding use of machine operand flags. No change in observable behavior, so no new test cases. llvm-svn: 170141
This commit is contained in:
parent
10d516a6a3
commit
bd4902c44a
@ -72,9 +72,7 @@ namespace llvm {
|
||||
MO_HA16 = 2 << 5,
|
||||
|
||||
MO_TPREL16_HA = 3 << 5,
|
||||
MO_TPREL16_LO = 4 << 5,
|
||||
MO_GOT_TPREL16_DS = 5 << 5,
|
||||
MO_TLS = 6 << 5
|
||||
MO_TPREL16_LO = 4 << 5
|
||||
};
|
||||
} // end namespace PPCII
|
||||
|
||||
|
@ -1351,15 +1351,11 @@ SDValue PPCTargetLowering::LowerGlobalTLSAddress(SDValue Op,
|
||||
llvm_unreachable("only local-exec is currently supported for ppc32");
|
||||
|
||||
if (Model == TLSModel::InitialExec) {
|
||||
SDValue GOTOffset = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0,
|
||||
PPCII::MO_GOT_TPREL16_DS);
|
||||
SDValue TPReg = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0,
|
||||
PPCII::MO_TLS);
|
||||
SDValue GOTReg = DAG.getRegister(is64bit ? PPC::X2 : PPC::R2,
|
||||
is64bit ? MVT::i64 : MVT::i32);
|
||||
SDValue TPOffset = DAG.getNode(PPCISD::LD_GOT_TPREL, dl, PtrVT,
|
||||
GOTOffset, GOTReg);
|
||||
return DAG.getNode(PPCISD::ADD_TLS, dl, PtrVT, TPOffset, TPReg);
|
||||
SDValue TGA = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0, 0);
|
||||
SDValue GOTReg = DAG.getRegister(PPC::X2, MVT::i64);
|
||||
SDValue TPOffset = DAG.getNode(PPCISD::LD_GOT_TPREL, dl,
|
||||
PtrVT, TGA, GOTReg);
|
||||
return DAG.getNode(PPCISD::ADD_TLS, dl, PtrVT, TPOffset, TGA);
|
||||
}
|
||||
|
||||
if (Model == TLSModel::GeneralDynamic) {
|
||||
|
@ -384,7 +384,7 @@ def ADD8 : XOForm_1<31, 266, 0, (outs G8RC:$rT), (ins G8RC:$rA, G8RC:$rB),
|
||||
// ADD8 has a special form: reg = ADD8(reg, sym@tls) for use by the
|
||||
// initial-exec thread-local storage model.
|
||||
def ADD8TLS : XOForm_1<31, 266, 0, (outs G8RC:$rT), (ins G8RC:$rA, tlsreg:$rB),
|
||||
"add $rT, $rA, $rB", IntSimple,
|
||||
"add $rT, $rA, $rB@tls", IntSimple,
|
||||
[(set G8RC:$rT, (add G8RC:$rA, tglobaltlsaddr:$rB))]>;
|
||||
|
||||
let Defs = [CARRY] in {
|
||||
|
@ -114,12 +114,6 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
|
||||
break;
|
||||
case PPCII::MO_TPREL16_LO: RefKind = MCSymbolRefExpr::VK_PPC_TPREL16_LO;
|
||||
break;
|
||||
case PPCII::MO_GOT_TPREL16_DS:
|
||||
RefKind = MCSymbolRefExpr::VK_PPC_GOT_TPREL16_DS;
|
||||
break;
|
||||
case PPCII::MO_TLS:
|
||||
RefKind = MCSymbolRefExpr::VK_PPC_TLS;
|
||||
break;
|
||||
}
|
||||
|
||||
// FIXME: This isn't right, but we don't have a good way to express this in
|
||||
|
Loading…
Reference in New Issue
Block a user