This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add bf16 to isFPImmLegal.
ClosedPublic

Authored by craig.topper on Aug 2 2023, 11:20 AM.

Details

Summary

Part of this test file was stolen from D156895. We should merge them
when committing.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 2 2023, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 11:20 AM
craig.topper requested review of this revision.Aug 2 2023, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 11:20 AM

Add test file

reames added inline comments.Aug 2 2023, 2:49 PM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
848

Don't you need handling for bf16 here?

craig.topper added inline comments.Aug 2 2023, 3:14 PM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
848

I think getLegalZfaFPImm should return -1 for bf16 since we don't have a bf16 FLI instruction.

asb accepted this revision.Aug 2 2023, 11:15 PM

LGTM. I incorporated the bfloat_zero and bfloat_negative_zero tests in the committed version of D156895.

This revision is now accepted and ready to land.Aug 2 2023, 11:15 PM
reames added a comment.Aug 3 2023, 7:23 AM

LGTM as well

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
848

Yep, I'd misread the code.

This revision was landed with ongoing or failed builds.Aug 3 2023, 8:30 AM
This revision was automatically updated to reflect the committed changes.