This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fix multiprecision arithmetic.
ClosedPublic

Authored by sdardis on May 24 2017, 6:30 AM.

Details

Summary

For multiprecision arithmetic on MIPS, rather than using ISD::ADDE / ISD::ADDC,
get SelectionDAG to break down the operation into ISD::ADDs and ISD::SETCC. Also
improve the generation code in such cases for targets with
TargetLoweringBase::ZeroOrOneBooleanContent by directly using the result of the
comparison node rather than using it in selects. Similarly for ISD::SUBE /
ISD::SUBC.

For MIPS, only the DSP ASE has a carry flag, so in the general case it is not
useful to directly support ISD::{ADDE, ADDC, SUBE, SUBC} nodes.

Address optimization breakage by moving the generation of MIPS specific integer
multiply-accumulate nodes to before operation legalization.

This revolves PR32713.

Thanks to Simonas Kazlauskas for reporting the issue!

Event Timeline

sdardis created this revision.May 24 2017, 6:30 AM
This revision is now accepted and ready to land.Jun 12 2017, 4:08 AM
This revision was automatically updated to reflect the committed changes.