aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Sparc
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-03-09 04:49:13 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-03-09 04:49:13 +0000
commitcf47198a49a4d493a64e9f3c9aecbbbe6112f005 (patch)
treeb11cac43c3ef7755be744979159eef3744f7a17f /lib/Target/Sparc
parentcc2a2a530ffa59786ab49a579d4ac7ed0c21536b (diff)
downloadexternal_llvm-cf47198a49a4d493a64e9f3c9aecbbbe6112f005.zip
external_llvm-cf47198a49a4d493a64e9f3c9aecbbbe6112f005.tar.gz
external_llvm-cf47198a49a4d493a64e9f3c9aecbbbe6112f005.tar.bz2
Hmm, who left this sitting around in my tree
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r--lib/Target/Sparc/InstSelectSimple.cpp8
-rw-r--r--lib/Target/Sparc/SparcV8ISelSimple.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp
index ec331ee..90fdacb 100644
--- a/lib/Target/Sparc/InstSelectSimple.cpp
+++ b/lib/Target/Sparc/InstSelectSimple.cpp
@@ -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
}
diff --git a/lib/Target/Sparc/SparcV8ISelSimple.cpp b/lib/Target/Sparc/SparcV8ISelSimple.cpp
index ec331ee..90fdacb 100644
--- a/lib/Target/Sparc/SparcV8ISelSimple.cpp
+++ b/lib/Target/Sparc/SparcV8ISelSimple.cpp
@@ -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
}