This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Don't parse the decimal minimum value for fli.s/fli.d/fli.h.
ClosedPublic

Authored by craig.topper on Mar 7 2023, 8:54 PM.

Details

Summary

There are a couple bugs in the current support for this:
-We do all the parsing in single precision so any value less than or
equal to the minimum fp32 is accepted as the minimum value for f64.
-To support fp16 minimum value, getLoadFP32Imm has a special case, but
that causes a miscompile in CodeGen.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 7 2023, 8:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 8:54 PM
craig.topper requested review of this revision.Mar 7 2023, 8:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 8:54 PM
asb accepted this revision.Mar 8 2023, 2:19 AM

LGTM.

This revision is now accepted and ready to land.Mar 8 2023, 2:19 AM
This revision was landed with ongoing or failed builds.Mar 8 2023, 9:25 AM
This revision was automatically updated to reflect the committed changes.
joshua-arch1 added a comment.EditedMar 14 2023, 7:45 PM

@craig.topper Since we parse the instructions using double precision and use separate lookup tables for fli.h/fli.d now, I think there are no reason not to parse minimum values for FLI.

@craig.topper Since we parse the instructions using double precision and use separate lookup tables for fli.h/fli.d now, I think there are no reason not to parse minimum v

@craig.topper Since we parse the instructions using double precision and use separate lookup tables for fli.h/fli.d now, I think there are no reason not to parse minimum values for FLI.

The min value for double is very long. I don’t think anyone would use it. I think we should ask on the riscv-isa-manual GitHub before supporting it.

@craig.topper Since we parse the instructions using double precision and use separate lookup tables for fli.h/fli.d now, I think there are no reason not to parse minimum v

@craig.topper Since we parse the instructions using double precision and use separate lookup tables for fli.h/fli.d now, I think there are no reason not to parse minimum values for FLI.

The min value for double is very long. I don’t think anyone would use it. I think we should ask on the riscv-isa-manual GitHub before supporting it.

I think we can at least test min value for half. Also, the min value for double is 2^(-1022) which is a certain number. There will be some circumstances where someone will use its specific value.