1 ;;;; allocating simple objects
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
17 ;;;; from signed/unsigned
19 ;;; KLUDGE: Why don't we want vops for this one and the next
20 ;;; one? -- WHN 19990916
21 #+sb-assembling ; We don't want a vop for this one.
22 (define-assembly-routine
24 ((:temp eax unsigned-reg eax-offset)
25 (:temp ebx unsigned-reg ebx-offset))
34 (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 1))
35 (storew eax ebx bignum-digits-offset other-pointer-type))
39 #+sb-assembling ; We don't want a vop for this one either.
40 (define-assembly-routine
42 ((:temp eax unsigned-reg eax-offset)
43 (:temp ebx unsigned-reg ebx-offset))
45 (inst test eax #xe0000000)
53 ;;; Note: On the mips port space for a two word bignum is always
54 ;;; allocated and the header size is set to either one or two words
55 ;;; as appropriate. On the mips port this is faster, and smaller
56 ;;; inline, but produces more garbage. The inline x86 version uses
57 ;;; the same approach, but here we save garbage and allocate the
58 ;;; smallest possible bignum.
59 (inst jmp :ns one-word-bignum)
63 (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 2))
64 (storew eax ebx bignum-digits-offset other-pointer-type))
68 (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 1))
69 (storew eax ebx bignum-digits-offset other-pointer-type))