Ignore:
Timestamp:
Feb 7, 2010, 7:00:33 AM (9 years ago)
Author:
gb
Message:

An unsigned-byte of the native word size shifted right by a value

the number of bits in a native word is always 0.

Closes ticket:660.

File:
1 edited

Legend:

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

    r13262 r13437  
    21902190(defnx1 nx1-symvector ((%symptr->symvector) (%symvector->symptr)) (arg)
    21912191  (make-acode (%nx1-default-operator) (nx1-form arg)))
    2192        
     2192
     2193
    21932194(defnx1 nx1-ash (ash) (&whole call &environment env num amt)
    21942195  (let* ((unsigned-natural-type (target-word-size-case
     
    22082209                         (nx1-form num))
    22092210             (if (nx-form-typep num unsigned-natural-type env)
    2210                (make-acode (%nx1-operator natural-shift-right)
    2211                            (nx1-form num)
    2212                            (make-acode (%nx1-operator fixnum)
    2213                                        (min (1- max) (- amt))))
     2211               (if (< (- amt) max)
     2212                 (make-acode (%nx1-operator natural-shift-right)
     2213                             (nx1-form num)
     2214                             (make-acode (%nx1-operator fixnum)
     2215                                         (- amt)))
     2216                 (nx1-form `(progn (require-type ,num 'integer) 0) env))
    22142217               (nx1-treat-as-call call))))
    22152218          ((and (fixnump amt)
Note: See TracChangeset for help on using the changeset viewer.