The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
xoroshiro.h File Reference

Xoroshiro RNG support functions. More...

#include <stdint.h>
+ Include dependency graph for xoroshiro.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define rotl(x, k)   (((x) << (k)) | ((x) >> (64 - (k))))
 
#define random_u64(rng_s)
 
#define random_init(rng_s, llid, seed)
 

Detailed Description

Xoroshiro RNG support functions.

Xoroshiro RNG support functions.

SPDX-FileCopyrightText: 2008-2021 D. Blackman and S. Vigna vigna.nosp@m.@acm.nosp@m..org

Definition in file xoroshiro.h.

Macro Definition Documentation

◆ random_init

#define random_init (   rng_s,
  llid,
  seed 
)
Value:
__extension__ ({ \
(rng_s)[0] = (llid + 1) * UINT64_C(16232384076195101791) ^ seed;\
(rng_s)[1] = (llid + 1) * UINT64_C(13983006573105492179) ^ seed;\
(rng_s)[2] = (llid + 1) * UINT64_C(10204677566545858177) ^ seed;\
(rng_s)[3] = (llid + 1) * UINT64_C(14539058011249359317) ^ seed;\
unsigned __i = 1024; \
while (__i--) \
random_u64((rng_s)); \
})

Definition at line 33 of file xoroshiro.h.

◆ random_u64

#define random_u64 (   rng_s)
Value:
__extension__ ({ \
const uint64_t __res = rotl((rng_s)[1] * 5, 7) * 9; \
const uint64_t __t = (rng_s)[1] << 17; \
\
(rng_s)[2] ^= (rng_s)[0]; \
(rng_s)[3] ^= (rng_s)[1]; \
(rng_s)[1] ^= (rng_s)[2]; \
(rng_s)[0] ^= (rng_s)[3]; \
(rng_s)[2] ^= __t; \
(rng_s)[3] = rotl((rng_s)[3], 45); \
\
__res; \
})

Definition at line 17 of file xoroshiro.h.