Ignore:
Timestamp:
Oct 5, 2008, 2:39:10 AM (12 years ago)
Author:
gb
Message:

TARGET-NIL-VALUE in vinsn templates has to be invoked at vinsn-expand
time (via :apply), not at vinsn-definition time. In some cases, this
means that containing expressions are non-constant and have to be
evaluated at vinsn-expand time, as well.

Note that :apply of a 0-arg function didn't work prior to r10974, so
this is a little hard to bootstrap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/PPC/PPC32/ppc32-vinsns.lisp

    r10959 r10979  
    895895                                     (crf :crf)))
    896896  :again
    897   (cmpwi crf object (target-nil-value))
     897  (cmpwi crf object (:apply target-nil-value))
    898898  (clrlwi tag object (- ppc32::nbits-in-word ppc32::nlisptagbits))
    899899  (beq crf :got-it)
     
    15111511                                   ())
    15121512  (rlwimi bits bits (- ppc32::least-significant-bit 27) 27 27) ; bits = 0000...X000X
    1513   (addi dest bits (target-nil-value)))
     1513  (addi dest bits (:apply target-nil-value)))
    15141514
    15151515(define-ppc32-vinsn invert-lowbit (((bits :u32))
     
    15951595(define-ppc32-vinsn eqnil->bit31 (((bits :u32))
    15961596                                  ((x t)))
    1597   (subi bits x (target-nil-value))
     1597  (subi bits x (:apply target-nil-value))
    15981598  (cntlzw bits bits)
    15991599  (srwi bits bits 5))
     
    16091609(define-ppc32-vinsn nenil->bit31 (((bits :u32))
    16101610                                  ((x t)))
    1611   (subi bits x (target-nil-value))
     1611  (subi bits x (:apply target-nil-value))
    16121612  (cntlzw bits bits)
    16131613  (srwi bits bits 5)
     
    17021702(define-ppc32-vinsn compare-to-nil (((crf :crf))
    17031703                                    ((arg0 t)))
    1704   (cmpwi crf arg0 (target-nil-value)))
     1704  (cmpwi crf arg0 (:apply target-nil-value)))
    17051705
    17061706(define-ppc32-vinsn compare-logical (((crf :crf))
     
    19551955(define-ppc32-vinsn %closure-code% (((dest :lisp))
    19561956                                    ())
    1957   (lwz dest (+ ppc32::symbol.vcell (ppc32::nrs-offset %closure-code%) (target-nil-value)) 0))
     1957  (lwz dest (:apply + ppc32::symbol.vcell (ppc32::nrs-offset %closure-code%) (:apply target-nil-value)) 0))
    19581958
    19591959
     
    22372237(define-ppc32-vinsn (load-nil :constant-ref) (((dest t))
    22382238                                              ())
    2239   (li dest (target-nil-value)))
     2239  (li dest (:apply target-nil-value)))
    22402240
    22412241(define-ppc32-vinsn (load-t :constant-ref) (((dest t))
    22422242                                            ())
    2243   (li dest (+ ppc32::t-offset (target-nil-value))))
     2243  (li dest (:apply + ppc32::t-offset (:apply target-nil-value))))
    22442244
    22452245(define-ppc32-vinsn set-eq-bit (((dest :crf))
     
    25512551  (bne+ :ok)
    25522552  :bad
    2553   (li dest (target-nil-value))
     2553  (li dest (:apply target-nil-value))
    25542554  (b :done)
    25552555  :ok
     
    34353435  ((:pred >= min 1)
    34363436   (mr ppc::arg_y ppc::arg_z))
    3437   (li ppc::arg_z (target-nil-value))
     3437  (li ppc::arg_z (:apply target-nil-value))
    34383438  :done)
    34393439
     
    34513451  ((:pred >= min 1)
    34523452   (mr ppc::arg_x ppc::arg_z))
    3453   (li ppc::arg_y (target-nil-value))
     3453  (li ppc::arg_y (:apply target-nil-value))
    34543454  (b :last)
    34553455  :one
     
    34613461  (mr ppc::arg_y ppc::arg_z)
    34623462  :last
    3463   (li ppc::arg_z (target-nil-value))
     3463  (li ppc::arg_z (:apply target-nil-value))
    34643464  :done)
    34653465
     
    34953495  ((:pred >= min 1)
    34963496   (stwu ppc::arg_z -4 ppc::vsp))
    3497   (li ppc::arg_x (target-nil-value))
     3497  (li ppc::arg_x (:apply target-nil-value))
    34983498  :last-2
    3499   (li ppc::arg_y (target-nil-value))
     3499  (li ppc::arg_y (:apply target-nil-value))
    35003500  :last-1
    3501   (li ppc::arg_z (target-nil-value))
     3501  (li ppc::arg_z (:apply target-nil-value))
    35023502  :done)
    35033503
     
    36393639                                 ((src (:lisp (:ne dest )))))
    36403640  (lwz dest (+ (ash 1 2) ppc32::misc-data-offset) src)
    3641   (tweqi dest (target-nil-value)))
     3641  (tweqi dest (:apply target-nil-value)))
    36423642                 
    36433643(define-ppc32-vinsn %natural+ (((dest :u32))
     
    37213721                                      (crf1 :crf)))
    37223722  (clrlwi tag src (- ppc32::nbits-in-word ppc32::nlisptagbits))
    3723   (cmpwi crf0 src (target-nil-value))
     3723  (cmpwi crf0 src (:apply target-nil-value))
    37243724  (cmpwi crf1 tag ppc32::tag-misc)
    37253725  (beq crf0 :nilsym)
     
    37343734  (b :done)
    37353735  :nilsym
    3736   (li dest (+ ppc32::nilsym-offset (target-nil-value)))
     3736  (li dest (:apply + ppc32::nilsym-offset (:apply target-nil-value)))
    37373737  :done)
    37383738
Note: See TracChangeset for help on using the changeset viewer.