diff options
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 24 | ||||
-rw-r--r-- | lib/Target/X86/X86FloatingPoint.cpp | 10 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 26 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.h | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 2 |
5 files changed, 32 insertions, 32 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index d25ede168d..bd9e5c653c 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -60,7 +60,7 @@ namespace { } void emitInstruction(const MachineInstr &MI, - const TargetInstrDescriptor *Desc); + const TargetInstrDesc *Desc); private: void emitPCRelativeBlockAddress(MachineBasicBlock *MBB); @@ -115,10 +115,10 @@ bool Emitter::runOnMachineFunction(MachineFunction &MF) { MCE.StartMachineBasicBlock(MBB); for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { - const TargetInstrDescriptor *Desc = I->getDesc(); - emitInstruction(*I, Desc); + const TargetInstrDesc &Desc = I->getDesc(); + emitInstruction(*I, &Desc); // MOVPC32r is basically a call plus a pop instruction. - if (Desc->Opcode == X86::MOVPC32r) + if (Desc.getOpcode() == X86::MOVPC32r) emitInstruction(*I, &II->get(X86::POP32r)); NumEmitted++; // Keep track of the # of mi's emitted } @@ -394,7 +394,7 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI, } } -static unsigned sizeOfImm(const TargetInstrDescriptor *Desc) { +static unsigned sizeOfImm(const TargetInstrDesc *Desc) { switch (Desc->TSFlags & X86II::ImmMask) { case X86II::Imm8: return 1; case X86II::Imm16: return 2; @@ -436,18 +436,18 @@ inline static bool isX86_64NonExtLowByteReg(unsigned reg) { /// size, and 3) use of X86-64 extended registers. unsigned Emitter::determineREX(const MachineInstr &MI) { unsigned REX = 0; - const TargetInstrDescriptor *Desc = MI.getDesc(); + const TargetInstrDesc &Desc = MI.getDesc(); // Pseudo instructions do not need REX prefix byte. - if ((Desc->TSFlags & X86II::FormMask) == X86II::Pseudo) + if ((Desc.TSFlags & X86II::FormMask) == X86II::Pseudo) return 0; - if (Desc->TSFlags & X86II::REX_W) + if (Desc.TSFlags & X86II::REX_W) REX |= 1 << 3; - unsigned NumOps = Desc->getNumOperands(); + unsigned NumOps = Desc.getNumOperands(); if (NumOps) { bool isTwoAddr = NumOps > 1 && - Desc->getOperandConstraint(1, TOI::TIED_TO) != -1; + Desc.getOperandConstraint(1, TOI::TIED_TO) != -1; // If it accesses SPL, BPL, SIL, or DIL, then it requires a 0x40 REX prefix. unsigned i = isTwoAddr ? 1 : 0; @@ -460,7 +460,7 @@ unsigned Emitter::determineREX(const MachineInstr &MI) { } } - switch (Desc->TSFlags & X86II::FormMask) { + switch (Desc.TSFlags & X86II::FormMask) { case X86II::MRMInitReg: if (isX86_64ExtendedReg(MI.getOperand(0))) REX |= (1 << 0) | (1 << 2); @@ -528,7 +528,7 @@ unsigned Emitter::determineREX(const MachineInstr &MI) { } void Emitter::emitInstruction(const MachineInstr &MI, - const TargetInstrDescriptor *Desc) { + const TargetInstrDesc *Desc) { unsigned Opcode = Desc->Opcode; // Emit the repeat opcode prefix as needed. diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp index 3d0d4238d2..1b3e0b8749 100644 --- a/lib/Target/X86/X86FloatingPoint.cpp +++ b/lib/Target/X86/X86FloatingPoint.cpp @@ -205,7 +205,7 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) { for (MachineBasicBlock::iterator I = BB.begin(); I != BB.end(); ++I) { MachineInstr *MI = I; - unsigned Flags = MI->getDesc()->TSFlags; + unsigned Flags = MI->getDesc().TSFlags; if ((Flags & X86II::FPTypeMask) == X86II::NotFP) continue; // Efficiently ignore non-fp insts! @@ -597,7 +597,7 @@ void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) { /// void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) { MachineInstr *MI = I; - unsigned NumOps = MI->getDesc()->getNumOperands(); + unsigned NumOps = MI->getDesc().getNumOperands(); assert((NumOps == 5 || NumOps == 1) && "Can only handle fst* & ftst instructions!"); @@ -657,7 +657,7 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) { /// void FPS::handleOneArgFPRW(MachineBasicBlock::iterator &I) { MachineInstr *MI = I; - unsigned NumOps = MI->getDesc()->getNumOperands(); + unsigned NumOps = MI->getDesc().getNumOperands(); assert(NumOps >= 2 && "FPRW instructions must have 2 ops!!"); // Is this the last use of the source register? @@ -766,7 +766,7 @@ void FPS::handleTwoArgFP(MachineBasicBlock::iterator &I) { ASSERT_SORTED(ForwardSTiTable); ASSERT_SORTED(ReverseSTiTable); MachineInstr *MI = I; - unsigned NumOperands = MI->getDesc()->getNumOperands(); + unsigned NumOperands = MI->getDesc().getNumOperands(); assert(NumOperands == 3 && "Illegal TwoArgFP instruction!"); unsigned Dest = getFPReg(MI->getOperand(0)); unsigned Op0 = getFPReg(MI->getOperand(NumOperands-2)); @@ -864,7 +864,7 @@ void FPS::handleCompareFP(MachineBasicBlock::iterator &I) { ASSERT_SORTED(ForwardSTiTable); ASSERT_SORTED(ReverseSTiTable); MachineInstr *MI = I; - unsigned NumOperands = MI->getDesc()->getNumOperands(); + unsigned NumOperands = MI->getDesc().getNumOperands(); assert(NumOperands == 2 && "Illegal FUCOM* instruction!"); unsigned Op0 = getFPReg(MI->getOperand(NumOperands-2)); unsigned Op1 = getFPReg(MI->getOperand(NumOperands-1)); diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index cae382d64a..42e41279f6 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -1243,13 +1243,13 @@ X86::CondCode X86::GetOppositeBranchCondition(X86::CondCode CC) { } bool X86InstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const { - const TargetInstrDescriptor *TID = MI->getDesc(); - if (!TID->isTerminator()) return false; + const TargetInstrDesc &TID = MI->getDesc(); + if (!TID.isTerminator()) return false; // Conditional branch is a special case. - if (TID->isBranch() && !TID->isBarrier()) + if (TID.isBranch() && !TID.isBarrier()) return true; - if (!TID->isPredicable()) + if (!TID.isPredicable()) return true; return !isPredicated(MI); } @@ -1276,7 +1276,7 @@ bool X86InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB, // If there is only one terminator instruction, process it. if (I == MBB.begin() || !isBrAnalysisUnpredicatedTerminator(--I, *this)) { - if (!LastInst->getDesc()->isBranch()) + if (!LastInst->getDesc().isBranch()) return true; // If the block ends with a branch there are 3 possibilities: @@ -1640,7 +1640,7 @@ static MachineInstr *FuseTwoAddrInst(unsigned Opcode, MIB.addImm(1).addReg(0).addImm(0); // Loop over the rest of the ri operands, converting them over. - unsigned NumOps = MI->getDesc()->getNumOperands()-2; + unsigned NumOps = MI->getDesc().getNumOperands()-2; for (unsigned i = 0; i != NumOps; ++i) { MachineOperand &MO = MI->getOperand(i+2); MIB = X86InstrAddOperand(MIB, MO); @@ -1692,9 +1692,9 @@ X86InstrInfo::foldMemoryOperand(MachineInstr *MI, unsigned i, SmallVector<MachineOperand,4> &MOs) const { const DenseMap<unsigned*, unsigned> *OpcodeTablePtr = NULL; bool isTwoAddrFold = false; - unsigned NumOps = MI->getDesc()->getNumOperands(); + unsigned NumOps = MI->getDesc().getNumOperands(); bool isTwoAddr = NumOps > 1 && - MI->getDesc()->getOperandConstraint(1, TOI::TIED_TO) != -1; + MI->getDesc().getOperandConstraint(1, TOI::TIED_TO) != -1; MachineInstr *NewMI = NULL; // Folding a memory location into the two-address part of a two-address @@ -1798,7 +1798,7 @@ MachineInstr* X86InstrInfo::foldMemoryOperand(MachineInstr *MI, return NULL; SmallVector<MachineOperand,4> MOs; - unsigned NumOps = LoadMI->getDesc()->getNumOperands(); + unsigned NumOps = LoadMI->getDesc().getNumOperands(); for (unsigned i = NumOps - 4; i != NumOps; ++i) MOs.push_back(LoadMI->getOperand(i)); return foldMemoryOperand(MI, Ops[0], MOs); @@ -1826,9 +1826,9 @@ bool X86InstrInfo::canFoldMemoryOperand(MachineInstr *MI, unsigned OpNum = Ops[0]; unsigned Opc = MI->getOpcode(); - unsigned NumOps = MI->getDesc()->getNumOperands(); + unsigned NumOps = MI->getDesc().getNumOperands(); bool isTwoAddr = NumOps > 1 && - MI->getDesc()->getOperandConstraint(1, TOI::TIED_TO) != -1; + MI->getDesc().getOperandConstraint(1, TOI::TIED_TO) != -1; // Folding a memory location into the two-address part of a two-address // instruction is different than folding it other places. It requires @@ -1880,7 +1880,7 @@ bool X86InstrInfo::unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI, return false; UnfoldStore &= FoldedStore; - const TargetInstrDescriptor &TID = get(Opc); + const TargetInstrDesc &TID = get(Opc); const TargetOperandInfo &TOI = TID.OpInfo[Index]; const TargetRegisterClass *RC = TOI.isLookupPtrRegClass() ? getPointerRegClass() : RI.getRegClass(TOI.RegClass); @@ -1979,7 +1979,7 @@ X86InstrInfo::unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N, unsigned Index = I->second.second & 0xf; bool FoldedLoad = I->second.second & (1 << 4); bool FoldedStore = I->second.second & (1 << 5); - const TargetInstrDescriptor &TID = get(Opc); + const TargetInstrDesc &TID = get(Opc); const TargetOperandInfo &TOI = TID.OpInfo[Index]; const TargetRegisterClass *RC = TOI.isLookupPtrRegClass() ? getPointerRegClass() : RI.getRegClass(TOI.RegClass); diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h index c0aefb4147..27675b94b1 100644 --- a/lib/Target/X86/X86InstrInfo.h +++ b/lib/Target/X86/X86InstrInfo.h @@ -364,7 +364,7 @@ public: // getBaseOpcodeFor - This function returns the "base" X86 opcode for the // specified machine instruction. // - unsigned char getBaseOpcodeFor(const TargetInstrDescriptor *TID) const { + unsigned char getBaseOpcodeFor(const TargetInstrDesc *TID) const { return TID->TSFlags >> X86II::OpcodeShift; } unsigned char getBaseOpcodeFor(unsigned Opcode) const { diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 1e5441794a..56523eb14d 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -729,7 +729,7 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF, MachineBasicBlock::iterator PI = prior(MBBI); unsigned Opc = PI->getOpcode(); if (Opc != X86::POP32r && Opc != X86::POP64r && - !PI->getDesc()->isTerminator()) + !PI->getDesc().isTerminator()) break; --MBBI; } |