[Libre-soc-isa] [Bug 650] write rfc for OpenPower fpr <-> gpr moves/conversions

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jun 4 03:47:17 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=650

--- Comment #26 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #23)
> (In reply to Jacob Lifshay from comment #19)
> > note, for FP -> Int, IEEE 754 only specifies the result for finite inputs
> > that round to an integer in-range for the result integer type. The results
> > for NaN/Infinite/out-of-range inputs is unspecified.
> > 
> > C/C++ specifies NaN/Infinite/out-of-range FP -> Int is Undefined Behavior
> 
> which is as it should be.  it means, "don't do it! and if you do, you get to
> sort it out".

nah, more like the compiler assumes that out-of-range fp -> int conversions
will never occur. if they do occur, the compiler has license to format your
hard drive or publish your ssh private keys or (more likely) delete that entire
branch of your program.

> i.e. c/c++ matches IEEE754.
C/C++ explicitly says it's Undefined Behavior (which has a specific meaning).
IEEE 754 just doesn't say.

> makes flags / exceptions for
> detecting when that happens pretty important though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libre-SOC-ISA mailing list