mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
[SystemZ] Allow integer insertions with a high-word destination
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191753 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -35,6 +35,15 @@ static MCInst lowerRILow(const MachineInstr *MI, unsigned Opcode) {
|
||||
.addImm(MI->getOperand(2).getImm());
|
||||
}
|
||||
|
||||
// Return an RI instruction like MI with opcode Opcode, but with the
|
||||
// GR64 register operands turned into GRH32s.
|
||||
static MCInst lowerRIHigh(const MachineInstr *MI, unsigned Opcode) {
|
||||
return MCInstBuilder(Opcode)
|
||||
.addReg(SystemZMC::getRegAsGRH32(MI->getOperand(0).getReg()))
|
||||
.addReg(SystemZMC::getRegAsGRH32(MI->getOperand(1).getReg()))
|
||||
.addImm(MI->getOperand(2).getImm());
|
||||
}
|
||||
|
||||
// Return an RI instruction like MI with opcode Opcode, but with the
|
||||
// R2 register turned into a GR64.
|
||||
static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode) {
|
||||
@@ -113,6 +122,14 @@ void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
|
||||
#undef LOWER_LOW
|
||||
|
||||
#define LOWER_HIGH(NAME) \
|
||||
case SystemZ::NAME##64: LoweredMI = lowerRIHigh(MI, SystemZ::NAME); break
|
||||
|
||||
LOWER_HIGH(IIHL);
|
||||
LOWER_HIGH(IIHH);
|
||||
|
||||
#undef LOWER_HIGH
|
||||
|
||||
default:
|
||||
Lower.lower(MI, LoweredMI);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user