diff options
| author | Jim Grosbach <grosbach@apple.com> | 2011-11-10 23:58:34 +0000 | 
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2011-11-10 23:58:34 +0000 | 
| commit | d9a9be269c88ef2bc449b14250eab2bb4549378f (patch) | |
| tree | 1c7f1f2853c4bdc3dabf7b8b7503b9cffa74e80d /llvm/lib | |
| parent | afad053141a0366aede389385ba56da288354a11 (diff) | |
| download | bcm5719-llvm-d9a9be269c88ef2bc449b14250eab2bb4549378f.tar.gz bcm5719-llvm-d9a9be269c88ef2bc449b14250eab2bb4549378f.zip | |
Thumb2 ldm/stm updating w/ one register in the list are LDR/STR.
rdar://10429490
llvm-svn: 144338
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 32 | 
1 files changed, 32 insertions, 0 deletions
| diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index dec92512e06..e782975844d 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -4590,6 +4590,38 @@ processInstruction(MCInst &Inst,      Inst = TmpInst;      return true;    } +  case ARM::t2LDMIA_UPD: { +    // If this is a load of a single register, then we should use +    // a post-indexed LDR instruction instead, per the ARM ARM. +    if (Inst.getNumOperands() != 5) +      return false; +    MCInst TmpInst; +    TmpInst.setOpcode(ARM::t2LDR_POST); +    TmpInst.addOperand(Inst.getOperand(4)); // Rt +    TmpInst.addOperand(Inst.getOperand(0)); // Rn_wb +    TmpInst.addOperand(Inst.getOperand(1)); // Rn +    TmpInst.addOperand(MCOperand::CreateImm(4)); +    TmpInst.addOperand(Inst.getOperand(2)); // CondCode +    TmpInst.addOperand(Inst.getOperand(3)); +    Inst = TmpInst; +    return true; +  } +  case ARM::t2STMDB_UPD: { +    // If this is a store of a single register, then we should use +    // a pre-indexed STR instruction instead, per the ARM ARM. +    if (Inst.getNumOperands() != 5) +      return false; +    MCInst TmpInst; +    TmpInst.setOpcode(ARM::t2STR_PRE); +    TmpInst.addOperand(Inst.getOperand(0)); // Rn_wb +    TmpInst.addOperand(Inst.getOperand(4)); // Rt +    TmpInst.addOperand(Inst.getOperand(1)); // Rn +    TmpInst.addOperand(MCOperand::CreateImm(-4)); +    TmpInst.addOperand(Inst.getOperand(2)); // CondCode +    TmpInst.addOperand(Inst.getOperand(3)); +    Inst = TmpInst; +    return true; +  }    case ARM::LDMIA_UPD:      // If this is a load of a single register via a 'pop', then we should use      // a post-indexed LDR instruction instead, per the ARM ARM. | 

