This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add +experimental-zvfh extension to cover half types in vectors.
ClosedPublic

Authored by craig.topper on Mar 9 2022, 3:40 PM.

Details

Summary

Currently we allow half types in vectors if the scalar Zfh extension
is enabled. This behavior is not inline with the vector spec. For f32
and f64 types, the Zve32f, Zve64f, Zve64d, and V explicitly control
the availablity of floating point types in vectors.

In order to make our compiler compliant, we either need to remove all support
for half in vectors or we need an extension to control it.

Draft spec here https://github.com/riscv/riscv-v-spec/pull/780

Diff Detail

Event Timeline

craig.topper created this revision.Mar 9 2022, 3:40 PM
craig.topper requested review of this revision.Mar 9 2022, 3:40 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 9 2022, 3:41 PM
craig.topper edited the summary of this revision. (Show Details)Mar 11 2022, 10:42 AM
kito-cheng added inline comments.Mar 13 2022, 7:50 PM
llvm/lib/Support/RISCVISAInfo.cpp
727

Zvfh require Zfhmin rather than Zfh

Spec: The Zvfh extension additionally requires the Zfhmin extension.
https://github.com/riscv/riscv-v-spec/pull/780/files#diff-ea57dd7a8daf0aa62f553688c1970c8e6608945d25597f8661c5ea6670fb509cR5182

Check zfhmin or zhinxmin for the error message. Codegen still uses Zfh because no one has done codegen work for the other extensions.

LGTM. wait @kito-cheng to approve it.

This revision is now accepted and ready to land.Mar 17 2022, 12:14 AM
This revision was landed with ongoing or failed builds.Mar 17 2022, 10:08 AM
This revision was automatically updated to reflect the committed changes.