|
Boost : |
From: Boris Gubenko (Boris.Gubenko_at_[hidden])
Date: 2006-12-08 20:05:30
Johan Rede wrote:
> I don't think it is worth the trouble.
I agree.
If you don't support VAX FP mode, then 64-bit long double is
"automatically" supported and there is no need to check __X_FLOAT
macro.
To verify it, I ran the test and the inspect tool on AlphaVMS and
Tru64 with 64-bit long double and, as far as I can see, the
results are correct.
Attached results in the following order:
AlphaVMS
test
full IEEE support
fast IEEE mode
inspect
full IEEE support
fast IEEE mode
Tru64
full IEEE support
test
inspect
fast IEEE mode
test
inspect
AlphaVMS
========
CXXC::_3> @build test
HP C++ V7.1-018 for OpenVMS Alpha V7.3-2
AlphaServer 4100 5/533 4MB
*** full IEEE support, 64-bit long double
fp_traits<float>::type is specialized
fp_traits<double>::type is generic
fp_traits<long double>::type is generic
sizeof(long double) = 8
Testing float
Testing double
Testing long double
*** fast IEEE mode, 64-bit long double
fp_traits<float>::type is specialized
fp_traits<double>::type is generic
fp_traits<long double>::type is generic
sizeof(long double) = 8
Testing float
Testing double
Testing long double
CXXC::_3>
CXXC::_3> @build inspect
HP C++ V7.1-018 for OpenVMS Alpha V7.3-2
AlphaServer 4100 5/533 4MB
*** full IEEE support, 64-bit long double
This platform is little-endian.
BOOST_LITTTLE_ENDIAN is defined.
---------- float --------------------
0 00 00 00 00
sn.min 00 00 00 01
-sn.min 80 00 00 01
n.min/256 00 00 80 00
n.min/2 00 40 00 00
-n.min/2 80 40 00 00
n.min 00 80 00 00
1 3f 80 00 00
3/2 3f c0 00 00
4/3 3f aa aa ab
max 7f 7f ff ff
inf 7f 80 00 00
q.nan ff c0 00 00
s.nan 7f 85 55 55
---------- double -------------------
0 00 00 00 00 00 00 00 00
sn.min 00 00 00 00 00 00 00 01
-sn.min 80 00 00 00 00 00 00 01
n.min/256 00 00 10 00 00 00 00 00
n.min/2 00 08 00 00 00 00 00 00
-n.min/2 80 08 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf 7f f0 00 00 00 00 00 00
q.nan ff f8 00 00 00 00 00 00
s.nan 7f f5 55 55 55 55 55 55
---------- long double --------------
0 00 00 00 00 00 00 00 00
sn.min 00 00 00 00 00 00 00 01
-sn.min 80 00 00 00 00 00 00 01
n.min/256 00 00 10 00 00 00 00 00
n.min/2 00 08 00 00 00 00 00 00
-n.min/2 80 08 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf 7f f0 00 00 00 00 00 00
q.nan ff f8 00 00 00 00 00 00
s.nan 7f f5 55 55 55 55 55 55
*** fast IEEE mode, 64-bit long double
This platform is little-endian.
BOOST_LITTTLE_ENDIAN is defined.
---------- float --------------------
0 00 00 00 00
sn.min -- -- -- --
-sn.min -- -- -- --
n.min/256 00 00 00 00
n.min/2 00 00 00 00
-n.min/2 00 00 00 00
n.min 00 80 00 00
1 3f 80 00 00
3/2 3f c0 00 00
4/3 3f aa aa ab
max 7f 7f ff ff
inf -- -- -- --
q.nan -- -- -- --
s.nan -- -- -- --
---------- double -------------------
0 00 00 00 00 00 00 00 00
sn.min -- -- -- -- -- -- -- --
-sn.min -- -- -- -- -- -- -- --
n.min/256 00 00 00 00 00 00 00 00
n.min/2 00 00 00 00 00 00 00 00
-n.min/2 00 00 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf -- -- -- -- -- -- -- --
q.nan -- -- -- -- -- -- -- --
s.nan -- -- -- -- -- -- -- --
---------- long double --------------
0 00 00 00 00 00 00 00 00
sn.min -- -- -- -- -- -- -- --
-sn.min -- -- -- -- -- -- -- --
n.min/256 00 00 00 00 00 00 00 00
n.min/2 00 00 00 00 00 00 00 00
-n.min/2 00 00 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf -- -- -- -- -- -- -- --
q.nan -- -- -- -- -- -- -- --
s.nan -- -- -- -- -- -- -- --
CXXC::_3>
Tru64
=====
cxxosf.zko.hp.com> cxx -V
Compaq C++ V7.1-006 for Compaq Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V7.1-006 (cxx) cxx Driver
cxxosf.zko.hp.com> /usr/sbin/sizer -c
cpu "DEC4100"
cxxosf.zko.hp.com>
With -ieee
----------
cxxosf.zko.hp.com> test.out
fp_traits<float>::type is specialized
fp_traits<double>::type is specialized
fp_traits<long double>::type is specialized
sizeof(long double) = 8
Testing float
Testing double
Testing long double
cxxosf.zko.hp.com>
cxxosf.zko.hp.com> inspect.out
This platform is little-endian.
BOOST_LITTTLE_ENDIAN is defined.
---------- float --------------------
0 00 00 00 00
sn.min 00 00 00 01
-sn.min 80 00 00 01
n.min/256 00 00 80 00
n.min/2 00 40 00 00
-n.min/2 80 40 00 00
n.min 00 80 00 00
1 3f 80 00 00
3/2 3f c0 00 00
4/3 3f aa aa ab
max 7f 7f ff ff
inf 7f 80 00 00
q.nan ff c0 00 00
s.nan 7f 85 55 55
---------- double -------------------
0 00 00 00 00 00 00 00 00
sn.min 00 00 00 00 00 00 00 01
-sn.min 80 00 00 00 00 00 00 01
n.min/256 00 00 10 00 00 00 00 00
n.min/2 00 08 00 00 00 00 00 00
-n.min/2 80 08 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf 7f f0 00 00 00 00 00 00
q.nan ff f8 00 00 00 00 00 00
s.nan 7f f5 55 55 55 55 55 55
---------- long double --------------
0 00 00 00 00 00 00 00 00
sn.min 00 00 00 00 00 00 00 01
-sn.min 80 00 00 00 00 00 00 01
n.min/256 00 00 10 00 00 00 00 00
n.min/2 00 08 00 00 00 00 00 00
-n.min/2 80 08 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf 7f f0 00 00 00 00 00 00
q.nan ff f8 00 00 00 00 00 00
s.nan 7f f5 55 55 55 55 55 55
cxxosf.zko.hp.com>
Without -ieee
-------------
cxxosf.zko.hp.com> test.out
fp_traits<float>::type is specialized
fp_traits<double>::type is specialized
fp_traits<long double>::type is specialized
sizeof(long double) = 8
Testing float
Testing double
Testing long double
cxxosf.zko.hp.com>
cxxosf.zko.hp.com> inspect.out
This platform is little-endian.
BOOST_LITTTLE_ENDIAN is defined.
---------- float --------------------
0 00 00 00 00
sn.min -- -- -- --
-sn.min -- -- -- --
n.min/256 00 00 00 00
n.min/2 00 00 00 00
-n.min/2 00 00 00 00
n.min 00 80 00 00
1 3f 80 00 00
3/2 3f c0 00 00
4/3 3f aa aa ab
max 7f 7f ff ff
inf -- -- -- --
q.nan -- -- -- --
s.nan -- -- -- --
---------- double -------------------
0 00 00 00 00 00 00 00 00
sn.min -- -- -- -- -- -- -- --
-sn.min -- -- -- -- -- -- -- --
n.min/256 00 00 00 00 00 00 00 00
n.min/2 00 00 00 00 00 00 00 00
-n.min/2 00 00 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf -- -- -- -- -- -- -- --
q.nan -- -- -- -- -- -- -- --
s.nan -- -- -- -- -- -- -- --
---------- long double --------------
0 00 00 00 00 00 00 00 00
sn.min -- -- -- -- -- -- -- --
-sn.min -- -- -- -- -- -- -- --
n.min/256 00 00 00 00 00 00 00 00
n.min/2 00 00 00 00 00 00 00 00
-n.min/2 00 00 00 00 00 00 00 00
n.min 00 10 00 00 00 00 00 00
1 3f f0 00 00 00 00 00 00
3/2 3f f8 00 00 00 00 00 00
4/3 3f f5 55 55 55 55 55 55
max 7f ef ff ff ff ff ff ff
inf -- -- -- -- -- -- -- --
q.nan -- -- -- -- -- -- -- --
s.nan -- -- -- -- -- -- -- --
cxxosf.zko.hp.com>
----- Original Message -----
From: "Johan Råde" <rade_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, December 08, 2006 4:37 PM
Subject: Re: [boost] Optimized portable isnan, isfinite, fpclassify etc
I have had second thoughts about this matter,
and I have decided not to support the non-ieee mode.
Instead I will do a compile time assert.
The problem is that in the non-ieee mode,
float and double use a VAX FP format without denormals,
while long double uses an IEEE extended double precision format with
denormals.
Dealing with this is not that difficult,
but it would make the code more complex,
and you are encouraging your customers to use the ieee mode anyway.
I don't think it is worth the trouble.
--Johan
Boris Gubenko wrote:
> Johan,
>
>> Could you test it in VAX FP mode?
>
> will do later today.
>
> -boris
>
> ----- Original Message -----
> From: "Johan Råde" <rade_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Friday, December 08, 2006 3:11 PM
> Subject: Re: [boost] Optimized portable isnan, isfinite, fpclassify etc
>
>
>> Boris,
>>
>> I have uploaded an experimental version called fpclassify_non_ieee.zip.
>>
>> Could you test it in VAX FP mode?
>>
>> --Johan
>>
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>
>>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk