forked from OSchip/llvm-project
Add completely untested support for mtcrf/mfcrf encoding
llvm-svn: 21353
This commit is contained in:
parent
baa9be572b
commit
53c40624f9
|
@ -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…
Reference in New Issue