Changeset 15149


Ignore:
Timestamp:
Dec 21, 2011, 10:28:20 PM (8 years ago)
Author:
gb
Message:

If the result of a "natural" arithmetic/logical operation is a
constant (as may be evident during late constant-folding), use
new function X862-NATURAL-CONSTANT to process it (and decide
whether to box, etc.)

Fixes ticket:899 in the trunk. Need to check PPC, ARM backends
to see if they have the same bug.

File:
1 edited

Legend:

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

    r15059 r15149  
    50305030    (^)))
    50315031
     5032(defun x862-natural-constant (seg vreg xfer value)
     5033  (x862-use-operator
     5034   (if (typep value *nx-target-fixnum-type*)
     5035     (%nx1-operator fixnum)
     5036     (%nx1-operator immediate))
     5037   seg vreg xfer value))
     5038
     5039
    50325040
    50335041
     
    1047310481           (fix-y (acode-fixnum-form-p y)))
    1047410482      (if (and fix-x fix-y)
    10475         (x862-absolute-natural seg vreg xfer (+ fix-x fix-y))
     10483        (x862-natural-constant seg vreg xfer (+ fix-x fix-y))
    1047610484        (let* ((u31x (and (typep fix-x '(unsigned-byte 31)) fix-x))
    1047710485               (u31y (and (typep fix-y '(unsigned-byte 31)) fix-y)))
     
    1049810506           (fix-y (acode-fixnum-form-p y)))
    1049910507      (if (and fix-x fix-y)
    10500         (x862-absolute-natural seg vreg xfer (- fix-x fix-y))
     10508        (x862-natural-constant seg vreg xfer (- fix-x fix-y))
    1050110509        (let* ((u31y (and (typep fix-y '(unsigned-byte 31)) fix-y)))
    1050210510          (if (not u31y)
     
    1052210530           (naturaly (nx-natural-constant-p y)))
    1052310531      (if (and naturalx naturaly)
    10524         (x862-absolute-natural seg vreg xfer (logior naturalx naturaly))
     10532        (x862-natural-constant seg vreg xfer (logior naturalx naturaly))
    1052510533        (let* ((u31x (nx-u31-constant-p x))
    1052610534               (u31y (nx-u31-constant-p y))
     
    1054810556           (naturaly (nx-natural-constant-p y)))
    1054910557      (if (and naturalx naturaly)
    10550         (x862-absolute-natural seg vreg xfer (logxor naturalx naturaly))
     10558        (x862-natural-constant seg vreg xfer (logxor naturalx naturaly))
    1055110559        (let* ((u32x (nx-u32-constant-p x))
    1055210560               (u32y (nx-u32-constant-p y))
     
    1057310581    (let* ((naturalx (nx-natural-constant-p x))
    1057410582           (naturaly (nx-natural-constant-p y)))
    10575       (if (and naturalx naturaly)
    10576         (x862-absolute-natural seg vreg xfer (logand naturalx naturaly))
     10583      (if (and naturalx naturaly)        
     10584        (x862-natural-constant seg vreg xfer (logand naturalx naturaly))
    1057710585        (let* ((u31x (nx-u31-constant-p x))
    1057810586               (u31y (nx-u31-constant-p y))
Note: See TracChangeset for help on using the changeset viewer.