aboutsummaryrefslogtreecommitdiff
path: root/include/xorshift64.h
blob: 62a0a4e48ce9f5c3ca64dfb62d95553b67504601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdint.h>

#ifndef XORSHIFT_H
#define XORSHIFT_H

extern uint64_t xors;

#define XORSHIFT64 { \
		xors ^= xors >> 12; \
		xors ^= xors << 25; \
		xors ^= xors >> 27; \
	}

#define RANDOM64 (xors*0x2545F4914F6CDD1D)
#define RANDOM32 ((uint32_t)RANDOM64)

#endif