Changeset 14235


Ignore:
Timestamp:
Sep 7, 2010, 6:03:11 PM (9 years ago)
Author:
rme
Message:

Abandon my attempts to do more low-level tricks with logand and logior
in the front end.

Location:
trunk/source/compiler
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x862.lisp

    r14196 r14235  
    1029210292      (^))))
    1029310293
    10294 (defx862 x862-%fixnum-mask-to-natural %fixnum-mask-to-natural (seg vreg xfer arg)
    10295   (with-imm-target () (target :natural)
    10296     (let ((r (x862-one-untargeted-reg-form seg arg *x862-arg-z*)))
    10297       (unless (or (acode-fixnum-form-p arg)
    10298                   *x862-reckless*)
    10299         (! trap-unless-fixnum r))
    10300       (! fixnum->signed-natural target r)
    10301       (<- target)
    10302       (^))))
    10303 
    1030410294(defx862 x862-%double-float %double-float (seg vreg xfer arg)
    1030510295  (let* ((real (or (acode-fixnum-form-p arg)
  • trunk/source/compiler/nx0.lisp

    r14229 r14235  
    27672767             (64 (subtypep *nx-form-type* '(unsigned-byte 64))))))))
    27682768
    2769 (defun nx-logand-2-op (form1 form2 env)
    2770   (let* ((acode1 (nx1-form form1))
    2771          (acode2 (nx1-form form2))
    2772          (fix1 (nx-acode-fixnum-type-p acode1 env))
    2773          (fix2 (nx-acode-fixnum-type-p acode2 env)))
    2774     (if (and fix1 fix2)
    2775       (make-acode (%nx1-operator %ilogand2) acode1 acode2)
    2776       (let* ((natural-type (target-word-size-case
    2777                             (32 '(unsigned-byte 32))
    2778                             (64 '(unsigned-byte 64))))
    2779              (nat1 (or fix1 (nx-acode-form-typep acode1 natural-type env)))
    2780              (nat2 (or fix2 (nx-acode-form-typep acode2 natural-type env))))
    2781         (if (and nat1 nat2)
    2782           (make-acode (%nx1-operator typed-form) natural-type
    2783                       (make-acode (%nx1-operator %natural-logand)
    2784                                   acode1 acode2))
    2785           (make-acode (%nx1-operator logand2) acode1 acode2))))))
    2786 
    2787 (defun nx-logior-2-op (form1 form2 env)
    2788   (let* ((acode1 (nx1-form form1))
    2789          (acode2 (nx1-form form2))
    2790          (fix1 (nx-acode-fixnum-type-p acode1 env))
    2791          (fix2 (nx-acode-fixnum-type-p acode2 env)))
    2792     (if (and fix1 fix2)
    2793       (make-acode (%nx1-operator %ilogior2) acode1 acode2)
    2794       (let* ((natural-type (target-word-size-case
    2795                             (32 '(unsigned-byte 32))
    2796                             (64 '(unsigned-byte 64))))
    2797              (nat1 (or fix1 (nx-acode-form-typep acode1 natural-type env)))
    2798              (nat2 (or fix2 (nx-acode-form-typep acode2 natural-type env))))
    2799         (if (and nat1 nat2)
    2800           (make-acode (%nx1-operator typed-form) natural-type
    2801                       (make-acode (%nx1-operator %natural-logior)
    2802                                   acode1 acode2))
    2803           (make-acode (%nx1-operator logior2) acode1 acode2))))))
    2804 
    28052769(defun nx-binary-boole-op (whole env arg-1 arg-2 fixop intop naturalop)
    28062770  (let* ((use-fixop (nx-binary-fixnum-op-p arg-1 arg-2 env t))
  • trunk/source/compiler/nx1.lisp

    r14231 r14235  
    450450                (nx1-form newvalue)))
    451451
    452 (defnx1 nx1-logior-2 ((logior-2)) (&environment env arg-1 arg-2)
    453   (nx-logior-2-op arg-1 arg-2 env))
     452(defnx1 nx1-logior-2 ((logior-2)) (&whole w &environment env arg-1 arg-2)
     453  (nx-binary-boole-op w
     454                      env
     455                      arg-1
     456                      arg-2
     457                      (%nx1-operator %ilogior2)
     458                      (%nx1-operator logior2)
     459                      (%nx1-operator %natural-logior)))
    454460
    455461(defnx1 nx1-logxor-2 ((logxor-2)) (&whole w &environment env arg-1 arg-2)
     
    462468                      (%nx1-operator %natural-logxor)))
    463469
    464 (defnx1 nx1-logand-2 ((logand-2)) (&environment env arg-1 arg-2)
    465   (nx-logand-2-op arg-1 arg-2 env))
     470(defnx1 nx1-logand-2 ((logand-2)) (&whole w &environment env arg-1 arg-2)
     471  (nx-binary-boole-op w
     472                      env
     473                      arg-1
     474                      arg-2
     475                      (%nx1-operator %ilogand2)
     476                      (%nx1-operator logand2)
     477                      (%nx1-operator %natural-logand)))
    466478
    467479(defnx1 nx1-require ((require-simple-vector)
     
    21952207              (nx1-form arg)))
    21962208
    2197 (defnx1 nx1-%fixnum-mask-to-natural ((%fixnum-mask-to-natural)) (arg)
    2198   (make-acode (%nx1-operator %fixnum-mask-to-natural)
    2199               (nx1-form arg)))
    2200 
    22012209(defnx1 nx1-%double-float ((%double-float)) (&whole whole arg &optional (result nil result-p))
    22022210  (declare (ignore result))
  • trunk/source/compiler/nxenv.lisp

    r13887 r14235  
    370370     (%double-float . #. #.(logior operator-acode-subforms-mask operator-assignment-free-mask operator-single-valued-mask))
    371371     (i386-ff-call . 0)
    372      (i386-syscall . 0)
    373      (%fixnum-mask-to-natural  . #.(logior operator-assignment-free-mask operator-single-valued-mask operator-acode-subforms-mask operator-side-effect-free-mask)))))
     372     (i386-syscall . 0))))
    374373
    375374(defmacro %nx1-operator (sym)
Note: See TracChangeset for help on using the changeset viewer.