asmprint pseudo instrs
authorChris Lattner <sabre@nondot.org>
Fri, 16 Dec 2005 07:13:26 +0000 (07:13 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 16 Dec 2005 07:13:26 +0000 (07:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24742 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/Sparc/SparcInstrInfo.td
lib/Target/SparcV8/SparcV8AsmPrinter.cpp
lib/Target/SparcV8/SparcV8InstrInfo.td

index 8867275d619a3cc46dceb214a13879a3a02ab194..cd66c1938453d7802132191175a93a4f858b6639 100644 (file)
@@ -422,19 +422,6 @@ void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
   if (CloseParen) O << ")";
 }
 
-static bool isPseudoInstruction (const MachineInstr *MI) {
-  switch (MI->getOpcode ()) {
-  case V8::PHI:
-  case V8::ADJCALLSTACKUP:
-  case V8::ADJCALLSTACKDOWN:
-  case V8::IMPLICIT_USE:
-  case V8::IMPLICIT_DEF:
-    return true;
-  default:
-    return false;
-  }
-}
-
 /// printBaseOffsetPair - Print two consecutive operands of MI, starting at #i,
 /// which form a base + offset pair (which may have brackets around it, if
 /// brackets is true, or may be in the form base - constant, if offset is a
@@ -467,10 +454,6 @@ void SparcV8AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
   const TargetInstrInfo &TII = *TM.getInstrInfo();
   const TargetInstrDescriptor &Desc = TII.get(Opcode);
 
-  // If it's a pseudo-instruction, comment it out.
-  if (isPseudoInstruction (MI))
-    O << "! ";
-
   O << Desc.Name << " ";
 
   // print non-immediate, non-register-def operands
index 6bf5f27d18cc620e0d367cbce7b303cb808537d1..1f8349e11bd4dec7705c3821da83d0f2cfef1e9e 100644 (file)
@@ -35,16 +35,19 @@ include "SparcV8InstrFormats.td"
 //===----------------------------------------------------------------------===//
 
 // Pseudo instructions.
-class PseudoInstV8<string nm, dag ops> : InstV8  {
-  let Name = nm;
+class PseudoInstV8<string asmstr, dag ops> : InstV8  {
+  let AsmString = asmstr;
   dag OperandList = ops;
 }
 def PHI : PseudoInstV8<"PHI", (ops variable_ops)>;
-def ADJCALLSTACKDOWN : PseudoInstV8<"ADJCALLSTACKDOWN", (ops variable_ops)>;
-def ADJCALLSTACKUP : PseudoInstV8<"ADJCALLSTACKUP", (ops variable_ops)>;
-def IMPLICIT_USE : PseudoInstV8<"IMPLICIT_USE", (ops variable_ops)>;
-def IMPLICIT_DEF : PseudoInstV8<"IMPLICIT_DEF", (ops variable_ops)>;
-def FpMOVD : PseudoInstV8<"FpMOVD", (ops)>; // pseudo 64-bit double move
+def ADJCALLSTACKDOWN : PseudoInstV8<"!ADJCALLSTACKDOWN $amt",
+                                    (ops i32imm:$amt)>;
+def ADJCALLSTACKUP : PseudoInstV8<"!ADJCALLSTACKUP $amt",
+                                  (ops i32imm:$amt)>;
+//def IMPLICIT_USE : PseudoInstV8<"!IMPLICIT_USE",(ops variable_ops)>;
+def IMPLICIT_DEF : PseudoInstV8<"!IMPLICIT_DEF $dst", 
+                                (ops IntRegs:$dst)>;
+def FpMOVD : PseudoInstV8<"!FpMOVD", (ops)>; // pseudo 64-bit double move
 
 // Section A.3 - Synthetic Instructions, p. 85
 // special cases of JMPL:
index 8867275d619a3cc46dceb214a13879a3a02ab194..cd66c1938453d7802132191175a93a4f858b6639 100644 (file)
@@ -422,19 +422,6 @@ void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
   if (CloseParen) O << ")";
 }
 
-static bool isPseudoInstruction (const MachineInstr *MI) {
-  switch (MI->getOpcode ()) {
-  case V8::PHI:
-  case V8::ADJCALLSTACKUP:
-  case V8::ADJCALLSTACKDOWN:
-  case V8::IMPLICIT_USE:
-  case V8::IMPLICIT_DEF:
-    return true;
-  default:
-    return false;
-  }
-}
-
 /// printBaseOffsetPair - Print two consecutive operands of MI, starting at #i,
 /// which form a base + offset pair (which may have brackets around it, if
 /// brackets is true, or may be in the form base - constant, if offset is a
@@ -467,10 +454,6 @@ void SparcV8AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
   const TargetInstrInfo &TII = *TM.getInstrInfo();
   const TargetInstrDescriptor &Desc = TII.get(Opcode);
 
-  // If it's a pseudo-instruction, comment it out.
-  if (isPseudoInstruction (MI))
-    O << "! ";
-
   O << Desc.Name << " ";
 
   // print non-immediate, non-register-def operands
index 6bf5f27d18cc620e0d367cbce7b303cb808537d1..1f8349e11bd4dec7705c3821da83d0f2cfef1e9e 100644 (file)
@@ -35,16 +35,19 @@ include "SparcV8InstrFormats.td"
 //===----------------------------------------------------------------------===//
 
 // Pseudo instructions.
-class PseudoInstV8<string nm, dag ops> : InstV8  {
-  let Name = nm;
+class PseudoInstV8<string asmstr, dag ops> : InstV8  {
+  let AsmString = asmstr;
   dag OperandList = ops;
 }
 def PHI : PseudoInstV8<"PHI", (ops variable_ops)>;
-def ADJCALLSTACKDOWN : PseudoInstV8<"ADJCALLSTACKDOWN", (ops variable_ops)>;
-def ADJCALLSTACKUP : PseudoInstV8<"ADJCALLSTACKUP", (ops variable_ops)>;
-def IMPLICIT_USE : PseudoInstV8<"IMPLICIT_USE", (ops variable_ops)>;
-def IMPLICIT_DEF : PseudoInstV8<"IMPLICIT_DEF", (ops variable_ops)>;
-def FpMOVD : PseudoInstV8<"FpMOVD", (ops)>; // pseudo 64-bit double move
+def ADJCALLSTACKDOWN : PseudoInstV8<"!ADJCALLSTACKDOWN $amt",
+                                    (ops i32imm:$amt)>;
+def ADJCALLSTACKUP : PseudoInstV8<"!ADJCALLSTACKUP $amt",
+                                  (ops i32imm:$amt)>;
+//def IMPLICIT_USE : PseudoInstV8<"!IMPLICIT_USE",(ops variable_ops)>;
+def IMPLICIT_DEF : PseudoInstV8<"!IMPLICIT_DEF $dst", 
+                                (ops IntRegs:$dst)>;
+def FpMOVD : PseudoInstV8<"!FpMOVD", (ops)>; // pseudo 64-bit double move
 
 // Section A.3 - Synthetic Instructions, p. 85
 // special cases of JMPL: