[llvm-commits] CVS: llvm/lib/Target/SparcV8/InstSelectSimple.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Mon Mar 8 22:50:01 PST 2004


Changes in directory llvm/lib/Target/SparcV8:

InstSelectSimple.cpp updated: 1.5 -> 1.6

---
Log message:

Hmm, who left this sitting around in my tree


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

Index: llvm/lib/Target/SparcV8/InstSelectSimple.cpp
diff -u llvm/lib/Target/SparcV8/InstSelectSimple.cpp:1.5 llvm/lib/Target/SparcV8/InstSelectSimple.cpp:1.6
--- llvm/lib/Target/SparcV8/InstSelectSimple.cpp:1.5	Fri Mar  5 23:32:28 2004
+++ llvm/lib/Target/SparcV8/InstSelectSimple.cpp	Mon Mar  8 22:49:13 2004
@@ -125,10 +125,10 @@
         RegMap.erase(V);  // Assign a new name to this constant if ref'd again
       } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
         // Move the address of the global into the register
-        //  X86 does:
-        // BuildMI(*MBB, IPt, V8::ORrr, 2, Reg).addReg(G0).addGlobalAddress(GV);
-        //  We need to use SETHI and OR.
-        assert (0 && "Can't move address of global yet");
+        unsigned TmpReg = makeAnotherReg(V->getType());
+        BuildMI (*MBB, IPt, V8::SETHIi, 1, TmpReg).addGlobalAddress (GV);
+        BuildMI (*MBB, IPt, V8::ORri, 2, Reg).addReg (TmpReg)
+          .addGlobalAddress (GV);
         RegMap.erase(V);  // Assign a new name to this address if ref'd again
       }
 





More information about the llvm-commits mailing list