summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsConstantIslandPass.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-11-06 04:29:52 +0000
committerReed Kotler <rkotler@mips.com>2013-11-06 04:29:52 +0000
commit7851bc1871dcb7c31b603b17cf975ae0b55f4c30 (patch)
tree66ff8345093496f5c71727d9bba8bf891445492b /lib/Target/Mips/MipsConstantIslandPass.cpp
parent8458f371b84ee0cd22c4a433059d53ea6e3ec4f4 (diff)
downloadllvm-7851bc1871dcb7c31b603b17cf975ae0b55f4c30.tar.gz
llvm-7851bc1871dcb7c31b603b17cf975ae0b55f4c30.tar.bz2
llvm-7851bc1871dcb7c31b603b17cf975ae0b55f4c30.tar.xz
Fix definition for Mips16 pc relative load word instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsConstantIslandPass.cpp')
-rw-r--r--lib/Target/Mips/MipsConstantIslandPass.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Target/Mips/MipsConstantIslandPass.cpp b/lib/Target/Mips/MipsConstantIslandPass.cpp
index a79692e47d..6d6f942a24 100644
--- a/lib/Target/Mips/MipsConstantIslandPass.cpp
+++ b/lib/Target/Mips/MipsConstantIslandPass.cpp
@@ -614,12 +614,13 @@ initializeFunctionInfo(const std::vector<MachineInstr*> &CPEMIs) {
llvm_unreachable("Unknown addressing mode for CP reference!");
case Mips::LwRxPcTcp16:
Bits = 8;
- Scale = 2;
+ Scale = 4;
LongFormOpcode = Mips::LwRxPcTcpX16;
break;
case Mips::LwRxPcTcpX16:
Bits = 16;
- Scale = 2;
+ Scale = 1;
+ NegOk = true;
break;
}
// Remember that this is a user of a CP entry.
@@ -782,9 +783,6 @@ MachineBasicBlock *MipsConstantIslands::splitBlockBeforeInstr
/// isOffsetInRange - Checks whether UserOffset (the location of a constant pool
/// reference) is within MaxDisp of TrialOffset (a proposed location of a
/// constant pool entry).
-/// UserOffset is computed by getUserOffset above to include PC adjustments. If
-/// the mod 4 alignment of UserOffset is not known, the uncertainty must be
-/// subtracted from MaxDisp instead. CPUser::getMaxDisp() does that.
bool MipsConstantIslands::isOffsetInRange(unsigned UserOffset,
unsigned TrialOffset, unsigned MaxDisp,
bool NegativeOK) {