update sfmt to version 1.5.1 from 1.4.1 (#4124)

This commit is contained in:
ebbit1q 2020-10-02 18:13:12 +02:00 committed by GitHub
parent a5511190a3
commit e2251fe06b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 30 deletions

View file

@ -40,11 +40,6 @@ extern "C" {
#undef ONLY64
#endif
/**
* parameters used by sse2.
*/
static const w128_t sse2_param_mask = {{SFMT_MSK1, SFMT_MSK2,
SFMT_MSK3, SFMT_MSK4}};
/*----------------
STATIC FUNCTIONS
----------------*/
@ -60,11 +55,18 @@ inline static void swap(w128_t *array, int size);
#if defined(HAVE_ALTIVEC)
#include "SFMT-alti.h"
#elif defined(HAVE_SSE2)
/**
* parameters used by sse2.
*/
static const w128_t sse2_param_mask = {{SFMT_MSK1, SFMT_MSK2,
SFMT_MSK3, SFMT_MSK4}};
#if defined(_MSC_VER)
#include "SFMT-sse2-msc.h"
#else
#include "SFMT-sse2.h"
#endif
#elif defined(HAVE_NEON)
#include "SFMT-neon.h"
#endif
/**
@ -81,7 +83,7 @@ inline static int idxof(int i) {
}
#endif
#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2))
#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2)) && (!defined(HAVE_NEON))
/**
* This function fills the user-specified array with pseudorandom
* integers.
@ -166,17 +168,19 @@ static uint32_t func2(uint32_t x) {
* @param sfmt SFMT internal state
*/
static void period_certification(sfmt_t * sfmt) {
int inner = 0;
uint32_t inner = 0;
int i, j;
uint32_t work;
uint32_t *psfmt32 = &sfmt->state[0].u[0];
const uint32_t parity[4] = {SFMT_PARITY1, SFMT_PARITY2,
SFMT_PARITY3, SFMT_PARITY4};
for (i = 0; i < 4; i++)
for (i = 0; i < 4; i++) {
inner ^= psfmt32[idxof(i)] & parity[i];
for (i = 16; i > 0; i >>= 1)
}
for (i = 16; i > 0; i >>= 1) {
inner ^= inner >> i;
}
inner &= 1;
/* check OK */
if (inner == 1) {
@ -232,7 +236,7 @@ int sfmt_get_min_array_size64(sfmt_t * sfmt) {
return SFMT_N64;
}
#if !defined(HAVE_SSE2) && !defined(HAVE_ALTIVEC)
#if !defined(HAVE_SSE2) && !defined(HAVE_ALTIVEC) && !defined(HAVE_NEON)
/**
* This function fills the internal state array with pseudorandom
* integers.