Hi Lukas,

First of all, @all: <http://wiki.php.net/rfc/rounding> - I didn't have
time to update it yet but the basically nothing has changed except for
implementation details wrt. FPU precision. For FPU precision
explanations see (*).

> Anyways, a few items from the top of my head that I know people were
> talking about:
> - rounding patch

I've split the patch in two parts:

(1) Make the Zend Engine always use double FPU precision on x87
platforms (creates zend_float.h, defines certain macros, uses those
macros in zend_strtod.c and zend_operators.c), include the correct
configure checks that detect the switching method. zend_float.h is
basically a copy of my xpfpa.h from (*) where I put in the research on
the behaviour of different platforms and compiler versions.

(2) Modify round() behaviour as described in the RFC (that also uses the
x87 FPU precision switch). The second part will only compile if the
first part was applied.

It is basically the same patch as I have already posted to this list -
just with a few cleanups. Here are the basic changes to the previous
patch versions:

a) Added Zend/tests/fpu_prec_001.phpt which tests for double precision.
With single, double-extended or quad precision, it will fail.
b) @Macrus: I've thought about your points wrt. cross-compilation and
I am now certain that if the configure test scripts compile & link,
the code will also work - so there is no need to execute it. I've
thus changed AC_TRY_RUN to AC_LINK_IFELSE.
c) Added
ext/standard/tests/math/round_{prerounding,large_exp,modes}.phpt
which check for the new behaviour of round().
d) Some minor cleanups to the FPU macros and configure checks.

Anyway, here are the patches, please remember that 1+3 test files are
added with the patches:

PHP 5.3, ZE2 FPU precision:
http://www.christian-seiler.de/temp/php/2008-11-28-fpu+rounding/php53-fpu.patch

PHP 5.3, round() behaviour:
http://www.christian-seiler.de/temp/php/2008-11-28-fpu+rounding/php53-round.patch

PHP 6, ZE2 FPU precision:
http://www.christian-seiler.de/temp/php/2008-11-28-fpu+rounding/php6-fpu.patch

PHP 6, round() behaviour:
http://www.christian-seiler.de/temp/php/2008-11-28-fpu+rounding/php6-round.patch

(*) <http://www.christian-seiler.de/projekte/fpmath/>

Regards,
Christian


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to