This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support Zfhmin extension
ClosedPublic

Authored by achieveartificialintelligence on Oct 14 2021, 11:35 PM.

Details

Summary

According to RISC-V Unprivileged ISA 15.6.

Diff Detail

Event Timeline

achieveartificialintelligence requested review of this revision.Oct 14 2021, 11:35 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 14 2021, 11:35 PM
asb added a comment.Oct 28 2021, 6:21 AM

From an initial look, I think this is almost ready to land - thank you.

One suggestion would be to review the various Subtarget.hasStdExtZfhmin() || Subtarget.hasStdExtZfh(). I'd first thought adding a new helper to RISCVSubtarget to be called instead, but actually it looks like a number of these could be replaced by just hasStdExtZfhmin due to Zfhmin implying Zfh.

llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
187

Unintended change?

achieveartificialintelligence marked an inline comment as done.Oct 28 2021, 8:19 AM
asb added inline comments.Nov 2 2021, 8:02 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1153–1154

This could equivalently just be if (VT == MVT::f16 && !Subtarget.hasStdExtZfhmin()), right?

1178

This could just be !Subtarget.hasStdExtZfhmin()?

1190

This could just be Subtarget.hasStdExtZfhmin()?

1397

This could just be !Subtarget.hasStdExtZfhmin()?

asb accepted this revision.Nov 5 2021, 4:21 AM

LGTM, modulo one tiny nit on a comment. Thanks!

llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
253

HasStdExtZfh=>HasStdExtZfhmin

This revision is now accepted and ready to land.Nov 5 2021, 4:21 AM
achieveartificialintelligence marked an inline comment as done.Nov 5 2021, 10:29 AM
This revision was landed with ongoing or failed builds.Nov 5 2021, 10:41 AM
This revision was automatically updated to reflect the committed changes.

LGTM, modulo one tiny nit on a comment. Thanks!

Thank you for your detailed suggestions!