This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/59666] IBM long double arithmetic results invalid in non-default rounding modes


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

--- Comment #5 from Vincent LefÃvre <vincent-gcc at vinc17 dot net> ---
(In reply to joseph@codesourcery.com from comment #4)
> For a non-IEEE type where the accuracy is specified as within 3ulp 
> (depending on the operation in question), there is no definition of what 
> honouring the rounding mode means.  Such types fall within 5.2.4.2.2#6, 
> "The accuracy of the floating-point operations (+, -, *, /) ... is 
> implementation-defined ... The implementation may state that the accuracy 
> is unknown.".

But directed rounding mode requirements are different from just accuracy
requirements. For instance, with rounding toward negative infinity, one must
have ROUND(x) â x. This allows one to get guaranteed bounds and to do interval
arithmetic, which is here more important than accuracy. If the rounding
direction is not honored, one no longer gets guaranteed bounds/enclosures.

> Note the proposed TC for DR#441: "The value of FLT_ROUNDS applies to all 
> IEC 60559 types supported by the implementation, but need not apply to 
> non-IEC 60559 types.".

IMHO, this is a bad proposition. This would mean that a user who switches from
double to long double could get incorrect results (enclosures) as a
consequence.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]