Changeset 8353


Ignore:
Timestamp:
Jan 29, 2008, 2:21:22 AM (17 years ago)
Author:
Gary Byers
Message:

%nargs is 32-bits wide now, so lotsa changes, generally for the better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8664/x8664-vinsns.lisp

    r8238 r8353  
    293293
    294294  ((:pred < n 16)
    295    (xorl (:%l x8664::nargs.l ) (:%l x8664::nargs.l ))
     295   (xorl (:%l x8664::nargs ) (:%l x8664::nargs ))
    296296   ((:pred > n 0)
    297     (addl (:$b (:apply ash n x8664::word-shift)) (:%l  x8664::nargs.l))))
     297    (addl (:$b (:apply ash n x8664::word-shift)) (:%l  x8664::nargs))))
    298298  ((:pred >= n 16)
    299    (movl (:$l (:apply ash n x8664::word-shift)) (:%l x8664::nargs.l ))))
     299   (movl (:$l (:apply ash n x8664::word-shift)) (:%l x8664::nargs ))))
    300300
    301301(define-x8664-vinsn check-exact-nargs (()
     
    303303  :resume
    304304  ((:pred = n 0)
    305    (testw (:%w x8664::nargs) (:%w x8664::nargs)))
     305   (testl (:%l x8664::nargs) (:%l x8664::nargs)))
    306306  ((:not (:pred = n 0))
    307    (cmpw (:$w (:apply ash n x8664::word-shift)) (:%w x8664::nargs)))
     307   ((:pred < n 16)
     308   (cmpl (:$b (:apply ash n x8664::word-shift)) (:%l x8664::nargs)))
     309   ((:pred >= n 16)
     310    (cmpl (:$l (:apply ash n x8664::word-shift)) (:%l x8664::nargs))))
    308311  (jne :bad)
    309312  (:anchored-uuo-section :resume)
     
    315318  :resume
    316319  ((:pred = min 1)
    317    (testw (:%w x8664::nargs) (:%w x8664::nargs))
     320   (testl (:%l x8664::nargs) (:%l x8664::nargs))
    318321   (je :toofew))
    319322  ((:not (:pred = min 1))
    320    (rcmpw (:%w x8664::nargs) (:$w (:apply ash min x8664::word-shift)))
     323   ((:pred < min 16)
     324    (rcmpl (:%l x8664::nargs) (:$b (:apply ash min x8664::word-shift))))
     325   ((:pred >= min 16)
     326    (rcmpl (:%l x8664::nargs) (:$l (:apply ash min x8664::word-shift))))
    321327   (jb :toofew)) 
    322328 
     
    328334                                       ((n :u16const)))
    329335  :resume
    330   (rcmpw (:%w x8664::nargs) (:$w (:apply ash n x8664::word-shift)))
     336  ((:pred < n 16)
     337   (rcmpl (:%l x8664::nargs) (:$b (:apply ash n x8664::word-shift))))
     338  ((:pred >= n 16)
     339   (rcmpl (:%l x8664::nargs) (:$l (:apply ash n x8664::word-shift))))
    331340  (ja :bad)
    332341 
     
    341350  :resume
    342351  ((:pred = min 1)
    343    (testw (:%w x8664::nargs) (:%w x8664::nargs))
     352   (testl (:%l x8664::nargs) (:%l x8664::nargs))
    344353   (je :toofew))
    345354  ((:not (:pred = min 1))
    346    (rcmpw (:%w x8664::nargs) (:$w (:apply ash min x8664::word-shift)))
     355   ((:pred < min 16)
     356    (rcmpl (:%l x8664::nargs) (:$b (:apply ash min x8664::word-shift))))
     357   ((:pred >= min 16)
     358    (rcmpl (:%l x8664::nargs) (:$l (:apply ash min x8664::word-shift))))
    347359   (jb :toofew))
    348   (rcmpw (:%w x8664::nargs) (:$w (:apply ash max x8664::word-shift)))
     360  ((:pred < max 16)
     361   (rcmpl (:%l x8664::nargs) (:$b (:apply ash max x8664::word-shift))))
     362  ((:pred >= max 16)
     363   (rcmpl (:%l x8664::nargs) (:$l (:apply ash max x8664::word-shift))))
    349364  (ja :toomany)
    350365 
     
    359374(define-x8664-vinsn default-1-arg (()
    360375                                   ((min :u16const)))
    361   (rcmpw (:%w x8664::nargs) (:$w (:apply ash min x8664::word-shift)))
     376  ((:pred < min 16)
     377   (rcmpl (:%l x8664::nargs) (:$b (:apply ash min x8664::word-shift))))
     378  ((:pred >= min 16)
     379   (rcmpl (:%l x8664::nargs) (:$l (:apply ash min x8664::word-shift))))
    362380  (jne :done)
    363381  ((:pred >= min 3)
     
    373391(define-x8664-vinsn default-2-args (()
    374392                                    ((min :u16const)))
    375   (rcmpw (:%w x8664::nargs ) (:$w (:apply ash (:apply 1+ min) x8664::word-shift)))
     393  ((:pred < (:apply 1+ min) 16)
     394   (rcmpl (:%l x8664::nargs ) (:$b (:apply ash (:apply 1+ min) x8664::word-shift))))
     395  ((:pred >= (:apply 1+ min) 16)
     396   (rcmpl (:%l x8664::nargs ) (:$l (:apply ash (:apply 1+ min) x8664::word-shift))))
    376397  (ja :done)
    377398  (je :one)
     
    398419(define-x8664-vinsn default-3-args (()
    399420                                    ((min :u16const)))
    400   (rcmpw (:%w x8664::nargs ) (:$w (:apply ash (:apply + 2 min) x8664::word-shift)))
     421  ((:pred < (:apply + 2 min) 16)
     422   (rcmpl (:%l x8664::nargs ) (:$b (:apply ash (:apply + 2 min) x8664::word-shift))))
     423  ((:pred >= (:apply + 2 min) 16)
     424   (rcmpl (:%l x8664::nargs ) (:$l (:apply ash (:apply + 2 min) x8664::word-shift))))
    401425  (ja :done)
    402426  (je :two)
    403   (rcmpw (:%w x8664::nargs ) (:$w (:apply ash min x8664::word-shift)))
     427  ((:pred < min 16)
     428   (rcmpl (:%l x8664::nargs ) (:$b (:apply ash min x8664::word-shift))))
     429  ((:pred >= min 16)
     430   (rcmpl (:%l x8664::nargs ) (:$l (:apply ash min x8664::word-shift))))
    404431  (je :none)
    405432  ;; The first (of three) &optional args was supplied.
     
    436463                                       ((n :u16const))
    437464                                       ((temp :u64)))
    438   (rcmpw (:%w x8664::nargs) (:$w (:apply ash n x8664::word-shift)))
    439   (movw (:%w x8664::nargs) (:%w temp))
     465  ((:pred < n 16)
     466   (rcmpl (:%l x8664::nargs) (:$b (:apply ash n x8664::word-shift))))
     467  ((:pred >= n 16)
     468   (rcmpl (:%l x8664::nargs) (:$l (:apply ash n x8664::word-shift))))
     469  (movl (:%l x8664::nargs) (:%l temp))
    440470  (jae :done)
    441471  :loop
    442   (addw (:$w x8664::fixnumone) (:%w temp))
    443   (cmpw (:$w (:apply ash n x8664::word-shift)) (:%w temp))
     472  (addl (:$b x8664::fixnumone) (:%l temp))
     473  ((:pred < n 16)
     474   (cmpl (:$b (:apply ash n x8664::word-shift)) (:%l temp)))
     475  ((:pred >= n 16)
     476   (cmpl (:$l (:apply ash n x8664::word-shift)) (:%l temp))) 
    444477  (pushq (:$l x8664::nil-value))
    445478  (jne :loop)
     
    462495                                                          ()
    463496                                                          ((temp :u64)))
    464   (movzwl (:%w x8664::nargs) (:%l temp))
     497  (movl (:%l x8664::nargs) (:%l temp))
    465498  (subq (:$b (* $numx8664argregs x8664::node-size)) (:%q temp))
    466499  (jle :push)
     
    479512                                                ()
    480513                                                ((temp :u64)))
    481   (movzwl (:%w x8664::nargs) (:%l temp))
     514  (movl (:%l x8664::nargs) (:%l temp))
    482515  (subq (:$b (* $numx8664argregs x8664::node-size)) (:%q temp))
    483516  (movq (:%q x8664::rbp) (:@ x8664::node-size (:%q x8664::rsp) (:%q temp)))
     
    13961429(define-x8664-vinsn (push-argregs :push :node :vsp) (()
    13971430                                                      ())
    1398   (testw (:%w x8664::nargs) (:%w x8664::nargs))
     1431  (testl (:%l x8664::nargs) (:%l x8664::nargs))
    13991432  (jz :done)
    1400   (rcmpw (:%w x8664::nargs) (:$w (* 2 x8664::node-size)))
     1433  (rcmpl (:%l x8664::nargs) (:$b (* 2 x8664::node-size)))
    14011434  (jb :one)
    14021435  (je :two)
     
    14111444                                                         ((max :u32const)))
    14121445  ((:pred >= max 3)
    1413    (testw (:%w x8664::nargs) (:%w x8664::nargs))
     1446   (testl (:%l x8664::nargs) (:%l x8664::nargs))
    14141447   (jz :done)
    1415    (rcmpw (:%w x8664::nargs) (:$w (* 2 x8664::node-size)))
     1448   (rcmpl (:%l x8664::nargs) (:$b (* 2 x8664::node-size)))
    14161449   (jb :one)
    14171450   (je :two)
     
    14231456   :done)
    14241457  ((:pred = max 2)
    1425    (rcmpw (:%w x8664::nargs) (:$w (* 1 x8664::node-size)))
     1458   (rcmpl (:%l x8664::nargs) (:$b (* 1 x8664::node-size)))
    14261459   (jb :done)
    14271460   (je :one)
     
    14311464   :done)
    14321465  ((:pred = max 1)
    1433    (testw (:%w x8664::nargs) (:%w x8664::nargs))
     1466   (testl (:%l x8664::nargs) (:%l x8664::nargs))
    14341467   (je :done)
    14351468   (pushq (:%q x8664::arg_z))
     
    16461679                             ((imm :u16)))
    16471680  ((:pred = n 0)
    1648    (xorq (:%q imm) (:%q imm)))
     1681   (xorl (:%l imm) (:%l imm)))
    16491682  ((:not (:pred = n 0))
    1650    (movw (:$w (:apply ash n x8664::fixnumshift)) (:%w imm)))
    1651   (subw (:%w x8664::nargs) (:%w imm))
     1683   (movl (:$l (:apply ash n x8664::fixnumshift)) (:%l imm)))
     1684  (subl (:%l x8664::nargs) (:%l imm))
    16521685  (jae :push-more)
    1653   (movswq (:%w imm) (:%q imm))
     1686  (movslq (:%l imm) (:%q imm))
    16541687  (subq (:%q imm) (:%q x8664::rsp))
    16551688  (jmp :done)
    16561689  :push-loop
    16571690  (pushq (:$l x8664::nil-value))
    1658   (addw (:$b x8664::node-size) (:%w x8664::nargs))
    1659   (subw (:$b x8664::node-size) (:%w imm))
     1691  (addl (:$b x8664::node-size) (:%l x8664::nargs))
     1692  (subl (:$b x8664::node-size) (:%l imm))
    16601693  :push-more
    16611694  (jne :push-loop)
     
    31463179                                 ((nfixed :s16const)))
    31473180  ((:pred > nfixed 0)
    3148    (addw (:$w (:apply - (:apply ash nfixed x8664::word-shift))) (:%w x8664::nargs))))
     3181   ((:pred < nfixed 16)
     3182    (subl (:$b (:apply ash nfixed x8664::word-shift)) (:%l x8664::nargs)))
     3183   ((:pred >= nfixed 16)
     3184    (subl (:$l (:apply ash nfixed x8664::word-shift)) (:%l x8664::nargs)))))
    31493185
    31503186(define-x8664-vinsn opt-supplied-p (()
    3151                                     ())
    3152   (xorl (:%l x8664::imm1) (:%l x8664::imm1))
    3153   (movl (:$l x8664::t-value) (:%l x8664::arg_y))
     3187                                    ((num-opt :u16const))
     3188                                    ((nargs (:u64 #.x8664::nargs))
     3189                                     (imm :imm)))
     3190  (xorl (:%l imm) (:%l imm))
     3191  (movl (:$l x8664::nil-value) (:%l x8664::arg_y))
    31543192  :loop
    3155   (rcmpw (:%w x8664::imm1) (:%w x8664::nargs))
    3156   (movl (:$l x8664::nil-value) (:%l x8664::arg_z))
    3157   (cmovll (:%l x8664::arg_y) (:%l  x8664::arg_z))
    3158   (addl (:$b x8664::node-size) (:%l x8664::imm1))
    3159   (cmpl (:%l x8664::imm1) (:%l x8664::imm0))
     3193  (rcmpl (:%l imm) (:%l nargs))
     3194  (movl (:%l x8664::arg_y) (:%l x8664::arg_z))
     3195  (cmovll (:@ x8664::t-offset (:%l x8664::arg_y)) (:%l  x8664::arg_z))
     3196  (addl (:$b x8664::node-size) (:%l imm))
     3197  (rcmpl (:%l imm) (:$l (:apply ash num-opt x8664::fixnumshift)))
    31603198  (pushq (:%q x8664::arg_z))
    31613199  (jne :loop))
     
    31643202                                        ()
    31653203                                        ((temp :u64)))
    3166   (testw (:%w x8664::nargs) (:%w x8664::nargs))
    3167   (setne (:%b temp))
    3168   (negb (:%b temp))
    3169   (andl (:$b x8664::t-offset) (:%l temp))
    3170   (addl (:$l x8664::nil-value) (:%l temp))
     3204  (testl (:%l x8664::nargs) (:%l x8664::nargs))
     3205  (movl (:$l x8664::nil-value) (:%l temp))
     3206  (cmovnel (:@ x8664::t-offset (:%l temp)) (:%l temp))
    31713207  (pushq (:%q temp)))
    31723208
     
    31753211                                        ((temp0 :u64)
    31763212                                         (temp1 :u64)))
    3177   (rcmpw (:%w x8664::nargs) (:$w x8664::node-size))
    3178   (setae (:%b temp0))
    3179   (seta (:%b temp1))
    3180   (negb (:%b temp0))
    3181   (negb (:%b temp1))
    3182   (andl (:$b x8664::t-offset) (:%l temp0))
    3183   (andl (:$b x8664::t-offset) (:%l temp1))
    3184   (addl (:$l x8664::nil-value) (:%l temp0))
    3185   (addl (:$l x8664::nil-value) (:%l temp1))
     3213  (rcmpl (:%l x8664::nargs) (:$b x8664::node-size))
     3214  (movl (:$l x8664::nil-value) (:%l temp0))
     3215  (movl (:%l temp0) (:%l temp1))
     3216  (cmovael (:@ x8664::t-offset (:%l temp0)) (:%l temp0))
     3217  (cmoval (:@ x8664::t-offset (:%l temp1)) (:%l temp1))
    31863218  (pushq (:%q temp0))
    31873219  (pushq (:%q temp1)))
     
    32523284   (pushq (:%q x8664::arg_z)))
    32533285  ((:pred = min-fixed 2)                ; at least 2 args
    3254    (cmpw (:$w (ash 2 x8664::word-shift)) (:%w x8664::nargs))
     3286   (cmpl (:$b (ash 2 x8664::word-shift)) (:%l x8664::nargs))
    32553287   (je :yz2)                      ; skip arg_x if exactly 2
    32563288   (pushq (:%q x8664::arg_x))
     
    32593291   (pushq (:%q x8664::arg_z)))
    32603292  ((:pred = min-fixed 1)                ; at least one arg
    3261    (rcmpw (:%w x8664::nargs) (:$w  (ash 2 x8664::word-shift)))
     3293   (rcmpl (:%l x8664::nargs) (:$b  (ash 2 x8664::word-shift)))
    32623294   (jl :z1)                       ; branch if exactly one
    32633295   (je :yz1)                      ; branch if exactly two
     
    32683300   (pushq (:%q x8664::arg_z)))
    32693301  ((:pred = min-fixed 0)
    3270    (testw (:%w x8664::nargs) (:%w x8664::nargs))
     3302   (testl (:%l x8664::nargs) (:%l x8664::nargs))
    32713303   (je  :none)                     ; exactly zero
    3272    (rcmpw (:%w x8664::nargs) (:$w (ash 2 x8664::word-shift)))
     3304   (rcmpl (:%l x8664::nargs) (:$b (ash 2 x8664::word-shift)))
    32733305   (je :yz0)                      ; exactly two
    32743306   (jl :z0)                       ; one
     
    32813313   :none
    32823314   )
    3283   (movzwl (:%w x8664::nargs) (:%l x8664::nargs))
    32843315  ((:not (:pred = min-fixed 0))
    32853316   (leaq (:@ (:apply - (:apply ash min-fixed x8664::word-shift)) (:%q x8664::nargs))
     
    35763607                               ()
    35773608                               ((imm0 :u64)))
    3578   (movzwl (:%w x8664::nargs) (:%l x8664::nargs))
    35793609  (leaq (:@ (:%q x8664::rsp) (:%q x8664::nargs)) (:%q imm0))
    35803610  (subq (:@ (:%q imm0)) (:%q x8664::nargs))
     
    38023832(define-x8664-vinsn pop-argument-registers (()
    38033833                                            ())
    3804   (testw (:%w x8664::nargs) (:%w x8664::nargs))
     3834  (testl (:%l x8664::nargs) (:%l x8664::nargs))
    38053835  (je :done)
    3806   (rcmpw (:%w x8664::nargs) (:$w (ash 2 x8664::word-shift)))
     3836  (rcmpl (:%l x8664::nargs) (:$b (ash 2 x8664::word-shift)))
    38073837  (popq (:%q x8664::arg_z))
    38083838  (jb :done)
     
    38333863  (movss (:@ (:%q src) (:%q index)) (:%xmm dest)))
    38343864
    3835 (define-x8664-vinsn zero-extend-nargs (()
    3836                                        ())
    3837   (movzwl (:%w x8664::nargs) (:%l x8664::nargs)))
    38383865
    38393866(define-x8664-vinsn load-adl (()
Note: See TracChangeset for help on using the changeset viewer.