Changeset 8353
- Timestamp:
- Jan 29, 2008, 2:21:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/compiler/X86/X8664/x8664-vinsns.lisp
r8238 r8353 293 293 294 294 ((:pred < n 16) 295 (xorl (:%l x8664::nargs .l ) (:%l x8664::nargs.l))295 (xorl (:%l x8664::nargs ) (:%l x8664::nargs )) 296 296 ((: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)))) 298 298 ((: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 )))) 300 300 301 301 (define-x8664-vinsn check-exact-nargs (() … … 303 303 :resume 304 304 ((:pred = n 0) 305 (test w (:%w x8664::nargs) (:%wx8664::nargs)))305 (testl (:%l x8664::nargs) (:%l x8664::nargs))) 306 306 ((: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)))) 308 311 (jne :bad) 309 312 (:anchored-uuo-section :resume) … … 315 318 :resume 316 319 ((:pred = min 1) 317 (test w (:%w x8664::nargs) (:%wx8664::nargs))320 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 318 321 (je :toofew)) 319 322 ((: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)))) 321 327 (jb :toofew)) 322 328 … … 328 334 ((n :u16const))) 329 335 :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)))) 331 340 (ja :bad) 332 341 … … 341 350 :resume 342 351 ((:pred = min 1) 343 (test w (:%w x8664::nargs) (:%wx8664::nargs))352 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 344 353 (je :toofew)) 345 354 ((: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)))) 347 359 (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)))) 349 364 (ja :toomany) 350 365 … … 359 374 (define-x8664-vinsn default-1-arg (() 360 375 ((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)))) 362 380 (jne :done) 363 381 ((:pred >= min 3) … … 373 391 (define-x8664-vinsn default-2-args (() 374 392 ((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)))) 376 397 (ja :done) 377 398 (je :one) … … 398 419 (define-x8664-vinsn default-3-args (() 399 420 ((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)))) 401 425 (ja :done) 402 426 (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)))) 404 431 (je :none) 405 432 ;; The first (of three) &optional args was supplied. … … 436 463 ((n :u16const)) 437 464 ((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)) 440 470 (jae :done) 441 471 :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))) 444 477 (pushq (:$l x8664::nil-value)) 445 478 (jne :loop) … … 462 495 () 463 496 ((temp :u64))) 464 (mov zwl (:%wx8664::nargs) (:%l temp))497 (movl (:%l x8664::nargs) (:%l temp)) 465 498 (subq (:$b (* $numx8664argregs x8664::node-size)) (:%q temp)) 466 499 (jle :push) … … 479 512 () 480 513 ((temp :u64))) 481 (mov zwl (:%wx8664::nargs) (:%l temp))514 (movl (:%l x8664::nargs) (:%l temp)) 482 515 (subq (:$b (* $numx8664argregs x8664::node-size)) (:%q temp)) 483 516 (movq (:%q x8664::rbp) (:@ x8664::node-size (:%q x8664::rsp) (:%q temp))) … … 1396 1429 (define-x8664-vinsn (push-argregs :push :node :vsp) (() 1397 1430 ()) 1398 (test w (:%w x8664::nargs) (:%wx8664::nargs))1431 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 1399 1432 (jz :done) 1400 (rcmp w (:%w x8664::nargs) (:$w(* 2 x8664::node-size)))1433 (rcmpl (:%l x8664::nargs) (:$b (* 2 x8664::node-size))) 1401 1434 (jb :one) 1402 1435 (je :two) … … 1411 1444 ((max :u32const))) 1412 1445 ((:pred >= max 3) 1413 (test w (:%w x8664::nargs) (:%wx8664::nargs))1446 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 1414 1447 (jz :done) 1415 (rcmp w (:%w x8664::nargs) (:$w(* 2 x8664::node-size)))1448 (rcmpl (:%l x8664::nargs) (:$b (* 2 x8664::node-size))) 1416 1449 (jb :one) 1417 1450 (je :two) … … 1423 1456 :done) 1424 1457 ((:pred = max 2) 1425 (rcmp w (:%w x8664::nargs) (:$w(* 1 x8664::node-size)))1458 (rcmpl (:%l x8664::nargs) (:$b (* 1 x8664::node-size))) 1426 1459 (jb :done) 1427 1460 (je :one) … … 1431 1464 :done) 1432 1465 ((:pred = max 1) 1433 (test w (:%w x8664::nargs) (:%wx8664::nargs))1466 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 1434 1467 (je :done) 1435 1468 (pushq (:%q x8664::arg_z)) … … 1646 1679 ((imm :u16))) 1647 1680 ((:pred = n 0) 1648 (xor q (:%q imm) (:%qimm)))1681 (xorl (:%l imm) (:%l imm))) 1649 1682 ((:not (:pred = n 0)) 1650 (mov w (:$w (:apply ash n x8664::fixnumshift)) (:%wimm)))1651 (sub w (:%w x8664::nargs) (:%wimm))1683 (movl (:$l (:apply ash n x8664::fixnumshift)) (:%l imm))) 1684 (subl (:%l x8664::nargs) (:%l imm)) 1652 1685 (jae :push-more) 1653 (movs wq (:%wimm) (:%q imm))1686 (movslq (:%l imm) (:%q imm)) 1654 1687 (subq (:%q imm) (:%q x8664::rsp)) 1655 1688 (jmp :done) 1656 1689 :push-loop 1657 1690 (pushq (:$l x8664::nil-value)) 1658 (add w (:$b x8664::node-size) (:%wx8664::nargs))1659 (sub w (:$b x8664::node-size) (:%wimm))1691 (addl (:$b x8664::node-size) (:%l x8664::nargs)) 1692 (subl (:$b x8664::node-size) (:%l imm)) 1660 1693 :push-more 1661 1694 (jne :push-loop) … … 3146 3179 ((nfixed :s16const))) 3147 3180 ((: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))))) 3149 3185 3150 3186 (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)) 3154 3192 :loop 3155 (rcmp w (:%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))) 3160 3198 (pushq (:%q x8664::arg_z)) 3161 3199 (jne :loop)) … … 3164 3202 () 3165 3203 ((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)) 3171 3207 (pushq (:%q temp))) 3172 3208 … … 3175 3211 ((temp0 :u64) 3176 3212 (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)) 3186 3218 (pushq (:%q temp0)) 3187 3219 (pushq (:%q temp1))) … … 3252 3284 (pushq (:%q x8664::arg_z))) 3253 3285 ((:pred = min-fixed 2) ; at least 2 args 3254 (cmp w (:$w (ash 2 x8664::word-shift)) (:%wx8664::nargs))3286 (cmpl (:$b (ash 2 x8664::word-shift)) (:%l x8664::nargs)) 3255 3287 (je :yz2) ; skip arg_x if exactly 2 3256 3288 (pushq (:%q x8664::arg_x)) … … 3259 3291 (pushq (:%q x8664::arg_z))) 3260 3292 ((:pred = min-fixed 1) ; at least one arg 3261 (rcmp w (:%w x8664::nargs) (:$w(ash 2 x8664::word-shift)))3293 (rcmpl (:%l x8664::nargs) (:$b (ash 2 x8664::word-shift))) 3262 3294 (jl :z1) ; branch if exactly one 3263 3295 (je :yz1) ; branch if exactly two … … 3268 3300 (pushq (:%q x8664::arg_z))) 3269 3301 ((:pred = min-fixed 0) 3270 (test w (:%w x8664::nargs) (:%wx8664::nargs))3302 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 3271 3303 (je :none) ; exactly zero 3272 (rcmp w (:%w x8664::nargs) (:$w(ash 2 x8664::word-shift)))3304 (rcmpl (:%l x8664::nargs) (:$b (ash 2 x8664::word-shift))) 3273 3305 (je :yz0) ; exactly two 3274 3306 (jl :z0) ; one … … 3281 3313 :none 3282 3314 ) 3283 (movzwl (:%w x8664::nargs) (:%l x8664::nargs))3284 3315 ((:not (:pred = min-fixed 0)) 3285 3316 (leaq (:@ (:apply - (:apply ash min-fixed x8664::word-shift)) (:%q x8664::nargs)) … … 3576 3607 () 3577 3608 ((imm0 :u64))) 3578 (movzwl (:%w x8664::nargs) (:%l x8664::nargs))3579 3609 (leaq (:@ (:%q x8664::rsp) (:%q x8664::nargs)) (:%q imm0)) 3580 3610 (subq (:@ (:%q imm0)) (:%q x8664::nargs)) … … 3802 3832 (define-x8664-vinsn pop-argument-registers (() 3803 3833 ()) 3804 (test w (:%w x8664::nargs) (:%wx8664::nargs))3834 (testl (:%l x8664::nargs) (:%l x8664::nargs)) 3805 3835 (je :done) 3806 (rcmp w (:%w x8664::nargs) (:$w(ash 2 x8664::word-shift)))3836 (rcmpl (:%l x8664::nargs) (:$b (ash 2 x8664::word-shift))) 3807 3837 (popq (:%q x8664::arg_z)) 3808 3838 (jb :done) … … 3833 3863 (movss (:@ (:%q src) (:%q index)) (:%xmm dest))) 3834 3864 3835 (define-x8664-vinsn zero-extend-nargs (()3836 ())3837 (movzwl (:%w x8664::nargs) (:%l x8664::nargs)))3838 3865 3839 3866 (define-x8664-vinsn load-adl (()
Note:
See TracChangeset
for help on using the changeset viewer.
