This is an archive of the discontinued LLVM Phabricator instance.

LangRef: Clarify semantics of lround/llround and lrint/llrint
ClosedPublic

Authored by arsenm on Dec 5 2022, 10:57 AM.

Details

Diff Detail

Event Timeline

arsenm created this revision.Dec 5 2022, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 10:57 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
arsenm requested review of this revision.Dec 5 2022, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 10:57 AM
Herald added a subscriber: wdng. · View Herald Transcript

Thanks.
unspecified is not a term used in LLVM IR semantics. I would write, for example, "a non-deterministic value (equivalent to freeze poison)".

arsenm updated this revision to Diff 480171.Dec 5 2022, 11:15 AM

Rephrase

nlopes accepted this revision.Dec 5 2022, 11:49 AM

LGTM

This revision is now accepted and ready to land.Dec 5 2022, 11:49 AM

The clarification looks good to me as well, thanks.
Since LLVM IR does not have a notion of unspecified value (AFAIK), defining these as returning a nondeterministic, well-defined value seems like a right choice because it satisfies refinement.
Making them return an undefined value or poison value breaks refinement.

aqjune accepted this revision.Dec 5 2022, 11:53 AM