source: Daodan/src/dSFMT/dSFMT-params.h@ 453

Last change on this file since 453 was 440, checked in by rossy, 15 years ago

int32rand

File size: 2.3 KB
Line 
1#ifndef DSFMT_PARAMS_H
2#define DSFMT_PARAMS_H
3
4#include "dSFMT.h"
5
6/*----------------------
7 the parameters of DSFMT
8 following definitions are in dSFMT-paramsXXXX.h file.
9 ----------------------*/
10/** the pick up position of the array.
11#define DSFMT_POS1 122
12*/
13
14/** the parameter of shift left as four 32-bit registers.
15#define DSFMT_SL1 18
16 */
17
18/** the parameter of shift right as four 32-bit registers.
19#define DSFMT_SR1 12
20*/
21
22/** A bitmask, used in the recursion. These parameters are introduced
23 * to break symmetry of SIMD.
24#define DSFMT_MSK1 (uint64_t)0xdfffffefULL
25#define DSFMT_MSK2 (uint64_t)0xddfecb7fULL
26*/
27
28/** These definitions are part of a 128-bit period certification vector.
29#define DSFMT_PCV1 UINT64_C(0x00000001)
30#define DSFMT_PCV2 UINT64_C(0x00000000)
31*/
32
33#define DSFMT_LOW_MASK UINT64_C(0x000FFFFFFFFFFFFF)
34#define DSFMT_HIGH_CONST UINT64_C(0x3FF0000000000000)
35#define DSFMT_SR 12
36
37/* for sse2 */
38#if defined(HAVE_SSE2)
39 #define SSE2_SHUFF 0x1b
40#elif defined(HAVE_ALTIVEC)
41 #if defined(__APPLE__) /* For OSX */
42 #define ALTI_SR (vector unsigned char)(4)
43 #define ALTI_SR_PERM \
44 (vector unsigned char)(15,0,1,2,3,4,5,6,15,8,9,10,11,12,13,14)
45 #define ALTI_SR_MSK \
46 (vector unsigned int)(0x000fffffU,0xffffffffU,0x000fffffU,0xffffffffU)
47 #define ALTI_PERM \
48 (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3)
49 #else
50 #define ALTI_SR {4}
51 #define ALTI_SR_PERM {15,0,1,2,3,4,5,6,15,8,9,10,11,12,13,14}
52 #define ALTI_SR_MSK {0x000fffffU,0xffffffffU,0x000fffffU,0xffffffffU}
53 #define ALTI_PERM {12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3}
54 #endif
55#endif
56
57#if DSFMT_MEXP == 521
58 #include "dSFMT-params521.h"
59#elif DSFMT_MEXP == 1279
60 #include "dSFMT-params1279.h"
61#elif DSFMT_MEXP == 2203
62 #include "dSFMT-params2203.h"
63#elif DSFMT_MEXP == 4253
64 #include "dSFMT-params4253.h"
65#elif DSFMT_MEXP == 11213
66 #include "dSFMT-params11213.h"
67#elif DSFMT_MEXP == 19937
68 #include "dSFMT-params19937.h"
69#elif DSFMT_MEXP == 44497
70 #include "dSFMT-params44497.h"
71#elif DSFMT_MEXP == 86243
72 #include "dSFMT-params86243.h"
73#elif DSFMT_MEXP == 132049
74 #include "dSFMT-params132049.h"
75#elif DSFMT_MEXP == 216091
76 #include "dSFMT-params216091.h"
77#else
78#ifdef __GNUC__
79 #error "DSFMT_MEXP is not valid."
80 #undef DSFMT_MEXP
81#else
82 #undef DSFMT_MEXP
83#endif
84
85#endif
86
87#endif /* DSFMT_PARAMS_H */
Note: See TracBrowser for help on using the repository browser.