Changeset 10234


Ignore:
Timestamp:
Jul 29, 2008, 4:46:29 AM (11 years ago)
Author:
rme
Message:

Update address of .SPcall_closure in vinsn init-nclosure.

Add a few other new vinsns that are now used by the compiler.
(check-min-max-nargs, compare-to-t, compare-constant-to-register,
updated opt-suppplied-p, and align-loop-head).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8632/x8632-vinsns.lisp

    r10126 r10234  
    273273  (uuo-error-too-many-args)
    274274  :ok)
     275
     276(define-x8632-vinsn check-min-max-nargs (()
     277                                         ((min :u16const)
     278                                          (max :u16)))
     279  :resume
     280  ((:pred = min 1)
     281   (testl (:%l x8632::nargs) (:%l x8632::nargs))
     282   (je :toofew))
     283  ((:not (:pred = min 1))
     284   ((:pred < min 32)
     285    (rcmpl (:%l x8632::nargs) (:$b (:apply ash min x8632::word-shift))))
     286   ((:pred >= min 32)
     287    (rcmpl (:%l x8632::nargs) (:$l (:apply ash min x8632::word-shift))))
     288   (jb :toofew))
     289  ((:pred < max 32)
     290   (rcmpl (:%l x8632::nargs) (:$b (:apply ash max x8632::word-shift))))
     291  ((:pred >= max 32)
     292   (rcmpl (:%l x8632::nargs) (:$l (:apply ash max x8632::word-shift))))
     293  (ja :toomany)
     294 
     295  (:anchored-uuo-section :resume)
     296  :toofew
     297  (:anchored-uuo (uuo-error-too-few-args))
     298  (:anchored-uuo-section :resume)
     299  :toomany
     300  (:anchored-uuo (uuo-error-too-many-args)))
    275301
    276302(define-x8632-vinsn default-1-arg (()
     
    436462  (cmpl (:$l x8632::nil-value) (:%l arg0)))
    437463
     464(define-x8632-vinsn compare-to-t (()
     465                                  ((arg0 t)))
     466  (cmpl (:$l x8632::t-value) (:%l arg0)))
     467
    438468(define-x8632-vinsn ref-constant (((dest :lisp))
    439469                                  ((lab :label)))
    440470  (movl (:@ (:^ lab) (:%l x8632::fn)) (:%l dest)))
     471
     472(define-x8632-vinsn compare-constant-to-register (()
     473                                                  ((lab :label)
     474                                                   (reg :lisp)))
     475  (cmpl (:@ (:^ lab) (:%l x8632::fn)) (:%l reg)))
    441476
    442477(define-x8632-vinsn (vpush-constant :push :node :vsp) (()
     
    31523187  (movl (:%l closure) (:@ (+ x8632::misc-data-offset 3) (:%l closure)))
    31533188  (movb (:$b #xff) (:@ (+ x8632::misc-data-offset 7) (:%l closure))) ;jmp
    3154   (movl (:$l #x0050b425) (:@ (+ x8632::misc-data-offset 8) (:%l closure))) ;.SPcall-closure
     3189  (movl (:$l #x0150b425) (:@ (+ x8632::misc-data-offset 8) (:%l closure))) ;.SPcall-closure
    31553190  ;; already aligned
    31563191  ;; (movl ($ 0) (:@ (+ x8632::misc-data-offset 12))) ;"end" of self-references
     
    36593694    (subl (:$l (:apply ash nfixed x8632::word-shift)) (:%l x8632::nargs)))))
    36603695
    3661 ;; num-opt in imm0
    36623696(define-x8632-vinsn opt-supplied-p (()
    3663                                     ())
    3664   (subl (:%l x8632::nargs) (:%l x8632::imm0))
    3665   (jmp :push-t-test)
    3666   :push-t-loop
    3667   (pushl (:$l x8632::t-value))
    3668   :push-t-test
    3669   (subl (:$b x8632::node-size) (:%l x8632::nargs))
    3670   (jge :push-t-loop)
    3671   (jmp :push-nil-test)
    3672   :push-nil-loop
    3673   (pushl (:$l x8632::nil-value))
    3674   :push-nil-test
    3675   (subl (:$b x8632::node-size) (:%l x8632::imm0))
    3676   (jge :push-nil-loop))
     3697                                    ((num-opt :u16const))
     3698                                    ((nargs (:u32 #.x8632::nargs))
     3699                                     (imm :imm)))
     3700  (xorl (:%l imm) (:%l imm))
     3701  (movl (:$l x8632::nil-value) (:%l x8632::arg_y))
     3702  :loop
     3703  (rcmpl (:%l imm) (:%l nargs))
     3704  (movl (:%l x8632::arg_y) (:%l x8632::arg_z))
     3705  (cmovll (:@ (+ x8632::t-offset x8632::symbol.vcell) (:%l x8632::arg_y)) (:%l  x8632::arg_z))
     3706  (addl (:$b x8632::node-size) (:%l imm))
     3707  (rcmpl (:%l imm) (:$l (:apply ash num-opt x8632::fixnumshift)))
     3708  (pushl (:%l x8632::arg_z))
     3709  (jne :loop))
    36773710
    36783711(define-x8632-vinsn one-opt-supplied-p (()
     
    38653898  (movss (:%xmm x8632::fpzero) (:@ (:%seg :rcontext) x8632::tcr.save3)))
    38663899
     3900(define-x8632-vinsn align-loop-head (()
     3901                                     ())
     3902  (:align 4))
     3903
    38673904(queue-fixup
    38683905 (fixup-x86-vinsn-templates
Note: See TracChangeset for help on using the changeset viewer.