This is an archive of the discontinued LLVM Phabricator instance.

[FPEnv] Partially implement #pragma STDC FENV_ROUND
ClosedPublic

Authored by sepavloff on Sep 1 2020, 2:50 AM.

Details

Summary

This change implements pragma STDC FENV_ROUND, which is introduced by
the extension to standard (TS 18661-1). The pragma is implemented only
in frontend, it sets apprpriate state of FPOptions stored in Sema. Use
of these bits in constant evaluation adn/or code generator is not in the
scope of this change.

Parser issues warning on unsuppored pragma when it encounteres pragma
STDC FENV_ROUND, however it makes syntax checks and updates Sema state
as if the pragma were supported.

Primary purpose of the partial implementation is to facilitate
development of non-default floating poin environment. Previously a
developer cannot set non-default rounding mode in sources, this mades
preparing tests for say constant evaluation substantially complicated.

Diff Detail

Event Timeline

sepavloff created this revision.Sep 1 2020, 2:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2020, 2:50 AM
Herald added a subscriber: dexonsmith. · View Herald Transcript
sepavloff requested review of this revision.Sep 1 2020, 2:50 AM
This revision is now accepted and ready to land.Sep 3 2020, 10:26 PM
This revision was automatically updated to reflect the committed changes.