Page MenuHomePhabricator

[RISCV] Replace most uses of RISCVSubtarget::hasStdExtV. NFCI
ClosedPublic

Authored by craig.topper on Oct 25 2021, 3:22 PM.

Details

Summary

Add new hasVInstructions() which is currently equivalent.

Replace vector uses of hasStdExtZfh/F/D with new vector specific
versions. The vector spec no longer requires that the vectors implement the
same types as scalar. It only requires that the scalar type is
the maximum size the vectors can support. This is currently
implemented using the scalar rule we were using before.

Add new hasVInstructionsI64() begin using to qualify code that
requires i64 vector elements.

This is all NFC for now, but we can start using this to better
implement D112408 which introduces the Zve extensions.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 25 2021, 3:22 PM
craig.topper requested review of this revision.Oct 25 2021, 3:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2021, 3:22 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

Thanks, I think this is the sensible thing to do.

llvm/lib/Target/RISCV/RISCV.td
153

I was wondering if some uses of this are better expressed as HasVInstructionsAnyF or something, such as when defining the instructions themselves. It's not a big deal if everyone knows that having Zfh/D implies having F but I just think that there may be two subtly-different meanings of this predicate which could make maintenance more difficult.

Rename predicate to HasVInstructionsAnyF

eopXD accepted this revision.Oct 27 2021, 11:05 AM

LGTM, thank you for the patch.

This revision is now accepted and ready to land.Oct 27 2021, 11:05 AM
frasercrmck accepted this revision.Oct 27 2021, 1:33 PM

LGTM too, cheers.

This revision was landed with ongoing or failed builds.Oct 27 2021, 7:34 PM
This revision was automatically updated to reflect the committed changes.