This is an archive of the discontinued LLVM Phabricator instance.

[mips] Add madd4 subtarget feature
ClosedPublic

Authored by smaksimovic on May 22 2017, 3:18 AM.

Details

Summary

Addition of a feature and a predicate used to control generation of madd.fmt and similar instructions.

Diff Detail

Event Timeline

smaksimovic created this revision.May 22 2017, 3:18 AM
sdardis requested changes to this revision.May 22 2017, 5:35 AM

Rather than enabling the usage of 4 operand multiply accumulate instructions, we want to presume they're available by default if the ISA supports them. So rather than "HasMadd4", the logic we want is "DisableMadd4" which by default is false.

This revision now requires changes to proceed.May 22 2017, 5:35 AM
smaksimovic edited edge metadata.

Changed the feature name to disable_madd4 and set it to false by default.
As a result, removed the -mattr=... options from the test file.

sdardis requested changes to this revision.May 30 2017, 5:14 AM

This requires a test. Can you bring back test/CodeGen/Mips/fmad1.ll and add some additional RUN lines where madd/msub/etc is disabled, and check that madd/msub/etc aren't generated?

lib/Target/Mips/Mips.td
188

This should be "nomadd4" rather than "disable_madd4".

189

"Disable 4-operand madd.fmt and related instructions".

This revision now requires changes to proceed.May 30 2017, 5:14 AM
smaksimovic edited edge metadata.

Addressed review comments.

smaksimovic marked 2 inline comments as done.May 30 2017, 6:56 AM
sdardis accepted this revision.May 30 2017, 8:48 AM

LGTM with a nit addressed.

test/CodeGen/Mips/fmadd1.ll
8–30 ↗(On Diff #100702)

Rather than reusing prefixes in a slightly unexpected way, rename the ones that don't have madd.fmt instructions to some like '$ORIGNALLABEL-NOMADD".

This revision is now accepted and ready to land.May 30 2017, 8:48 AM

Renamed prefixes.
Additionally, noticed that some of the MC tests were failing due to llvm-mc incorrectly interpreting the newly added feature. Changed AssemblerPredicate<"FeatureMadd4"> to AssemblerPredicate<"!FeatureMadd4"> to fix the issue.

This revision was automatically updated to reflect the committed changes.