[mips] MUL macro variations
Adds support for MUL macro variations.
Patch by: Srdjan Obucina
Paths
| Differential D16807
[mips] MUL macro variations ClosedPublic Authored by sdardis on Feb 2 2016, 8:28 AM.
Details Summary [mips] MUL macro variations Adds support for MUL macro variations. Patch by: Srdjan Obucina
Diff Detail Event Timelineobucina updated this object. Comment Actions In original test example there is one more instruction dmul $4, $5, $6 However, there is a DMUL instruction in TD files, available only for Cavium Octeon, with predicate [HasCnMips], so I am getting "error: instruction requires a CPU feature not currently enabled" when I try to process this instruction. I need advice on how to handle this situation. One solution is to define new DMUL pseudo instruction for everything but CnMips. Existing DMUL appears as a processor specific instruction, and not a general one, so I am wondering about naming conventions, should I leave existing DMUL as is, or rename it to reflect its nature. dsanders edited edge metadata. Comment Actions
Yes, adding a MipsAsmPseudoInst for the non-cnMIPS macro is the right way to go about it. For the naming convention, instructions use the mnemonic as far as possible. A few instructions have conflicting definitions for the same mnemonic so these have a disambiguating suffix like '_R6', '_MM', or '_64'. For assembly macros, we've been moving towards using the mnemonic with a 'Macro' suffix (e.g. DMULMacro).
This revision now requires changes to proceed.Feb 3 2016, 6:48 AM obucina edited edge metadata. obucina marked 8 inline comments as done. Comment ActionsChanges according to the comments obucina edited edge metadata. Comment ActionsOld file accidentally left in the patch - removed. DMUL for non CnMips still missing. Comment Actions Added DMUL macro for non CnMips. Please, take a look at the predicates of DMULMacro, and confirm are they OK. dsanders edited edge metadata. Comment Actions
Those predicates look ok to me. As future work, I think we might want to consider splitting InsnPredicates into a list of positive predicates and a list of negative predicates. Then we could use something like:
This revision now requires changes to proceed.Mar 11 2016, 5:45 AM obucina edited edge metadata. obucina marked 5 inline comments as done. Comment ActionsAccording to feedback - using ternary operators. obucina added inline comments.
Comment Actions This review seems to have aged out and needs the last comments addressed and a refresh to latest trunk. This revision now requires changes to proceed.Sep 26 2016, 6:51 AM sdardis edited edge metadata. sdardis marked 2 inline comments as done. Comment ActionsUpdated to trunk, addressed outstanding comment on directly specified branch operands vs. usage of label operands and labels. Comment Actions
That must be a new requirement of phabricator. Marked as approved to let it change the overall state. This revision is now accepted and ready to land.Feb 6 2017, 9:12 AM Closed by commit rL294471: [mips] MUL macro variations (authored by sdardis). · Explain WhyFeb 8 2017, 8:36 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 47324 lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/AsmParser/MipsAsmParser.old.cpp
lib/Target/Mips/MipsInstrInfo.td
test/MC/Mips/mul-macro-variations.s
|
Use the ternary operator