[mips][mips64r6] Replace m[tf]hi, m[tf]lo, mult, multu, dmult, dmultu, div, ddiv...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 12 Jun 2014 10:44:10 +0000 (10:44 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 12 Jun 2014 10:44:10 +0000 (10:44 +0000)
commit308181eaa00c3eb20ca56c8235b438529d62d817
tree5460884d6aaef9c2f28995e4a067293d94a0352a
parentf77acce0594a052ab69518294dea552ed0150f1d
[mips][mips64r6] Replace m[tf]hi, m[tf]lo, mult, multu, dmult, dmultu, div, ddiv, divu, ddivu for MIPS32r6/MIPS64.

Summary:
The accumulator-based (HI/LO) multiplies and divides from earlier ISA's have
been removed and replaced with GPR-based equivalents. For example:
  div $1, $2
  mflo $3
is now:
  div $3, $1, $2

This patch disables the accumulator-based multiplies and divides for
MIPS32r6/MIPS64r6 and uses the GPR-based equivalents instead.

Renamed expandPseudoDiv to insertDivByZeroTrap to better describe the
behaviour of the function.

MipsDelaySlotFiller now invalidates the liveness information when moving
instructions to the delay slot. Without this, divrem.ll will abort since
%GP ends up used before it is defined.

Reviewers: vmedic, zoran.jovanovic, jkolek

Reviewed By: jkolek

Differential Revision: http://reviews.llvm.org/D3896

llvm-svn: 210760
16 files changed:
llvm/lib/Target/Mips/Mips32r6InstrInfo.td
llvm/lib/Target/Mips/Mips64InstrInfo.td
llvm/lib/Target/Mips/Mips64r6InstrInfo.td
llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
llvm/lib/Target/Mips/MipsISelLowering.cpp
llvm/lib/Target/Mips/MipsInstrInfo.td
llvm/lib/Target/Mips/MipsSEISelLowering.cpp
llvm/test/CodeGen/Mips/divrem.ll
llvm/test/CodeGen/Mips/mips64muldiv.ll
llvm/test/MC/Mips/mips32r6/invalid-mips1.s
llvm/test/MC/Mips/mips32r6/invalid-mips2.s
llvm/test/MC/Mips/mips32r6/valid.s
llvm/test/MC/Mips/mips64r6/invalid-mips1.s
llvm/test/MC/Mips/mips64r6/invalid-mips2.s
llvm/test/MC/Mips/mips64r6/invalid-mips3.s
llvm/test/MC/Mips/mips64r6/valid.s