{
enum
{
+ num_distinct_sizes_16_bit = 14,
num_distinct_sizes_32_bit = 30,
num_distinct_sizes_64_bit = 62,
- num_distinct_sizes = sizeof(std::size_t) != 8 ?
- num_distinct_sizes_32_bit : num_distinct_sizes_64_bit,
+ // The number of values is limited by the width of size_t.
+ // Maybe we could just use (__SIZE_WIDTH__ - 2) here.
+#if __SIZE_WIDTH__ >= 64
+ num_distinct_sizes = num_distinct_sizes_64_bit
+#elif __SIZE_WIDTH__ >= 32
+ num_distinct_sizes = num_distinct_sizes_32_bit
+#else
+ num_distinct_sizes = num_distinct_sizes_16_bit
+#endif
};
// Originally taken from the SGI implementation; acknowledged in the docs.
// Further modified (for 64 bits) from tr1's hashtable.
- static const std::size_t g_a_sizes[num_distinct_sizes_64_bit] =
+ static const std::size_t g_a_sizes[num_distinct_sizes] =
{
/* 0 */ 5ul,
/* 1 */ 11ul,
/* 11 */ 14033ul,
/* 12 */ 28411ul,
/* 13 */ 57557ul,
+#if __SIZE_WIDTH__ >= 32
/* 14 */ 116731ul,
/* 15 */ 236897ul,
/* 16 */ 480881ul,
/* 27 */ 1164186217ul,
/* 28 */ 2364114217ul,
/* 29 */ 4294967291ul,
+#if __SIZE_WIDTH__ >= 64
/* 30 */ (std::size_t)8589934583ull,
/* 31 */ (std::size_t)17179869143ull,
/* 32 */ (std::size_t)34359738337ull,
/* 59 */ (std::size_t)4611686018427387847ull,
/* 60 */ (std::size_t)9223372036854775783ull,
/* 61 */ (std::size_t)18446744073709551557ull,
+#endif
+#endif
};
} // namespace detail
0xa3ac4000U, 0xecc1327aU>
sfmt44497_64;
+#if __SIZE_WIDTH__ >= 32
typedef simd_fast_mersenne_twister_engine<uint32_t, 86243, 366,
6, 7, 19, 1,
0xf8000001U, 0x89e80709U,
0x3bd2b64bU, 0x0c64b1e4U>
sfmt216091_64;
+#endif // __SIZE_WIDTH__ >= 32
#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__