diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-03-27 22:17:24 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-03-27 22:17:24 (GMT) |
commit | 50d7a323300919e20340862fba3caf1f36216877 (patch) | |
tree | 0686d9f8fc7864c5fd1a2f445421c24f0d91af14 /src | |
parent | ff1c86df14d33cda54b36d72cf2e40a8db2cf8d2 (diff) | |
download | hdf5-50d7a323300919e20340862fba3caf1f36216877.zip hdf5-50d7a323300919e20340862fba3caf1f36216877.tar.gz hdf5-50d7a323300919e20340862fba3caf1f36216877.tar.bz2 |
[svn-r26632] Description:
Bring r26549 from autotools_rework branch to trunk:
Remove the BAD_LOG2_CODE_GENERATED macro/define, it's working around bugs
in old SGI compilers.
Tested on:
Linux/32 2.6.18 (jam) w/serial & parallel
(Daily tested on branch for 2+ days)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VMprivate.h | 29 | ||||
-rw-r--r-- | src/H5config.h.in | 3 |
2 files changed, 10 insertions, 22 deletions
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 4706b5f..20821b2 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -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() */ diff --git a/src/H5config.h.in b/src/H5config.h.in index bf21313..9b840f2 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -3,9 +3,6 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD -/* Define if your system generates wrong code for log2 routine. */ -#undef BAD_LOG2_CODE_GENERATED - /* Define if the memory buffers being written to disk should be cleared before writing. */ #undef CLEAR_MEMORY |