dSFMT-params.h 2.4 KB

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