[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 04:29:04 BST 2021


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

--- Comment #28 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Jacob Lifshay from comment #26)
> (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.

A contrived example of how UB from out-of-range fp -> int makes it format your
hard drive

https://gcc.godbolt.org/z/eM1s78vTG

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


More information about the Libre-SOC-ISA mailing list