mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-06 12:04:48 +00:00
Implement the 'm' modifier. Note that it only works for memory operands.
Part of rdar://9119939 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132081 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d85b3ecbb3
commit
8f89463894
@ -426,7 +426,6 @@ bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
|
||||
return true;
|
||||
O << (MI->getOperand(OpNum).getImm() & 0xffff);
|
||||
return false;
|
||||
case 'm': // The base register of a memory operand.
|
||||
case 'M': // A register range suitable for LDM/STM.
|
||||
case 'p': // The high single-precision register of a VFP double-precision
|
||||
// register.
|
||||
@ -450,9 +449,20 @@ bool ARMAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
unsigned OpNum, unsigned AsmVariant,
|
||||
const char *ExtraCode,
|
||||
raw_ostream &O) {
|
||||
if (ExtraCode && ExtraCode[0])
|
||||
return true; // Unknown modifier.
|
||||
|
||||
// Does this asm operand have a single letter operand modifier?
|
||||
if (ExtraCode && ExtraCode[0]) {
|
||||
if (ExtraCode[1] != 0) return true; // Unknown modifier.
|
||||
|
||||
switch (ExtraCode[0]) {
|
||||
default: return true; // Unknown modifier.
|
||||
case 'm': // The base register of a memory operand.
|
||||
if (!MI->getOperand(OpNum).isReg())
|
||||
return true;
|
||||
O << ARMInstPrinter::getRegisterName(MI->getOperand(OpNum).getReg());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const MachineOperand &MO = MI->getOperand(OpNum);
|
||||
assert(MO.isReg() && "unexpected inline asm memory operand");
|
||||
O << "[" << ARMInstPrinter::getRegisterName(MO.getReg()) << "]";
|
||||
|
@ -29,3 +29,14 @@ entry:
|
||||
call void asm sideeffect ".word ${0:L} \0A\09", "i"(i32 -1) nounwind, !srcloc !0
|
||||
ret void
|
||||
}
|
||||
|
||||
@f2_ptr = internal global i32* @f2_var, align 4
|
||||
@f2_var = external global i32
|
||||
|
||||
define void @f2() nounwind ssp {
|
||||
entry:
|
||||
; CHECK: f2
|
||||
; CHECK: ldr r0, [r{{[0-9]+}}]
|
||||
call void asm sideeffect "ldr r0, [${0:m}]\0A\09", "*m,~{r0}"(i32** @f2_ptr) nounwind, !srcloc !0
|
||||
ret void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user