Changeset 8827


Ignore:
Timestamp:
Mar 19, 2008, 5:23:56 PM (12 years ago)
Author:
rme
Message:

Add some stubs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-0/X86/X8632/x8632-bignum.lisp

    r8213 r8827  
    1717  (set-nargs 2)
    1818  (jmp-subprim .SPvalues))
     19
     20(defx8632lapfunction %bignum-ref-hi ((bignum arg_y) (i arg_z))
     21  (int ($ 3)))
     22
     23
    1924
    2025;;; BIGNUM[I] := DIGIT[0]
     
    691696;;; in two halves.
    692697(defx8632lapfunction %floor-loop-quo ((x 8) (q 4) #|(ra 0)|# (yhi arg_y) (ylo arg_z))
    693   )
    694 
    695 
    696 
     698  (int ($ 3)))
     699
     700(defx8632lapfunction %floor-loop-no-quo ((q 4) #|(ra 0)|# (yhi arg_y) (ylo arg_z))
     701  (int ($ 3)))
     702
     703(defx8632lapfunction truncate-guess-loop ((guess-h 16) (guess-l 12) (x 8)
     704                                          (xidx 4) #|(ra 0)|#
     705                                          (yptr arg_y) (yidx arg_z))
     706  (int ($ 3)))
     707
     708(defx8632lapfunction %floor-99 ((x-stk 8) (xidx 4) #|(ra 0)|#
     709                                (yptr arg_y) (yidx arg_z))
     710  (int ($ 3)))
     711
     712(defx8632lapfunction %multiply-and-add-1 ((x-high 16)
     713                                          (x-low 12)
     714                                          (y-high 8)
     715                                          (y-low 4)
     716                                          #|(ra 0)|#
     717                                          (carry-in-high arg_y)
     718                                          (carry-in-low arg_z))
     719  (int ($ 3)))
     720
     721;;; Copy the limb SRC points to to where DEST points.
     722(defx8632lapfunction copy-limb ((src arg_y) (dest arg_z))
     723  (int ($ 3)))
     724
     725;;; Return T iff LIMB contains 0.
     726(defx8632lapfunction limb-zerop ((limb arg_z))
     727  (int ($ 3)))
     728
     729;;; Return -1,0,1 according to whether the contents of Y are
     730;;; <,=,> the contents of Z.
     731(defx8632lapfunction compare-limbs ((y arg_y) (z arg_z))
     732  (int ($ 3)))
     733
     734;;; Add a fixnum to the limb LIMB points to.  Ignore overflow.
     735(defx8632lapfunction add-fixnum-to-limb ((fixnum arg_y) (limb arg_z))
     736  (int ($ 3)))
     737
     738;;; Store a fixnum value where LIMB points.
     739(defx8632lapfunction copy-fixnum-to-limb ((fixnum arg_y) (limb arg_z))
     740  (int ($ 3)))
     741
     742;;; Increment a "LIMB VECTOR" (bignum) by a small amount.  The caller
     743;;; knows that carries will only propagate for a word or two.
     744(defx8632lapfunction mpn-incr-u ((limb arg_y) (fixby arg_z))
     745  (int ($ 3)))
     746
     747;;; Store XP-YP at WP; return carry (0 or 1).
     748;;; wp, xp, yp: word-aligned, unboxed ptrs (fixnums)
     749;;; size: boxed fixnum
     750;;; returns boxed carry
     751(defx8632lapfunction mpn-sub-n ((wp 8) (xp 4) #|(ra 0)|#
     752                                (yp arg_y) (size arg_z))
     753  (int ($ 3)))
     754
     755;;; Store XP+YP at WP; return carry (0 or 1).
     756;;; wp, xp, yp = word-aligned, unboxed macptrs (fixnums).
     757;;; size = boxed fixnum
     758;;; result = boxed carry
     759(defx8632lapfunction mpn-add-n ((wp 8) (xp 4) #|(ra 0)|#
     760                                (yp arg_y) (size arg_z))
     761  (int ($ 3)))
     762
     763;;; Add the single limb LIMB to S1P (propagating carry.)  Store the
     764;;; result at RP.  RP and S1P may be the same place, so check for
     765;;; that and do nothing after carry stops propagating.  Return carry.
     766(defx8632lapfunction mpn-add-1 ((rp-offset 8) (s1p 4) #|(ra 0)|#
     767                                (size arg_y) (limb arg_z))
     768  (int ($ 3)))
     769
     770;;; Multiply the limb vector S1 by the single limb at LIMBPTR, storing
     771;;; the result at RES.  Store the "carry out" (high word of last 64-bit
     772;;; partial product) at the limb RESULT.
     773;;; res, s1, limbptr, result:
     774;;;   unboxed, word-aligned ptrs (fixnums).  size: boxed fixnum
     775;;; It'd be hard to transliterate the GMP code here; the GMP version
     776;;; uses lots more immediate registers than we can easily use in LAP
     777;;; (and is much more aggressively pipelined).
     778(defx8632lapfunction mpn-mul-1 ((res-offset 12)
     779                                (s1-offset 8)
     780                                (size 4)
     781                                #|(ra 0)|#
     782                                (limbptr arg_y)
     783                                (result arg_z))
     784  (int ($ 3)))
     785
     786;;; multiply s1*limb and add result to res
     787;;; res, s1, limbptr, result:
     788;;;   unboxed, word-aligned ptrs (fixnums).
     789;;; size: boxed fixnum
     790;;; limbptr: source "limb".
     791;;; result: carry out (high word of product).
     792(defx8632lapfunction mpn-addmul-1 ((res-offset 12)
     793                                   (s1-offset 8)
     794                                   (size 4)
     795                                   #|(ra 0)|#
     796                                   (limbptr arg_y)
     797                                   (result arg_z))
     798  (int ($ 3)))
     799
     800;;; Multiply the UN-word limb vector at UP and the VN-word limb vector
     801;;; at VP, store the result at RP.
     802(defx8632lapfunction mpn-mul-basecase ((rp-offset 12)
     803                                       (up-offset 8)
     804                                       (un 4)
     805                                       #|(ra 0)|#
     806                                       (vp arg_y)
     807                                       (vn arg_z))
     808  (int ($ 3)))
     809
     810;;; left-shift src by 1 bit, storing result at res.  Return
     811;;; the bit that was shifted out.
     812(defx8632lapfunction mpn-lshift-1 ((resptr 4) #|(ra 0)|#
     813                                   (s1ptr arg_y) (size-arg arg_z))
     814  (int ($ 3)))
     815
     816;;; Do a 32x32=64 unsigned multiply of the words at X and Y.  Store
     817;;; result (low word first) at RESULT.
     818(defx8632lapfunction umulppm ((x 4) #|(ra 0)|# (y arg_y) (result arg_z))
     819  (int ($ 3)))
     820
     821(defx8632lapfunction %fixnum-to-bignum-set ((bignum arg_y) (fixnum arg_z))
     822  (unbox-fixnum fixnum imm0)
     823  (movl (% imm0) (@ x8632::misc-data-offset (% bignum)))
     824  (single-value-return))
Note: See TracChangeset for help on using the changeset viewer.