[llvm-commits] CVS: llvm/lib/Target/Sparc/Sparc.burg.in SparcInstrSelection.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Oct 18 00:57:01 PDT 2003


Changes in directory llvm/lib/Target/Sparc:

Sparc.burg.in updated: 1.7 -> 1.8
SparcInstrSelection.cpp updated: 1.119 -> 1.120

---
Log message:

Update the sparc backend to at least compile correctly with the new varargs stuff even if it's not all implemented yet.


---
Diffs of the changes:  (+16 -4)

Index: llvm/lib/Target/Sparc/Sparc.burg.in
diff -u llvm/lib/Target/Sparc/Sparc.burg.in:1.7 llvm/lib/Target/Sparc/Sparc.burg.in:1.8
--- llvm/lib/Target/Sparc/Sparc.burg.in:1.7	Fri Oct 10 13:46:50 2003
+++ llvm/lib/Target/Sparc/Sparc.burg.in	Sat Oct 18 00:55:58 2003
@@ -87,8 +87,9 @@
 %term Call=CallOPCODE
 %term Shl=ShlOPCODE
 %term Shr=ShrOPCODE
-%term VaArg=VarArgOPCODE
-		/* 32...46 are unused */
+%term VANext=VANextOPCODE
+%term VAArg=VAArgOPCODE
+		/* 33...46 are unused */
     /*
      * The foll. values should match the constants in InstrForest.h
      */
@@ -258,7 +259,8 @@
 reg:	Shl(reg,reg)		=   62 (20);	/* 1 for issue restrictions */
 reg:	Shr(reg,reg)		=   63 (20);	/* 1 for issue restrictions */
 reg:	Phi(reg,reg)		=   64 (0);
-reg:	VaArg(reg)		=   65 (40);	/* load from stack then incr */
+reg:	VANext(reg)		=   65 (40);	/* incr stack slot pointer */
+reg:	VAArg(reg)		=   66 (40);	/* get a vararg */
 
 	/*
 	 * Finally, leaf nodes of expression trees.


Index: llvm/lib/Target/Sparc/SparcInstrSelection.cpp
diff -u llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.119 llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.120
--- llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.119	Tue Sep 23 12:28:11 2003
+++ llvm/lib/Target/Sparc/SparcInstrSelection.cpp	Sat Oct 18 00:55:58 2003
@@ -1408,6 +1408,9 @@
 {
   switch (iid) {
   case LLVMIntrinsic::va_start: {
+    // FIXME: this needs to be updated!
+    abort();
+
     // Get the address of the first vararg value on stack and copy it to
     // the argument of va_start(va_list* ap).
     bool ignore;
@@ -1426,6 +1429,9 @@
     return true;                        // no-op on Sparc
 
   case LLVMIntrinsic::va_copy:
+    // FIXME: this needs to be updated!
+    abort();
+
     // Simple copy of current va_list (arg2) to new va_list (arg1)
     mvec.push_back(BuildMI(V9::ORr, 3).
                    addMReg(target.getRegInfo().getZeroRegNum()).
@@ -2829,8 +2835,11 @@
       case 64:	// reg:   Phi(reg,reg)
         break;                          // don't forward the value
 
-      case 65:	// reg:   VaArg(reg): the va_arg instruction
+      case 65:	// reg:   VANext(reg): the va_next instruction
+      case 66:	// reg:   VAArg (reg): the va_arg instruction
       {
+        abort();        // FIXME: This is incorrect!
+#if 0
         // Use value initialized by va_start as pointer to args on the stack.
         // Load argument via current pointer value, then increment pointer.
         int argSize = target.getFrameInfo().getSizeOfEachArgOnStack();
@@ -2842,6 +2851,7 @@
         mvec.push_back(BuildMI(V9::ADDi, 3).addReg(vaArgI->getOperand(0)).
                        addSImm(argSize).addRegDef(vaArgI->getOperand(0)));
         break;
+#endif
       }
       
       case 71:	// reg:     VReg





More information about the llvm-commits mailing list