mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r26549] Description:
Remove the BAD_LOG2_CODE_GENERATED macro/define, it's working around bugs in old SGI compilers. Tested on: MacOSX/64 10.10.2 (amazon) w/serial & parallel (h5committest not required on this branch)
This commit is contained in:
parent
51fd9e31a6
commit
9c07c94448
@ -259,16 +259,6 @@ H5ConversionTests (H5_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts
|
||||
#
|
||||
H5ConversionTests (H5_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm")
|
||||
# ----------------------------------------------------------------------
|
||||
# Set the flag to indicate that the machine generates bad code
|
||||
# for the H5VM_log2_gen() routine in src/H5VMprivate.h
|
||||
# (This flag should be set to no for all machines, except for SGI IRIX64,
|
||||
# where the cache value is set to yes in it's config file)
|
||||
#
|
||||
if (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$)
|
||||
set (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine")
|
||||
message (STATUS "Checking IF your system generates wrong code for log2 routine... no")
|
||||
endif (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$)
|
||||
# ----------------------------------------------------------------------
|
||||
# Check if pointer alignments are enforced
|
||||
#
|
||||
H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced")
|
||||
|
@ -36,9 +36,6 @@
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@
|
||||
|
||||
/* Define if your system generates wrong code for log2 routine. */
|
||||
#cmakedefine H5_BAD_LOG2_CODE_GENERATED @H5_BAD_LOG2_CODE_GENERATED@
|
||||
|
||||
/* Define if the memory buffers being written to disk should be cleared before
|
||||
writing. */
|
||||
#cmakedefine H5_CLEAR_MEMORY @H5_CLEAR_MEMORY@
|
||||
|
17
configure.ac
17
configure.ac
@ -2556,23 +2556,6 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Set the flag to indicate that the machine generates bad code
|
||||
## for the H5VM_log2_gen() routine in src/H5VMprivate.h
|
||||
## (This flag should be set to no for all machines, except for SGI IRIX64,
|
||||
## where the cache value is set to yes in it's config file)
|
||||
##
|
||||
AC_MSG_CHECKING([if bad code for log2 routine is generated])
|
||||
AC_CACHE_VAL([hdf5_cv_bad_log2_code_generated], [hdf5_cv_bad_log2_code_generated=no])
|
||||
|
||||
if test ${hdf5_cv_bad_log2_code_generated} = "yes"; then
|
||||
AC_DEFINE([BAD_LOG2_CODE_GENERATED], [1],
|
||||
[Define if your system generates wrong code for log2 routine.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Set some variables for general configuration information to be saved
|
||||
## and installed with the libraries (used to generate libhdf5.settings).
|
||||
|
@ -357,26 +357,17 @@ H5VM_log2_gen(uint64_t n)
|
||||
unsigned r; /* r will be log2(n) */
|
||||
register unsigned int t, tt, ttt; /* temporaries */
|
||||
|
||||
#ifdef H5_BAD_LOG2_CODE_GENERATED
|
||||
if(n > (uint64_t)0x7fffffffffffffff)
|
||||
r = 63;
|
||||
else {
|
||||
n &= (uint64_t)0x7fffffffffffffff;
|
||||
#endif /* H5_BAD_LOG2_CODE_GENERATED */
|
||||
if((ttt = (unsigned)(n >> 32)))
|
||||
if((tt = (unsigned)(n >> 48)))
|
||||
r = (t = (unsigned)(n >> 56)) ? 56 + (unsigned)LogTable256[t] : 48 + (unsigned)LogTable256[tt & 0xFF];
|
||||
else
|
||||
r = (t = (unsigned)(n >> 40)) ? 40 + (unsigned)LogTable256[t] : 32 + (unsigned)LogTable256[ttt & 0xFF];
|
||||
if((ttt = (unsigned)(n >> 32)))
|
||||
if((tt = (unsigned)(n >> 48)))
|
||||
r = (t = (unsigned)(n >> 56)) ? 56 + (unsigned)LogTable256[t] : 48 + (unsigned)LogTable256[tt & 0xFF];
|
||||
else
|
||||
if((tt = (unsigned)(n >> 16)))
|
||||
r = (t = (unsigned)(n >> 24)) ? 24 + (unsigned)LogTable256[t] : 16 + (unsigned)LogTable256[tt & 0xFF];
|
||||
else
|
||||
/* Added 'uint8_t' cast to pacify PGCC compiler */
|
||||
r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n];
|
||||
#ifdef H5_BAD_LOG2_CODE_GENERATED
|
||||
} /* end else */
|
||||
#endif /* H5_BAD_LOG2_CODE_GENERATED */
|
||||
r = (t = (unsigned)(n >> 40)) ? 40 + (unsigned)LogTable256[t] : 32 + (unsigned)LogTable256[ttt & 0xFF];
|
||||
else
|
||||
if((tt = (unsigned)(n >> 16)))
|
||||
r = (t = (unsigned)(n >> 24)) ? 24 + (unsigned)LogTable256[t] : 16 + (unsigned)LogTable256[tt & 0xFF];
|
||||
else
|
||||
/* Added 'uint8_t' cast to pacify PGCC compiler */
|
||||
r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n];
|
||||
|
||||
return(r);
|
||||
} /* H5VM_log2_gen() */
|
||||
|
Loading…
Reference in New Issue
Block a user