mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Add completely untested support for mtcrf/mfcrf encoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
14522e31d9
commit
f577c6122f
@ -186,6 +186,13 @@ int PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) {
|
||||
// or things that get fixed up later by the JIT.
|
||||
if (MO.isRegister()) {
|
||||
rv = enumRegToMachineReg(MO.getReg());
|
||||
|
||||
// Special encoding for MTCRF and MFCRF, which uses a bit mask for the
|
||||
// register, not the register number directly.
|
||||
if ((MI.getOpcode() == PPC::MTCRF || MI.getOpcode() == PPC::MFCRF) &&
|
||||
(MO.getReg() >= PPC::CR0 && MO.getReg() <= PPC::CR7)) {
|
||||
rv = 0x80 >> rv;
|
||||
}
|
||||
} else if (MO.isImmediate()) {
|
||||
rv = MO.getImmedValue();
|
||||
} else if (MO.isGlobalAddress() || MO.isExternalSymbol()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user