-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use SplitMix64 for seeding test cases
Close #581.
- Loading branch information
Showing
1 changed file
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,10 +350,40 @@ static inline double bankersRounding(double val) | |
return ret; | ||
} | ||
|
||
static float ranf(void) | ||
/*static float ranf(void) | ||
{ | ||
uint32_t ir = rand() & 0x7FFF; | ||
return (float) ir * (1.0f / 32768.0f); | ||
uint32_t ir = rand() & 0xFFFF; | ||
return (float) ir * (1.0f / 65536.0f); | ||
}*/ | ||
|
||
/* Written in 2015 by Sebastiano Vigna ([email protected]) | ||
* | ||
* To the extent possible under law, the author has dedicated all copyright | ||
* and related and neighboring rights to this software to the public domain | ||
* worldwide. This software is distributed without any warranty. | ||
* | ||
* See <http://creativecommons.org/publicdomain/zero/1.0/>. */ | ||
|
||
/* This is a fixed-increment version of Java 8's SplittableRandom generator | ||
* See http://dx.doi.org/10.1145/2714064.2660195 and | ||
* http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html | ||
* | ||
* It is a very fast generator passing BigCrush, and it can be useful | ||
* if for some reason you absolutely want 64 bits of state. */ | ||
static uint64_t x; | ||
const double TWOPOWER64 = pow(2, 64); | ||
|
||
static double next() | ||
{ | ||
uint64_t z = (x += 0x9e3779b97f4a7c15); | ||
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9; | ||
z = (z ^ (z >> 27)) * 0x94d049bb133111eb; | ||
return z ^ (z >> 31); | ||
} | ||
|
||
static float ranf() | ||
{ | ||
return next() / TWOPOWER64; | ||
} | ||
|
||
static float ranf(float low, float high) | ||
|
@@ -4059,6 +4089,11 @@ result_t test_mm_cmplt_sd(const SSE2NEONTestImpl &impl, uint32_t iter) | |
__m128d b = load_m128d(_b); | ||
__m128d c = _mm_cmplt_sd(a, b); | ||
|
||
/*double res[2]; | ||
memcpy(res, &c, sizeof(res)); | ||
printf("a: %lf %lf \nb: %lf %lf \nc: %lf %lf \nd0: %" PRId64 " d1: %" PRId64 | ||
"\n===\n", _a[0], _a[1], _b[0], _b[1], res[0], res[1], d0, d1);*/ | ||
|
||
return validateDouble(c, *(double *) &d0, *(double *) &d1); | ||
} | ||
|
||
|