mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
PPC: Use HWEncoding and TRI->getEncodingValue
As pointed out by Jakob, we don't need to maintain a separate register-numbering table. Instead we should let TableGen generate the table for us from the information (already present) in PPCRegisterInfo.td. TRI->getEncodingValue is now used to access register-encoding values. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178067 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -142,7 +142,7 @@ unsigned PPCCodeEmitter::get_crbitm_encoding(const MachineInstr &MI,
|
||||
assert((MI.getOpcode() == PPC::MTCRF || MI.getOpcode() == PPC::MTCRF8 ||
|
||||
MI.getOpcode() == PPC::MFOCRF) &&
|
||||
(MO.getReg() >= PPC::CR0 && MO.getReg() <= PPC::CR7));
|
||||
return 0x80 >> getPPCRegisterNumbering(MO.getReg());
|
||||
return 0x80 >> TM.getRegisterInfo()->getEncodingValue(MO.getReg());
|
||||
}
|
||||
|
||||
MachineRelocation PPCCodeEmitter::GetRelocation(const MachineOperand &MO,
|
||||
@@ -260,7 +260,7 @@ unsigned PPCCodeEmitter::getMachineOpValue(const MachineInstr &MI,
|
||||
assert((MI.getOpcode() != PPC::MTCRF && MI.getOpcode() != PPC::MTCRF8 &&
|
||||
MI.getOpcode() != PPC::MFOCRF) ||
|
||||
MO.getReg() < PPC::CR0 || MO.getReg() > PPC::CR7);
|
||||
return getPPCRegisterNumbering(MO.getReg());
|
||||
return TM.getRegisterInfo()->getEncodingValue(MO.getReg());
|
||||
}
|
||||
|
||||
assert(MO.isImm() &&
|
||||
|
Reference in New Issue
Block a user