Changeset 10203 for trunk/source/compiler/X86/x86-lapmacros.lisp
- Timestamp:
- Jul 25, 2008, 2:11:54 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/compiler/X86/x86-lapmacros.lisp
r8354 r10203 23 23 `(cmp ,dest ,src)) 24 24 25 (defx86lapmacro clrl (reg) 26 `(xorl (% ,reg) (% ,reg))) 27 25 28 (defx86lapmacro clrq (reg) 26 29 `(xorq (% ,reg) (% ,reg))) 27 30 28 31 (defx86lapmacro set-nargs (n) 29 (cond ((>= n 16) `(movl ($ ',n) (% nargs))) 30 ((= n 0) `(xorl (% nargs) (% nargs))) 31 (t `(progn 32 (xorl (% nargs) (% nargs)) 33 (addl ($ ',n) (% nargs)))))) 32 (let* ((many (target-arch-case 33 (:x8632 32) 34 (:x8664 16)))) 35 (cond ((>= n many) `(movl ($ ',n) (% nargs))) 36 ((= n 0) `(xorl (% nargs) (% nargs))) 37 (t `(progn 38 (xorl (% nargs) (% nargs)) 39 (addl ($ ',n) (% nargs))))))) 34 40 35 41 … … 88 94 89 95 90 91 96 (defx86lapmacro extract-lisptag (node dest) 92 `(progn 93 (movb ($ x8664::tagmask) (%b ,dest)) 94 (andb (%b ,node) (%b ,dest)))) 97 (target-arch-case 98 (:x8632 99 `(progn 100 (movl ($ x8632::tagmask) (% ,dest)) 101 (andl (%l ,node) (%l ,dest)))) 102 (:x8664 103 `(progn 104 (movb ($ x8664::tagmask) (%b ,dest)) 105 (andb (%b ,node) (%b ,dest)))))) 95 106 96 107 (defx86lapmacro extract-fulltag (node dest) 97 `(progn 98 (movb ($ x8664::fulltagmask) (%b ,dest)) 99 (andb (%b ,node) (%b ,dest)))) 108 (target-arch-case 109 (:x8632 110 `(progn 111 (movl ($ x8632::fulltagmask) (%l ,dest)) 112 (andl (%l ,node) (%l ,dest)))) 113 (:x8664 114 `(progn 115 (movb ($ x8664::fulltagmask) (%b ,dest)) 116 (andb (%b ,node) (%b ,dest)))))) 100 117 101 118 (defx86lapmacro extract-subtag (node dest) 102 `(movb (@ x8664::misc-subtag-offset (% ,node)) (%b ,dest))) 119 (target-arch-case 120 (:x8632 121 `(movb (@ x8632::misc-subtag-offset (% ,node)) (%b ,dest))) 122 (:x8664 123 `(movb (@ x8664::misc-subtag-offset (% ,node)) (%b ,dest))))) 103 124 104 125 (defx86lapmacro extract-typecode (node dest) … … 107 128 ;;; the #xff00 byte. 108 129 (let* ((done (gensym))) 109 `(progn 110 (extract-lisptag ,node ,dest) 111 (rcmp (%b ,dest) ($ x8664::tag-misc)) 112 (jne ,done) 113 (movb (@ x8664::misc-subtag-offset (% ,node)) (%b ,dest)) 114 ,done))) 130 (target-arch-case 131 (:x8632 132 `(progn 133 (extract-lisptag ,node ,dest) 134 (rcmp (%b ,dest) ($ x8632::tag-misc)) 135 (jne ,done) 136 (movb (@ x8632::misc-subtag-offset (% ,node)) (%b ,dest)) 137 ,done)) 138 (:x8664 139 `(progn 140 (extract-lisptag ,node ,dest) 141 (rcmp (%b ,dest) ($ x8664::tag-misc)) 142 (jne ,done) 143 (movb (@ x8664::misc-subtag-offset (% ,node)) (%b ,dest)) 144 ,done))))) 115 145 116 146 (defx86lapmacro trap-unless-typecode= (node tag &optional (immreg 'imm0)) … … 143 173 (defx86lapmacro trap-unless-fixnum (node) 144 174 (let* ((ok (gensym))) 145 `(progn 146 (testb ($ x8664::tagmask) (%b ,node)) 147 (je.pt ,ok) 148 (uuo-error-reg-not-fixnum (% ,node)) 149 ,ok))) 175 (target-arch-case 176 (:x8632 177 `(progn 178 (test ($ x8632::tagmask) (% ,node)) 179 (je.pt ,ok) 180 (uuo-error-reg-not-fixnum (% ,node)) 181 ,ok)) 182 (:x8664 183 `(progn 184 (testb ($ x8664::tagmask) (%b ,node)) 185 (je.pt ,ok) 186 (uuo-error-reg-not-fixnum (% ,node)) 187 ,ok))))) 150 188 151 189 ;;; On x8664, NIL has its own tag, so no other lisp object can 152 ;;; have the same low byte as NIL. (That probably won't be153 ;;; true on x8632.)190 ;;; have the same low byte as NIL. On x8632, NIL is a just 191 ;;; a distiguished CONS. 154 192 (defx86lapmacro cmp-reg-to-nil (reg) 155 `(cmpb ($ (logand #xff x8664::nil-value)) (%b ,reg))) 156 193 (target-arch-case 194 (:x8632 195 `(cmpl ($ x8632::nil-value) (%l ,reg))) 196 (:x8664 197 `(cmpb ($ (logand #xff x8664::nil-value)) (%b ,reg))))) 157 198 158 199 (defx86lapmacro unbox-fixnum (src dest) 159 `(progn 160 (mov (% ,src) (% ,dest)) 161 (sar ($ x8664::fixnumshift) (% ,dest)))) 200 (target-arch-case 201 (:x8632 202 `(progn 203 (mov (% ,src) (% ,dest)) 204 (sar ($ x8632::fixnumshift) (% ,dest)))) 205 (:x8664 206 `(progn 207 (mov (% ,src) (% ,dest)) 208 (sar ($ x8664::fixnumshift) (% ,dest)))))) 162 209 163 210 (defx86lapmacro box-fixnum (src dest) 164 `(imulq ($ x8664::fixnumone) (% ,src) (% ,dest))) 165 211 (target-arch-case 212 (:x8632 213 `(imull ($ x8632::fixnumone) (% ,src) (% ,dest))) 214 (:x8664 215 `(imulq ($ x8664::fixnumone) (% ,src) (% ,dest))))) 166 216 167 217 (defx86lapmacro get-single-float (node dest) 168 `(progn 169 (movd (% ,node) (% ,dest)) 170 (psrlq ($ 32) (% ,dest)))) 171 172 173 ;;; Note that this modifies the src argument. 218 (target-arch-case 219 (:x8632 220 `(movss (@ x8632::single-float.value (% ,node)) (% ,dest))) 221 (:x8664 222 `(progn 223 (movd (% ,node) (% ,dest)) 224 (psrlq ($ 32) (% ,dest)))))) 225 226 ;;; Note that this modifies the src argument in the x8664 case. 174 227 (defx86lapmacro put-single-float (src node) 175 `(progn 176 (psllq ($ 32) (% ,src)) 177 (movd (% ,src) (% ,node)) 178 (movb ($ x8664::tag-single-float) (%b ,node)))) 228 (target-arch-case 229 (:x8632 230 `(movss (% ,src) (@ x8632::single-float.value (% ,node)))) 231 (:x8664 232 `(progn 233 (psllq ($ 32) (% ,src)) 234 (movd (% ,src) (% ,node)) 235 (movb ($ x8664::tag-single-float) (%b ,node)))))) 179 236 180 237 (defx86lapmacro get-double-float (src fpreg) 181 `(movsd (@ x8664::double-float.value (% ,src)) (% ,fpreg))) 238 (target-arch-case 239 (:x8632 240 `(movsd (@ x8632::double-float.value (% ,src)) (% ,fpreg))) 241 (:x8664 242 `(movsd (@ x8664::double-float.value (% ,src)) (% ,fpreg))))) 182 243 183 244 (defx86lapmacro put-double-float (fpreg dest) 184 `(movsd (% ,fpreg) (@ x8664::double-float.value (% ,dest)))) 185 186 187 245 (target-arch-case 246 (:x8632 247 `(movsd (% ,fpreg) (@ x8632::double-float.value (% ,dest)))) 248 (:x8664 249 `(movsd (% ,fpreg) (@ x8664::double-float.value (% ,dest)))))) 250 188 251 (defx86lapmacro getvheader (src dest) 189 `(movq (@ x8664::misc-header-offset (% ,src)) (% ,dest))) 252 (target-arch-case 253 (:x8632 254 `(movl (@ x8632::misc-header-offset (% ,src)) (% ,dest))) 255 (:x8664 256 `(movq (@ x8664::misc-header-offset (% ,src)) (% ,dest))))) 190 257 191 258 ;;; "Size" is unboxed element-count. vheader and dest should 192 259 ;;; both be immediate registers 193 260 (defx86lapmacro header-size (vheader dest) 194 `(progn 195 (mov (% ,vheader) (% ,dest)) 196 (shr ($ x8664::num-subtag-bits) (% ,dest)))) 197 261 (target-arch-case 262 (:x8632 263 `(progn 264 (mov (% ,vheader) (% ,dest)) 265 (shr ($ x8632::num-subtag-bits) (% ,dest)))) 266 (:x8664 267 `(progn 268 (mov (% ,vheader) (% ,dest)) 269 (shr ($ x8664::num-subtag-bits) (% ,dest)))))) 198 270 199 271 ;;; "Length" is fixnum element-count. 200 272 (defx86lapmacro header-length (vheader dest) 201 `(progn 202 (movq ($ (lognot 255)) (% ,dest)) 203 (andq (% ,vheader) (% ,dest)) 204 (shr ($ (- x8664::num-subtag-bits x8664::fixnumshift)) (% ,dest)))) 273 (target-arch-case 274 (:x8632 275 `(progn 276 (movl ($ (lognot 255)) (% ,dest)) 277 (andl (% ,vheader) (% ,dest)) 278 (shr ($ (- x8632::num-subtag-bits x8632::fixnumshift)) (% ,dest)))) 279 (:x8664 280 `(progn 281 (movq ($ (lognot 255)) (% ,dest)) 282 (andq (% ,vheader) (% ,dest)) 283 (shr ($ (- x8664::num-subtag-bits x8664::fixnumshift)) (% ,dest)))))) 205 284 206 285 (defx86lapmacro header-subtag[fixnum] (vheader dest) … … 215 294 216 295 (defx86lapmacro vector-length (vector dest) 217 `(progn 218 (movq ($ (lognot 255)) (% ,dest)) 219 (andq (@ x8664::misc-header-offset (% ,vector)) (% ,dest)) 220 (shr ($ (- x8664::num-subtag-bits x8664::fixnumshift)) (% ,dest)))) 221 296 (target-arch-case 297 (:x8632 298 `(progn 299 (movl ($ (lognot 255)) (% ,dest)) 300 (andl (@ x8632::misc-header-offset (% ,vector)) (% ,dest)) 301 (shr ($ (- x8632::num-subtag-bits x8632::fixnumshift)) (% ,dest)))) 302 (:x8664 303 `(progn 304 (movq ($ (lognot 255)) (% ,dest)) 305 (andq (@ x8664::misc-header-offset (% ,vector)) (% ,dest)) 306 (shr ($ (- x8664::num-subtag-bits x8664::fixnumshift)) (% ,dest)))))) 222 307 223 308 (defx86lapmacro int-to-double (int temp double) 224 `(progn 225 (unbox-fixnum ,int ,temp) 226 (cvtsi2sdq (% ,temp) (% ,double)))) 309 (target-arch-case 310 (:x8632 311 `(progn 312 (unbox-fixnum ,int ,temp) 313 (cvtsi2sdl (% ,temp) (% ,double)))) 314 (:x8664 315 `(progn 316 (unbox-fixnum ,int ,temp) 317 (cvtsi2sdq (% ,temp) (% ,double)))))) 227 318 228 319 (defx86lapmacro int-to-single (int temp single) 229 `(progn 230 (unbox-fixnum ,int ,temp) 231 (cvtsi2ssq (% ,temp) (% ,single)))) 320 (target-arch-case 321 (:x8632 322 `(progn 323 (unbox-fixnum ,int ,temp) 324 (cvtsi2ssl (% ,temp) (% ,single)))) 325 (:x8664 326 `(progn 327 (unbox-fixnum ,int ,temp) 328 (cvtsi2ssq (% ,temp) (% ,single)))))) 232 329 233 330 (defx86lapmacro ref-global (global reg) 234 `(movq (@ (+ x8664::nil-value ,(x8664::%kernel-global global))) (% ,reg))) 331 (target-arch-case 332 (:x8632 333 `(movl (@ (+ x8632::nil-value ,(x8632::%kernel-global global))) (% ,reg))) 334 (:x8664 335 `(movq (@ (+ x8664::nil-value ,(x8664::%kernel-global global))) (% ,reg))))) 235 336 236 337 (defx86lapmacro ref-global.l (global reg) 237 `(movl (@ (+ x8664::nil-value ,(x8664::%kernel-global global))) (%l ,reg))) 338 (target-arch-case 339 (:x8632 340 `(movl (@ (+ x8632::nil-value ,(x8632::%kernel-global global))) (%l ,reg))) 341 (:x8664 342 `(movl (@ (+ x8664::nil-value ,(x8664::%kernel-global global))) (%l ,reg))))) 238 343 239 344 (defx86lapmacro set-global (reg global) 240 `(movq (% ,reg) (@ (+ x8664::nil-value ,(x8664::%kernel-global global))))) 345 (target-arch-case 346 (:x8632 347 `(movl (% ,reg) (@ (+ x8632::nil-value ,(x8632::%kernel-global global))))) 348 (:x8664 349 `(movq (% ,reg) (@ (+ x8664::nil-value ,(x8664::%kernel-global global))))))) 241 350 242 351 (defx86lapmacro macptr-ptr (src dest) 243 `(movq (@ x8664::macptr.address (% ,src)) (% ,dest))) 352 (target-arch-case 353 (:x8632 354 `(movl (@ x8632::macptr.address (% ,src)) (% ,dest))) 355 (:x8664 356 `(movq (@ x8664::macptr.address (% ,src)) (% ,dest))))) 244 357 245 358 ;;; CODE is unboxed char-code (in low 8 bits); CHAR needs to be boxed. 246 359 (defx86lapmacro box-character (code char) 247 `(progn 248 (box-fixnum ,code ,char) 249 (shl ($ (- x8664::charcode-shift x8664::fixnumshift)) (% ,char)) 250 (movb ($ x8664::subtag-character) (%b ,char)))) 251 360 (target-arch-case 361 (:x8632 362 `(progn 363 (box-fixnum ,code ,char) 364 (shl ($ (- x8632::charcode-shift x8632::fixnumshift)) (% ,char)) 365 (movb ($ x8632::subtag-character) (%b ,char)))) 366 (:x8664 367 `(progn 368 (box-fixnum ,code ,char) 369 (shl ($ (- x8664::charcode-shift x8664::fixnumshift)) (% ,char)) 370 (movb ($ x8664::subtag-character) (%b ,char)))))) 252 371 253 372 ;;; index is a constant 254 373 (defx86lapmacro svref (vector index dest) 255 `(movq (@ (+ x8664::misc-data-offset (* ,index 8)) (% ,vector)) (% ,dest))) 374 (target-arch-case 375 (:x8632 376 `(movl (@ (+ x8632::misc-data-offset (* ,index 4)) (% ,vector)) (% ,dest))) 377 (:x8664 378 `(movq (@ (+ x8664::misc-data-offset (* ,index 8)) (% ,vector)) (% ,dest))))) 256 379 257 380 ;;; Index is still a constant 258 381 (defx86lapmacro svset (vector index new) 259 `(movq (% ,new) (@ (+ x8664::misc-data-offset (* ,index 8)) (% ,vector)))) 260 382 (target-arch-case 383 (:x8632 384 `(movl (% ,new) (@ (+ x8632::misc-data-offset (* ,index 4)) (% ,vector)))) 385 (:x8664 386 `(movq (% ,new) (@ (+ x8664::misc-data-offset (* ,index 8)) (% ,vector)))))) 261 387 262 388 … … 266 392 ;;; Simple frame, since the caller didn't reserve space for it. 267 393 (defx86lapmacro save-simple-frame () 268 `(progn 269 (pushq (% rbp)) 270 (movq (% rsp) (% rbp)))) 271 394 (target-arch-case 395 (:x8632 396 `(progn 397 (pushl (% ebp)) 398 (movl (% esp) (% ebp)))) 399 (:x8664 400 `(progn 401 (pushq (% rbp)) 402 (movq (% rsp) (% rbp)))))) 403 272 404 (defx86lapmacro save-frame-variable-arg-count () 273 405 (let* ((push (gensym)) 274 406 (done (gensym))) 275 `(progn 276 (movl (% nargs) (%l imm0)) 277 (subq ($ (* $numx8664argregs x8664::node-size)) (% imm0)) 278 (jle ,push) 279 (movq (% rbp) (@ 8 (% rsp) (% imm0))) 280 (leaq (@ 8 (% rsp) (% imm0)) (% rbp)) 281 (popq (@ 8 (% rbp))) 282 (jmp ,done) 283 ,push 284 (save-simple-frame) 285 ,done))) 407 (target-arch-case 408 (:x8632 409 `(progn 410 (movl (% nargs) (% imm0)) 411 (subl ($ (* $numx8632argregs x8632::node-size)) (% imm0)) 412 (jle ,push) 413 (movl (% ebp) (@ 4 (% esp) (% imm0))) 414 (leal (@ 4 (% esp) (% imm0)) (% ebp)) 415 (popl (@ 4 (% ebp))) 416 (jmp ,done) 417 ,push 418 (save-simple-frame) 419 ,done)) 420 (:x8664 421 `(progn 422 (movl (% nargs) (%l imm0)) 423 (subq ($ (* $numx8664argregs x8664::node-size)) (% imm0)) 424 (jle ,push) 425 (movq (% rbp) (@ 8 (% rsp) (% imm0))) 426 (leaq (@ 8 (% rsp) (% imm0)) (% rbp)) 427 (popq (@ 8 (% rbp))) 428 (jmp ,done) 429 ,push 430 (save-simple-frame) 431 ,done))))) 286 432 287 433 … … 290 436 (leave))) 291 437 292 293 294 438 (defx86lapmacro discard-reserved-frame () 295 `(add ($ '2) (% rsp))) 439 (target-arch-case 440 (:x8632 441 `(add ($ '2) (% esp))) 442 (:x8664 443 `(add ($ '2) (% rsp))))) 296 444 297 445 ;;; Return to caller. 298 446 (defx86lapmacro single-value-return (&optional (words-to-discard 0)) 299 (if (zerop words-to-discard) 300 `(ret) 301 `(ret ($ ,(* x8664::node-size words-to-discard))))) 302 303 ;;; Using *x8664-backend* here is wrong but expedient. 447 (target-arch-case 448 (:x8632 449 (if (zerop words-to-discard) 450 `(ret) 451 `(ret ($ ,(* x8632::node-size words-to-discard))))) 452 (:x8664 453 (if (zerop words-to-discard) 454 `(ret) 455 `(ret ($ ,(* x8664::node-size words-to-discard))))))) 456 304 457 (defun x86-subprim-offset (name) 305 (let* ((info (find name (arch::target-subprims-table (backend-target-arch * x8664-backend*)) :test #'string-equal :key #'subprimitive-info-name))458 (let* ((info (find name (arch::target-subprims-table (backend-target-arch *target-backend*)) :test #'string-equal :key #'subprimitive-info-name)) 306 459 (offset (when info 307 460 (subprimitive-info-offset info)))) 308 461 (or offset 309 462 (error "Unknown subprim: ~s" name)))) 310 463 311 464 (defx86lapmacro jmp-subprim (name) 312 465 `(jmp (@ ,(x86-subprim-offset name)))) 313 466 467 (defx86lapmacro recover-fn () 468 `(movl ($ :self) (% fn))) 469 314 470 (defx86lapmacro call-subprim (name) 315 `(progn 316 (:talign 4) 317 (call (@ ,(x86-subprim-offset name))) 318 (recover-fn-from-rip))) 319 320 321 (defx86lapmacro %car (src dest) 322 `(movq (@ x8664::cons.car (% ,src)) (% ,dest))) 471 (target-arch-case 472 (:x8632 473 `(progn 474 (:talign x8632::fulltag-tra) 475 (call (@ ,(x86-subprim-offset name))) 476 (recover-fn))) 477 (:x8664 478 `(progn 479 (:talign 4) 480 (call (@ ,(x86-subprim-offset name))) 481 (recover-fn-from-rip))))) 482 483 (defx86lapmacro %car (src dest) 484 (target-arch-case 485 (:x8632 486 `(movl (@ x8632::cons.car (% ,src)) (% ,dest))) 487 (:x8664 488 `(movq (@ x8664::cons.car (% ,src)) (% ,dest))))) 323 489 324 490 (defx86lapmacro %cdr (src dest) 325 `(movq (@ x8664::cons.cdr (% ,src)) (% ,dest))) 491 (target-arch-case 492 (:x8632 493 `(movl (@ x8632::cons.cdr (% ,src)) (% ,dest))) 494 (:x8664 495 `(movq (@ x8664::cons.cdr (% ,src)) (% ,dest))))) 326 496 327 497 (defx86lapmacro stack-probe () 328 (let* ((ok (gensym))) 329 `(progn 330 (rcmp (% rsp) (@ (% rcontext) x8664::tcr.cs-limit)) 331 (jae.pt ,ok) 332 (uuo-stack-overflow) 333 ,ok))) 498 (target-arch-case 499 (:x8632 500 (let* ((ok (gensym))) 501 `(progn 502 (rcmp (% esp) (@ (% rcontext) x8632::tcr.cs-limit)) 503 (jae.pt ,ok) 504 (uuo-stack-overflow) 505 ,ok))) 506 (:x8664 507 (let* ((ok (gensym))) 508 `(progn 509 (rcmp (% rsp) (@ (% rcontext) x8664::tcr.cs-limit)) 510 (jae.pt ,ok) 511 (uuo-stack-overflow) 512 ,ok))))) 334 513 335 514 (defx86lapmacro load-constant (constant dest &optional (fn 'fn)) 336 `(movq (@ ',constant (% ,fn)) (% ,dest))) 515 (target-arch-case 516 (:x8632 517 `(movl (@ ',constant (% ,fn)) (% ,dest))) 518 (:x8664 519 `(movq (@ ',constant (% ,fn)) (% ,dest))))) 337 520 338 521 (defx86lapmacro recover-fn-from-rip () … … 346 529 ;;; to return a single value. 347 530 (defx86lapmacro call-symbol (name nargs) 348 `(progn 349 (load-constant ,name fname) 350 (set-nargs ,nargs) 351 (:talign 4) 352 (call (@ x8664::symbol.fcell (% fname))) 353 (recover-fn-from-rip))) 531 (target-arch-case 532 (:x8632 533 `(progn 534 (load-constant ,name fname) 535 (set-nargs ,nargs) 536 (:talign 5) 537 (call (@ x8632::symbol.fcell (% fname))) 538 (recover-fn))) 539 (:x8664 540 `(progn 541 (load-constant ,name fname) 542 (set-nargs ,nargs) 543 (:talign 4) 544 (call (@ x8664::symbol.fcell (% fname))) 545 (recover-fn-from-rip))))) 354 546 355 547 … … 360 552 ;;; prevent the current function from being GCed halfway through 361 553 ;;; those couple of instructions. 554 362 555 (defx86lapmacro jump-symbol (name nargs) 363 `(progn 364 (load-constant ,name fname) 365 (set-nargs ,nargs) 366 (jmp (@ x8664::symbol.fcell (% fname))))) 556 (target-arch-case 557 (:x8632 558 `(progn 559 (load-constant ,name fname) 560 (set-nargs ,nargs) 561 (jmp (@ x8632::symbol.fcell (% fname))))) 562 (:x8664 563 `(progn 564 (load-constant ,name fname) 565 (set-nargs ,nargs) 566 (jmp (@ x8664::symbol.fcell (% fname))))))) 367 567 368 568 (defx86lapmacro push-argregs () … … 370 570 (yz (gensym)) 371 571 (z (gensym))) 372 `(progn 373 (testl (% nargs) (% nargs)) 374 (je ,done) 375 (cmpl ($ '2) (% nargs)) 376 (je ,yz) 377 (jb ,z) 378 (push (% arg_x)) 379 ,yz 380 (push (% arg_y)) 381 ,z 382 (push (% arg_z)) 383 ,done))) 384 572 (target-arch-case 573 (:x8632 574 `(progn 575 (testl (% nargs) (% nargs)) 576 (je ,done) 577 (cmpl ($ '1) (% nargs)) 578 (je ,z) 579 (push (% arg_y)) 580 ,z 581 (push (% arg_z)) 582 ,done)) 583 (:x8664 584 `(progn 585 (testl (% nargs) (% nargs)) 586 (je ,done) 587 (cmpl ($ '2) (% nargs)) 588 (je ,yz) 589 (jb ,z) 590 (push (% arg_x)) 591 ,yz 592 (push (% arg_y)) 593 ,z 594 (push (% arg_z)) 595 ,done))))) 596 597 ;;; clears reg 598 (defx86lapmacro mark-as-node (reg) 599 (let* ((regnum (logand #x7 (x86::gpr-ordinal (string reg)))) 600 (bit (ash 1 regnum))) 601 `(progn 602 (xorl (% ,reg) (% ,reg)) 603 (orb ($ ,bit) (@ (% :rcontext) x8632::tcr.node-regs-mask))))) 604 605 (defx86lapmacro mark-as-imm (reg) 606 (let* ((regnum (logand #x7 (x86::gpr-ordinal (string reg)))) 607 (bit (ash 1 regnum))) 608 `(progn 609 (andb ($ (lognot ,bit)) (@ (% :rcontext) x8632::tcr.node-regs-mask))))) 610 611 (defx86lapmacro compose-digit (high low dest) 612 (target-arch-case 613 (:x8632 614 `(progn 615 (unbox-fixnum ,low ,dest) 616 (andl ($ #xffff) (% ,dest)) 617 (shll ($ (- 16 x8632::fixnumshift)) (% ,high)) 618 (orl (% ,high) (% ,dest)))) 619 (:x8664 620 (error "compose-digit on x8664?"))))
Note: See TracChangeset
for help on using the changeset viewer.