summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-03-23 21:57:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-03-23 21:57:09 (GMT)
commit9c07c94448f6cea9966e0f8aef91caa8d40dc06b (patch)
treeddead9898a359de22e074e0930925d775742c0ea /src
parent51fd9e31a6199caae10dc6bdea129b7637d11fa9 (diff)
downloadhdf5-9c07c94448f6cea9966e0f8aef91caa8d40dc06b.zip
hdf5-9c07c94448f6cea9966e0f8aef91caa8d40dc06b.tar.gz
hdf5-9c07c94448f6cea9966e0f8aef91caa8d40dc06b.tar.bz2
[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)
Diffstat (limited to 'src')
-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() */