summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-04-10 23:00:48 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-04-10 23:00:48 (GMT)
commit6a27582a4488d4d18a0b6cd584b8950ab02b81a7 (patch)
tree01615f7679a3d3ef4b2d9caa487874aa421df506 /src/H5VMprivate.h
parent7a4b02567e4de16d7478c10ffa07562b0daf320b (diff)
parent3875cc6960266775e8078c782c8864516865be67 (diff)
downloadhdf5-6a27582a4488d4d18a0b6cd584b8950ab02b81a7.zip
hdf5-6a27582a4488d4d18a0b6cd584b8950ab02b81a7.tar.gz
hdf5-6a27582a4488d4d18a0b6cd584b8950ab02b81a7.tar.bz2
[svn-r26781] Merge revisions 26305 through 26780 from trunk to vds branch.
Tested: ummon
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() */