Raymond Toy pushed to branch rtoy-xoro-default at cmucl / cmucl
Commits: 448e9970 by Raymond Toy at 2017-12-28T09:53:39-08:00 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.
- - - - -
1 changed file:
- src/code/rand-xoroshiro.lisp
Changes:
===================================== src/code/rand-xoroshiro.lisp ===================================== --- a/src/code/rand-xoroshiro.lisp +++ b/src/code/rand-xoroshiro.lisp @@ -206,15 +206,17 @@ ;;;; 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)) -#+x86 +#+(or x86 sparc) (defun xoroshiro-gen (state) (declare (type (simple-array double-float (2)) state) (optimize (speed 3) (safety 0))) (vm::xoroshiro-next state))
-#-x86 +#+(or x86 sparc) (defun xoroshiro-gen (state) (declare (type (simple-array double-float (2)) state) (optimize (speed 3) (safety 0)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/448e99705bdfbc1a9e77756e3b...
--- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/448e99705bdfbc1a9e77756e3b... You're receiving this email because of your account on gitlab.common-lisp.net.