This is an archive of the discontinued LLVM Phabricator instance.

[mips][mips64r6] Replace m[tf]hi, m[tf]lo, mult, multu, dmult, dmultu, div, ddiv, divu, ddivu for MIPS32r6/MIPS64.
ClosedPublic

Authored by dsanders on May 23 2014, 6:10 AM.

Details

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.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 9755.May 23 2014, 6:10 AM
dsanders retitled this revision from to [mips][mips64r6] Replace m[tf]hi, m[tf]lo, mult, multu, dmult, dmultu, div, ddiv, divu, ddivu for MIPS32r6/MIPS64..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders updated this revision to Diff 9757.May 23 2014, 6:40 AM
  • Disable old mul instruction for MIPS32r6/MIPS64r6 and enable the commented out test.
  • Disable Pseudo(MULT|MULTu|MFHI|MFLO|MTHILO). They won't match anyway because the custom SelectionDAG node is not generated but it's best to be on the safe side.
dsanders updated this revision to Diff 10227.Jun 9 2014, 2:33 AM

Refresh patch and ping

dsanders updated this revision to Diff 10228.Jun 9 2014, 2:37 AM

_Correctly_, refresh the patch

vmedic added inline comments.Jun 11 2014, 2:39 AM
lib/Target/Mips/Mips64InstrInfo.td
203–209

The line exceeds 80 characters limit.

dsanders added inline comments.Jun 11 2014, 3:04 AM
lib/Target/Mips/Mips64InstrInfo.td
203–209

Ok, I'll fix that. Does the patch look good to you apart from that?

jkolek accepted this revision.Jun 12 2014, 2:24 AM
jkolek edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jun 12 2014, 2:24 AM
dsanders closed this revision.Jun 12 2014, 3:52 AM

Committed with the long lines fixed in rL210760