[llvm-branch-commits] [llvm-branch] r75691 - in /llvm/branches/Apple/Bender-SWB: lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp test/CodeGen/X86/inline-asm-modifier-n.ll

Bill Wendling isanbard at gmail.com
Tue Jul 14 15:35:48 PDT 2009


Author: void
Date: Tue Jul 14 17:35:22 2009
New Revision: 75691

URL: http://llvm.org/viewvc/llvm-project?rev=75691&view=rev
Log:
--- Merging r74336 into '.':
A    test/CodeGen/X86/inline-asm-modifier-n.ll
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

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

Added:
    llvm/branches/Apple/Bender-SWB/test/CodeGen/X86/inline-asm-modifier-n.ll
      - copied unchanged from r74336, llvm/trunk/test/CodeGen/X86/inline-asm-modifier-n.ll
Modified:
    llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Modified: llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=75691&r1=75690&r2=75691&view=diff

==============================================================================
--- llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Tue Jul 14 17:35:22 2009
@@ -725,6 +725,17 @@
     case 'P': // Don't print @PLT, but do print as memory.
       printOperand(MI, OpNo, "mem");
       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 << '-';
+    }
     }
   }
 





More information about the llvm-branch-commits mailing list