Page MenuHomePhabricator

[LangRef] fptosi and fptoui return poison on overflow.
ClosedPublic

Authored by efriedma on Jun 6 2018, 4:16 PM.

Details

Summary

I think we assume poison, not undef, for certain transforms we currently do. In any case, we should clarify the language here.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Jun 6 2018, 4:16 PM
nlopes accepted this revision.Jun 7 2018, 6:10 AM

LGTM.

The C++ standard defines this as UB: http://eel.is/c++draft/conv.fpint#1
"A prvalue of a floating-point type can be converted to a prvalue of an integer type. The conversion truncates; that is, the fractional part is discarded.
The behavior is undefined if the truncated value cannot be represented in the destination type."

This revision is now accepted and ready to land.Jun 7 2018, 6:10 AM
This revision was automatically updated to reflect the committed changes.