Changeset 11532


Ignore:
Timestamp:
01/03/09 19:02:39 (13 years ago)
Author:
vvoutilainen
Message:

Helper function for p2-test-minusp/plusp/zerop.

File:
1 edited

Legend:

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

    r11531 r11532  
    31943194             (p2-test-predicate form "listp"))))))
    31953195
    3196 (defun p2-test-minusp (form)
     3196(defun p2-test-minusp/plusp/zerop (form instruction predicate)
    31973197  (when (check-arg-count form 1)
    31983198    (let ((arg (%cadr form)))
    31993199      (cond ((fixnum-type-p (derive-compiler-type arg))
    32003200       (compile-forms-and-maybe-emit-clear-values arg 'stack :int)
    3201              'ifge)
     3201             instruction)
    32023202            (t
    3203              (p2-test-predicate form "minusp"))))))
     3203             (p2-test-predicate form predicate))))))
     3204
     3205(defun p2-test-minusp (form)
     3206  (p2-test-minusp/plusp/zerop form 'ifge "minusp"))
    32043207
    32053208(defun p2-test-plusp (form)
    3206   (when (check-arg-count form 1)
    3207     (let ((arg (%cadr form)))
    3208       (cond ((fixnum-type-p (derive-compiler-type arg))
    3209      (compile-forms-and-maybe-emit-clear-values arg 'stack :int)
    3210              'ifle)
    3211             (t
    3212              (p2-test-predicate form "plusp"))))))
     3209  (p2-test-minusp/plusp/zerop form 'ifle "plusp"))
    32133210
    32143211(defun p2-test-zerop (form)
    3215   (when (check-arg-count form 1)
    3216     (let ((arg (%cadr form)))
    3217       (cond ((fixnum-type-p (derive-compiler-type arg))
    3218      (compile-forms-and-maybe-emit-clear-values arg 'stack :int)
    3219              'ifne)
    3220             (t
    3221              (p2-test-predicate form "zerop"))))))
     3212  (p2-test-minusp/plusp/zerop form 'ifne "zerop"))
    32223213
    32233214(defun p2-test-numberp (form)
Note: See TracChangeset for help on using the changeset viewer.