Skip to content
Snippets Groups Projects
Commit 448e9970 authored by Raymond Toy's avatar Raymond Toy
Browse files

Use the xoroshiro vop on sparc

The vop greatly speeds up the generator on sparc.  The time to
generate 10,000,000 single-floats (on a 1 GHz Ultrasparc 3i) is:

mt19937:   1.32 sec
xoroshiro: 1.03 sec

So xoroshiro is 22% faster than mt19937.
parent 11a14537
No related branches found
No related tags found
No related merge requests found
...@@ -206,15 +206,17 @@ ...@@ -206,15 +206,17 @@
;;;; Random entries: ;;;; Random entries:
#+x86 ;; Sparc and x86 have vops to implement xoroshiro-gen that are much
;; faster than the portable lisp version. Use them.
#+(or x86 sparc)
(declaim (inline xoroshiro-gen)) (declaim (inline xoroshiro-gen))
#+x86 #+(or x86 sparc)
(defun xoroshiro-gen (state) (defun xoroshiro-gen (state)
(declare (type (simple-array double-float (2)) state) (declare (type (simple-array double-float (2)) state)
(optimize (speed 3) (safety 0))) (optimize (speed 3) (safety 0)))
(vm::xoroshiro-next state)) (vm::xoroshiro-next state))
#-x86 #+(or x86 sparc)
(defun xoroshiro-gen (state) (defun xoroshiro-gen (state)
(declare (type (simple-array double-float (2)) state) (declare (type (simple-array double-float (2)) state)
(optimize (speed 3) (safety 0))) (optimize (speed 3) (safety 0)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment