[svn-r8516] Purpose: Bug fix

Description:  A new bug is found on HP.  There is float exception during conversion from double to
unsigned long long when the value of double is very big.

Solution:  Try to catch the problem in configure and skip this part of test.

Platforms tested:  kelgia and verbena(mainly these two machines are involved)
This commit is contained in:
Raymond Lu 2004-05-13 16:16:44 -05:00
parent a4c58cf641
commit 7c354e2d8b
2 changed files with 40 additions and 28 deletions

34
configure vendored
View File

@ -33294,20 +33294,20 @@ else
int ret = 0;
if(sizeof(unsigned long)==8) {
l1 = 0xf000000000000b00; /*Round-down case*/
l2 = 0xf000000000000401; /*Round-up case*/
l3 = 0xf000000000000400; /*Round-down case*/
l4 = 0xf000000000000c00; /*Round-up case*/
l1 = 0xf000000000000b00UL; /*Round-down case*/
l2 = 0xf000000000000401UL; /*Round-up case*/
l3 = 0xf000000000000400UL; /*Round-down case*/
l4 = 0xf000000000000c00UL; /*Round-up case*/
d1 = (double)l1;
d2 = (double)l2;
d3 = (double)l3;
d4 = (double)l4;
} else if(sizeof(unsigned long long)==8) {
ld1 = 0xf000000000000b00; /*Round-down case*/
ld2 = 0xf000000000000401; /*Round-up case*/
ld3 = 0xf000000000000400; /*Round-down case*/
ld4 = 0xf000000000000c00; /*Round-up case*/
ld1 = 0xf000000000000b00ULL; /*Round-down case*/
ld2 = 0xf000000000000401ULL; /*Round-up case*/
ld3 = 0xf000000000000400ULL; /*Round-down case*/
ld4 = 0xf000000000000c00ULL; /*Round-up case*/
d1 = (double)ld1;
d2 = (double)ld2;
@ -33401,8 +33401,8 @@ else
int main(void)
{
float f = 111.60;
double d = 222.55;
float f = 111.60f;
double d = 222.55L;
unsigned long long l1 = (unsigned long long)f;
unsigned long long l2 = (unsigned long long)d;
int ret = 0;
@ -33472,13 +33472,19 @@ else
int main(void)
{
float f = 9701917572145405952.00f;
double d = 9701917572145405952.00;
double d1 = 9701917572145405952.00L;
double d2 = 2e40L;
unsigned long long l1 = (unsigned long long)f;
unsigned long long l2 = (unsigned long long)d;
unsigned long long l3 = 0x7fffffffffffffffLLU;
unsigned long long l2 = (unsigned long long)d1;
unsigned long long l3;
unsigned long long l4 = 0x7fffffffffffffffLLU;
int ret = 0;
if(l1 <= l3 || l2 <= l3)
if(l1 <= l4 || l2 <= l4)
ret = 1;
l3 = (unsigned long long)d2;
if(l3 <= l4)
ret = 1;
done:

View File

@ -2408,20 +2408,20 @@ if test ${host_os_novers} = "solaris2.x"; then
int ret = 0;
if(sizeof(unsigned long)==8) {
l1 = 0xf000000000000b00; /*Round-down case*/
l2 = 0xf000000000000401; /*Round-up case*/
l3 = 0xf000000000000400; /*Round-down case*/
l4 = 0xf000000000000c00; /*Round-up case*/
l1 = 0xf000000000000b00UL; /*Round-down case*/
l2 = 0xf000000000000401UL; /*Round-up case*/
l3 = 0xf000000000000400UL; /*Round-down case*/
l4 = 0xf000000000000c00UL; /*Round-up case*/
d1 = (double)l1;
d2 = (double)l2;
d3 = (double)l3;
d4 = (double)l4;
} else if(sizeof(unsigned long long)==8) {
ld1 = 0xf000000000000b00; /*Round-down case*/
ld2 = 0xf000000000000401; /*Round-up case*/
ld3 = 0xf000000000000400; /*Round-down case*/
ld4 = 0xf000000000000c00; /*Round-up case*/
ld1 = 0xf000000000000b00ULL; /*Round-down case*/
ld2 = 0xf000000000000401ULL; /*Round-up case*/
ld3 = 0xf000000000000400ULL; /*Round-down case*/
ld4 = 0xf000000000000c00ULL; /*Round-up case*/
d1 = (double)ld1;
d2 = (double)ld2;
@ -2477,8 +2477,8 @@ AC_CACHE_VAL([hdf5_cv_fp_to_ullong_bottom_bit_works],
[AC_TRY_RUN([
int main(void)
{
float f = 111.60;
double d = 222.55;
float f = 111.60f;
double d = 222.55L;
unsigned long long l1 = (unsigned long long)f;
unsigned long long l2 = (unsigned long long)d;
int ret = 0;
@ -2515,13 +2515,19 @@ AC_CACHE_VAL([hdf5_cv_fp_to_ullong_right_maximum],
int main(void)
{
float f = 9701917572145405952.00f;
double d = 9701917572145405952.00;
double d1 = 9701917572145405952.00L;
double d2 = 2e40L;
unsigned long long l1 = (unsigned long long)f;
unsigned long long l2 = (unsigned long long)d;
unsigned long long l3 = 0x7fffffffffffffffLLU;
unsigned long long l2 = (unsigned long long)d1;
unsigned long long l3;
unsigned long long l4 = 0x7fffffffffffffffLLU;
int ret = 0;
if(l1 <= l3 || l2 <= l3)
if(l1 <= l4 || l2 <= l4)
ret = 1;
l3 = (unsigned long long)d2;
if(l3 <= l4)
ret = 1;
done: