Skip to content

Commit

Permalink
Fix an obvious bug in isMoveInstr. It needs to return sub-register in…
Browse files Browse the repository at this point in the history
…dices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103157 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Evan Cheng committed May 6, 2010
1 parent 4ffc22a commit 9c35ee2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Target/ARM/ARMBaseInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,6 @@ bool
ARMBaseInstrInfo::isMoveInstr(const MachineInstr &MI,
unsigned &SrcReg, unsigned &DstReg,
unsigned& SrcSubIdx, unsigned& DstSubIdx) const {
SrcSubIdx = DstSubIdx = 0; // No sub-registers.

switch (MI.getOpcode()) {
default: break;
case ARM::VMOVS:
Expand All @@ -551,6 +549,8 @@ ARMBaseInstrInfo::isMoveInstr(const MachineInstr &MI,
case ARM::VMOVQQ : {
SrcReg = MI.getOperand(1).getReg();
DstReg = MI.getOperand(0).getReg();
SrcSubIdx = MI.getOperand(1).getSubReg();
DstSubIdx = MI.getOperand(0).getSubReg();
return true;
}
case ARM::MOVr:
Expand All @@ -565,6 +565,8 @@ ARMBaseInstrInfo::isMoveInstr(const MachineInstr &MI,
"Invalid ARM MOV instruction");
SrcReg = MI.getOperand(1).getReg();
DstReg = MI.getOperand(0).getReg();
SrcSubIdx = MI.getOperand(1).getSubReg();
DstSubIdx = MI.getOperand(0).getSubReg();
return true;
}
}
Expand Down

0 comments on commit 9c35ee2

Please sign in to comment.