1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Add x86 support for 'n' inline asm modifier. This will be handled target independently as part of MC work.

llvm-svn: 74336
This commit is contained in:
Evan Cheng 2009-06-26 22:00:19 +00:00
parent 3a48623aef
commit 016ed65455
2 changed files with 19 additions and 0 deletions

View File

@ -840,6 +840,17 @@ bool X86ATTAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
case 'P': // Don't print @PLT, but do print as memory.
printOperand(MI, OpNo, "mem", /*NotRIPRel=*/true);
return false;
case 'n': { // Negate the immediate or print a '-' before the operand.
// Note: this is a temporary solution. It should be handled target
// independently as part of the 'MC' work.
const MachineOperand &MO = MI->getOperand(OpNo);
if (MO.isImm()) {
O << -MO.getImm();
return false;
}
O << '-';
}
}
}

View File

@ -0,0 +1,8 @@
; RUN: llvm-as < %s | llc -march=x86 | grep { 37}
; rdar://7008959
define void @bork() nounwind {
entry:
tail call void asm sideeffect "BORK ${0:n}", "i,~{dirflag},~{fpsr},~{flags}"(i32 -37) nounwind
ret void
}