Thanks for the comments! I've added tests, including checking correct
behavior
on some values from the range ]-1, -0].
The use-case for V8 is to use frintp to implement Math.ceil in turbofan,
which
currently uses a runtime call to implement Math.ceil. I hope to upload the
corresponding CL later this week. I'd like to add you as a reviewer for the
ARM64 parts, if that's ok.
https://codereview.chromium.org/669923002/diff/1/src/arm64/simulator-arm64.cc
File src/arm64/simulator-arm64.cc (right):
https://codereview.chromium.org/669923002/diff/1/src/arm64/simulator-arm64.cc#newcode2777
src/arm64/simulator-arm64.cc:2777: int_result = ceil(value);
On 2014/10/22 06:34:40, Sven Panne wrote:
On 2014/10/21 19:22:00, Rodolph Perfetta (ARM) wrote:
> Is ceil of a value in the range ]-1, -0] guaranteed to return -0 on
all
> supported platform?
According to
http://stackoverflow.com/questions/5986875/c-ceil-and-negative-zero
it should, but I fail to find the quoted part of the C standard in my
local
copy. :-/
F.9.6.1 of the standard defines ceil(). Annex F begins with stating that
"An implementation that defines __STDC_IEC_559__ shall conform to the
specifications in this annex. Where a binding between the C language and
IEC 60559 is indicated, the IEC 60559-specified behavior is adopted by
reference, unless stated otherwise."
I interpret this to mean: Every implementation defining __STDC_IEC_559__
implements IEEE behavior for ceil.
As Sven pointed out in personal discussion, if ceil would not conform to
IEEE, then we'd have problem in the implementation of DoubleToInteger in
conversions-inl.h:78, where we assume IEEE behavior.
https://codereview.chromium.org/669923002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.