Changeset 13876


Ignore:
Timestamp:
Jun 24, 2010, 4:29:24 AM (9 years ago)
Author:
rme
Message:

purported improvements to logand

Location:
branches/rme-logops/compiler
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/rme-logops/compiler/X86/x862.lisp

    r13538 r13876  
    1009410094      (^))))
    1009510095
     10096(defx862 x862-%fixnum-mask-to-natural %fixnum-mask-to-natural (seg vreg xfer arg)
     10097  (with-imm-target () (target :natural)
     10098    (let ((r (x862-one-untargeted-reg-form seg arg *x862-arg-z*)))
     10099      (unless (or (acode-fixnum-form-p arg)
     10100                  *x862-reckless*)
     10101        (! trap-unless-finxum r))
     10102      (! fixnum->signed-natural target r)
     10103      (<- target)
     10104      (^))))
     10105
    1009610106(defx862 x862-%double-float %double-float (seg vreg xfer arg)
    1009710107  (let* ((real (or (acode-fixnum-form-p arg)
  • branches/rme-logops/compiler/nx0.lisp

    r13813 r13876  
    27132713    (subtypep (nx-form-type arg env) type env)))
    27142714
     2715(defun nx-fixnum-op-p (form env)
     2716  (target-word-size-case
     2717   (32 (nx-form-typep form '(signed-byte 30) env))
     2718   (64 (nx-form-typep form '(signed-byte 61) env))))
     2719
     2720(defun nx-natural-op-p (form env)
     2721  (target-word-size-case
     2722   (32 (nx-form-typep form '(unsigned-byte 32) env))
     2723   (64 (nx-form-typep form '(unsigned-byte 64) env))))
    27152724
    27162725(defun nx-binary-fixnum-op-p (form1 form2 env &optional ignore-result-type)
     
    27462755             (64 (subtypep *nx-form-type* '(unsigned-byte 64))))))))
    27472756
    2748    
    2749 
     2757(defun nx-logand-2-op (arg-1 arg-2 env)
     2758  (let ((fix-1 (nx-fixnum-op-p arg-1 env))
     2759        (fix-2 (nx-fixnum-op-p arg-2 env))
     2760        (nat-1 (nx-natural-op-p arg-1 env))
     2761        (nat-2 (nx-natural-op-p arg-2 env))
     2762        (form-1 (nx1-form arg-1))
     2763        (form-2 (nx1-form arg-2)))
     2764    (cond
     2765      ((and fix-1 fix-2)
     2766       (make-acode (%nx1-operator %ilogand2) form-1 form-2))
     2767      ((and nat-1 nat-2)
     2768       (make-acode (%nx1-operator typed-form)
     2769                   (target-word-size-case
     2770                    (32 '(unsigned-byte 32))
     2771                    (64 '(unsigned-byte 64)))
     2772                   (make-acode (%nx1-operator %natural-logand) form-1 form-2)))
     2773      ((and fix-1 nat-2)
     2774       (make-acode (%nx1-operator typed-form)
     2775                   (target-word-size-case
     2776                    (32 '(unsigned-byte 32))
     2777                    (64 '(unsigned-byte 64)))
     2778                   (make-acode (%nx1-operator %natural-logand)
     2779                               (make-acode (%nx1-operator %fixnum-mask-to-natural)
     2780                                           form-1)
     2781                               form-2)))
     2782      ((and nat-1 fix-2)
     2783       (make-acode (%nx1-operator typed-form)
     2784                   (target-word-size-case
     2785                    (32 '(unsigned-byte 32))
     2786                    (64 '(unsigned-byte 64)))
     2787                   (make-acode (%nx1-operator %natural-logand)
     2788                               form-1
     2789                               (make-acode (%nx1-operator %fixnum-mask-to-natural)
     2790                                                          form-2))))
     2791      (t
     2792       (make-acode (%nx1-operator logand2) form-1 form-2)))))
     2793         
    27502794
    27512795(defun nx-binary-boole-op (whole env arg-1 arg-2 fixop intop naturalop)
  • branches/rme-logops/compiler/nx1.lisp

    r13488 r13876  
    468468                      (%nx1-operator %natural-logxor)))
    469469
     470(defnx1 nx1-logand-2 ((logand-2)) (&environment env arg-1 arg-2)
     471  (nx-logand-2-op arg-1 arg-2 env))
     472
     473#+not-any-more
    470474(defnx1 nx1-logand-2 ((logand-2)) (&whole w &environment env arg-1 arg-2)
    471475  (nx-binary-boole-op w
     
    21982202              (nx1-form arg)))
    21992203
     2204(defnx1 nx1-%fixnum-mask-to-natural ((%fixnum-mask-to-natural)) (arg)
     2205  (make-acode (%nx1-operator %fixnum-mask-to-natural)
     2206              (nx1-form arg)))
     2207
    22002208(defnx1 nx1-%double-float ((%double-float)) (&whole whole arg &optional (result nil result-p))
    22012209  (declare (ignore result))
  • branches/rme-logops/compiler/nxenv.lisp

    r13782 r13876  
    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))))
     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)))))
    373374
    374375(defmacro %nx1-operator (sym)
Note: See TracChangeset for help on using the changeset viewer.