summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-03-27 22:17:24 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-03-27 22:17:24 (GMT)
commit50d7a323300919e20340862fba3caf1f36216877 (patch)
tree0686d9f8fc7864c5fd1a2f445421c24f0d91af14 /src/H5VMprivate.h
parentff1c86df14d33cda54b36d72cf2e40a8db2cf8d2 (diff)
downloadhdf5-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/H5VMprivate.h')
-rw-r--r--src/H5VMprivate.h29
1 files changed, 10 insertions, 19 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() */