I can't find any reason why we can't just use the SMIN/SMAX/UMIN/UMAX opcodes instead of the MipsISD versions.
Not sure what to do for the max_a/min_a instructions?
Found while investigating D43338
PS - the LLVM project needs more Simons.
Paths
| Differential D43433
[MIPS][MSA] Convert vector integer min/max opcodes to generic implementation ClosedPublic Authored by RKSimon on Feb 17 2018, 10:53 AM.
Details Summary I can't find any reason why we can't just use the SMIN/SMAX/UMIN/UMAX opcodes instead of the MipsISD versions. Not sure what to do for the max_a/min_a instructions? Found while investigating D43338 PS - the LLVM project needs more Simons.
Diff Detail
Event TimelineComment Actions LGTM. Thanks for the clean-up. I've encountered a similar issue this week when following up an internal bug report/todo. Some code archaeology shows that portions of the MIPS MSA support in LLVM use MipsISD opcodes which at the time did not have a corresponding target independent ISD opcode. Our target specific opcodes were added before the generic ISD opcodes were expanded to include SMAX & co. The min_a & co. instructions are more specific to match, which is beyond the scope of this change, so they can be ignored. Thanks again.
This revision is now accepted and ready to land.Feb 17 2018, 12:34 PM Closed by commit rL325447: [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation (authored by RKSimon). · Explain WhyFeb 17 2018, 1:31 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 134809 lib/Target/Mips/MipsISelLowering.h
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsMSAInstrInfo.td
lib/Target/Mips/MipsSEISelLowering.cpp
|
Nit: C++ operator precedence, == is higher than ||, so the brackets around the type comparison are strictly redundant, though they do help make the checks obvious. That's a tiny cleanup for the original code.