Hmm, who left this sitting around in my tree
authorBrian Gaeke <gaeke@uiuc.edu>
Tue, 9 Mar 2004 04:49:13 +0000 (04:49 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Tue, 9 Mar 2004 04:49:13 +0000 (04:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12255 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/InstSelectSimple.cpp
lib/Target/Sparc/SparcV8ISelSimple.cpp
lib/Target/SparcV8/InstSelectSimple.cpp
lib/Target/SparcV8/SparcV8ISelSimple.cpp

index ec331ee8fb9f33497e877fdc050e20b19dd79c3f..90fdacbeeef00af08954e2f7871940ba23b558d7 100644 (file)
@@ -125,10 +125,10 @@ namespace {
         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
       }
 
index ec331ee8fb9f33497e877fdc050e20b19dd79c3f..90fdacbeeef00af08954e2f7871940ba23b558d7 100644 (file)
@@ -125,10 +125,10 @@ namespace {
         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
       }
 
index ec331ee8fb9f33497e877fdc050e20b19dd79c3f..90fdacbeeef00af08954e2f7871940ba23b558d7 100644 (file)
@@ -125,10 +125,10 @@ namespace {
         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
       }
 
index ec331ee8fb9f33497e877fdc050e20b19dd79c3f..90fdacbeeef00af08954e2f7871940ba23b558d7 100644 (file)
@@ -125,10 +125,10 @@ namespace {
         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
       }