Changeset 7860
- Timestamp:
- Dec 9, 2007, 5:55:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp
r7780 r7860 298 298 (define-x8664-vinsn check-exact-nargs (() 299 299 ((n :u16const))) 300 :resume 300 301 ((:pred = n 0) 301 302 (testw (:%w x8664::nargs) (:%w x8664::nargs))) 302 303 ((:not (:pred = n 0)) 303 304 (cmpw (:$w (:apply ash n x8664::word-shift)) (:%w x8664::nargs))) 304 (jz.pt :ok) 305 (uuo-error-wrong-number-of-args) 306 :ok) 305 (jne :bad) 306 (:anchored-uuo-section :resume) 307 :bad 308 (:anchored-uuo (uuo-error-wrong-number-of-args))) 307 309 308 310 (define-x8664-vinsn check-min-nargs (() 309 311 ((n :u16const))) 312 :resume 310 313 (rcmpw (:%w x8664::nargs) (:$w (:apply ash n x8664::word-shift))) 311 (jae.pt :ok) 312 (uuo-error-too-few-args) 313 :ok) 314 (jb :bad) 315 316 (:anchored-uuo-section :resume) 317 :bad 318 (:anchored-uuo (uuo-error-too-few-args))) 314 319 315 320 (define-x8664-vinsn check-max-nargs (() 316 321 ((n :u16const))) 322 :resume 317 323 (rcmpw (:%w x8664::nargs) (:$w (:apply ash n x8664::word-shift))) 318 (jbe.pt :ok) 319 (uuo-error-too-many-args) 320 :ok) 324 (jg :bad) 325 326 (:anchored-uuo-section :resume) 327 :bad 328 (:anchored-uuo (uuo-error-too-many-args))) 321 329 322 330 … … 516 524 (define-x8664-vinsn compare-to-nil (() 517 525 ((arg0 t))) 518 (cmp b (:$b x8664::fulltag-nil) (:%barg0)))526 (cmpl (:$l x8664::nil-value) (:%l arg0))) 519 527 520 528 … … 560 568 (define-x8664-vinsn trap-unless-bit (() 561 569 ((value :lisp))) 562 570 :resume 563 571 (testq (:$l (lognot x8664::fixnumone)) (:%q value)) 564 (je.pt :ok) 565 (uuo-error-reg-not-type (:%q value) (:$ub arch::error-object-not-bit)) 566 :ok 572 (jne :bad) 573 574 (:anchored-uuo-section :resume) 575 :bad 576 (:anchored-uuo (uuo-error-reg-not-type (:%q value) (:$ub arch::error-object-not-bit))) 567 577 ) 568 578 … … 570 580 ((object :lisp)) 571 581 ((tag :u8))) 572 (movb (:%b object) (:%b tag)) 573 (andb (:$b x8664::tagmask) (:%b tag)) 574 (cmpb (:$b x8664::tag-list) (:%b tag)) 575 (je.pt :ok) 576 (uuo-error-reg-not-list (:%q object)) 577 :ok) 582 :resume 583 (movl (:%l object) (:%l tag)) 584 (andl (:$b x8664::tagmask) (:%l tag)) 585 (cmpl (:$b x8664::tag-list) (:%l tag)) 586 (jne :bad) 587 588 (:anchored-uuo-section :resume) 589 :bad 590 (:anchored-uuo (uuo-error-reg-not-list (:%q object)))) 591 592 578 593 579 594 (define-x8664-vinsn trap-unless-cons (() 580 ((object :lisp)) 581 ((tag :u8))) 582 (movb (:%b object) (:%b tag)) 583 (andb (:$b x8664::fulltagmask) (:%b tag)) 584 (cmpb (:$b x8664::fulltag-cons) (:%b tag)) 585 (je.pt :ok) 586 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::fulltag-cons)) 587 :ok) 588 595 ((object :lisp)) 596 ((tag :u8))) 597 :resume 598 (movl (:%l object) (:%l tag)) 599 (andl (:$b x8664::fulltagmask) (:%l tag)) 600 (cmpl (:$b x8664::fulltag-cons) (:%l tag)) 601 (jne :bad) 602 603 (:anchored-uuo-section :resume) 604 :bad 605 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::fulltag-cons)))) 606 607 589 608 (define-x8664-vinsn trap-unless-uvector (() 590 609 ((object :lisp)) 591 610 ((tag :u8))) 592 (movb (:%b object) (:%b tag)) 593 (andb (:$b x8664::tagmask) (:%b tag)) 594 (cmpb (:$b x8664::tag-misc) (:%b tag)) 595 (jz.pt :ok) 596 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::tag-misc)) 597 :ok) 611 :resume 612 (movl (:%l object) (:%l tag)) 613 (andl (:$b x8664::tagmask) (:%l tag)) 614 (cmpl (:$b x8664::tag-misc) (:%l tag)) 615 (jne :bad) 616 617 (:anchored-uuo-section :resume) 618 :bad 619 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::tag-misc)))) 598 620 599 621 (define-x8664-vinsn trap-unless-single-float (() 600 622 ((object :lisp))) 623 :resume 601 624 (cmpb (:$b x8664::tag-single-float) (:%b object)) 602 (je.pt :ok) 603 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::tag-single-float)) 604 :ok) 625 (jne :bad) 626 627 (:anchored-uuo-section :resume) 628 :bad 629 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::tag-single-float)))) 605 630 606 631 (define-x8664-vinsn trap-unless-character (() 607 632 ((object :lisp))) 633 :resume 608 634 (cmpb (:$b x8664::subtag-character) (:%b object)) 609 (je.pt :ok) 610 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-character)) 611 :ok) 635 (jne :bad) 636 637 (:anchored-uuo-section :resume) 638 :bad 639 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-character)))) 612 640 613 641 (define-x8664-vinsn trap-unless-fixnum (() 614 642 ((object :lisp)) 615 643 ()) 644 :resume 616 645 (testb (:$b x8664::tagmask) (:%b object)) 617 (je.pt :ok) 618 (uuo-error-reg-not-fixnum (:%q object)) 619 :ok) 646 (jne :bad) 647 648 (:anchored-uuo-section :resume) 649 :bad 650 (:anchored-uuo (uuo-error-reg-not-fixnum (:%q object)))) 620 651 621 652 (define-x8664-vinsn set-flags-from-lisptag (() … … 628 659 (tagval :u16const)) 629 660 ((tag :u8))) 630 (movb (:%b object) (:%b tag)) 631 (andb (:$b x8664::tagmask) (:%b tag)) 632 (cmpb (:$b x8664::tag-misc) (:%b tag)) 661 :resume 662 (movl (:%l object) (:%l tag)) 663 (andl (:$b x8664::tagmask) (:%l tag)) 664 (cmpl (:$b x8664::tag-misc) (:%l tag)) 633 665 (jne :have-tag) 634 (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b tag)) 666 ;; This needs to be a sign-extending mov, since the cmpl below 667 ;; will sign-extend the 8-bit constant operand. 668 (movsbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag)) 635 669 :have-tag 636 (cmpb (:$b tagval) (:%b tag)) 637 (je.pt :ok) 638 (uuo-error-reg-not-tag (:%q object) (:$ub tagval)) 639 :ok) 670 (cmpl (:$b tagval) (:%l tag)) 671 (jne :bad) 672 (:anchored-uuo-section :resume) 673 :bad 674 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub tagval)))) 640 675 641 676 (define-x8664-vinsn trap-unless-double-float (() 642 677 ((object :lisp)) 643 678 ((tag :u8))) 644 (movb (:%b object) (:%b tag)) 645 (andb (:$b x8664::tagmask) (:%b tag)) 646 (cmpb (:$b x8664::tag-misc) (:%b tag)) 679 :resume 680 (movl (:%l object) (:%l tag)) 681 (andl (:$b x8664::tagmask) (:%l tag)) 682 (cmpl (:$b x8664::tag-misc) (:%l tag)) 647 683 (jne :have-tag) 648 (mov b (:@ x8664::misc-subtag-offset (:%q object)) (:%btag))684 (movsbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag)) 649 685 :have-tag 650 (cmpb (:$b x8664::subtag-double-float) (:%b tag)) 651 (je.pt :ok) 652 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-double-float)) 653 :ok) 686 (cmpl (:$b x8664::subtag-double-float) (:%l tag)) 687 (jne :bad) 688 (:anchored-uuo-section :resume) 689 :bad 690 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-double-float)))) 654 691 655 692 (define-x8664-vinsn trap-unless-macptr (() 656 693 ((object :lisp)) 657 694 ((tag :u8))) 658 (movb (:%b object) (:%b tag)) 659 (andb (:$b x8664::tagmask) (:%b tag)) 660 (cmpb (:$b x8664::tag-misc) (:%b tag)) 695 :resume 696 (movl (:%l object) (:%l tag)) 697 (andl (:$b x8664::tagmask) (:%l tag)) 698 (cmpl (:$b x8664::tag-misc) (:%l tag)) 661 699 (jne :have-tag) 662 (mov b (:@ x8664::misc-subtag-offset (:%q object)) (:%btag))700 (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag)) 663 701 :have-tag 664 702 (cmpb (:$b x8664::subtag-macptr) (:%b tag)) 665 (je.pt :ok) 666 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-macptr)) 667 :ok) 703 (jne :bad) 704 705 (:anchored-uuo-section :resume) 706 :bad 707 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-macptr)))) 668 708 669 709 … … 672 712 (v :lisp)) 673 713 ((temp :u64))) 714 :resume 674 715 (movq (:@ x8664::misc-header-offset (:%q v)) (:%q temp)) 675 ( xorb (:%b temp) (:%btemp))676 (sh rq (:$ub (- x8664::num-subtag-bits x8664::fixnumshift)) (:%q temp))716 (shrq (:$ub x8664::num-subtag-bits) (:%q temp)) 717 (shlq (:$ub x8664::fixnumshift) (:%q temp)) 677 718 (rcmpq (:%q idx) (:%q temp)) 678 (jb.pt :ok) 679 (uuo-error-vector-bounds (:%q idx) (:%q v)) 680 :ok) 719 (jge :bad) 720 721 (:anchored-uuo-section :resume) 722 :bad 723 (:anchored-uuo (uuo-error-vector-bounds (:%q idx) (:%q v)))) 681 724 682 725 … … 745 788 (cmpb (:$b x8664::tag-misc) (:%b tag)) 746 789 (jne :have-tag) 747 (mov b (:@ x8664::misc-subtag-offset (:%q object)) (:%btag))790 (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag)) 748 791 :have-tag) 749 792 … … 751 794 ((object :lisp)) 752 795 ((temp :u32))) 753 (mov zbl (:%bobject) (:%l temp))754 (and b (:$b x8664::tagmask) (:%btemp))755 (cmp b (:$b x8664::tag-misc) (:%btemp))796 (movl (:%l object) (:%l temp)) 797 (andl (:$b x8664::tagmask) (:%l temp)) 798 (cmpl (:$b x8664::tag-misc) (:%l temp)) 756 799 (jne :have-tag) 757 (mov b (:@ x8664::misc-subtag-offset (:%q object)) (:%btemp))800 (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l temp)) 758 801 :have-tag 759 802 (leal (:@ (:%q temp) 8) (:%l tag))) … … 823 866 (define-x8664-vinsn unbox-u8 (((dest :u8)) 824 867 ((src :lisp))) 868 :resume 825 869 (movq (:$l (lognot (ash #xff x8664::fixnumshift))) (:%q dest)) 826 870 (andq (:% src) (:% dest)) 827 (je.pt :ok) 828 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-8)) 829 :ok 871 (jne :bad) 830 872 (movq (:%q src) (:%q dest)) 831 (shrq (:$ub x8664::fixnumshift) (:%q dest))) 873 (shrq (:$ub x8664::fixnumshift) (:%q dest)) 874 875 (:anchored-uuo-section :resume) 876 :bad 877 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-8)))) 832 878 833 879 (define-x8664-vinsn %unbox-u8 (((dest :u8)) … … 839 885 (define-x8664-vinsn unbox-s8 (((dest :s8)) 840 886 ((src :lisp))) 887 :resume 841 888 (movq (:%q src) (:%q dest)) 842 889 (shlq (:$ub (- x8664::nbits-in-word (+ 8 x8664::fixnumshift))) (:%q dest)) 843 890 (sarq (:$ub (- x8664::nbits-in-word (+ 8 x8664::fixnumshift))) (:%q dest)) 844 891 (cmpq (:%q src) (:%q dest)) 845 (jne .pn:bad)892 (jne :bad) 846 893 (testb (:$b x8664::fixnummask) (:%b dest)) 847 (jne .pn:bad)894 (jne :bad) 848 895 (sarq (:$ub x8664::fixnumshift) (:%q dest)) 849 (jmp :got-it) 850 :bad851 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-8))852 :got-it)896 897 (:anchored-uuo-section :resume) 898 :bad 899 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-8)))) 853 900 854 901 (define-x8664-vinsn unbox-u16 (((dest :u16)) 855 902 ((src :lisp))) 903 :resume 856 904 (testq (:$l (lognot (ash #xffff x8664::fixnumshift))) (:% src)) 857 905 (movq (:%q src) (:%q dest)) 858 (je.pt :ok) 859 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-16)) 860 :ok 861 (shrq (:$ub x8664::fixnumshift) (:%q dest))) 906 (jne :bad) 907 (shrq (:$ub x8664::fixnumshift) (:%q dest)) 908 909 (:anchored-uuo-section :resume) 910 :bad 911 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-16)))) 862 912 863 913 (define-x8664-vinsn %unbox-u16 (((dest :u16)) … … 868 918 (define-x8664-vinsn unbox-s16 (((dest :s16)) 869 919 ((src :lisp))) 920 :resume 870 921 (movq (:%q src) (:%q dest)) 871 922 (shlq (:$ub (- x8664::nbits-in-word (+ 16 x8664::fixnumshift))) (:%q dest)) 872 923 (sarq (:$ub (- x8664::nbits-in-word (+ 16 x8664::fixnumshift))) (:%q dest)) 873 924 (cmpq (:%q src) (:%q dest)) 874 (j ne.pn:bad)925 (je :bad) 875 926 (testb (:$b x8664::fixnummask) (:%b dest)) 876 (je.pt :got-it) 877 :bad 878 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-16)) 879 :got-it 880 (sarq (:$ub x8664::fixnumshift) (:%q dest))) 927 (jne :bad) 928 (sarq (:$ub x8664::fixnumshift) (:%q dest)) 929 930 (:anchored-uuo-section :resume) 931 :bad 932 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-16)))) 881 933 882 934 (define-x8664-vinsn %unbox-s16 (((dest :s16)) … … 887 939 (define-x8664-vinsn unbox-u32 (((dest :u32)) 888 940 ((src :lisp))) 941 :resume 889 942 (movq (:$q (lognot (ash #xffffffff x8664::fixnumshift))) (:%q dest)) 890 943 (testq (:% src) (:% dest)) 891 (je.pt :ok) 892 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-32)) 893 :ok 944 (jne :bad) 945 (movq (:%q src) (:%q dest)) 946 (shrq (:$ub x8664::fixnumshift) (:%q dest)) 947 948 (:anchored-uuo-section :resume) 949 :bad 950 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-32)))) 951 952 (define-x8664-vinsn %unbox-u32 (((dest :u32)) 953 ((src :lisp))) 954 894 955 (movq (:%q src) (:%q dest)) 895 956 (shrq (:$ub x8664::fixnumshift) (:%q dest))) 896 957 897 (define-x8664-vinsn %unbox-u32 (((dest :u32))898 ((src :lisp)))899 900 (movq (:%q src) (:%q dest))901 (shrq (:$ub x8664::fixnumshift) (:%q dest)))902 903 958 (define-x8664-vinsn unbox-s32 (((dest :s32)) 904 959 ((src :lisp))) 960 :resume 905 961 (movq (:%q src) (:%q dest)) 906 962 (shlq (:$ub (- x8664::nbits-in-word (+ 32 x8664::fixnumshift))) (:%q dest)) 907 963 (sarq (:$ub (- x8664::nbits-in-word (+ 32 x8664::fixnumshift))) (:%q dest)) 908 964 (cmpq (:%q src) (:%q dest)) 909 (jne .pn:bad)965 (jne :bad) 910 966 (testb (:$b x8664::fixnummask) (:%b dest)) 911 (je.pt :got-it) 912 :bad 913 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-32)) 914 :got-it 915 (sarq (:$ub x8664::fixnumshift) (:%q dest))) 967 (jne :bad) 968 (sarq (:$ub x8664::fixnumshift) (:%q dest)) 969 970 (:anchored-uuo-section :resume) 971 :bad 972 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-32)))) 916 973 917 974 (define-x8664-vinsn %unbox-s32 (((dest :s32)) … … 923 980 (define-x8664-vinsn unbox-u64 (((dest :u64)) 924 981 ((src :lisp))) 982 :resume 925 983 (movq (:$q (lognot (ash x8664::target-most-positive-fixnum x8664::fixnumshift))) (:%q dest)) 926 984 (testq (:%q dest) (:%q src)) … … 930 988 (jmp :done) 931 989 :maybe-bignum 932 (and b (:$b x8664::tagmask) (:%bdest))933 (cmp b (:$b x8664::tag-misc) (:%bdest))990 (andl (:$b x8664::tagmask) (:%l dest)) 991 (cmpl (:$b x8664::tag-misc) (:%l dest)) 934 992 (jne :have-tag) 935 (mov b (:@ x8664::misc-subtag-offset (:%q src)) (:%bdest))993 (movzbl (:@ x8664::misc-subtag-offset (:%q src)) (:%l dest)) 936 994 :have-tag 937 (cmp b (:$b x8664::subtag-bignum) (:%bdest))995 (cmpl (:$b x8664::subtag-bignum) (:%l dest)) 938 996 (jne :bad) 939 997 (movq (:@ x8664::misc-header-offset (:%q src)) (:%q dest)) … … 944 1002 (movq (:@ x8664::misc-data-offset (:%q src)) (:%q dest)) 945 1003 (testq (:%q dest) (:%q dest)) 946 (j ns :done)947 :bad948 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-64)) 1004 (js :bad) 1005 (jmp :done) 1006 949 1007 :three 950 1008 (movl (:@ (+ 8 x8664::misc-data-offset) (:%q src)) (:%l dest)) … … 952 1010 (movq (:@ x8664::misc-data-offset (:%q src)) (:%q dest)) 953 1011 (jne :bad) 954 :done) 1012 :done 1013 1014 (:anchored-uuo-section :resume) 1015 :bad 1016 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-64)))) 955 1017 956 1018 (define-x8664-vinsn unbox-s64 (((dest :s64)) 957 1019 ((src :lisp))) 1020 :resume 958 1021 (movq (:%q src) (:%q dest)) 959 1022 (sarq (:$ub x8664::fixnumshift) (:%q dest)) … … 962 1025 (je :done) 963 1026 ;; May be a 2-digit bignum 964 (mov b (:%b src) (:%bdest))965 (and b (:$b x8664::tagmask) (:%bdest))966 (cmp b (:$b x8664::tag-misc) (:%bdest))1027 (movl (:%l src) (:%l dest)) 1028 (andl (:$b x8664::tagmask) (:%l dest)) 1029 (cmpl (:$b x8664::tag-misc) (:%l dest)) 967 1030 (jne :bad) 968 1031 (cmpq (:$l x8664::two-digit-bignum-header) (:@ x8664::misc-header-offset (:%q src))) 969 1032 (movq (:@ x8664::misc-data-offset (:%q src)) (:%q dest)) 970 (je :done) 971 :bad 972 (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-64)) 973 :done) 1033 (jne :bad) 1034 :done 1035 1036 (:anchored-uuo-section :resume) 1037 :bad 1038 (:anchored-uuo (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-signed-byte-64)))) 974 1039 975 1040 (define-x8664-vinsn sign-extend-s8 (((dest :s64)) … … 1470 1535 ((source :lisp)) 1471 1536 ((tag :u8))) 1472 (movb (:%b source) (:%b tag)) 1473 (andb (:$b x8664::tagmask) (:%b tag)) 1474 (cmpb (:$b x8664::tag-misc) (:%b tag)) 1537 :resume 1538 (movl (:%l source) (:%l tag)) 1539 (andl (:$b x8664::tagmask) (:%l tag)) 1540 (cmpl (:$b x8664::tag-misc) (:%l tag)) 1475 1541 (jne :have-tag) 1476 (mov b (:@ x8664::misc-subtag-offset (:%q source)) (:%btag))1542 (movsbl (:@ x8664::misc-subtag-offset (:%q source)) (:%l tag)) 1477 1543 :have-tag 1478 (cmpb (:$b x8664::subtag-double-float) (:%b tag)) 1479 (je.pt :ok) 1480 (uuo-error-reg-not-tag (:%q source) (:$ub x8664::subtag-double-float)) 1481 :ok 1482 (movsd (:@ x8664::double-float.value (:%q source)) (:%xmm target))) 1544 (cmpl (:$b x8664::subtag-double-float) (:%l tag)) 1545 (jne :bad) 1546 (movsd (:@ x8664::double-float.value (:%q source)) (:%xmm target)) 1547 1548 (:anchored-uuo-section :resume) 1549 :bad 1550 (:anchored-uuo (uuo-error-reg-not-tag (:%q source) (:$ub x8664::subtag-double-float)))) 1483 1551 1484 1552 (define-x8664-vinsn single->node (((result :lisp) … … 1574 1642 () 1575 1643 ((tag :u8))) 1576 (movb (:%b x8664::temp0) (:%b tag)) 1577 (andb (:$b x8664::fulltagmask) (:%b tag)) 1578 (cmpb (:$b x8664::fulltag-symbol) (:%b tag)) 1644 :resume 1645 (movl (:%l x8664::temp0) (:%l tag)) 1646 (andl (:$b x8664::fulltagmask) (:%l tag)) 1647 (cmpl (:$b x8664::fulltag-symbol) (:%l tag)) 1579 1648 (cmovgq (:%q x8664::temp0) (:%q x8664::fn)) 1580 1649 (jl :bad) … … 1582 1651 (pushq (:@ (+ x8664::nil-value (x8664::%kernel-global 'x86::ret1valaddr)))) 1583 1652 (jmp (:%q x8664::fn)) 1584 :bad 1585 (uuo-error-not-callable) 1586 ;; If we don't do this (and leave %fn as a TRA into itself), reporting 1587 ;; the error is likely a little harder. Tough. 1588 ;; (leaq (@ (:apply - (:^ :bad)) (:%q x8664::rn)) (:%q x8664::fn)) 1589 ) 1653 1654 (:anchored-uuo-section :resume) 1655 :bad 1656 (:anchored-uuo (uuo-error-not-callable))) 1590 1657 1591 1658 … … 1836 1903 ((tag :u8) 1837 1904 (entry (:label 1)))) 1838 (movb (:%b x8664::temp0) (:%b tag)) 1839 (andb (:$b x8664::fulltagmask) (:%b tag)) 1840 (cmpb (:$b x8664::fulltag-symbol) (:%b tag)) 1905 :resume 1906 (movl (:%l x8664::temp0) (:%l tag)) 1907 (andl (:$b x8664::fulltagmask) (:%l tag)) 1908 (cmpl (:$b x8664::fulltag-symbol) (:%l tag)) 1841 1909 (cmovgq (:%q x8664::temp0) (:%q x8664::xfn)) 1842 (jge.pt :call) 1843 (uuo-error-not-callable) 1844 :call 1910 (jl :bad) 1845 1911 (cmoveq (:@ x8664::symbol.fcell (:%q x8664::fname)) (:%q x8664::xfn)) 1846 1912 (:talign 4) 1847 1913 (call (:%q x8664::xfn)) 1848 (leaq (:@ (:^ entry) (:% x8664::rip)) (:%q x8664::fn))) 1914 (leaq (:@ (:^ entry) (:% x8664::rip)) (:%q x8664::fn)) 1915 (:anchored-uuo-section :resume) 1916 :bad 1917 (:anchored-uuo (uuo-error-not-callable))) 1849 1918 1850 1919 (define-x8664-vinsn tail-funcall (() 1851 1920 () 1852 ((tag :u8))) 1853 (movb (:%b x8664::temp0) (:%b tag)) 1854 (andb (:$b x8664::fulltagmask) (:%b tag)) 1855 (cmpb (:$b x8664::fulltag-symbol) (:%b tag)) 1921 ((tag (:u8 #.x8664::imm0)))) 1922 :resume 1923 (movl (:%l x8664::temp0) (:%l tag)) 1924 (andl (:$b x8664::fulltagmask) (:%l tag)) 1925 (cmpl (:$b x8664::fulltag-symbol) (:%l tag)) 1856 1926 (cmovgq (:%q x8664::temp0) (:%q x8664::xfn)) 1857 1927 (jl :bad) 1858 1928 (cmoveq (:@ x8664::symbol.fcell (:%q x8664::fname)) (:%q x8664::xfn)) 1859 1929 (jmp (:%q x8664::xfn)) 1860 :bad 1861 (uuo-error-not-callable)) 1930 1931 (:anchored-uuo-section :resume) 1932 :bad 1933 (:anchored-uuo (uuo-error-not-callable))) 1862 1934 1863 1935 … … 1892 1964 ((table :imm) 1893 1965 (idx :imm))) 1966 :resume 1894 1967 (movq (:@ x8664::symbol.binding-index (:%q src)) (:%q idx)) 1895 1968 (rcmpq (:%q idx) (:@ (:%seg :rcontext) x8664::tcr.tlb-limit)) … … 1897 1970 (jae :symbol) 1898 1971 (movq (:@ (:%q table) (:%q idx)) (:%q dest)) 1899 (cmp b (:$b x8664::subtag-no-thread-local-binding) (:%bdest))1972 (cmpl (:$b x8664::subtag-no-thread-local-binding) (:%l dest)) 1900 1973 (jne :test) 1901 1974 :symbol 1902 1975 (movq (:@ x8664::symbol.vcell (:%q src)) (:%q dest)) 1903 1976 :test 1904 (cmpb (:$b x8664::unbound-marker) (:%b dest)) 1905 (jne.pt :done) 1906 (uuo-error-unbound (:%q src)) 1907 :done) 1977 (cmpl (:$b x8664::unbound-marker) (:%l dest)) 1978 (je :bad) 1979 1980 (:anchored-uuo-section :resume) 1981 :bad 1982 (:anchored-uuo (uuo-error-unbound (:%q src)))) 1908 1983 1909 1984 … … 2594 2669 ((object :lisp))) 2595 2670 :again 2596 (test b (:$b x8664::fixnummask) (:%bobject))2597 (j e.pt :got-it)2598 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-fixnum))2599 (jmp :again)2600 :got-it)2671 (testl (:$l x8664::fixnummask) (:%l object)) 2672 (jne :bad) 2673 (:anchored-uuo-section :again) 2674 :bad 2675 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-fixnum)))) 2601 2676 2602 2677 (define-x8664-vinsn require-integer (() … … 2604 2679 ((tag :u8))) 2605 2680 :again 2606 (mov b (:%b object) (:%btag))2607 (and b (:$b x8664::fixnummask) (:%btag))2681 (movl (:%l object) (:%l tag)) 2682 (andl (:$b x8664::fixnummask) (:%l tag)) 2608 2683 (je.pt :got-it) 2609 (cmp b (:$b x8664::tag-misc) (:%btag))2684 (cmpl (:$b x8664::tag-misc) (:%l tag)) 2610 2685 (jne :bad) 2611 2686 (cmpb (:$b x8664::subtag-bignum) (:@ x8664::misc-subtag-offset (:%q object))) 2612 (je :got-it) 2613 :bad 2614 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-integer)) 2615 (jmp :again) 2616 :got-it) 2687 (jne :bad) 2688 :got-it 2689 2690 (:anchored-uuo-section :again) 2691 :bad 2692 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-integer)))) 2617 2693 2618 2694 (define-x8664-vinsn require-simple-vector (() … … 2620 2696 ((tag :u8))) 2621 2697 :again 2622 (mov b (:%b object) (:%btag))2623 (and b (:$b x8664::fixnummask) (:%btag))2624 (cmp b (:$b x8664::tag-misc) (:%btag))2698 (movl (:%l object) (:%l tag)) 2699 (andl (:$b x8664::fixnummask) (:%l tag)) 2700 (cmpl (:$b x8664::tag-misc) (:%l tag)) 2625 2701 (jne :bad) 2626 2702 (cmpb (:$b x8664::subtag-simple-vector) (:@ x8664::misc-subtag-offset (:%q object))) 2627 (j e :got-it)2628 :bad 2629 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-simple-vector))2630 (jmp :again)2631 :got-it)2703 (jne :bad) 2704 2705 (:anchored-uuo-section :again) 2706 :bad 2707 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-simple-vector)))) 2632 2708 2633 2709 (define-x8664-vinsn require-simple-string (() … … 2635 2711 ((tag :u8))) 2636 2712 :again 2637 (mov b (:%b object) (:%btag))2638 (and b (:$b x8664::fixnummask) (:%btag))2639 (cmp b (:$b x8664::tag-misc) (:%btag))2713 (movl (:%l object) (:%l tag)) 2714 (andl (:$b x8664::fixnummask) (:%l tag)) 2715 (cmpl (:$b x8664::tag-misc) (:%l tag)) 2640 2716 (jne :bad) 2641 2717 (cmpb (:$b x8664::subtag-simple-base-string) (:@ x8664::misc-subtag-offset (:%q object))) 2642 (j e :got-it)2643 :bad 2644 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-simple-string))2645 (jmp :again)2646 :got-it)2718 (jne :bad) 2719 2720 (:anchored-uuo-section :again) 2721 :bad 2722 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-simple-string)))) 2647 2723 2648 2724 (define-x8664-vinsn require-real (() … … 2657 2733 (:%q mask)) 2658 2734 :again 2659 (mov b (:$b x8664::tagmask) (:%btag))2660 (and b (:%b object) (:%btag))2661 (cmp b (:$b x8664::tag-misc) (:%btag))2735 (movl (:%l object) (:%l tag)) 2736 (andl (:$b x8664::tagmask) (:%l tag)) 2737 (cmpl (:$b x8664::tag-misc) (:%l tag)) 2662 2738 (jne :have-tag) 2663 (mov b (:@ x8664::misc-subtag-offset (:%q object)) (:%btag))2739 (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag)) 2664 2740 :have-tag 2665 (rcmp b (:%btag) (:$b 64))2741 (rcmpl (:%l tag) (:$b 64)) 2666 2742 (jae :bad) 2667 2743 (btq (:%q tag) (:%q mask)) 2668 (j b.pt :good)2669 :bad 2670 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-real))2671 (jmp :again)2672 :good)2744 (jae :bad) 2745 2746 (:anchored-uuo-section :again) 2747 :bad 2748 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-real)))) 2673 2749 2674 2750 (define-x8664-vinsn require-number (() … … 2684 2760 (:%q mask)) 2685 2761 :again 2686 (mov b (:$b x8664::tagmask) (:%b tag))2687 (and b (:%b object) (:%btag))2688 (cmp b (:$b x8664::tag-misc) (:%btag))2762 (movl (:%l object) (:%l tag)) 2763 (andl (:$b x8664::tagmask) (:%l tag)) 2764 (cmpl (:$b x8664::tag-misc) (:%l tag)) 2689 2765 (jne :have-tag) 2690 (mov b (:@ x8664::misc-subtag-offset (:%q object)) (:%btag))2766 (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag)) 2691 2767 :have-tag 2692 (rcmpb (:%b tag) (:$b 64)) 2693 ;;(movzbl (:%b tag) (:%l tag)) 2768 (rcmpl (:%l tag) (:$b 64)) 2694 2769 (jae :bad) 2695 2770 (btq (:%q tag) (:%q mask)) 2696 (jb.pt :good) 2697 :bad 2698 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-number)) 2699 (jmp :again) 2700 :good) 2771 (jae :bad) 2772 (:anchored-uuo-section :again) 2773 :bad 2774 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-number)))) 2701 2775 2702 2776 (define-x8664-vinsn require-list (() … … 2704 2778 ((tag :u8))) 2705 2779 :again 2706 (movb (:%b object) (:%b tag)) 2707 (andb (:$b x8664::tagmask) (:%b tag)) 2708 (cmpb (:$b x8664::tag-list) (:%b tag)) 2709 (je :good) 2710 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-list)) 2711 (jmp :again) 2712 :good) 2780 (movl (:%l object) (:%l tag)) 2781 (andl (:$b x8664::tagmask) (:%l tag)) 2782 (cmpl (:$b x8664::tag-list) (:%l tag)) 2783 (jne :bad) 2784 2785 (:anchored-uuo-section :again) 2786 :bad 2787 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-list)))) 2713 2788 2714 2789 (define-x8664-vinsn require-symbol (() … … 2716 2791 ((tag :u8))) 2717 2792 :again 2718 (cmpb (:$b x8664::fulltag-nil) (:%b object)) 2793 (movzbl (:%b object) (:%l tag)) 2794 (cmpl (:$b x8664::fulltag-nil) (:%l tag)) 2719 2795 (je :good) 2720 (movb (:%b object) (:%b tag)) 2721 (andb (:$b x8664::tagmask) (:%b tag)) 2722 (cmpb (:$b x8664::tag-symbol) (:%b tag)) 2723 (je :good) 2724 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-symbol)) 2725 (jmp :again) 2726 :good) 2796 (andl (:$b x8664::tagmask) (:%l tag)) 2797 (cmpl (:$b x8664::tag-symbol) (:%l tag)) 2798 (jne :bad) 2799 :good 2800 2801 (:anchored-uuo-section :again) 2802 :bad 2803 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-symbol)))) 2727 2804 2728 2805 (define-x8664-vinsn require-character (() … … 2730 2807 :again 2731 2808 (cmpb (:$b x8664::subtag-character) (:%b object)) 2732 (j e.pt :ok)2733 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-character))2734 (jmp :again)2735 :ok)2809 (jne :bad) 2810 (:anchored-uuo-section :again) 2811 :bad 2812 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-character)))) 2736 2813 2737 2814 (define-x8664-vinsn require-s8 (() … … 2744 2821 (shlq (:$ub x8664::fixnumshift) (:%q tag)) 2745 2822 (cmpq (:%q object) (:%q tag)) 2746 (j e.pt :ok)2747 :bad 2748 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-8))2749 (jmp :again)2750 :ok)2823 (jne :bad) 2824 2825 (:anchored-uuo-section :again) 2826 :bad 2827 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-8)))) 2751 2828 2752 2829 (define-x8664-vinsn require-u8 (() … … 2756 2833 (movq (:$l (lognot (ash #xff x8664::fixnumshift))) (:%q tag)) 2757 2834 (andq (:% object) (:% tag)) 2758 (j e.pt :ok)2759 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-8))2760 (jmp :again)2761 :ok)2835 (jne :bad) 2836 (:anchored-uuo-section :again) 2837 :bad 2838 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-8)))) 2762 2839 2763 2840 (define-x8664-vinsn require-s16 (() … … 2770 2847 (shlq (:$ub x8664::fixnumshift) (:%q tag)) 2771 2848 (cmpq (:%q object) (:%q tag)) 2772 (je.pt :ok) 2773 :bad 2774 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-16)) 2775 (jmp :again) 2776 :ok) 2849 (jne :bad) 2850 (:anchored-uuo-section :again) 2851 :bad 2852 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-16)))) 2777 2853 2778 2854 (define-x8664-vinsn require-u16 (() … … 2782 2858 (movq (:$l (lognot (ash #xffff x8664::fixnumshift))) (:%q tag)) 2783 2859 (andq (:% object) (:% tag)) 2784 (j e.pt :ok)2785 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-16))2786 (jmp :again)2787 :ok)2860 (jne :bad) 2861 (:anchored-uuo-section :again) 2862 :bad 2863 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-16)))) 2788 2864 2789 2865 (define-x8664-vinsn require-s32 (() … … 2796 2872 (shlq (:$ub x8664::fixnumshift) (:%q tag)) 2797 2873 (cmpq (:%q object) (:%q tag)) 2798 (jne.pn :bad) 2799 (testb (:$b x8664::fixnummask) (:%b object)) 2800 (je.pt :bad) 2801 :bad 2802 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-32)) 2803 (jmp :again) 2804 :ok) 2874 (jne :bad) 2875 (testl (:$l x8664::fixnummask) (:%l object)) 2876 (jne :bad) 2877 (:anchored-uuo-section :again) 2878 :bad 2879 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-32)))) 2805 2880 2806 2881 (define-x8664-vinsn require-u32 (() … … 2810 2885 (movq (:$q (lognot (ash #xffffffff x8664::fixnumshift))) (:%q tag)) 2811 2886 (andq (:% object) (:% tag)) 2812 (j e.pt :ok)2813 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-32))2814 (jmp :again)2815 :ok)2887 (jne :bad) 2888 (:anchored-uuo-section :again) 2889 :bad 2890 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-32)))) 2816 2891 2817 2892 (define-x8664-vinsn require-s64 (() … … 2819 2894 ((tag :s64))) 2820 2895 :again 2821 (test b (:$b x8664::fixnummask) (:%bobject))2822 (mov q (:%q object) (:%qtag))2896 (testl (:$l x8664::fixnummask) (:%l object)) 2897 (movl (:%l object) (:%l tag)) 2823 2898 (je.pt :ok) 2824 (and b (:$b x8664::fulltagmask) (:%btag))2825 (cmp b (:$b x8664::fulltag-misc) (:%btag))2826 (jne .pn:bad)2899 (andl (:$b x8664::fulltagmask) (:%l tag)) 2900 (cmpl (:$b x8664::fulltag-misc) (:%l tag)) 2901 (jne :bad) 2827 2902 (cmpq (:$l x8664::two-digit-bignum-header) (:@ x8664::misc-header-offset (:%q object))) 2828 (j e.pt :ok)2829 : bad2830 ( uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-64))2831 (jmp :again)2832 :ok)2903 (jne :bad) 2904 :ok 2905 (:anchored-uuo-section :again) 2906 :bad 2907 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-64)))) 2833 2908 2834 2909 (define-x8664-vinsn require-u64 (() … … 2836 2911 ((tag :s64))) 2837 2912 :again 2838 (test b (:$b x8664::fixnummask) (:%bobject))2913 (testl (:$l x8664::fixnummask) (:%l object)) 2839 2914 (movq (:%q object) (:%q tag)) 2840 2915 (je.pt :ok-if-non-negative) … … 2848 2923 (cmpl (:$b 0) (:@ (+ x8664::misc-data-offset 8) (:%q object))) 2849 2924 (je :ok) 2850 :bad 2851 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-64)) 2852 (jmp :again) 2925 (jmp :bad) 2853 2926 :two 2854 2927 (movq (:@ x8664::misc-data-offset (:%q object)) (:%q tag)) … … 2856 2929 (testq (:%q tag) (:%q tag)) 2857 2930 (js :bad) 2858 :ok) 2931 :ok 2932 (:anchored-uuo-section :again) 2933 :bad 2934 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-unsigned-byte-64)))) 2859 2935 2860 2936 (define-x8664-vinsn require-char-code (() … … 2862 2938 ((tag :u32))) 2863 2939 :again 2864 (test b (:$b x8664::fixnummask) (:%bobject))2865 (jne .pn:bad)2940 (testl (:$l x8664::fixnummask) (:%l object)) 2941 (jne :bad) 2866 2942 (cmpq (:$l (ash #x110000 x8664::fixnumshift)) (:%q object)) 2867 (jb.pt :ok) 2868 :bad 2869 (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-mod-char-code-limit)) 2870 (jmp :again) 2871 :ok) 2872 2873 2943 (jae :bad) 2944 (:anchored-uuo-section :again) 2945 :bad 2946 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-mod-char-code-limit)))) 2874 2947 2875 2948 … … 2902 2975 ((temp :u64))) 2903 2976 (movq (:@ x8664::misc-header-offset (:%q src)) (:%q temp)) 2904 (movb (:$b 0) (:%b temp)) 2905 (movq (:%q temp) (:%q dest)) 2906 (shrq (:$ub (- x8664::num-subtag-bits x8664::fixnumshift)) (:%q dest))) 2977 (shrq (:$ub x8664::num-subtag-bits) (:%q temp)) 2978 (imulq (:$b x8664::fixnumone) (:%q temp)(:%q dest))) 2907 2979 2908 2980 (define-x8664-vinsn %logior2 (((dest :imm)) … … 3208 3280 (valtype :lisp))) 3209 3281 (xorl (:%l valtype) (:%l valtype)) 3210 (mov b (:%b val) (:%btag))3211 (and b (:$b x8664::tagmask) (:%btag))3212 (cmp b (:$b x8664::tag-misc) (:%btag))3282 (movl (:%l val) (:%l tag)) 3283 (andl (:$b x8664::tagmask) (:%l tag)) 3284 (cmpl (:$b x8664::tag-misc) (:%l tag)) 3213 3285 (jne :have-tag) 3214 (mov b (:@ x8664::misc-subtag-offset (:%q val)) (:%btag))3286 (movzbl (:@ x8664::misc-subtag-offset (:%q val)) (:%l tag)) 3215 3287 :have-tag 3216 (cmp b (:$b x8664::subtag-istruct) (:%btag))3288 (cmpl (:$b x8664::subtag-istruct) (:%l tag)) 3217 3289 (jne :do-compare) 3218 3290 (movq (:@ x8664::misc-data-offset (:%q val)) (:%q valtype)) … … 3291 3363 ((src :lisp)) 3292 3364 ((tag :u8))) 3365 :begin 3293 3366 (movl (:$l (+ x8664::nil-value x8664::nilsym-offset)) (:%l tag)) 3294 3367 (cmpb (:$b x8664::fulltag-nil) (:%b src)) 3295 3368 (cmoveq (:%q tag) (:%q dest)) 3296 (mov b (:%b src) (:%btag))3369 (movl (:%l src) (:%l tag)) 3297 3370 (je :ok) 3298 (andb (:$b x8664::tagmask) (:%b tag)) 3299 (cmpb (:$b x8664::tag-symbol) (:%b tag)) 3300 (je.pt :no-trap) 3301 (uuo-error-reg-not-tag (:%q src) (:$ub x8664::fulltag-symbol)) 3302 :no-trap 3371 (andl (:$b x8664::tagmask) (:%l tag)) 3372 (cmpl (:$b x8664::tag-symbol) (:%l tag)) 3373 (jne :bad) 3374 3303 3375 ((:not (:pred = 3304 3376 (:apply %hard-regspec-value dest) 3305 3377 (:apply %hard-regspec-value src))) 3306 3378 (movq (:% src) (:% dest))) 3307 :ok) 3379 :ok 3380 (:anchored-uuo-section :begin) 3381 :bad 3382 (:anchored-uuo (uuo-error-reg-not-tag (:%q src) (:$ub x8664::fulltag-symbol)))) 3308 3383 3309 3384 (define-x8664-vinsn symbol-function (((val :lisp)) 3310 3385 ((sym (:lisp (:ne val)))) 3311 3386 ((tag :u8))) 3387 :anchor 3312 3388 (movq (:@ x8664::symbol.fcell (:%q sym)) (:%q val)) 3313 (movb (:%b val) (:%b tag)) 3314 (andb (:$b x8664::tagmask) (:%b tag)) 3315 (cmpb (:$b x8664::tag-function) (:%b tag)) 3316 (je.pt :ok) 3317 (uuo-error-udf (:%q sym)) 3318 :ok) 3389 (movl (:%l val) (:%l tag)) 3390 (andl (:$b x8664::tagmask) (:%l tag)) 3391 (cmpl (:$b x8664::tag-function) (:%l tag)) 3392 (jne :bad) 3393 3394 (:anchored-uuo-section :anchor) 3395 :bad 3396 (:anchored-uuo (uuo-error-udf (:%q sym)))) 3319 3397 3320 3398 (define-x8664-subprim-jump-vinsn (tail-call-fn-slide) .SPtcallnfnslide) … … 3353 3431 (define-x8664-vinsn unbox-base-char (((dest :u64)) 3354 3432 ((src :lisp))) 3433 :anchor 3355 3434 (movq (:%q src) (:%q dest)) 3356 3435 (shrq (:$ub x8664::charcode-shift) (:%q dest)) 3357 3436 (cmpb (:$b x8664::subtag-character) (:%b src)) 3358 (je.pt ::got-it) 3359 (uuo-error-reg-not-tag (:%q src) (:$ub x8664::subtag-character)) 3360 :got-it) 3437 (jne :bad) 3438 (:anchored-uuo-section :anchor) 3439 :bad 3440 (:anchored-uuo (uuo-error-reg-not-tag (:%q src) (:$ub x8664::subtag-character)))) 3361 3441 3362 3442 (define-x8664-subprim-lea-jmp-vinsn (save-values) .SPsave-values) … … 3585 3665 (index :lisp))) 3586 3666 (movq (:@ x8664::misc-data-offset (:%q instance) (:%q index)) (:%q dest)) 3587 (cmpb (:$b x8664::slot-unbound-marker) (:%b dest)) 3588 (jne.pt :ok) 3589 (uuo-error-slot-unbound (:%q dest) (:%q instance) (:%q index)) 3590 :ok) 3667 (cmpl (:$b x8664::slot-unbound-marker) (:%l dest)) 3668 (je :bad) 3669 :ok 3670 (:anchored-uuo-section :ok) 3671 :bad 3672 (:anchored-uuo (uuo-error-slot-unbound (:%q dest) (:%q instance) (:%q index)))) 3591 3673 3592 3674 (define-x8664-vinsn eep.address (((dest t)) … … 3595 3677 (:%q dest)) 3596 3678 (cmpb (:$b x8664::fulltag-nil) (:%b dest)) 3597 (jne :ok) 3598 (uuo-error-eep-unresolved (:%q src) (:%q dest)) 3599 :ok) 3679 (je :bad) 3680 :ok 3681 (:anchored-uuo-section :ok) 3682 :bad 3683 (:anchored-uuo (uuo-error-eep-unresolved (:%q src) (:%q dest)))) 3600 3684 3601 3685 (define-x8664-subprim-lea-jmp-vinsn (heap-cons-rest-arg) .SPheap-cons-rest-arg) … … 3909 3993 (type-error :u8const)) 3910 3994 ((tag :u8))) 3911 3912 (mov b (:%b object) (:%btag))3913 (and b (:$b x8664::tagmask) (:%btag))3914 (cmp b (:$b x8664::tag-misc) (:%btag))3995 :again 3996 (movl (:%l object) (:%l tag)) 3997 (andl (:$b x8664::tagmask) (:%l tag)) 3998 (cmpl (:$b x8664::tag-misc) (:%l tag)) 3915 3999 (jne :bad) 3916 4000 (cmpb (:$b x8664::subtag-arrayH) (:@ x8664::misc-subtag-offset (:%q object))) … … 3919 4003 (jne :bad) 3920 4004 (cmpq (:$l (:apply ash expected-flags x8664::fixnumshift)) (:@ x8664::arrayH.flags (:%q object))) 3921 (je.pt :good) 3922 :bad 3923 (uuo-error-reg-not-type (:%q object) (:$ub type-error)) 3924 :good) 4005 (jne :bad) 4006 4007 (:anchored-uuo-section :again) 4008 :bad 4009 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub type-error)))) 3925 4010 3926 4011 (define-x8664-vinsn trap-unless-simple-array-3 (() … … 3929 4014 (type-error :u8const)) 3930 4015 ((tag :u8))) 3931 3932 (mov b (:%b object) (:%btag))3933 (and b (:$b x8664::tagmask) (:%btag))3934 (cmp b (:$b x8664::tag-misc) (:%btag))4016 :again 4017 (movl (:%l object) (:%l tag)) 4018 (andl (:$b x8664::tagmask) (:%l tag)) 4019 (cmpl (:$b x8664::tag-misc) (:%l tag)) 3935 4020 (jne :bad) 3936 4021 (cmpb (:$b x8664::subtag-arrayH) (:@ x8664::misc-subtag-offset (:%q object))) … … 3939 4024 (jne :bad) 3940 4025 (cmpq (:$l (:apply ash expected-flags x8664::fixnumshift)) (:@ x8664::arrayH.flags (:%q object))) 3941 (j e.pt :good)3942 :bad3943 (uuo-error-reg-not-type (:%q object) (:$ub type-error))3944 :good)4026 (jne :bad) 4027 (:anchored-uuo-section :again) 4028 :bad 4029 (:anchored-uuo (uuo-error-reg-not-type (:%q object) (:$ub type-error)))) 3945 4030 3946 4031 (define-x8664-vinsn trap-unless-array-header (() 3947 4032 ((object :lisp)) 3948 4033 ((tag :u8))) 3949 (movb (:%b object) (:%b tag)) 3950 (andb (:$b x8664::tagmask) (:%b tag)) 3951 (cmpb (:$b x8664::tag-misc) (:%b tag)) 4034 :again 4035 (movl (:%l object) (:%l tag)) 4036 (andl (:$b x8664::tagmask) (:%l tag)) 4037 (cmpl (:$b x8664::tag-misc) (:%l tag)) 3952 4038 (jne :trap) 3953 4039 (cmpb (:$b x8664::subtag-arrayH) (:@ x8664::misc-subtag-offset (:%q object))) 3954 (je :ok) 4040 (jne :trap) 4041 4042 (:anchored-uuo-section :again) 3955 4043 :trap 3956 (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-arrayH)) 3957 :ok) 4044 (:anchored-uuo (uuo-error-reg-not-tag (:%q object) (:$ub x8664::subtag-arrayH)))) 3958 4045 3959 4046 (define-x8664-vinsn check-arrayH-rank (() … … 3961 4048 (expected :u32const)) 3962 4049 ((rank :imm))) 4050 :anchor 3963 4051 (movl (:$l (:apply ash expected x8664::fixnumshift)) (:%l rank)) 3964 4052 (cmpq (:@ x8664::arrayH.rank (:%q header)) (:%q rank)) 3965 (je.pt :ok) 3966 (uuo-error-array-rank (:%q header) (:%q rank)) 3967 :ok) 4053 (jne :bad) 4054 (:anchored-uuo-section :anchor) 4055 :bad 4056 (:anchored-uuo (uuo-error-array-rank (:%q header) (:%q rank)))) 3968 4057 3969 4058 (define-x8664-vinsn check-arrayH-flags (() … … 3971 4060 (expected :u32const) 3972 4061 (type-error :u8const))) 4062 :anchor 3973 4063 (cmpq (:$l (:apply ash expected x8664::fixnumshift)) 3974 4064 (:@ x8664::arrayH.flags (:%q header))) 3975 (je.pt :ok) 3976 (uuo-error-reg-not-type (:%q header) (:$ub type-error)) 3977 :ok) 4065 (jne :bad) 4066 (:anchored-uuo-section :anchor) 4067 :bad 4068 (:anchored-uuo (uuo-error-reg-not-type (:%q header) (:$ub type-error)))) 3978 4069 3979 4070 (define-x8664-vinsn misc-ref-c-u16 (((dest :u16)) … … 4127 4218 (j :imm) 4128 4219 (header :lisp))) 4220 :anchor 4129 4221 (cmpq (:@ (+ x8664::misc-data-offset (* 8 x8664::arrayH.dim0-cell)) (:%q header)) (:%q i)) 4130 (jb :i-ok) 4131 (uuo-error-array-bounds (:%q i) (:%q header)) 4132 :i-ok 4222 (jae :bad-i) 4133 4223 (movq (:@ (+ x8664::misc-data-offset (* 8 (1+ x8664::arrayH.dim0-cell))) (:%q header)) 4134 4224 (:%q dim)) 4135 4225 (cmpq (:%q dim) (:%q j)) 4136 (jb :j-ok) 4137 (uuo-error-array-bounds (:%q j) (:%q header)) 4138 :j-ok 4139 (sarq (:$ub x8664::fixnumshift) (:%q dim))) 4226 (jae :bad-j) 4227 (sarq (:$ub x8664::fixnumshift) (:%q dim)) 4228 (:anchored-uuo-section :anchor) 4229 :bad-i 4230 (:anchored-uuo (uuo-error-array-bounds (:%q i) (:%q header))) 4231 (:anchored-uuo-section :anchor) 4232 :bad-j 4233 (:anchored-uuo (uuo-error-array-bounds (:%q j) (:%q header)))) 4140 4234 4141 4235 ;;; Return dim1, dim2 (unboxed) … … 4146 4240 (k :imm) 4147 4241 (header :lisp))) 4242 :anchor 4148 4243 (cmpq (:@ (+ x8664::misc-data-offset (* 8 x8664::arrayH.dim0-cell)) (:%q header)) (:%q i)) 4149 (jb :i-ok) 4150 (uuo-error-array-bounds (:%q i) (:%q header)) 4151 :i-ok 4244 (jae :bad-i) 4152 4245 (movq (:@ (+ x8664::misc-data-offset (* 8 (1+ x8664::arrayH.dim0-cell))) (:%q header)) (:%q dim1)) 4153 4246 (cmpq (:%q dim1) (:%q j)) 4154 (jb :j-ok) 4155 (uuo-error-array-bounds (:%q j) (:%q header)) 4156 :j-ok 4247 (jae :bad-j) 4157 4248 (sarq (:$ub x8664::fixnumshift) (:%q dim1)) 4158 4249 (movq (:@ (+ x8664::misc-data-offset (* 8 (+ 2 x8664::arrayH.dim0-cell))) (:%q header)) (:%q dim2)) 4159 4250 (cmpq (:%q dim2) (:%q k)) 4160 (jb ::k-ok) 4161 (uuo-error-array-bounds (:%q k) (:%q header)) 4162 :k-ok 4163 (sarq (:$ub x8664::fixnumshift) (:%q dim2))) 4251 (jae :bad-k) 4252 (sarq (:$ub x8664::fixnumshift) (:%q dim2)) 4253 (:anchored-uuo-section :anchor) 4254 :bad-i 4255 (:anchored-uuo (uuo-error-array-bounds (:%q i) (:%q header))) 4256 (:anchored-uuo-section :anchor) 4257 :bad-j 4258 (:anchored-uuo (uuo-error-array-bounds (:%q j) (:%q header))) 4259 (:anchored-uuo-section :anchor) 4260 :bad-k 4261 (:anchored-uuo (uuo-error-array-bounds (:%q k) (:%q header))) 4262 ) 4164 4263 4165 4264 … … 4209 4308 (dest :label)) 4210 4309 ((tag :u8))) 4211 (mov b (:%b a) (:%btag))4212 (or b (:%b b) (:%btag))4310 (movl (:%l a) (:%l tag)) 4311 (orl (:%l b) (:%l tag)) 4213 4312 (testb (:$b x8664::fixnummask) (:%b tag)) 4214 4313 (jne dest)) … … 4244 4343 ((entry (:label 1)))) 4245 4344 (leaq (:@ (:^ entry) (:% x8664::rip)) (:%q x8664::fn))) 4246 4345 4346 (define-x8664-vinsn align-loop-head (() 4347 () 4348 ()) 4349 (:align 4)) 4350 4247 4351 (queue-fixup 4248 4352 (fixup-x86-vinsn-templates
Note:
See TracChangeset
for help on using the changeset viewer.
