From 5990aea2f2601d46e565a8bf94c48750663367ad Mon Sep 17 00:00:00 2001 From: Euler-37 <64597797+Euler-37@users.noreply.github.com> Date: Sun, 14 May 2023 11:07:25 +0800 Subject: [PATCH 1/2] Update stdlib_random.fypp change function `rtol` to fortran intrinsic `ishftc` --- src/stdlib_random.fypp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/stdlib_random.fypp b/src/stdlib_random.fypp index 9a587c86b..4945a9b50 100644 --- a/src/stdlib_random.fypp +++ b/src/stdlib_random.fypp @@ -78,27 +78,16 @@ module stdlib_random integer(int64) :: res, t if(.not. seed_initialized) call random_distribution_seed_iint64(si,t) - res = rol64(st(2) * 5, 7) * 9 + res = ishftc(st(2) * 5, 7) * 9 t = shiftl(st(2), 17) st(3) = ieor(st(3), st(1)) st(4) = ieor(st(4), st(2)) st(2) = ieor(st(2), st(3)) st(1) = ieor(st(1), st(4)) st(3) = ieor(st(3), t) - st(4) = rol64(st(4), 45) + st(4) = ishftc(st(4),45) end function xoshiro256ss - pure function rol64(x, k) result(res) - integer(int64), intent(in) :: x - integer, intent(in) :: k - integer(int64) :: t1, t2, res - - t1 = shiftr(x, (64 - k)) - t2 = shiftl(x, k) - res = ior(t1, t2) - end function rol64 - - function splitmix64(s) result(res) ! Written in 2015 by Sebastiano Vigna (vigna@acm.org) ! This is a fixed-increment version of Java 8's SplittableRandom From 967f63b49c3bbb430998be2d46965cc66d754a90 Mon Sep 17 00:00:00 2001 From: Euler-37 <64597797+Euler-37@users.noreply.github.com> Date: Sun, 14 May 2023 11:09:03 +0800 Subject: [PATCH 2/2] Update stdlib_random.fypp --- src/stdlib_random.fypp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdlib_random.fypp b/src/stdlib_random.fypp index 4945a9b50..241a9c63d 100644 --- a/src/stdlib_random.fypp +++ b/src/stdlib_random.fypp @@ -85,7 +85,7 @@ module stdlib_random st(2) = ieor(st(2), st(3)) st(1) = ieor(st(1), st(4)) st(3) = ieor(st(3), t) - st(4) = ishftc(st(4),45) + st(4) = ishftc(st(4), 45) end function xoshiro256ss function splitmix64(s) result(res)