This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Two or three initial observations on the fp prining patch
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Jerry Quinn <jlquinn at optonline dot net>
- Date: Tue, 18 Nov 2003 16:36:15 +0100
- Subject: Two or three initial observations on the fp prining patch
Hi,
finally I'm beginning to play a bit with the actual patch.
At build time I got a warning about the __mod parameter of _M_insert_float
being unused: Jerry, it looks like can be removed.
The first, good indeed!, numbers on my P4-2400 linux are the
following (always -O2)
For this testcase:
for (double i = 0.0; i < 3000000; i++)
std::cout << i << '\n';
2.96-99 RH
----------
4.050u 0.000s 0:04.07 99.5% 0+0k 0+0io 143pf+0w
3.4
---
7.760u 0.000s 0:07.80 99.4% 0+0k 0+0io 248pf+0w
3.4 + fp-patch
--------------
3.210u 0.000s 0:03.23 99.3% 0+0k 0+0io 204pf+0w
Overall, more than a 2x speedup, therefore, and /better/ than v2!
For this testcase, as expected, slightly worse numbers:
for (int i = 0; i < 3000000; i++) {
std::cout << std::setprecision(30)
<< (double)i +
9.09923452563465256292345256346525629234525634652562e+18 << '\n';
}
2.96-99 RH
----------
8.780u 0.030s 0:08.85 99.5% 0+0k 0+0io 143pf+0w
3.4
---
12.320u 0.030s 0:12.46 99.1% 0+0k 0+0io 248pf+0w
3.4 + fp-patch
--------------
10.980u 0.020s 0:11.11 99.0% 0+0k 0+0io 204pf+0w
All in all, the results seem definitely worth the trouble, especially
considering that we can also remove the __convert_from_v mess...
The next step is dealing with the various configury bits:
* uint32_t and int32_t types
This seems easy: probably we can do something very similar to
the the LFS work: an autoconf test that checks for the presence
of the C99 types with a fall back to unsigned long and long.
* IEEE, IBM, or VAX
For this, one of the most difficult, we should probably start from
the macros present in v2 code and generalize it to the architectures
currently supported.
* big or little endian
This seems easy, in principle. Probably, instead of the awful test
present in v2 we can use FLOAT_WORDS_BIG_ENDIAN, as suggested by
Jerry
* Check_FLT_ROUNDS - i'm not sure what this really does
This seems minor, already more or less ok.
More about all those things in the next days...
Paolo.