Changeset 7860


Ignore:
Timestamp:
Dec 9, 2007, 1:55:22 PM (13 years ago)
Author:
gb
Message:

Use the new scheme so that most UUOs (at least those used to signal
errors) are assembled in a separate frag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp

    r7780 r7860  
    298298(define-x8664-vinsn check-exact-nargs (()
    299299                                       ((n :u16const)))
     300  :resume
    300301  ((:pred = n 0)
    301302   (testw (:%w x8664::nargs) (:%w x8664::nargs)))
    302303  ((:not (:pred = n 0))
    303304   (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)))
    307309
    308310(define-x8664-vinsn check-min-nargs (()
    309311                                       ((n :u16const)))
     312  :resume
    310313  (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)))
    314319
    315320(define-x8664-vinsn check-max-nargs (()
    316321                                       ((n :u16const)))
     322  :resume
    317323  (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)))
    321329
    322330
     
    516524(define-x8664-vinsn compare-to-nil (()
    517525                                    ((arg0 t)))
    518   (cmpb (:$b x8664::fulltag-nil) (:%b arg0)))
     526  (cmpl (:$l x8664::nil-value) (:%l arg0)))
    519527
    520528
     
    560568(define-x8664-vinsn trap-unless-bit (()
    561569                                     ((value :lisp)))
    562                                      
     570  :resume
    563571  (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)))
    567577  )
    568578
     
    570580                                      ((object :lisp))
    571581                                      ((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
    578593
    579594(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                                         
    589608(define-x8664-vinsn trap-unless-uvector (()
    590609                                         ((object :lisp))
    591610                                         ((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))))
    598620 
    599621(define-x8664-vinsn trap-unless-single-float (()
    600622                                              ((object :lisp)))
     623  :resume
    601624  (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))))
    605630
    606631(define-x8664-vinsn trap-unless-character (()
    607632                                              ((object :lisp)))
     633  :resume
    608634  (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))))
    612640
    613641(define-x8664-vinsn trap-unless-fixnum (()
    614642                                        ((object :lisp))
    615643                                        ())
     644  :resume
    616645  (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))))
    620651
    621652(define-x8664-vinsn set-flags-from-lisptag (()
     
    628659                                            (tagval :u16const))
    629660                                           ((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))
    633665  (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))
    635669  :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))))
    640675
    641676(define-x8664-vinsn trap-unless-double-float (()
    642677                                              ((object :lisp))
    643678                                              ((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))
    647683  (jne :have-tag)
    648   (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b tag))
     684  (movsbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag))
    649685  :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))))
    654691
    655692(define-x8664-vinsn trap-unless-macptr (()
    656693                                        ((object :lisp))
    657694                                        ((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))
    661699  (jne :have-tag)
    662   (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b tag))
     700  (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag))
    663701  :have-tag
    664702  (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))))
    668708
    669709
     
    672712                                       (v :lisp))
    673713                                      ((temp :u64)))
     714  :resume
    674715  (movq (:@ x8664::misc-header-offset (:%q v)) (:%q temp))
    675   (xorb (:%b temp) (:%b temp))
    676   (shrq (:$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))
    677718  (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))))
    681724
    682725
     
    745788  (cmpb (:$b x8664::tag-misc) (:%b tag))
    746789  (jne :have-tag)
    747   (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b tag))
     790  (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag))
    748791  :have-tag)
    749792
     
    751794                                             ((object :lisp))
    752795                                             ((temp :u32)))
    753   (movzbl (:%b object) (:%l temp))
    754   (andb (:$b x8664::tagmask) (:%b temp))
    755   (cmpb (:$b x8664::tag-misc) (:%b temp))
     796  (movl (:%l object) (:%l temp))
     797  (andl (:$b x8664::tagmask) (:%l temp))
     798  (cmpl (:$b x8664::tag-misc) (:%l temp))
    756799  (jne :have-tag)
    757   (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b temp))
     800  (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l temp))
    758801  :have-tag
    759802  (leal (:@ (:%q temp) 8) (:%l tag)))
     
    823866(define-x8664-vinsn unbox-u8 (((dest :u8))
    824867                              ((src :lisp)))
     868  :resume
    825869  (movq (:$l (lognot (ash #xff x8664::fixnumshift))) (:%q dest))
    826870  (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)
    830872  (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))))
    832878
    833879(define-x8664-vinsn %unbox-u8 (((dest :u8))
     
    839885(define-x8664-vinsn unbox-s8 (((dest :s8))
    840886                              ((src :lisp)))
     887  :resume
    841888  (movq (:%q src) (:%q dest))
    842889  (shlq (:$ub (- x8664::nbits-in-word (+ 8 x8664::fixnumshift))) (:%q dest))
    843890  (sarq (:$ub (- x8664::nbits-in-word (+ 8 x8664::fixnumshift))) (:%q dest))
    844891  (cmpq (:%q src) (:%q dest))
    845   (jne.pn :bad)
     892  (jne :bad)
    846893  (testb (:$b x8664::fixnummask) (:%b dest))
    847   (jne.pn :bad)
     894  (jne :bad)
    848895  (sarq (:$ub x8664::fixnumshift) (:%q dest))
    849   (jmp :got-it)
    850   :bad
    851   (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))))
    853900
    854901(define-x8664-vinsn unbox-u16 (((dest :u16))
    855902                              ((src :lisp)))
     903  :resume
    856904  (testq (:$l (lognot (ash #xffff x8664::fixnumshift))) (:% src))
    857905  (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))))
    862912
    863913(define-x8664-vinsn %unbox-u16 (((dest :u16))
     
    868918(define-x8664-vinsn unbox-s16 (((dest :s16))
    869919                              ((src :lisp)))
     920  :resume
    870921  (movq (:%q src) (:%q dest))
    871922  (shlq (:$ub (- x8664::nbits-in-word (+ 16 x8664::fixnumshift))) (:%q dest))
    872923  (sarq (:$ub (- x8664::nbits-in-word (+ 16 x8664::fixnumshift))) (:%q dest))
    873924  (cmpq (:%q src) (:%q dest))
    874   (jne.pn :bad)
     925  (je :bad)
    875926  (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))))
    881933
    882934(define-x8664-vinsn %unbox-s16 (((dest :s16))
     
    887939(define-x8664-vinsn unbox-u32 (((dest :u32))
    888940                              ((src :lisp)))
     941  :resume
    889942  (movq (:$q (lognot (ash #xffffffff x8664::fixnumshift))) (:%q dest))
    890943  (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
    894955  (movq (:%q src) (:%q dest))
    895956  (shrq (:$ub x8664::fixnumshift) (:%q dest)))
    896957
    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 
    903958(define-x8664-vinsn unbox-s32 (((dest :s32))
    904959                               ((src :lisp)))
     960  :resume
    905961  (movq (:%q src) (:%q dest))
    906962  (shlq (:$ub (- x8664::nbits-in-word (+ 32 x8664::fixnumshift))) (:%q dest))
    907963  (sarq (:$ub (- x8664::nbits-in-word (+ 32 x8664::fixnumshift))) (:%q dest))
    908964  (cmpq (:%q src) (:%q dest))
    909   (jne.pn :bad)
     965  (jne :bad)
    910966  (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))))
    916973
    917974(define-x8664-vinsn %unbox-s32 (((dest :s32))
     
    923980(define-x8664-vinsn unbox-u64 (((dest :u64))
    924981                               ((src :lisp)))
     982  :resume
    925983  (movq (:$q (lognot (ash x8664::target-most-positive-fixnum x8664::fixnumshift))) (:%q dest))
    926984  (testq (:%q dest) (:%q src))
     
    930988  (jmp :done)
    931989  :maybe-bignum
    932   (andb (:$b x8664::tagmask) (:%b dest))
    933   (cmpb (:$b x8664::tag-misc) (:%b dest))
     990  (andl (:$b x8664::tagmask) (:%l dest))
     991  (cmpl (:$b x8664::tag-misc) (:%l dest))
    934992  (jne :have-tag)
    935   (movb (:@ x8664::misc-subtag-offset (:%q src)) (:%b dest))
     993  (movzbl (:@ x8664::misc-subtag-offset (:%q src)) (:%l dest))
    936994  :have-tag
    937   (cmpb (:$b x8664::subtag-bignum) (:%b dest))
     995  (cmpl (:$b x8664::subtag-bignum) (:%l dest))
    938996  (jne :bad)
    939997  (movq (:@ x8664::misc-header-offset (:%q src)) (:%q dest))
     
    9441002  (movq (:@ x8664::misc-data-offset (:%q src)) (:%q dest))
    9451003  (testq (:%q dest) (:%q dest))
    946   (jns :done)
    947   :bad
    948   (uuo-error-reg-not-type (:%q src) (:$ub arch::error-object-not-unsigned-byte-64))
     1004  (js :bad)
     1005  (jmp :done)
     1006
    9491007  :three
    9501008  (movl (:@ (+ 8 x8664::misc-data-offset) (:%q src)) (:%l dest))
     
    9521010  (movq (:@ x8664::misc-data-offset (:%q src)) (:%q dest))
    9531011  (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))))
    9551017
    9561018(define-x8664-vinsn unbox-s64 (((dest :s64))
    9571019                               ((src :lisp)))
     1020  :resume
    9581021  (movq (:%q src) (:%q dest))
    9591022  (sarq (:$ub x8664::fixnumshift) (:%q dest))
     
    9621025  (je :done)
    9631026  ;; May be a 2-digit bignum
    964   (movb (:%b src) (:%b dest))
    965   (andb (:$b x8664::tagmask) (:%b dest))
    966   (cmpb (:$b x8664::tag-misc) (:%b dest))
     1027  (movl (:%l src) (:%l dest))
     1028  (andl (:$b x8664::tagmask) (:%l dest))
     1029  (cmpl (:$b x8664::tag-misc) (:%l dest))
    9671030  (jne :bad)
    9681031  (cmpq (:$l x8664::two-digit-bignum-header) (:@ x8664::misc-header-offset (:%q src)))
    9691032  (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))))
    9741039
    9751040(define-x8664-vinsn sign-extend-s8 (((dest :s64))
     
    14701535                                 ((source :lisp))
    14711536                                 ((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))
    14751541  (jne :have-tag)
    1476   (movb (:@ x8664::misc-subtag-offset (:%q source)) (:%b tag))
     1542  (movsbl (:@ x8664::misc-subtag-offset (:%q source)) (:%l tag))
    14771543  :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))))
    14831551
    14841552(define-x8664-vinsn single->node (((result :lisp)
     
    15741642                                          ()
    15751643                                          ((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))
    15791648  (cmovgq (:%q x8664::temp0) (:%q x8664::fn))
    15801649  (jl :bad)
     
    15821651  (pushq (:@ (+ x8664::nil-value (x8664::%kernel-global 'x86::ret1valaddr))))
    15831652  (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)))
    15901657
    15911658
     
    18361903                             ((tag :u8)
    18371904                              (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))
    18411909  (cmovgq (:%q x8664::temp0) (:%q x8664::xfn))
    1842   (jge.pt :call)
    1843   (uuo-error-not-callable)
    1844   :call
     1910  (jl :bad)
    18451911  (cmoveq (:@ x8664::symbol.fcell (:%q x8664::fname)) (:%q x8664::xfn))
    18461912  (:talign 4)
    18471913  (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)))
    18491918
    18501919(define-x8664-vinsn tail-funcall (()
    18511920                                  ()
    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))
    18561926  (cmovgq (:%q x8664::temp0) (:%q x8664::xfn))
    18571927  (jl :bad)
    18581928  (cmoveq (:@ x8664::symbol.fcell (:%q x8664::fname)) (:%q x8664::xfn))
    18591929  (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)))
    18621934                             
    18631935
     
    18921964                                              ((table :imm)
    18931965                                               (idx :imm)))
     1966  :resume
    18941967  (movq (:@ x8664::symbol.binding-index (:%q src)) (:%q idx))
    18951968  (rcmpq (:%q idx) (:@ (:%seg :rcontext) x8664::tcr.tlb-limit))
     
    18971970  (jae :symbol)
    18981971  (movq (:@ (:%q table) (:%q idx)) (:%q dest))
    1899   (cmpb (:$b x8664::subtag-no-thread-local-binding) (:%b dest))
     1972  (cmpl (:$b x8664::subtag-no-thread-local-binding) (:%l dest))
    19001973  (jne :test)
    19011974  :symbol
    19021975  (movq (:@ x8664::symbol.vcell (:%q src)) (:%q dest))
    19031976  :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))))
    19081983
    19091984
     
    25942669                                    ((object :lisp)))
    25952670  :again
    2596   (testb (:$b x8664::fixnummask) (:%b object))
    2597   (je.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))))
    26012676
    26022677(define-x8664-vinsn require-integer (()
     
    26042679                                     ((tag :u8)))
    26052680  :again
    2606   (movb (:%b object) (:%b tag))
    2607   (andb (:$b x8664::fixnummask) (:%b tag))
     2681  (movl (:%l object) (:%l tag))
     2682  (andl (:$b x8664::fixnummask) (:%l tag))
    26082683  (je.pt :got-it)
    2609   (cmpb (:$b x8664::tag-misc) (:%b tag))
     2684  (cmpl (:$b x8664::tag-misc) (:%l tag))
    26102685  (jne :bad)
    26112686  (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))))
    26172693
    26182694(define-x8664-vinsn require-simple-vector (()
     
    26202696                                           ((tag :u8)))
    26212697  :again
    2622   (movb (:%b object) (:%b tag))
    2623   (andb (:$b x8664::fixnummask) (:%b tag))
    2624   (cmpb (:$b x8664::tag-misc) (:%b tag))
     2698  (movl (:%l object) (:%l tag))
     2699  (andl (:$b x8664::fixnummask) (:%l tag))
     2700  (cmpl (:$b x8664::tag-misc) (:%l tag))
    26252701  (jne :bad)
    26262702  (cmpb (:$b x8664::subtag-simple-vector) (:@ x8664::misc-subtag-offset (:%q object)))
    2627   (je :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))))
    26322708
    26332709(define-x8664-vinsn require-simple-string (()
     
    26352711                                           ((tag :u8)))
    26362712  :again
    2637   (movb (:%b object) (:%b tag))
    2638   (andb (:$b x8664::fixnummask) (:%b tag))
    2639   (cmpb (:$b x8664::tag-misc) (:%b tag))
     2713  (movl (:%l object) (:%l tag))
     2714  (andl (:$b x8664::fixnummask) (:%l tag))
     2715  (cmpl (:$b x8664::tag-misc) (:%l tag))
    26402716  (jne :bad)
    26412717  (cmpb (:$b x8664::subtag-simple-base-string) (:@ x8664::misc-subtag-offset (:%q object)))
    2642   (je :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))))
    26472723                                   
    26482724(define-x8664-vinsn require-real (()
     
    26572733        (:%q mask))
    26582734  :again
    2659   (movb (:$b x8664::tagmask) (:%b tag))
    2660   (andb (:%b object) (:%b tag))
    2661   (cmpb (:$b x8664::tag-misc) (:%b tag))
     2735  (movl (:%l object) (:%l tag))
     2736  (andl (:$b x8664::tagmask) (:%l tag))
     2737  (cmpl (:$b x8664::tag-misc) (:%l tag))
    26622738  (jne :have-tag)
    2663   (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b tag))
     2739  (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag))
    26642740  :have-tag
    2665   (rcmpb (:%b tag) (:$b 64))
     2741  (rcmpl (:%l tag) (:$b 64))
    26662742  (jae :bad)
    26672743  (btq (:%q tag) (:%q mask))
    2668   (jb.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))))
    26732749
    26742750(define-x8664-vinsn require-number (()
     
    26842760        (:%q mask))
    26852761  :again
    2686   (movb (:$b x8664::tagmask) (:%b tag))
    2687   (andb (:%b object) (:%b tag))
    2688   (cmpb (:$b x8664::tag-misc) (:%b tag))
     2762  (movl (:%l object) (:%l tag)) 
     2763  (andl (:$b x8664::tagmask) (:%l tag))
     2764  (cmpl (:$b x8664::tag-misc) (:%l tag))
    26892765  (jne :have-tag)
    2690   (movb (:@ x8664::misc-subtag-offset (:%q object)) (:%b tag))
     2766  (movzbl (:@ x8664::misc-subtag-offset (:%q object)) (:%l tag))
    26912767  :have-tag
    2692   (rcmpb (:%b tag) (:$b 64))
    2693   ;;(movzbl (:%b tag) (:%l tag))
     2768  (rcmpl (:%l tag) (:$b 64))
    26942769  (jae :bad)
    26952770  (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))))
    27012775
    27022776(define-x8664-vinsn require-list (()
     
    27042778                                  ((tag :u8)))
    27052779  :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))))
    27132788
    27142789(define-x8664-vinsn require-symbol (()
     
    27162791                                    ((tag :u8)))
    27172792  :again
    2718   (cmpb (:$b x8664::fulltag-nil) (:%b object))
     2793  (movzbl (:%b object) (:%l tag))
     2794  (cmpl (:$b x8664::fulltag-nil) (:%l tag))
    27192795  (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))))
    27272804
    27282805(define-x8664-vinsn require-character (()
     
    27302807  :again
    27312808  (cmpb (:$b x8664::subtag-character) (:%b object))
    2732   (je.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))))
    27362813
    27372814(define-x8664-vinsn require-s8 (()
     
    27442821  (shlq (:$ub x8664::fixnumshift) (:%q tag))
    27452822  (cmpq (:%q object) (:%q tag))
    2746   (je.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))))
    27512828
    27522829(define-x8664-vinsn require-u8 (()
     
    27562833  (movq (:$l (lognot (ash #xff x8664::fixnumshift))) (:%q tag))
    27572834  (andq (:% object) (:% tag))
    2758   (je.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))))
    27622839
    27632840(define-x8664-vinsn require-s16 (()
     
    27702847  (shlq (:$ub x8664::fixnumshift) (:%q tag))
    27712848  (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))))
    27772853
    27782854(define-x8664-vinsn require-u16 (()
     
    27822858  (movq (:$l (lognot (ash #xffff x8664::fixnumshift))) (:%q tag))
    27832859  (andq (:% object) (:% tag))
    2784   (je.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))))
    27882864
    27892865(define-x8664-vinsn require-s32 (()
     
    27962872  (shlq (:$ub x8664::fixnumshift) (:%q tag))
    27972873  (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))))
    28052880
    28062881(define-x8664-vinsn require-u32 (()
     
    28102885  (movq (:$q (lognot (ash #xffffffff x8664::fixnumshift))) (:%q tag))
    28112886  (andq (:% object) (:% tag))
    2812   (je.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))))
    28162891
    28172892(define-x8664-vinsn require-s64 (()
     
    28192894                                ((tag :s64)))
    28202895  :again
    2821   (testb (:$b x8664::fixnummask) (:%b object))
    2822   (movq (:%q object) (:%q tag))
     2896  (testl (:$l x8664::fixnummask) (:%l object))
     2897  (movl (:%l object) (:%l tag))
    28232898  (je.pt :ok)
    2824   (andb (:$b x8664::fulltagmask) (:%b tag))
    2825   (cmpb (:$b x8664::fulltag-misc) (:%b tag))
    2826   (jne.pn :bad)
     2899  (andl (:$b x8664::fulltagmask) (:%l tag))
     2900  (cmpl (:$b x8664::fulltag-misc) (:%l tag))
     2901  (jne :bad)
    28272902  (cmpq (:$l x8664::two-digit-bignum-header) (:@ x8664::misc-header-offset (:%q object)))
    2828   (je.pt :ok)
    2829   :bad
    2830   (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))))
    28332908
    28342909(define-x8664-vinsn require-u64 (()
     
    28362911                                ((tag :s64)))
    28372912  :again
    2838   (testb (:$b x8664::fixnummask) (:%b object))
     2913  (testl (:$l x8664::fixnummask) (:%l object))
    28392914  (movq (:%q object) (:%q tag))
    28402915  (je.pt :ok-if-non-negative)
     
    28482923  (cmpl (:$b 0) (:@ (+ x8664::misc-data-offset 8) (:%q object)))
    28492924  (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)
    28532926  :two
    28542927  (movq (:@ x8664::misc-data-offset (:%q object)) (:%q tag))
     
    28562929  (testq (:%q tag) (:%q tag))
    28572930  (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))))
    28592935
    28602936(define-x8664-vinsn require-char-code (()
     
    28622938                                       ((tag :u32)))
    28632939  :again
    2864   (testb (:$b x8664::fixnummask) (:%b object))
    2865   (jne.pn :bad)
     2940  (testl (:$l x8664::fixnummask) (:%l object))
     2941  (jne :bad)
    28662942  (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))))
    28742947
    28752948
     
    29022975                                               ((temp :u64)))
    29032976  (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)))
    29072979
    29082980(define-x8664-vinsn %logior2 (((dest :imm))
     
    32083280                                                  (valtype :lisp)))
    32093281  (xorl (:%l valtype) (:%l valtype))
    3210   (movb (:%b val) (:%b tag))
    3211   (andb (:$b x8664::tagmask) (:%b tag))
    3212   (cmpb (:$b x8664::tag-misc) (:%b tag))
     3282  (movl (:%l val) (:%l tag))
     3283  (andl (:$b x8664::tagmask) (:%l tag))
     3284  (cmpl (:$b x8664::tag-misc) (:%l tag))
    32133285  (jne :have-tag)
    3214   (movb (:@ x8664::misc-subtag-offset (:%q val)) (:%b tag))
     3286  (movzbl (:@ x8664::misc-subtag-offset (:%q val)) (:%l tag))
    32153287  :have-tag
    3216   (cmpb (:$b x8664::subtag-istruct) (:%b tag))
     3288  (cmpl (:$b x8664::subtag-istruct) (:%l tag))
    32173289  (jne :do-compare)
    32183290  (movq (:@ x8664::misc-data-offset (:%q val)) (:%q valtype))
     
    32913363                                     ((src :lisp))
    32923364                                     ((tag :u8)))
     3365  :begin
    32933366  (movl (:$l (+ x8664::nil-value x8664::nilsym-offset)) (:%l tag))
    32943367  (cmpb (:$b x8664::fulltag-nil) (:%b src))
    32953368  (cmoveq (:%q tag) (:%q dest))
    3296   (movb (:%b src) (:%b tag))
     3369  (movl (:%l src) (:%l tag))
    32973370  (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
    33033375  ((:not (:pred =
    33043376                (:apply %hard-regspec-value dest)
    33053377                (:apply %hard-regspec-value src)))
    33063378   (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))))
    33083383
    33093384(define-x8664-vinsn symbol-function (((val :lisp))
    33103385                                     ((sym (:lisp (:ne val))))
    33113386                                     ((tag :u8)))
     3387  :anchor
    33123388  (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))))
    33193397
    33203398(define-x8664-subprim-jump-vinsn (tail-call-fn-slide) .SPtcallnfnslide)
     
    33533431(define-x8664-vinsn unbox-base-char (((dest :u64))
    33543432                                     ((src :lisp)))
     3433  :anchor
    33553434  (movq (:%q src) (:%q dest))
    33563435  (shrq (:$ub x8664::charcode-shift) (:%q dest))
    33573436  (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))))
    33613441
    33623442(define-x8664-subprim-lea-jmp-vinsn (save-values) .SPsave-values)
     
    35853665                                 (index :lisp)))
    35863666  (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))))
    35913673
    35923674(define-x8664-vinsn eep.address (((dest t))
     
    35953677        (:%q dest))
    35963678  (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))))
    36003684
    36013685(define-x8664-subprim-lea-jmp-vinsn (heap-cons-rest-arg) .SPheap-cons-rest-arg)
     
    39093993                                                 (type-error :u8const))
    39103994                                                ((tag :u8)))
    3911  
    3912   (movb (:%b object) (:%b tag))
    3913   (andb (:$b x8664::tagmask) (:%b tag))
    3914   (cmpb (:$b x8664::tag-misc) (:%b tag))
     3995  :again
     3996  (movl (:%l object) (:%l tag))
     3997  (andl (:$b x8664::tagmask) (:%l tag))
     3998  (cmpl (:$b x8664::tag-misc) (:%l tag))
    39153999  (jne :bad)
    39164000  (cmpb (:$b x8664::subtag-arrayH) (:@ x8664::misc-subtag-offset (:%q object)))
     
    39194003  (jne :bad)
    39204004  (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))))
    39254010
    39264011(define-x8664-vinsn trap-unless-simple-array-3 (()
     
    39294014                                                 (type-error :u8const))
    39304015                                                ((tag :u8)))
    3931  
    3932   (movb (:%b object) (:%b tag))
    3933   (andb (:$b x8664::tagmask) (:%b tag))
    3934   (cmpb (:$b x8664::tag-misc) (:%b tag))
     4016  :again
     4017  (movl (:%l object) (:%l tag))
     4018  (andl (:$b x8664::tagmask) (:%l tag))
     4019  (cmpl (:$b x8664::tag-misc) (:%l tag))
    39354020  (jne :bad)
    39364021  (cmpb (:$b x8664::subtag-arrayH) (:@ x8664::misc-subtag-offset (:%q object)))
     
    39394024  (jne :bad)
    39404025  (cmpq (:$l (:apply ash expected-flags x8664::fixnumshift)) (:@ x8664::arrayH.flags (:%q object)))
    3941   (je.pt :good)
    3942   :bad
    3943   (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))))
    39454030 
    39464031(define-x8664-vinsn trap-unless-array-header (()
    39474032                                              ((object :lisp))
    39484033                                              ((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))
    39524038  (jne :trap)
    39534039  (cmpb (:$b x8664::subtag-arrayH) (:@ x8664::misc-subtag-offset (:%q object)))
    3954   (je :ok)
     4040  (jne :trap)
     4041
     4042  (:anchored-uuo-section :again)
    39554043  :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))))
    39584045
    39594046(define-x8664-vinsn check-arrayH-rank (()
     
    39614048                                        (expected :u32const))
    39624049                                       ((rank :imm)))
     4050  :anchor
    39634051  (movl (:$l (:apply ash expected x8664::fixnumshift)) (:%l rank))
    39644052  (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))))
    39684057
    39694058(define-x8664-vinsn check-arrayH-flags (()
     
    39714060                                        (expected :u32const)
    39724061                                        (type-error :u8const)))
     4062  :anchor
    39734063  (cmpq (:$l (:apply ash expected x8664::fixnumshift))
    39744064        (:@ 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))))
    39784069
    39794070(define-x8664-vinsn misc-ref-c-u16  (((dest :u16))
     
    41274218                                     (j :imm)
    41284219                                     (header :lisp)))
     4220  :anchor
    41294221  (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)
    41334223  (movq (:@ (+ x8664::misc-data-offset (* 8 (1+ x8664::arrayH.dim0-cell))) (:%q header))
    41344224        (:%q dim))
    41354225  (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))))
    41404234
    41414235;;; Return dim1, dim2 (unboxed)
     
    41464240                                     (k :imm)
    41474241                                     (header :lisp)))
     4242  :anchor
    41484243  (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)
    41524245  (movq (:@ (+ x8664::misc-data-offset (* 8 (1+ x8664::arrayH.dim0-cell))) (:%q header)) (:%q dim1))
    41534246  (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)
    41574248  (sarq (:$ub x8664::fixnumshift) (:%q dim1))
    41584249  (movq (:@ (+ x8664::misc-data-offset (* 8 (+ 2 x8664::arrayH.dim0-cell))) (:%q header)) (:%q dim2))
    41594250  (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  )
    41644263
    41654264
     
    42094308                                                      (dest :label))
    42104309                                                     ((tag :u8)))
    4211   (movb (:%b a) (:%b tag))
    4212   (orb (:%b b) (:%b tag))
     4310  (movl (:%l a) (:%l tag))
     4311  (orl (:%l b) (:%l tag))
    42134312  (testb (:$b x8664::fixnummask) (:%b tag))
    42144313  (jne dest))
     
    42444343                                  ((entry (:label 1))))
    42454344  (leaq (:@ (:^ entry) (:% x8664::rip)) (:%q x8664::fn)))
    4246                                  
     4345
     4346(define-x8664-vinsn align-loop-head (()
     4347                                     ()
     4348                                     ())
     4349  (:align 4))
     4350
    42474351(queue-fixup
    42484352 (fixup-x86-vinsn-templates
Note: See TracChangeset for help on using the changeset viewer.