Changeset 15568
 Timestamp:
 Jan 8, 2013, 8:02:20 AM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/level0/PPC/PPC64/ppc64bignum.lisp
r13422 r15568 37 37 (blr)) 38 38 39 (defppclapfunction %multiplyandaddloop40 ((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::miscdataoffset 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::miscdataoffset)55 @loop56 (lwzx yy temp0 j)57 (mulld yy xx yy)58 ;; 64bit product now in %yy59 (lwzx rr temp1 i)60 ;; add in digit from r[i]61 (add rr rr yy)62 ;; add in carry63 (add rr rr cc)64 (stwx rr temp1 i)65 (srdi cc rr 32) ;get carry digit into low word66 (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 (setnargs 0)73 (la vsp 16 vsp)74 (blr)))75 39 76 40 (defppclapfunction %multiplyandaddloop64 … … 163 127 (ba .SPvalues))) 164 128 129 (defppclapfunction %multiplyandaddfixnumloop ((len64 0) (x arg_x) (y arg_y) (result arg_z)) 130 (let ((carry imm4) 131 (iidx imm3) 132 (unboxedy imm0) 133 (i temp0) 134 (hi imm2) 135 (rlen temp1)) 136 (vpop rlen) 137 (li carry 0) 138 (li iidx ppc64::miscdataoffset) 139 (li i 0) 140 (b @test) 141 @loop 142 (unboxfixnum unboxedy y) 143 (ldx imm1 x iidx) 144 (rotldi imm1 imm1 32) 145 (mulhdu hi imm1 unboxedy) 146 (mulld imm0 imm1 unboxedy) 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 165 162 ;;; Return the (possibly truncated) 32bit quotient and remainder 166 163 ;;; resulting from dividing hi:low by divisor.
Note: See TracChangeset
for help on using the changeset viewer.