[Bug rtl-optimization/82153] missed optimization: double rounding

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Fri Sep 8 23:08:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82153

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Fri, 8 Sep 2017, arjan at linux dot intel.com wrote:

> When a conversion is inexact, a truncated result is returned. If a converted
> result is larger than the maximum signed doubleword integer, the floating-point
> invalid exception is raised, and if this exception is masked, the indefinite
> integer value (80000000H) is returned.

What manual is that from?

I'm looking at the "Intel® 64 and IA-32 Architectures Software Developer’s 
Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D and 4" (Order 
Number: 325462-063US, July 2017).  Which clearly has problems here because 
it has the "When a conversion is inexact, the value returned is rounded 
according to the rounding control bits in the MXCSR register." text for 
CVTTSD2SI (page 848 of the PDF) despite the description as "Convert with 
Truncation Scalar Double-Precision Floating-Point Value to Signed 
Integer".  But under "SIMD Floating-Point Exceptions" it lists "Invalid, 
Precision".  And in my experiment, CVTTSD2SI does indeed generate 
"inexact" for a conversion from non-integer floating point to integer.


More information about the Gcc-bugs mailing list