[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)
commit38b2a0bfdde226ecfd5440399998e2c3443e57d4
tree0f0f2bf1c00893a7c432ae44759dff037c3dfaff
parente0bf9d21b0bb07ba61f5ba5cbbb91bcc8fbfba35
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210760 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
lib/Target/Mips/Mips32r6InstrInfo.td
lib/Target/Mips/Mips64InstrInfo.td
lib/Target/Mips/Mips64r6InstrInfo.td
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsSEISelLowering.cpp
test/CodeGen/Mips/divrem.ll
test/CodeGen/Mips/mips64muldiv.ll
test/MC/Mips/mips32r6/invalid-mips1.s
test/MC/Mips/mips32r6/invalid-mips2.s
test/MC/Mips/mips32r6/valid.s
test/MC/Mips/mips64r6/invalid-mips1.s
test/MC/Mips/mips64r6/invalid-mips2.s
test/MC/Mips/mips64r6/invalid-mips3.s
test/MC/Mips/mips64r6/valid.s