1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* util.c (ruby_hdtoa): revert r29729.

If you want ruby to behave as before on x86, specify to use SSE like
  -msse2 -mfpmath=sse for gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-04-22 02:59:09 +00:00
parent e9679c9ad4
commit f544ca4e4e
2 changed files with 8 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Mon Apr 22 10:25:21 2013 NARUSE, Yui <naruse@ruby-lang.org>
* util.c (ruby_hdtoa): revert r29729.
If you want ruby to behave as before on x86, specify to use SSE like
-msse2 -mfpmath=sse for gcc.
Sun Apr 21 23:19:00 2013 Charlie Somerville <charlie@charliesomerville.com>
* configure.in: Revert using sigsetjmp by default due to performance

7
util.c
View file

@ -3878,13 +3878,10 @@ ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign,
/* Round to the desired number of digits. */
if (SIGFIGS > ndigits && ndigits > 0) {
float redux = 1.0f;
volatile double d;
int offset = 4 * ndigits + DBL_MAX_EXP - 4 - DBL_MANT_DIG;
dexp_set(u, offset);
d = u.d;
d += redux;
d -= redux;
u.d = d;
u.d += redux;
u.d -= redux;
*decpt += dexp_get(u) - offset;
}