Changeset 11545


Ignore:
Timestamp:
01/04/09 22:21:07 (12 years ago)
Author:
vvoutilainen
Message:

Another small helper for p2-plus/minus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11544 r11545  
    65876587          (compile-function-call form target representation))))
    65886588
     6589(defun fixnum-result-plus/minus (target representation result-type arg1 arg2
     6590         int-op long-op)
     6591  (cond ((or (eq representation :int)
     6592       (fixnum-type-p result-type))
     6593   (new-fixnum (null representation))
     6594   (compile-forms-and-maybe-emit-clear-values arg1 'stack :int
     6595                arg2 'stack :int)
     6596   (emit int-op)
     6597   (emit-fixnum-init representation))
     6598  (t
     6599   (two-long-ints-times/plus/minus
     6600    arg1 arg2 long-op representation)))
     6601  (emit-move-from-stack target representation))
     6602
    65896603(defun p2-plus (form target representation)
    65906604  (case (length form)
     
    66146628              (emit-move-from-stack target representation))
    66156629             ((and (fixnum-type-p type1) (fixnum-type-p type2))
    6616               (cond ((or (eq representation :int)
    6617                          (fixnum-type-p result-type))
    6618          (new-fixnum (null representation))
    6619          (compile-forms-and-maybe-emit-clear-values arg1 'stack :int
    6620                 arg2 'stack :int)
    6621                      (emit 'iadd)
    6622          (emit-fixnum-init representation))
    6623                     (t
    6624          (two-long-ints-times/plus/minus
    6625           arg1 arg2 'ladd representation)))
    6626               (emit-move-from-stack target representation))
     6630        (fixnum-result-plus/minus target representation result-type
     6631          arg1 arg2 'iadd 'ladd))
    66276632             ((and (java-long-type-p type1)
    66286633                   (java-long-type-p type2)
     
    67206725              (compile-constant (- arg1 arg2) target representation))
    67216726             ((and (fixnum-type-p type1) (fixnum-type-p type2))
    6722               (cond ((or (eq representation :int)
    6723                          (fixnum-type-p result-type))
    6724          (new-fixnum (null representation))
    6725          (compile-forms-and-maybe-emit-clear-values arg1 'stack :int
    6726                 arg2 'stack :int)
    6727                      (emit 'isub)
    6728          (emit-fixnum-init representation))
    6729                     (t
    6730          (two-long-ints-times/plus/minus
    6731           arg1 arg2 'lsub representation)))
    6732               (emit-move-from-stack target representation))
     6727        (fixnum-result-plus/minus target representation result-type
     6728          arg1 arg2 'isub 'lsub))
    67336729             ((and (java-long-type-p type1) (java-long-type-p type2)
    67346730                   (java-long-type-p result-type))
Note: See TracChangeset for help on using the changeset viewer.