Raymond Toy pushed to branch issue-276-xoroshiro128starstar at cmucl / cmucl
Commits: 31b7ffd9 by Raymond Toy at 2024-02-13T19:57:48-08:00 Remove old implementation of xoroshiro-next
This was for xoroshiro128+, and we're using xoroshiro128** now.
- - - - - f452e5d2 by Raymond Toy at 2024-02-13T19:58:26-08:00 Update release notes
Make an explicit note that we've changed the RNG generator.
- - - - -
2 changed files:
- src/compiler/x86/arith.lisp - src/general-info/release-21f.md
Changes:
===================================== src/compiler/x86/arith.lisp ===================================== @@ -1678,79 +1678,6 @@
(in-package "VM")
-#|| -#+random-xoroshiro -(progn -(defknown xoroshiro-next ((simple-array double-float (2))) - (values (unsigned-byte 32) (unsigned-byte 32)) - (movable)) - -(define-vop (xoroshiro-next) - (:policy :fast-safe) - (:translate xoroshiro-next) - (:args (state :scs (descriptor-reg) :to (:result 3))) - (:arg-types simple-array-double-float) - (:results (r1 :scs (unsigned-reg)) - (r0 :scs (unsigned-reg))) - (:result-types unsigned-num unsigned-num) - (:temporary (:sc double-reg) s0) - (:temporary (:sc double-reg) s1) - (:temporary (:sc double-reg) t0) - (:generator 10 - ;; s0 = state[0] - (inst movsd s0 (make-ea :dword :base state - :disp (- (+ (* vm:vector-data-offset - vm:word-bytes) - (* 8 0)) - vm:other-pointer-type))) - ;; s1 = state[1] - (inst movsd s1 (make-ea :dword :base state - :disp (- (+ (* vm:vector-data-offset - vm:word-bytes) - (* 8 1)) - vm:other-pointer-type))) - ;; Compute result = s0 + s1 - (inst movapd t0 s0) - (inst paddq t0 s1) - ;; Save the 64-bit result as two 32-bit results - (inst movd r0 t0) - (inst psrlq t0 32) - (inst movd r1 t0) - - ;; s1 = s1 ^ s0 - (inst xorpd s1 s0) - - ;; s0 = rotl(s0,55) = s0 << 55 | s0 >> 9 - (inst movapd t0 s0) - (inst psllq s0 55) ; s0 = s0 << 55 - (inst psrlq t0 9) ; t0 = s0 >> 9 - (inst orpd s0 t0) ; s0 = rotl(s0, 55) - - (inst movapd t0 s1) - (inst xorpd s0 s1) ; s0 = s0 ^ s1 - (inst psllq t0 14) ; t0 = s1 << 14 - (inst xorpd s0 t0) ; s0 = s0 ^ t0 - (inst movsd (make-ea :dword :base state - :disp (- (+ (* vm:vector-data-offset - vm:word-bytes) - (* 8 0)) - vm:other-pointer-type)) - s0) - - ;; s1 = rotl(s1, 36) = s1 << 36 | s1 >> 28, using t0 as temp - (inst movapd t0 s1) - (inst psllq s1 36) - (inst psrlq t0 28) - (inst orpd s1 t0) - - (inst movsd (make-ea :dword :base state - :disp (- (+ (* vm:vector-data-offset - vm:word-bytes) - (* 8 1)) - vm:other-pointer-type)) - s1))) -) -||# #+random-xoroshiro (progn (defknown xoroshiro-next ((simple-array double-float (2))) @@ -1790,6 +1717,8 @@ ;; ;; return result; ;; } + + ;; s0 = state[0] (inst movsd s0 (make-ea :dword :base state :disp (- (+ (* vm:vector-data-offset vm:word-bytes) @@ -1819,6 +1748,7 @@ (inst psrlq t0 32) (inst movd r1 t0)
+ ;; s1 = state[1] (inst movsd s1 (make-ea :dword :base state :disp (- (+ (* vm:vector-data-offset vm:word-bytes)
===================================== src/general-info/release-21f.md ===================================== @@ -23,6 +23,9 @@ public domain. * Add support for Gray streams implementation of file-length via `ext:stream-file-length` generic function. * Changes: + * The RNG has changed from an old version of xoroshiro128+ to + xoroshiro128**. This means sequences of random numbers will be + different from before. See ~~#276~~. * ANSI compliance fixes: * Bug fixes: * Gitlab tickets: @@ -40,6 +43,7 @@ public domain. * ~~#258~~ Remove `get-page-size` from linux-os.lisp * ~~#269~~ Add function to get user's home directory * ~~#266~~ Support "~user" in namestrings + * ~~#276~~ Implement xoroshiro128** generator for x86 * Other changes: * Improvements to the PCL implementation of CLOS: * Changes to building procedure:
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/1b1c57ad6e23556f6cf9ba6...