This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix operand order in fixed-length VM(OR|AND)NOT patterns
ClosedPublic

Authored by frasercrmck on May 17 2021, 3:32 AM.

Details

Summary

Where the RVV specification writes vs2, vs1, our TableGen patterns use
rs1, rs2. These differences can easily cause confusion. The VMANDNOT
instruction performs LHS && !RHS, and similarly for VMORNOT.

Diff Detail

Event Timeline

frasercrmck created this revision.May 17 2021, 3:32 AM
frasercrmck requested review of this revision.May 17 2021, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2021, 3:32 AM

Should we try and get this into the 12.0.1 release?

craig.topper accepted this revision.May 17 2021, 11:19 AM

LGTM. Let's try to get it into the 12.0.1 release.

This revision is now accepted and ready to land.May 17 2021, 11:19 AM

Does the vs2, vs1 operand order in the spec make sense? Would vs1, vs2 not be more natural?

This revision was landed with ongoing or failed builds.May 18 2021, 1:29 AM
This revision was automatically updated to reflect the committed changes.

LGTM. Let's try to get it into the 12.0.1 release.

My bad, it seems that the 12 release doesn't have the fixed-length RVV support. Time flies.

Does the vs2, vs1 operand order in the spec make sense? Would vs1, vs2 not be more natural?

To me, vs1,vs2 would certainly be more natural and it is indeed vs1,vs2 in a select few operations. To be honest, I can't think of a way that it has to be the way it is. Perhaps it's more consistent and requires fewer unique operand names across the full instruction set.