mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[PATCH, PowerPC] Accept 'U' and 'X' constraints in inline asm
Inline asm may specify 'U' and 'X' constraints to print a 'u' for an update-form memory reference, or an 'x' for an indexed-form memory reference. However, these are really only useful in GCC internal code generation. In inline asm the operand of the memory constraint is typically just a register containing the address, so 'U' and 'X' make no sense. This patch quietly accepts 'U' and 'X' in inline asm patterns, but otherwise does nothing. If we ever unexpectedly see a non-register, we'll assert and sort it out afterwards. I've added a new test for these constraints; the test case should be used for other asm-constraints changes down the road. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -275,6 +275,16 @@ bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
printOperand(MI, OpNo, O);
|
||||
return false;
|
||||
}
|
||||
case 'U': // Print 'u' for update form.
|
||||
case 'X': // Print 'x' for indexed form.
|
||||
{
|
||||
// Memory constraints should always produce an MO_Register,
|
||||
// so we never get an update or indexed form. (In GCC, these
|
||||
// are useful in internal code gen; not so much in inline asm.)
|
||||
// So tolerate these but don't output anything.
|
||||
assert(MI->getOperand(OpNo).isReg());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user