Changeset 11112


Ignore:
Timestamp:
Oct 17, 2008, 9:30:55 AM (11 years ago)
Author:
gb
Message:

%MULTIPLY-AND-ADD-LOOP for ppc64, too.

File:
1 edited

Legend:

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

    r6009 r11112  
    3636  (blr))
    3737 
    38 
     38(defppclapfunction %multiply-and-add-loop
     39    ((x 8) (y 0)  (r arg_x) (idx arg_y) (ylen arg_z))
     40  (let ((cc nargs)
     41        (xx imm2)
     42        (yy imm3)
     43        (rr imm4)
     44        (i imm0)
     45        (j imm1))
     46    (srdi i idx 1)
     47    (la i ppc64::misc-data-offset i)
     48    (ld temp0 x vsp)
     49    (lwzx xx temp0 i)                   ;x[i]
     50    (ld temp0 y vsp)
     51    (mr temp1 r)
     52    (li cc 0)
     53    (li j ppc64::misc-data-offset)
     54    @loop
     55    (lwzx yy temp0 j)
     56    (mulld yy xx yy)
     57    ;; 64-bit product now in %yy
     58    (lwzx rr temp1 i)
     59    ;; add in digit from r[i]
     60    (add rr rr yy)
     61    ;; add in carry
     62    (add rr rr cc)
     63    (stwx rr temp1 i)
     64    (srdi cc rr 32)             ;get carry digit into low word
     65    (cmpdi ylen '1)
     66    (la i 4 i)
     67    (la j 4 j)
     68    (subi ylen ylen '1)
     69    (bne  @loop)
     70    (stwx cc temp1 i)
     71    (set-nargs 0)
     72    (la vsp 16 vsp)
     73    (blr)))
    3974
    4075;;; Multiply the (32-bit) digits X and Y, producing a 64-bit result.
Note: See TracChangeset for help on using the changeset viewer.