compiler

Unnamed Compiled Systems Language Project
git clone http://frotz.net/git/compiler.git
Log | Files | Refs

commit 1a619509b646cd08c35bd0ed391af4c42eb6dcb2
parent 20458a1f06ef6bdb664cfb1d001a28dc65aff51d
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 14 Mar 2020 21:55:57 -0700

test: xorshift32

Diffstat:
Atest/1024-xorshift32.log | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/1024-xorshift32.src | 20++++++++++++++++++++
2 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/test/1024-xorshift32.log b/test/1024-xorshift32.log @@ -0,0 +1,65 @@ +D 8df0839b +D 2df6061a +D 4b932080 +D dfe5df61 +D e53061c5 +D c81e1d61 +D 7df52fb8 +D d84a3499 +D 45f22555 +D 2a483ad9 +D 8f728650 +D 28a5d80c +D e7262a1e +D 6eda9eac +D 9cef054b +D f48d3668 +D 1a43f648 +D f5d245ad +D 1190d8de +D 5be8aefb +D 88cad5e0 +D 9ca127bb +D b2956990 +D eb4bae23 +D 4f7fade4 +D e2ad6025 +D 9b950951 +D 6d59b5ce +D 27eb5ffe +D ce838774 +D 73c65002 +D 810fd0c1 +D 19ee640a +D 7886991d +D df08f52f +D f403cad9 +D 264d22d5 +D c0efb81e +D ca601ee8 +D fe123cf6 +D 8818a630 +D 0703e3bf +D 15f3fea5 +D 2eca1d76 +D c1f99344 +D 81bc3b0c +D dd6ab422 +D f6388b75 +D 0d9d431e +D 1a24edc1 +D 740d4fef +D 63e8e3f7 +D 8d51bbbc +D feeab34f +D b8e3e6ce +D 4372deb3 +D 0c32eec1 +D 6cb620b4 +D bcbe6864 +D 47e8c71d +D be625b98 +D 57350310 +D 1db86fdb +D 1823f8ba +X 00000040 diff --git a/test/1024-xorshift32.src b/test/1024-xorshift32.src @@ -0,0 +1,20 @@ + +// todo: u32 and LSR support + +var state i32 = 0xd3f56332; + +func xorshift32() i32 { + state = state ^ (state << 13); + state = state ^ ((state >> 17) & 0x7FFF); + state = state ^ (state << 5); + return state; +} + +func start() i32 { + var n i32 = 0; + while (n < 64) { + _hexout_(xorshift32()); + n++; + } + return 64; +}