Changeset 10979


Ignore:
Timestamp:
Oct 5, 2008, 2:39:10 AM (11 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.

Location:
trunk/source/compiler/PPC
Files:
2 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
  • trunk/source/compiler/PPC/PPC64/ppc64-vinsns.lisp

    r10959 r10979  
    10191019                                   (crfy :crf)))
    10201020  :again
    1021   (cmpdi crfx object (target-nil-value))
     1021  (cmpdi crfx object (:apply target-nil-value))
    10221022  (clrldi tag object (- ppc64::nbits-in-word ppc64::ntagbits))
    10231023  (cmpdi crfy tag ppc64::fulltag-cons)
     
    14411441                                      ((tag :u8)
    14421442                                       (crf :crf)))
    1443   (cmpldi crf object (target-nil-value))
     1443  (cmpldi crf object (:apply target-nil-value))
    14441444  (clrldi tag object (- ppc64::nbits-in-word ppc64::ntagbits))
    14451445  (beq crf :ok)
     
    15511551                                   ())
    15521552  (mulli bits bits ppc64::t-offset)
    1553   (addi dest bits (target-nil-value)))
     1553  (addi dest bits (:apply target-nil-value)))
    15541554
    15551555(define-ppc64-vinsn invert-lowbit (((bits :u64))
     
    16361636(define-ppc64-vinsn eqnil->bit31 (((bits :u64))
    16371637                                  ((x t)))
    1638   (subi bits x (target-nil-value))
     1638  (subi bits x (:apply target-nil-value))
    16391639  (cntlzd bits bits)
    16401640  (srdi bits bits 6))
     
    16501650(define-ppc64-vinsn nenil->bit31 (((bits :u64))
    16511651                                  ((x t)))
    1652   (subi bits x (target-nil-value))
     1652  (subi bits x (:apply target-nil-value))
    16531653  (cntlzd bits bits)
    16541654  (srdi bits bits 6)
     
    17431743(define-ppc64-vinsn compare-to-nil (((crf :crf))
    17441744                                    ((arg0 t)))
    1745   (cmpdi crf arg0 (target-nil-value)))
     1745  (cmpdi crf arg0 (:apply target-nil-value)))
    17461746
    17471747(define-ppc64-vinsn compare-logical (((crf :crf))
     
    19951995(define-ppc64-vinsn %closure-code% (((dest :lisp))
    19961996                                    ())
    1997   (ld dest (+ ppc64::symbol.vcell (ppc64::nrs-offset %closure-code%) (target-nil-value)) 0))
     1997  (ld dest (:apply + ppc64::symbol.vcell (ppc64::nrs-offset %closure-code%) (:apply target-nil-value)) 0))
    19981998
    19991999(define-ppc64-vinsn single-float-bits (((dest :u32))
     
    22282228(define-ppc64-vinsn (load-nil :constant-ref) (((dest t))
    22292229                                              ())
    2230   (li dest (target-nil-value)))
     2230  (li dest (:apply target-nil-value)))
    22312231
    22322232
    22332233(define-ppc64-vinsn (load-t :constant-ref) (((dest t))
    22342234                                            ())
    2235   (li dest (+ ppc64::t-offset (target-nil-value))))
     2235  (li dest (:apply + ppc64::t-offset (:apply target-nil-value))))
    22362236
    22372237(define-ppc64-vinsn set-eq-bit (((dest :crf))
     
    25592559  (bne+ :ok)
    25602560  :bad
    2561   (li dest (target-nil-value))
     2561  (li dest (:apply target-nil-value))
    25622562  (b :done)
    25632563  :ok
     
    34223422  ((:pred >= min 1)
    34233423   (mr ppc::arg_y ppc::arg_z))
    3424   (li ppc::arg_z (target-nil-value))
     3424  (li ppc::arg_z (:apply target-nil-value))
    34253425  :done)
    34263426
     
    34383438  ((:pred >= min 1)
    34393439   (mr ppc::arg_x ppc::arg_z))
    3440   (li ppc::arg_y (target-nil-value))
     3440  (li ppc::arg_y (:apply target-nil-value))
    34413441  (b :last)
    34423442  :one
     
    34483448  (mr ppc::arg_y ppc::arg_z)
    34493449  :last
    3450   (li ppc::arg_z (target-nil-value))
     3450  (li ppc::arg_z (:apply target-nil-value))
    34513451  :done)
    34523452
     
    34823482  ((:pred >= min 1)
    34833483   (stdu ppc::arg_z -8 ppc::vsp))
    3484   (li ppc::arg_x (target-nil-value))
     3484  (li ppc::arg_x (:apply target-nil-value))
    34853485  :last-2
    3486   (li ppc::arg_y (target-nil-value))
     3486  (li ppc::arg_y (:apply target-nil-value))
    34873487  :last-1
    3488   (li ppc::arg_z (target-nil-value))
     3488  (li ppc::arg_z (:apply target-nil-value))
    34893489  :done)
    34903490
     
    36323632                                 ((src (:lisp (:ne dest )))))
    36333633  (ld dest (+ (ash 1 ppc64::word-shift) ppc64::misc-data-offset) src)
    3634   (tdeqi dest (target-nil-value)))
     3634  (tdeqi dest (:apply target-nil-value)))
    36353635
    36363636(define-ppc64-vinsn %natural+ (((dest :u64))
Note: See TracChangeset for help on using the changeset viewer.