Changeset 14980


Ignore:
Timestamp:
Sep 12, 2011, 6:35:39 PM (8 years ago)
Author:
gb
Message:

Add (%nx1-operator div2) to *numeric-acode-ops*; this allows us to
do some simple type inference/handle some cases of numeric contagion
involving two-arg #'/. (We don't do anything with INTEGER-typed args;
if we ever did, we'd have to be careful with #'/ here.)

In NX1-NOTE-VAR-BINDING, be careful: NX-ACODE-FORM-TYPE can
destrictively modify its argument, making an acode from that's had
type info stripped from it bcome a type-asserted form. Change the
order in which the variables INIT and INITTYPE are initialized so
that we can recognize:

  (let* ((v0 v1))
    ...)

and consider whether or not the two variables need to be disjoint.

While we're at it: ACODE-FORM-TYPE (which does these destructive type
assertions) is supposed to plead ignorance when it encounters a
lexical reference and it's called from the frontend. It really
shouldn't assert that ignorance, which may inhibit subsequent calls
from the backend from determining type info when more information
is available.

File:
1 edited

Legend:

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

    r14972 r14980  
    450450  (list (%nx1-operator add2)
    451451        (%nx1-operator sub2)
    452         (%nx1-operator mul2)))
     452        (%nx1-operator mul2)
     453        (%nx1-operator div2)))
    453454
    454455
     
    484485                                (if (eq op (%nx1-operator lexical-reference))
    485486                                  (locally (declare (special *nx-in-frontend*))
    486                                     (unless *nx-in-frontend*
     487                                    (if *nx-in-frontend*
     488                                      (setq assert nil)
    487489                                      (let* ((var (cadr form))
    488490                                             (bits (nx-var-bits var))
     
    10441046;;; can be punted.
    10451047(defun nx1-note-var-binding (var initform)
    1046   (let* ((init (nx-untyped-form initform))
    1047          (inittype (nx-acode-form-type initform *nx-lexical-environment*))
     1048  (let* ((inittype (nx-acode-form-type initform *nx-lexical-environment*))
     1049         (init (nx-untyped-form initform))
    10481050         (bits (nx-var-bits var)))
    10491051    (when (%ilogbitp $vbitspecial bits) (nx-record-xref-info :binds (var-name var)))
Note: See TracChangeset for help on using the changeset viewer.