diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:05:42 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:05:42 +0000 |
commit | 80a73e7d8be72d77ad45e38f75e1be85cf53c98e (patch) | |
tree | ea0d052e29a485ee60a4ac97c17dbaa61b3fc4bb /llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | |
parent | b900245e13fa562341c755a57e7d90338d626401 (diff) | |
download | bcm5719-llvm-80a73e7d8be72d77ad45e38f75e1be85cf53c98e.tar.gz bcm5719-llvm-80a73e7d8be72d77ad45e38f75e1be85cf53c98e.zip |
Add 8-bit insts. zext behaviour is not modelled yet
llvm-svn: 70722
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430InstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp index c84c96e6569..579da6e90ea 100644 --- a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp +++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp @@ -32,16 +32,24 @@ bool MSP430InstrInfo::copyRegToReg(MachineBasicBlock &MBB, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *DestRC, const TargetRegisterClass *SrcRC) const { - if (DestRC != SrcRC) { - // Not yet supported! - return false; - } - DebugLoc DL = DebugLoc::getUnknownLoc(); if (I != MBB.end()) DL = I->getDebugLoc(); - BuildMI(MBB, I, DL, get(MSP430::MOV16rr), DestReg).addReg(SrcReg); - return true; + if (DestRC == SrcRC) { + unsigned Opc; + if (DestRC == &MSP430::GR16RegClass) { + Opc = MSP430::MOV16rr; + } else if (DestRC == &MSP430::GR8RegClass) { + Opc = MSP430::MOV8rr; + } else { + return false; + } + + BuildMI(MBB, I, DL, get(Opc), DestReg).addReg(SrcReg); + return true; + } + + return false; } bool @@ -53,8 +61,9 @@ MSP430InstrInfo::isMoveInstr(const MachineInstr& MI, switch (MI.getOpcode()) { default: return false; + case MSP430::MOV8rr: case MSP430::MOV16rr: - assert(MI.getNumOperands() >= 2 && + assert(MI.getNumOperands() >= 2 && MI.getOperand(0).isReg() && MI.getOperand(1).isReg() && "invalid register-register move instruction"); |