Changeset 13325


Ignore:
Timestamp:
Dec 22, 2009, 6:33:31 AM (10 years ago)
Author:
rme
Message:

Use new ppc lap macros u32-ref, u32-set in implementation of
%mrg31k3p ppc lap function. This lets it work on pp64, too.
On ppc64, don't clear the sign bit of the returned fixnum; we
can return the full interval of [0, 231 - 1) on 64-bit platforms.

Location:
branches/new-random
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/new-random/compiler/PPC/ppc-lapmacros.lisp

    r13067 r13325  
    10741074    (and. ,mask ,was ,mask)))
    10751075                                           
     1076(defppclapmacro u32-ref (dest index vector)
     1077  `(lwz ,dest (+ (* 4 ,index) target::misc-data-offset) ,vector))
     1078
     1079(defppclapmacro u32-set (new-value index vector)
     1080  `(stw ,new-value (+ (* 4 ,index) target::misc-data-offset) ,vector))
    10761081
    10771082(provide "PPC-LAPMACROS")
  • branches/new-random/level-0/PPC/ppc-numbers.lisp

    r13319 r13325  
    442442  (let ((seed temp0))
    443443    (svref seed 1 state)
    444     (svref imm0 1 seed)
    445     (svref imm3 2 seed)
     444    (u32-ref imm0 1 seed)
     445    (u32-ref imm3 2 seed)
    446446    (rlwinm imm1 imm0 22 1 9)
    447447    (srwi imm2 imm0 9)
     
    472472
    473473    ;; update state
    474     (svref imm1 1 seed)
    475     (svset imm1 2 seed)
    476     (svref imm1 0 seed)
    477     (svset imm1 1 seed)
    478     (svset imm0 0 seed)
     474    (u32-ref imm1 1 seed)
     475    (u32-set imm1 2 seed)
     476    (u32-ref imm1 0 seed)
     477    (u32-set imm1 1 seed)
     478    (u32-set imm0 0 seed)
    479479
    480480    ;; construct m2 (- (expt 2 31) 21069))
     
    483483
    484484    ;; second component
    485     (svref imm0 3 seed)
     485    (u32-ref imm0 3 seed)
    486486    (rlwinm imm1 imm0 15 1 16)
    487487    (srwi imm2 imm0 16)
     
    495495    @ok3
    496496
    497     (svref imm1 5 seed)
     497    (u32-ref imm1 5 seed)
    498498    (rlwinm imm2 imm1 15 1 16)
    499499    (srwi imm3 imm1 16)
     
    520520
    521521    ;; update state
    522     (svref imm0 4 seed)
    523     (svset imm0 5 seed)
    524     (svref imm0 3 seed)
    525     (svset imm0 4 seed)
    526     (svset imm2 3 seed)
     522    (u32-ref imm0 4 seed)
     523    (u32-set imm0 5 seed)
     524    (u32-ref imm0 3 seed)
     525    (u32-set imm0 4 seed)
     526    (u32-set imm2 3 seed)
     527
     528    ;; construct m1 (1- (expt 2 31))
     529    (lis imm5 #x7fff)
     530    (ori imm5 imm5 #xffff)
    527531
    528532    ;; combination
    529     (svref imm0 0 seed)
     533    (u32-ref imm0 0 seed)
    530534    (cmplw cr7 imm0 imm2)
    531535    (sub imm0 imm0 imm2)
     
    533537    (add imm0 imm0 imm5)
    534538    @finish
     539    #+ppc32-target
    535540    (clrlwi imm0 imm0 3)                ;don't want negative fixnums
    536541    (box-fixnum arg_z imm0)
Note: See TracChangeset for help on using the changeset viewer.