Skip to content
Snippets Groups Projects
Commit 01dfc8c0 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Added dSFMT and license (BSD).

Authors:
	Mutsuo Saito (saito@math.sci.hiroshima-u.ac.jp) Hiroshima University
	Makoto Matsumoto (m-mat@math.sci.hiroshima-u.ac.jp) Hiroshima University

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/

refs #1428
parent d9dd8731
No related branches found
No related tags found
No related merge requests found
Copyright (c) 2007, 2008 Mutsuo Saito, Makoto Matsumoto and Hiroshima
University. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the Hiroshima University nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <config.h>
#ifndef DSFMT_PARAMS_H
#define DSFMT_PARAMS_H
#include "dSFMT.h"
/*----------------------
the parameters of DSFMT
following definitions are in dSFMT-paramsXXXX.h file.
----------------------*/
/** the pick up position of the array.
#define DSFMT_POS1 122
*/
/** the parameter of shift left as four 32-bit registers.
#define DSFMT_SL1 18
*/
/** the parameter of shift right as four 32-bit registers.
#define DSFMT_SR1 12
*/
/** A bitmask, used in the recursion. These parameters are introduced
* to break symmetry of SIMD.
#define DSFMT_MSK1 (uint64_t)0xdfffffefULL
#define DSFMT_MSK2 (uint64_t)0xddfecb7fULL
*/
/** These definitions are part of a 128-bit period certification vector.
#define DSFMT_PCV1 UINT64_C(0x00000001)
#define DSFMT_PCV2 UINT64_C(0x00000000)
*/
#define DSFMT_LOW_MASK UINT64_C(0x000FFFFFFFFFFFFF)
#define DSFMT_HIGH_CONST UINT64_C(0x3FF0000000000000)
#define DSFMT_SR 12
/* for sse2 */
#if defined(HAVE_SSE2)
#define SSE2_SHUFF 0x1b
#elif defined(HAVE_ALTIVEC)
#if defined(__APPLE__) /* For OSX */
#define ALTI_SR (vector unsigned char)(4)
#define ALTI_SR_PERM \
(vector unsigned char)(15,0,1,2,3,4,5,6,15,8,9,10,11,12,13,14)
#define ALTI_SR_MSK \
(vector unsigned int)(0x000fffffU,0xffffffffU,0x000fffffU,0xffffffffU)
#define ALTI_PERM \
(vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3)
#else
#define ALTI_SR {4}
#define ALTI_SR_PERM {15,0,1,2,3,4,5,6,15,8,9,10,11,12,13,14}
#define ALTI_SR_MSK {0x000fffffU,0xffffffffU,0x000fffffU,0xffffffffU}
#define ALTI_PERM {12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3}
#endif
#endif
#if DSFMT_MEXP == 521
#include "dSFMT-params521.h"
#elif DSFMT_MEXP == 1279
#include "dSFMT-params1279.h"
#elif DSFMT_MEXP == 2203
#include "dSFMT-params2203.h"
#elif DSFMT_MEXP == 4253
#include "dSFMT-params4253.h"
#elif DSFMT_MEXP == 11213
#include "dSFMT-params11213.h"
#elif DSFMT_MEXP == 19937
#include "dSFMT-params19937.h"
#elif DSFMT_MEXP == 44497
#include "dSFMT-params44497.h"
#elif DSFMT_MEXP == 86243
#include "dSFMT-params86243.h"
#elif DSFMT_MEXP == 132049
#include "dSFMT-params132049.h"
#elif DSFMT_MEXP == 216091
#include "dSFMT-params216091.h"
#else
#ifdef __GNUC__
#error "DSFMT_MEXP is not valid."
#undef DSFMT_MEXP
#else
#undef DSFMT_MEXP
#endif
#endif
#endif /* DSFMT_PARAMS_H */
#ifndef DSFMT_PARAMS521_H
#define DSFMT_PARAMS521_H
/* #define DSFMT_N 4 */
/* #define DSFMT_MAXDEGREE 544 */
#define DSFMT_POS1 3
#define DSFMT_SL1 25
#define DSFMT_MSK1 UINT64_C(0x000fbfefff77efff)
#define DSFMT_MSK2 UINT64_C(0x000ffeebfbdfbfdf)
#define DSFMT_MSK32_1 0x000fbfefU
#define DSFMT_MSK32_2 0xff77efffU
#define DSFMT_MSK32_3 0x000ffeebU
#define DSFMT_MSK32_4 0xfbdfbfdfU
#define DSFMT_FIX1 UINT64_C(0xcfb393d661638469)
#define DSFMT_FIX2 UINT64_C(0xc166867883ae2adb)
#define DSFMT_PCV1 UINT64_C(0xccaa588000000000)
#define DSFMT_PCV2 UINT64_C(0x0000000000000001)
#define DSFMT_IDSTR "dSFMT2-521:3-25:fbfefff77efff-ffeebfbdfbfdf"
/* PARAMETERS FOR ALTIVEC */
#if defined(__APPLE__) /* For OSX */
#define ALTI_SL1 (vector unsigned int)(1, 1, 1, 1)
#define ALTI_SL1_PERM \
(vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2)
#define ALTI_SL1_MSK \
(vector unsigned int)(0xffffffffU,0xfe000000U,0xffffffffU,0xfe000000U)
#define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \
DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4)
#else /* For OTHER OSs(Linux?) */
#define ALTI_SL1 {1, 1, 1, 1}
#define ALTI_SL1_PERM \
{3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2}
#define ALTI_SL1_MSK \
{0xffffffffU,0xfe000000U,0xffffffffU,0xfe000000U}
#define ALTI_MSK \
{DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4}
#endif
#endif /* DSFMT_PARAMS521_H */
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment