Fix RNG seed code in stdlib for scalar target.
This commit is contained in:
@@ -3246,6 +3246,14 @@ static inline uniform unsigned int __seed4(RNGState * uniform state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void seed_rng(uniform RNGState * uniform state, uniform unsigned int seed) {
|
static inline void seed_rng(uniform RNGState * uniform state, uniform unsigned int seed) {
|
||||||
|
if (programCount == 1) {
|
||||||
|
state->z1 = seed;
|
||||||
|
state->z2 = seed ^ 0xbeeff00d;
|
||||||
|
state->z3 = ((seed & 0xffff) << 16) | (seed >> 16);
|
||||||
|
state->z4 = (((seed & 0xff) << 24) | ((seed & 0xff00) << 8) |
|
||||||
|
((seed & 0xff0000) >> 8) | (seed & 0xff000000) >> 24);
|
||||||
|
}
|
||||||
|
else {
|
||||||
seed = __seed4(state, 0, seed);
|
seed = __seed4(state, 0, seed);
|
||||||
if (programCount == 8)
|
if (programCount == 8)
|
||||||
__seed4(state, 4, seed ^ 0xbeeff00d);
|
__seed4(state, 4, seed ^ 0xbeeff00d);
|
||||||
@@ -3256,6 +3264,7 @@ static inline void seed_rng(uniform RNGState * uniform state, uniform unsigned i
|
|||||||
((seed & 0xff0000) >> 8) | (seed & 0xff000000) >> 24));
|
((seed & 0xff0000) >> 8) | (seed & 0xff000000) >> 24));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline void fastmath() {
|
static inline void fastmath() {
|
||||||
__fastmath();
|
__fastmath();
|
||||||
|
|||||||
Reference in New Issue
Block a user