diff options
Diffstat (limited to 'lib/Target/Sparc/InstSelectSimple.cpp')
-rw-r--r-- | lib/Target/Sparc/InstSelectSimple.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp index ec331ee8fb..90fdacbeee 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 } |