Changeset 13316 for branches/new-random


Ignore:
Timestamp:
Dec 22, 2009, 12:06:13 AM (10 years ago)
Author:
rme
Message:

Version of %mrg31k3p in x8632 lap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new-random/level-0/X86/X8632/x8632-numbers.lisp

    r13067 r13316  
    219219  (single-value-return))
    220220
     221(defx8632lapfunction %mrg31k3p ((state arg_z))
     222  (let ((seed temp0)
     223        (m1 #x7fffffff)
     224        (m2 #x7fffadb3)
     225        (negative-m1 #x80000001)
     226        (negative-m2 #x8000524d)
     227        (imm1 edx))                     ;temp1
     228    (std)                               ;temp1 now unboxed
     229    (svref state 1 seed)
     230    (movl (@ (+ x8632::misc-data-offset (* 4 1)) (% seed)) (% imm0))
     231    (andl ($ #x1ff) (% imm0))
     232    (shll ($ 22) (% imm0))
     233    (movl (@ (+ x8632::misc-data-offset (* 4 1)) (% seed)) (% imm1))
     234    (shrl ($ 9) (% imm1))
     235    (addl (% imm1) (% imm0))
     236
     237    (movl (@ (+ x8632::misc-data-offset (* 4 2)) (% seed)) (% imm1))
     238    (andl ($ #xffffff) (% imm1))
     239    (shll ($ 7) (% imm1))
     240    (addl (% imm1) (% imm0))
     241    (movl (@ (+ x8632::misc-data-offset (* 4 2)) (% seed)) (% imm1))
     242    (shrl ($ 24) (% imm1))
     243
     244    (addl (% imm1) (% imm0))
     245    (leal (@ negative-m1 (% imm0)) (% imm1))
     246    (cmpl ($ m1) (% imm0))
     247    (cmovael (% imm1) (% imm0))
     248
     249    (addl (@ (+ x8632::misc-data-offset (* 4 2)) (% seed)) (% imm0))
     250    (leal (@ negative-m1 (% imm0)) (% imm1))
     251    (cmpl ($ m1) (% imm0))
     252    (cmovael (% imm1) (% imm0))
     253
     254    ;; update state
     255    (movl (@ (+ x8632::misc-data-offset (* 4 1)) (% seed)) (% imm1))
     256    (movl (% imm1) (@ (+ x8632::misc-data-offset (* 4 2)) (% seed)))
     257    (movl (@ (+ x8632::misc-data-offset (* 4 0)) (% seed)) (% imm1))
     258    (movl (% imm1) (@ (+ x8632::misc-data-offset (* 4 1)) (% seed)))
     259    (movl (% imm0) (@ (+ x8632::misc-data-offset (* 4 0)) (% seed)))
     260
     261    ;; second component
     262    (movzwl (@ (+ x8632::misc-data-offset (* 4 3)) (% seed)) (% imm0))
     263    ;(andl ($ #xffff) (% imm0))
     264    (shll ($ 15) (% imm0))
     265    (movl (@ (+ x8632::misc-data-offset (* 4 3)) (% seed)) (% imm1))
     266    (shrl ($ 16) (% imm1))
     267    (imull ($ 21069) (% imm1) (% imm1))
     268
     269    (addl (% imm1) (% imm0))
     270    (leal (@ negative-m2 (% imm0)) (% imm1))
     271    (cmpl ($ m2) (% imm0))
     272    (cmovael (% imm1) (% imm0))
     273    (movl (% imm0) (:rcontext x8632::tcr.unboxed0))     ;stash t1
     274
     275    (movzwl (@ (+ x8632::misc-data-offset (* 4 5)) (% seed)) (% imm0))
     276    ;(andl ($ #xffff) (% imm0))
     277    (shll ($ 15) (% imm0))
     278    (movl (@ (+ x8632::misc-data-offset (* 4 5)) (% seed)) (% imm1))
     279    (shrl ($ 16) (% imm1))
     280    (imull ($ 21069) (% imm1) (% imm1))
     281
     282    (addl (% imm1) (% imm0))
     283    (leal (@ negative-m2 (% imm0)) (% imm1))
     284    (cmpl ($ m2) (% imm0))
     285    (cmovael (% imm1) (% imm0))
     286
     287    (addl (@ (+ x8632::misc-data-offset (* 4 5)) (% seed)) (% imm0))
     288    (leal (@ negative-m2 (% imm0)) (% imm1))
     289    (cmpl ($ m2) (% imm0))
     290    (cmovael (% imm1) (% imm0))
     291
     292    (addl (:rcontext x8632::tcr.unboxed0) (% imm0))     ;add in t1
     293    (leal (@ negative-m2 (% imm0)) (% imm1))
     294    (cmpl ($ m2) (% imm0))
     295    (cmovael (% imm1) (% imm0))
     296
     297    ;; update state
     298    (movl (@ (+ x8632::misc-data-offset (* 4 4)) (% seed)) (% imm1))
     299    (movl (% imm1) (@ (+ x8632::misc-data-offset (* 4 5)) (% seed)))
     300    (movl (@ (+ x8632::misc-data-offset (* 4 3)) (% seed)) (% imm1))
     301    (movl (% imm1) (@ (+ x8632::misc-data-offset (* 4 4)) (% seed)))
     302    (movl (% imm0) (@ (+ x8632::misc-data-offset (* 4 3)) (% seed)))
     303
     304    ;; combination
     305    (movl (@ (+ x8632::misc-data-offset (* 4 0)) (% seed)) (% imm1))
     306    (xchgl (% imm1) (% imm0))           ;for sanity
     307    (rcmpl (% imm0) (% imm1))
     308    (ja @ok)
     309    (subl (% imm1) (% imm0))
     310    (xorl (% imm1) (% imm1))
     311    (cld)
     312    (addl ($ m1) (% imm0))
     313    (box-fixnum imm0 arg_z)
     314    (andl ($ #x7fffffff) (% arg_z))
     315    (single-value-return)
     316    @ok
     317    (subl (% imm1) (% imm0))
     318    (xorl (% imm1) (% imm1))
     319    (cld)
     320    (box-fixnum imm0 arg_z)
     321    (andl ($ #x7fffffff) (% arg_z))
     322    (single-value-return)))
Note: See TracChangeset for help on using the changeset viewer.