summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-09-11 05:37:17 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-09-11 05:37:17 (GMT)
commitbae05c1ad5a067498389eb64ca990e0e435de1da (patch)
treee49c59a060ec479a877d848786c0942fef0fd275 /src/H5VMprivate.h
parentbac113b0050028d6eb27351f2755ff68ba0d2668 (diff)
downloadhdf5-bae05c1ad5a067498389eb64ca990e0e435de1da.zip
hdf5-bae05c1ad5a067498389eb64ca990e0e435de1da.tar.gz
hdf5-bae05c1ad5a067498389eb64ca990e0e435de1da.tar.bz2
[svn-r27759] Bring r26632 from trunk
Remove the BAD_LOG2_CODE_GENERATED macro/define, it's working around bugs in old SGI compilers. Tested on: h5committest
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 372a8aa..78799d8 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() */