diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-06-29 07:51:04 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-06-29 07:51:04 +0000 |
commit | b23b50d54daf11a4b24fc466b853a68a758c4bb7 (patch) | |
tree | 0f00f9797a386b8365812836f8589c401e250312 /llvm/lib/Target/ARM/ThumbRegisterInfo.cpp | |
parent | 4744d560b85c48bf305256412b0beac4345648c8 (diff) | |
download | bcm5719-llvm-b23b50d54daf11a4b24fc466b853a68a758c4bb7.tar.gz bcm5719-llvm-b23b50d54daf11a4b24fc466b853a68a758c4bb7.zip |
Implement Thumb2 ldr.
After much back and forth, I decided to deviate from ARM design and split LDR into 4 instructions (r + imm12, r + imm8, r + r << imm12, constantpool). The advantage of this is 1) it follows the latest ARM technical manual, and 2) makes it easier to reduce the width of the instruction later. The down side is this creates more inconsistency between the two sub-targets. We should split ARM LDR instruction in a similar fashion later. I've added a README entry for this.
llvm-svn: 74420
Diffstat (limited to 'llvm/lib/Target/ARM/ThumbRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ThumbRegisterInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp b/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp index 513126f5712..751aa72beaf 100644 --- a/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp +++ b/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp @@ -444,7 +444,7 @@ void ThumbRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, unsigned NumBits = 0; unsigned Scale = 1; switch (AddrMode) { - case ARMII::AddrModeTs: { + case ARMII::AddrModeT1_s: { ImmIdx = i+1; InstrOffs = MI.getOperand(ImmIdx).getImm(); NumBits = (FrameReg == ARM::SP) ? 8 : 5; @@ -472,7 +472,7 @@ void ThumbRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, } bool isThumSpillRestore = Opcode == ARM::tRestore || Opcode == ARM::tSpill; - if (AddrMode == ARMII::AddrModeTs) { + if (AddrMode == ARMII::AddrModeT1_s) { // Thumb tLDRspi, tSTRspi. These will change to instructions that use // a different base register. NumBits = 5; @@ -480,7 +480,7 @@ void ThumbRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, } // If this is a thumb spill / restore, we will be using a constpool load to // materialize the offset. - if (AddrMode == ARMII::AddrModeTs && isThumSpillRestore) + if (AddrMode == ARMII::AddrModeT1_s && isThumSpillRestore) ImmOp.ChangeToImmediate(0); else { // Otherwise, it didn't fit. Pull in what we can to simplify the immed. |