This is an archive of the discontinued LLVM Phabricator instance.

[flang] Normalize logical values during type conversions.
ClosedPublic

Authored by vzakhari on Mar 27 2023, 7:53 PM.

Details

Summary

Flang was missing value normalization for logical<->integer conversions
which is required by Flang specification. The shrinking logical<->logical
conversions were also incorrectly truncating the input.
This change performs value normalization for all logical<->integer
conversions and logical<->logical conversions between different kinds.

Note that value normalization is not strictly required for
logical(kind=k1)->logical(kind=k2) conversions when k1 < k2.

Diff Detail

Event Timeline

vzakhari created this revision.Mar 27 2023, 7:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2023, 7:54 PM
vzakhari requested review of this revision.Mar 27 2023, 7:54 PM
jeanPerier accepted this revision.Mar 28 2023, 12:20 AM

Looks great, thanks

This revision is now accepted and ready to land.Mar 28 2023, 12:20 AM
PeteSteinfeld accepted this revision.Mar 28 2023, 8:14 AM

All builds and tests correctly and looks good.