Changeset 15568


Ignore:
Timestamp:
Jan 8, 2013, 8:02:20 AM (6 years ago)
Author:
gb
Message:

Remove %MULTIPLY-AND-ADD-LOOP (only caller is unused.)
Add %MULTIPLY-AND-ADD-FIXNUM-LOOP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/PPC/PPC64/ppc64-bignum.lisp

    r13422 r15568  
    3737  (blr))
    3838 
    39 (defppclapfunction %multiply-and-add-loop
    40     ((x 8) (y 0)  (r arg_x) (idx arg_y) (ylen arg_z))
    41   (let ((cc nargs)
    42         (xx imm2)
    43         (yy imm3)
    44         (rr imm4)
    45         (i imm0)
    46         (j imm1))
    47     (srdi i idx 1)
    48     (la i ppc64::misc-data-offset i)
    49     (ld temp0 x vsp)
    50     (lwzx xx temp0 i)                   ;x[i]
    51     (ld temp0 y vsp)
    52     (mr temp1 r)
    53     (li cc 0)
    54     (li j ppc64::misc-data-offset)
    55     @loop
    56     (lwzx yy temp0 j)
    57     (mulld yy xx yy)
    58     ;; 64-bit product now in %yy
    59     (lwzx rr temp1 i)
    60     ;; add in digit from r[i]
    61     (add rr rr yy)
    62     ;; add in carry
    63     (add rr rr cc)
    64     (stwx rr temp1 i)
    65     (srdi cc rr 32)             ;get carry digit into low word
    66     (cmpdi ylen '1)
    67     (la i 4 i)
    68     (la j 4 j)
    69     (subi ylen ylen '1)
    70     (bne  @loop)
    71     (stwx cc temp1 i)
    72     (set-nargs 0)
    73     (la vsp 16 vsp)
    74     (blr)))
    7539
    7640(defppclapfunction %multiply-and-add-loop64
     
    163127    (ba .SPvalues)))
    164128
     129(defppclapfunction %multiply-and-add-fixnum-loop ((len64 0) (x arg_x) (y arg_y) (result arg_z))
     130  (let ((carry imm4)
     131        (iidx imm3)
     132        (unboxed-y imm0)
     133        (i temp0)
     134        (hi imm2)
     135        (rlen temp1))
     136    (vpop rlen)
     137    (li carry 0)
     138    (li iidx ppc64::misc-data-offset)
     139    (li i 0)
     140    (b @test)
     141    @loop
     142    (unbox-fixnum unboxed-y y)
     143    (ldx imm1 x iidx)
     144    (rotldi imm1 imm1 32)
     145    (mulhdu hi imm1 unboxed-y)
     146    (mulld imm0 imm1 unboxed-y)
     147    (addc imm0 imm0 carry)
     148    (addze carry hi)
     149    (rotldi imm0 imm0 32)
     150    (stdx imm0 result iidx)
     151    (la iidx 8 iidx)
     152    (add i i '1)
     153    @test
     154    (cmpd i rlen)
     155    (blt @loop)
     156    (rotldi carry carry 32)
     157    (stdx carry result iidx)
     158    (blr)))
     159   
     160   
     161
    165162;;; Return the (possibly truncated) 32-bit quotient and remainder
    166163;;; resulting from dividing hi:low by divisor.
Note: See TracChangeset for help on using the changeset viewer.