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

--- Comment #2 from Xan Lopez <xan at igalia dot com> ---
(In reply to Jakub Jelinek from comment #1)
> This is just incorrect expectations.
> "The signbit macro returns a nonzero value if and only if the sign of its
> argument value is negative."
> says the standard and gcc implements that exactly like that.
> In i387 math, it just returns 0x200 instead of 1 you are expecting to see.
> And, as on Unix the exit codes are just 0 to 255, (unsigned char) 0x200 is 0.
> Perhaps you mean to return signbit (...) != 0 or return !!signbit (...)?

Hi Jakub,

perhaps the reduction is not perfectly clear, my bad. The actual problem we are
seeing (or we think we are seeing) is that the result of ceil() is not the same
for the same code in 32bit ad 64bit builds. In particular for an input of -0.9
we see -0 for 64bit, and +0 for 32bit (which, I believe, is incorrect). So even
without using signbit or unix exit codes the value we are getting from ceil
seems to be wrong.

(This was found in a JavaScriptCore test, which was compiled with SSE2 (so no
x87 math) after this patch was applied:
https://bugs.webkit.org/show_bug.cgi?id=194853)

Reply via email to