/[cmucl]/src/code/dfixnum.lisp
ViewVC logotype

Diff of /src/code/dfixnum.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by rtoy, Fri Mar 19 15:18:58 2010 UTC revision 1.5 by rtoy, Mon Apr 19 02:18:03 2010 UTC
# Line 61  Line 61 
61    (l 0 :type dfparttype))    (l 0 :type dfparttype))
62    
63  (defun dfixnum-inc-df (v i)  (defun dfixnum-inc-df (v i)
64    _N"increments dfixnum v by dfixnum i"    "increments dfixnum v by dfixnum i"
65    (declare (type dfixnum v) (type dfixnum i))    (declare (type dfixnum v) (type dfixnum i))
66    (let ((low (+ (dfixnum-l v) (dfixnum-l i))))    (let ((low (+ (dfixnum-l v) (dfixnum-l i))))
67      (if (> low dfmax)      (if (> low dfmax)
# Line 81  Line 81 
81    (setf (dfixnum-l v) (dfixnum-l i)))    (setf (dfixnum-l v) (dfixnum-l i)))
82    
83  (defun dfixnum-inc-hf (v i)  (defun dfixnum-inc-hf (v i)
84    _N"increments dfixnum v by i (max half fixnum)"    "increments dfixnum v by i (max half fixnum)"
85    (declare (type dfixnum v) (type fixnum i))    (declare (type dfixnum v) (type fixnum i))
86    (when (> i dfmax)    (when (> i dfmax)
87        (error _"not a half-fixnum: ~a" i))        (error _"not a half-fixnum: ~a" i))
# Line 96  Line 96 
96    v)    v)
97    
98  (defun dfixnum-dec-df (v i)  (defun dfixnum-dec-df (v i)
99    _N"decrement dfixnum v by dfixnum i"    "decrement dfixnum v by dfixnum i"
100    (declare (type dfixnum v) (type dfixnum i))    (declare (type dfixnum v) (type dfixnum i))
101    (let ((low (- (dfixnum-l v) (dfixnum-l i)))    (let ((low (- (dfixnum-l v) (dfixnum-l i)))
102          (high (- (dfixnum-h v) (dfixnum-h i))))          (high (- (dfixnum-h v) (dfixnum-h i))))
# Line 111  Line 111 
111    v)    v)
112    
113  (defun dfixnum-dec-hf (v i)  (defun dfixnum-dec-hf (v i)
114    _N"decrement dfixnum v by half-fixnum i"    "decrement dfixnum v by half-fixnum i"
115    (declare (type dfixnum v) (type (integer 0 #.dfmax) i))    (declare (type dfixnum v) (type (integer 0 #.dfmax) i))
116    (let ((low (- (dfixnum-l v) i))    (let ((low (- (dfixnum-l v) i))
117          (high (dfixnum-h v)))          (high (dfixnum-h v)))
# Line 126  Line 126 
126    v)    v)
127    
128  (defun dfixnum-inc-integer (df i)  (defun dfixnum-inc-integer (df i)
129    _N"increments dfixnum by an interger which may be bigger than fixnum.    "increments dfixnum by an interger which may be bigger than fixnum.
130     May cons"     May cons"
131    (declare (type dfixnum df) (integer i) (optimize (ext:inhibit-warnings 3)))    (declare (type dfixnum df) (integer i) (optimize (ext:inhibit-warnings 3)))
132    (let ((carry (+ (dfixnum-l df) (mod i dfmax))))    (let ((carry (+ (dfixnum-l df) (mod i dfmax))))
# Line 145  Line 145 
145    (setf (dfixnum-l df) (mod i dfmax)))    (setf (dfixnum-l df) (mod i dfmax)))
146    
147  (defun dfixnum-make-from-number (i)  (defun dfixnum-make-from-number (i)
148    _N"returns a new dfixnum from number i"    "returns a new dfixnum from number i"
149    (declare (type number i) (optimize (ext:inhibit-warnings 3)))    (declare (type number i) (optimize (ext:inhibit-warnings 3)))
150    (let ((df (make-dfixnum)))    (let ((df (make-dfixnum)))
151      (declare (type dfixnum df))      (declare (type dfixnum df))
# Line 190  Line 190 
190       (setf ,l (dfixnum-l ,dfnum))))       (setf ,l (dfixnum-l ,dfnum))))
191    
192  (defmacro dfixnum-inc-pair (vh vl ih il)  (defmacro dfixnum-inc-pair (vh vl ih il)
193    _N"increments a pair of halffixnums by another pair"    "increments a pair of halffixnums by another pair"
194    `(progn    `(progn
195       (let ((low (+ ,vl ,il)))       (let ((low (+ ,vl ,il)))
196         (if (> low dfmax)         (if (> low dfmax)
# Line 207  Line 207 
207    (+ (* h dfmax) l))    (+ (* h dfmax) l))
208    
209  (defmacro dfixnum-dec-pair (vh vl ih il)  (defmacro dfixnum-dec-pair (vh vl ih il)
210    _N"decrement dfixnum pair by another pair"    "decrement dfixnum pair by another pair"
211    `(let ((low (- ,vl ,il))    `(let ((low (- ,vl ,il))
212           (high (- ,vh ,ih)))           (high (- ,vh ,ih)))
213       (declare (type fixnum low high))       (declare (type fixnum low high))

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.5