Changeset 13818


Ignore:
Timestamp:
Jun 14, 2010, 10:12:11 AM (10 years ago)
Author:
gb
Message:

Make the fact that some things that handle overflow out-of-line set
arg_z explicit (failing to do that confused the register-tracking
code.) Screw: should really treat them as :calls, since they
sometimes do subprim calls.
Fix closure allocation/initialization (need entrypoint slot);
compare-immediate confusion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/compiler/ARM/arm2.lisp

    r13795 r13818  
    24522452             (dest ($ arm::arg_z))
    24532453             (vsize (+ (length inherited-vars)
    2454                        2                ; %closure-code%, afunc
     2454                       3                ; entrypoint,%closure-code%, afunc
    24552455                       2)))             ; name, lfun-bits
    24562456        (declare (list inherited-vars))
     
    24602460                   (*arm2-top-vstack-lcell* *arm2-top-vstack-lcell*))
    24612461              (arm2-lri seg arm::arg_x (ash (nx-lookup-target-uvector-subtag :function) *arm2-target-fixnum-shift*))
     2462              (arm2-lri seg arm::temp0 (subprim-name->offset '.SPfix-nfn-entrypoint))
    24622463              (! %closure-code% arm::arg_y)
    24632464              (arm2-store-immediate seg (arm2-afunc-lfun-ref afunc) arm::arg_z)
     2465              (arm2-vpush-register-arg seg arm::temp0)
    24642466              (arm2-vpush-register-arg seg arm::arg_x)
    24652467              (arm2-vpush-register-arg seg arm::arg_y)
     
    24752477              (! make-stack-gvector))
    24762478            (arm2-open-undo $undostkblk))
    2477           (let* ((cell 0))
     2479          (let* ((cell 1))
    24782480            (declare (fixnum cell))
    24792481            (progn
     
    24822484                        (arch::make-vheader vsize (nx-lookup-target-uvector-subtag :function)))
    24832485              (! %alloc-misc-fixed dest arm::imm0 (ash vsize (arch::target-word-shift arch)))
    2484               )       
     2486              )
     2487            (! lri arm::arg_x (subprim-name->offset '.SPfix-nfn-entrypoint))
     2488            (! misc-set-c-node arm::arg_x dest 0)
    24852489            (! %closure-code% arm::arg_x)
    24862490            (arm2-store-immediate seg (arm2-afunc-lfun-ref afunc) arm::arg_y)
     
    30583062      (if (eql op (%nx1-operator fixnum))
    30593063        (let* ((val (ash (cadr form) arm::fixnumshift)))
    3060           (if (arm::encode-arm-immediate val)
    3061             (logand val #xffffffff)
    3062             (if (arm::encode-arm-immediate (lognot val))
    3063               (logand (lognot val) #xffffffff))))
     3064          (if (or (arm::encode-arm-immediate val)
     3065                  (arm::encode-arm-immediate (- val)))
     3066            (logand val #xffffffff)))
    30643067        (if (eql op (%nx1-operator %unbound-marker))
    30653068          arm::unbound-marker
     
    31733176
    31743177(defun arm2-test-reg-%izerop (seg vreg xfer reg cr-bit true-p  zero)
    3175   (declare (fixnum reg zero))
     3178  (declare (fixnum reg))
    31763179  (with-arm-local-vinsn-macros (seg vreg xfer)
    31773180    (regspec-crf-gpr-case
     
    31793182     (progn
    31803183       (if (or (arm::encode-arm-immediate zero)
    3181                (arm::encode-arm-immediate (lognot zero)))
     3184               (arm::encode-arm-immediate (- zero)))
    31823185         (! compare-immediate dest reg zero)
    31833186         (with-node-target (reg) other
     
    31873190     (with-crf-target () crf
    31883191       (if (or (arm::encode-arm-immediate zero)
    3189                (arm::encode-arm-immediate (lognot zero)))
     3192               (arm::encode-arm-immediate (- zero)))
    31903193         (! compare-immediate crf reg (logand #xffffffff zero))
    31913194         (with-node-target (reg) other
     
    47734776        (arm::make-lap-label unique)))
    47744777    (labels ((parse-operand-form (valform)
    4775                ;(break "valform = ~s" valform)
     4778                                        ;(break "valform = ~s" valform)
    47764779               (cond ((typep valform 'keyword)
    47774780                      (or (assq valform unique-labels)
     
    48304833                     (if (eval-predicate (car f))
    48314834                       (dolist (subform (cdr f))
    4832                          (expand-form subform))))))))
     4835                           (expand-form subform))))))))
    48334836      (declare (dynamic-extent #'expand-form #'parse-operand-form #'expand-insn-form #'eval-predicate))
    4834       ;(format t "~& vinsn = ~s" vinsn)
     4837                                        ;(format t "~& vinsn = ~s" vinsn)
    48354838      (dolist (form (vinsn-template-body template))
    48364839        (expand-form form ))
     
    53385341          (! negate-fixnum-overflow-inline target src)
    53395342          (progn
    5340             (! negate-fixnum-overflow-ool src)
     5343            (! negate-fixnum-overflow-ool ($ arm::arg_z) src)
    53415344            (arm2-copy-register seg target ($ arm::arg_z))))))
    53425345    (^)))
     
    59485951          (! fixnum-add-overflow-inline-skip ($ arm::arg_z) ($ arm::arg_y) ($ arm::arg_z) (aref *backend-labels* done))
    59495952          (progn
    5950             (! fixnum-add-overflow-ool ($ arm::arg_y) ($ arm::arg_z))
     5953            (! fixnum-add-overflow-ool ($ arm::arg_z) ($ arm::arg_y) ($ arm::arg_z))
    59515954            (-> done)))
    59525955        (@ out-of-line)
     
    59705973          (! fixnum-sub-overflow-inline-skip ($ arm::arg_z) ($ arm::arg_y) ($ arm::arg_z) (aref *backend-labels* done))
    59715974          (progn
    5972             (! fixnum-sub-overflow-ool ($ arm::arg_y) ($ arm::arg_z))
     5975            (! fixnum-sub-overflow-ool ($ arm::arg_z)($ arm::arg_y) ($ arm::arg_z))
    59735976            (-> done)))
    59745977        (@ out-of-line)
     
    62666269                 (! fixnum-add-overflow-inline target r1 r2)
    62676270                 (progn
    6268                    (! fixnum-add-overflow-ool r1 r2)
     6271                   (! fixnum-add-overflow-ool ($ arm::arg_z) r1 r2)
    62696272                   (arm2-copy-register seg target ($ arm::arg_z)))))
    62706273             (^)))
     
    63296332                   (! fixnum-sub-overflow-inline target r1 r2)
    63306333                   (progn
    6331                      (! fixnum-sub-overflow-ool r1 r2)
     6334                     (! fixnum-sub-overflow-ool ($ arm::arg_z) r1 r2)
    63326335                     (arm2-copy-register seg target ($ arm::arg_z)))))
    63336336              (^)))
Note: See TracChangeset for help on using the changeset viewer.