diff options
| author | Nikolai Bozhenov <nikolai.bozhenov@intel.com> | 2018-01-09 11:15:08 +0000 |
|---|---|---|
| committer | Nikolai Bozhenov <nikolai.bozhenov@intel.com> | 2018-01-09 11:15:08 +0000 |
| commit | eededdade956e057d099bea20b769d25374d89c5 (patch) | |
| tree | a6f294d0dcbfc00a8a146038dafe568c4f35f372 /llvm/lib/Target/Nios2/Nios2InstrInfo.cpp | |
| parent | 6db41e608f95bd405735b886b8246b1f566e38c6 (diff) | |
| download | bcm5719-llvm-eededdade956e057d099bea20b769d25374d89c5.tar.gz bcm5719-llvm-eededdade956e057d099bea20b769d25374d89c5.zip | |
[Nios2] Arithmetic instructions for R1 and R2 ISA.
Summary:
This commit enables some of the arithmetic instructions for Nios2 ISA (for both
R1 and R2 revisions), implements facilities required to emit those instructions
and provides LIT tests for added instructions.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D41236
Author: belickim <mateusz.belicki@intel.com>
llvm-svn: 322069
Diffstat (limited to 'llvm/lib/Target/Nios2/Nios2InstrInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/Nios2/Nios2InstrInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/Nios2/Nios2InstrInfo.cpp b/llvm/lib/Target/Nios2/Nios2InstrInfo.cpp index df435d2715d..9700cba3595 100644 --- a/llvm/lib/Target/Nios2/Nios2InstrInfo.cpp +++ b/llvm/lib/Target/Nios2/Nios2InstrInfo.cpp @@ -41,3 +41,14 @@ bool Nios2InstrInfo::expandPostRAPseudo(MachineInstr &MI) const { MBB.erase(MI); return true; } + +void Nios2InstrInfo::copyPhysReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, + const DebugLoc &DL, unsigned DestReg, + unsigned SrcReg, bool KillSrc) const { + unsigned opc = Subtarget.hasNios2r2() ? Nios2::ADD_R2 : Nios2::ADD_R1; + BuildMI(MBB, I, DL, get(opc)) + .addReg(DestReg, RegState::Define) + .addReg(Nios2::ZERO) + .addReg(SrcReg, getKillRegState(KillSrc)); +} |

