From e98d15d4eb88ec13a6e6ef97e915aada231855fa Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 9 Feb 2015 18:04:22 +0100 Subject: Replace isaac with xorshift No difference in performance. rdrand instruction alone is too slow. --- xorshift.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 xorshift.h (limited to 'xorshift.h') diff --git a/xorshift.h b/xorshift.h new file mode 100644 index 0000000..64c3ea2 --- /dev/null +++ b/xorshift.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +#define XORSHIFT_S 16 + +typedef struct { + uint64_t s[XORSHIFT_S]; + int p; +} randctx; + +uint64_t xorshift_step (randctx * const st); +void xorshift_seed (randctx * const st); + -- cgit v1.2.3