Changeset 13890


Ignore:
Timestamp:
Jun 25, 2010, 8:36:08 PM (9 years ago)
Author:
rme
Message:

Ugly additions to nx-logand-2-op to truncate a large integer
operand to natural size when it is known that the other
operand is a natural.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx0.lisp

    r13887 r13890  
    581581                    (if (acode-p x)
    582582                      (if (and (eq (acode-operator x) (%nx1-operator immediate))
    583                                (typep (cadr x) 'fixnum))
     583                               (typep (cadr x) 'integer))
    584584                        (cadr x)))))))
    585585    (and int
     
    595595                    (if (acode-p x)
    596596                      (if (and (eq (acode-operator x) (%nx1-operator immediate))
    597                                (typep (cadr x) 'fixnum))
     597                               (typep (cadr x) 'integer))
    598598                        (cadr x)))))))
    599599    (and int
     
    27782778         (fix-2 (nx-acode-fixnum-type-p form-2 env))
    27792779         (nat-1 (nx-acode-natural-type-p form-1 env))
    2780          (nat-2 (nx-acode-natural-type-p form-2 env)))
     2780         (nat-2 (nx-acode-natural-type-p form-2 env))
     2781         (natural-width (target-word-size-case (32 32) (64 64)))
     2782         (natural-mask (1- (ash 1 natural-width))))
     2783    (when (and nat-1
     2784               (not nat-2)
     2785               (acode-integer-constant-p form-2 natural-width))
     2786        (setq form-2 (nx1-form (logand natural-mask arg-2))
     2787              nat-2 t))
     2788    (when (and (not nat-1)
     2789               nat-2
     2790               (acode-integer-constant-p form-1 natural-width))
     2791        (setq form-1 (nx1-form (logand natural-mask arg-1))
     2792              nat-1 t))
    27812793    (cond
    27822794      ((and fix-1 fix-2)
Note: See TracChangeset for help on using the changeset viewer.