Changeset 10495


Ignore:
Timestamp:
Aug 19, 2008, 12:24:08 PM (11 years ago)
Author:
gb
Message:

There were 2 versions of X862-LONG-CONSTANT-P. The one that we in
effect (the second one defined in this file) was leftover from MCL,
and allowed strings of length 4 (and symbols whose pnames were of
length 4) to be interpreted as "long" constants (this was leftover
support for "OSTypes"); it also allowed integer constants of unspecified
width and signedness.

Replace that with (and change the one caller to use) X862-INTEGER-CONSTANT-P,
which takes an acode form and a mode name and returns an integer if the
form represents an constant integer of the indicated type.

(In other words:

? (#_malloc :four)

Error: value :FOUR is not of the expected type (UNSIGNED-BYTE 64).

? (defun foo ()

(#_malloc :four))

FOO

shouldn't work (in compiled code) as an obscure way to allocate
#x666F7572 bytes, and

? (defun foo ()

(#_malloc -10))

  • and other cases involving integer constants of the wrong width/

signedness - shouldn't work at all.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8632/x8632-vinsns.lisp

    r10363 r10495  
    238238(define-x8632-vinsn check-exact-nargs (()
    239239                                       ((n :u16const)))
     240  :resume
    240241  ((:pred = n 0)
    241242   (testl (:%l x8632::nargs) (:%l x8632::nargs)))
     
    244245  ((:pred >= n 32)
    245246   (cmpl (:$l (:apply ash n x8632::fixnumshift)) (:%l x8632::nargs)))
    246   (jz :ok)
    247   (uuo-error-wrong-number-of-args)
    248   :ok)
     247  (jne :bad)
     248  (:anchored-uuo-section :resume)
     249  :bad
     250  (:anchored-uuo (uuo-error-wrong-number-of-args)))
    249251
    250252(define-x8632-vinsn check-min-nargs (()
    251253                                     ((min :u16const)))
     254  :resume
    252255  ((:pred = min 1)
    253256   (testl (:%l x8632::nargs) (:%l x8632::nargs))
    254    (jnz :ok))
     257   (je :toofew))
    255258  ((:not (:pred = min 1))
    256259   ((:and (:pred > min 1) (:pred < min 32))
     
    258261   ((:pred >= min 32)
    259262    (rcmpl (:%l x8632::nargs) (:$l (:apply ash min x8632::fixnumshift))))
    260    (jae :ok))
    261   (uuo-error-too-few-args)
    262   :ok)
     263   (jb :toofew))
     264  (:anchored-uuo-section :resume)
     265  :toofew
     266  (:anchored-uuo (uuo-error-too-few-args)))
    263267
    264268(define-x8632-vinsn check-max-nargs (()
    265269                                     ((n :u16const)))
     270  :resume
    266271  ((:pred < n 32)
    267272   (rcmpl (:%l x8632::nargs) (:$b (:apply ash n x8632::fixnumshift))))
    268273  ((:pred >= n 32)
    269274   (rcmpl (:%l x8632::nargs) (:$l (:apply ash n x8632::fixnumshift))))
    270   (jbe :ok)
    271   (uuo-error-too-many-args)
    272   :ok)
     275  (ja :bad)
     276  (:anchored-uuo-section :resume)
     277  :bad
     278  (:anchored-uuo (uuo-error-too-many-args)))
    273279
    274280(define-x8632-vinsn check-min-max-nargs (()
     
    515521(define-x8632-vinsn trap-unless-bit (()
    516522                                     ((value :lisp)))
     523  :resume
    517524  (testl (:$l (lognot x8632::fixnumone)) (:%l value))
    518   (je :ok)
    519   (uuo-error-reg-not-type (:%l value) (:$ub arch::error-object-not-bit))
    520   :ok
    521   )
     525  (jne :bad)
     526
     527  (:anchored-uuo-section :resume)
     528  :bad
     529  (:anchored-uuo (uuo-error-reg-not-type (:%l value) (:$ub arch::error-object-not-bit))))
    522530
    523531;;; note that NIL is just a distinguished CONS.
     
    527535                                      ((object :lisp))
    528536                                      ((tag :u8)))
     537  :resume
    529538  (movl (:% object) (:% tag))
    530539  (andl (:$b x8632::fulltagmask) (:% tag))
    531540  (cmpl (:$b x8632::fulltag-cons) (:% tag))
    532   (je :ok)
    533   (uuo-error-reg-not-list (:%l object))
    534   :ok)
     541  (jne :bad)
     542
     543  (:anchored-uuo-section :resume)
     544  :bad 
     545  (:anchored-uuo (uuo-error-reg-not-list (:%l object))))
    535546
    536547(define-x8632-vinsn trap-unless-cons (()
     
    538549                                      ((tag :u8)))
    539550  ;; special check for NIL (which is a distinguished CONS on x8632)
     551  :resume
    540552  (cmpl (:$l x8632::nil-value) (:%l object))
    541553  (je :bad)
     
    543555  (andl (:$b x8632::fulltagmask) (:%l tag))
    544556  (cmpl (:$b x8632::fulltag-cons) (:%l tag))
    545   (je :ok)
    546   :bad
    547   (uuo-error-reg-not-tag (:%l object) (:$ub x8632::fulltag-cons))
    548   :ok)
     557  (jne :bad)
     558
     559  (:anchored-uuo-section :resume)
     560  :bad
     561  (:anchored-uuo (uuo-error-reg-not-tag (:%l object) (:$ub x8632::fulltag-cons))))
    549562
    550563(define-x8632-vinsn set-z-flag-if-consp (()
     
    562575                                         ((object :lisp))
    563576                                         ((tag :u8)))
     577  :resume
    564578  (movl (:%l object) (:%l tag))
    565579  (andl (:$b x8632::tagmask) (:%l tag))
    566580  (cmpl (:$b x8632::tag-misc) (:%l tag))
    567   (jz :ok)
    568   (uuo-error-reg-not-tag (:%l object) (:$ub x8632::tag-misc))
    569   :ok)
     581  (jne :bad)
     582
     583  (:anchored-uuo-section :resume)
     584  :bad
     585  (:anchored-uuo (uuo-error-reg-not-tag (:%l object) (:$ub x8632::tag-misc))))
    570586
    571587(define-x8632-vinsn trap-unless-character (()
     
    573589                                           ((tag :u8)))
    574590  ;; xxx can't be sure that object will be in a byte-accessible register
     591  :resume
    575592  (movl (:%l object) (:%l tag))
    576593  (cmpb (:$b x8632::subtag-character) (:%b tag))
    577   (je :ok)
    578   (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-character))
    579   :ok)
     594  (jne :bad)
     595
     596  (:anchored-uuo-section :resume)
     597  :bad
     598  (:anchored-uuo(uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-character))))
    580599
    581600(define-x8632-vinsn trap-unless-fixnum (()
    582601                                        ((object :lisp))
    583602                                        ())
     603  :resume
    584604  (testl (:$l x8632::tagmask) (:%l object))
    585   (je :ok)
    586   (uuo-error-reg-not-fixnum (:%l object))
    587   :ok)
     605  (jne :bad)
     606
     607  (:anchored-uuo-section :resume)
     608  :bad
     609  (:anchored-uuo (uuo-error-reg-not-fixnum (:%l object))))
    588610
    589611(define-x8632-vinsn set-flags-from-lisptag (()
     
    595617                                            (tagval :u8const))
    596618                                           ((tag :u8)))
     619  :resume
    597620  (movl (:%l object) (:%l tag))
    598621  ((:pred = (:apply %hard-regspec-value tag) x8632::eax)
     
    607630  :have-tag
    608631  (cmpb (:$b tagval) (:%b tag))
    609   (je :ok)
    610   (uuo-error-reg-not-tag (:%l object) (:$ub tagval))
    611   :ok)
     632  (jne :bad)
     633
     634  (:anchored-uuo-section :resume)
     635  :bad
     636  (:anchored-uuo (uuo-error-reg-not-tag (:%l object) (:$ub tagval))))
    612637
    613638(define-x8632-vinsn trap-unless-single-float (()
    614639                                              ((object :lisp))
    615640                                              ((tag :u8)))
     641  :resume
    616642  (movl (:%l object) (:%l tag))
    617643  (andl (:$b x8632::tagmask) (:%l tag))
     
    621647  (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
    622648  (cmpb (:$b x8632::subtag-single-float) (:%b tag))
    623   (je :ok)
    624   :bad
    625   (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-single-float))
    626   :ok)
     649  (jne :bad)
     650
     651  (:anchored-uuo-section :resume)
     652  :bad
     653  (:anchored-uuo (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-single-float))))
    627654
    628655(define-x8632-vinsn trap-unless-double-float (()
    629656                                              ((object :lisp))
    630657                                              ((tag :u8)))
     658  :resume
    631659  (movl (:%l object) (:%l tag))
    632660  (andl (:$b x8632::tagmask) (:%l tag))
     
    636664  (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
    637665  (cmpb (:$b x8632::subtag-double-float) (:%b tag))
    638   (je :ok)
    639   :bad
    640   (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-double-float))
    641   :ok)
     666  (jne :bad)
     667
     668  (:anchored-uuo-section :resume)
     669  :bad
     670  (:anchored-uuo (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-double-float))))
    642671
    643672(define-x8632-vinsn trap-unless-macptr (()
    644673                                        ((object :lisp))
    645674                                        ((tag :u8)))
     675  :resume
    646676  (movl (:%l object) (:%l tag))
    647677  (andl (:$b x8632::tagmask) (:%l tag))
     
    652682  :have-tag
    653683  (cmpl (:$b x8632::subtag-macptr) (:%l tag))
    654   (je :ok)
    655   (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-macptr))
    656   :ok)
     684  (jne :bad)
     685
     686  (:anchored-uuo-section :resume)
     687  :bad
     688  (:anchored-uuo (uuo-error-reg-not-tag (:%l object) (:$ub x8632::subtag-macptr))))
    657689
    658690(define-x8632-vinsn check-misc-bound (()
     
    660692                                       (v :lisp))
    661693                                      ((temp :u32)))
     694  :resume
    662695  (movl (:@ x8632::misc-header-offset (:%l v)) (:%l temp))
    663696  ((:and (:pred >= (:apply %hard-regspec-value temp) x8632::eax)
     
    669702   (shll (:$ub x8632::fixnumshift) (:%l temp)))
    670703  (rcmpl (:%l idx) (:%l temp))
    671   (jb :ok)
    672   (uuo-error-vector-bounds (:%l idx) (:%l v))
    673   :ok)
     704  (jae :bad)
     705
     706  (:anchored-uuo-section :resume)
     707  :bad
     708  (:anchored-uuo (uuo-error-vector-bounds (:%l idx) (:%l v))))
    674709
    675710(define-x8632-vinsn %cdr (((dest :lisp))
     
    837872(define-x8632-vinsn unbox-u8 (((dest :u8))
    838873                              ((src :lisp)))
     874  :resume
    839875  (movl (:$l (lognot (ash #xff x8632::fixnumshift))) (:%l dest))
    840876  (andl (:% src) (:% dest))
    841   (je :ok)
    842   (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-unsigned-byte-8))
    843   :ok
     877  (jne :bad)
    844878  (movl (:%l src) (:%l dest))
    845   (shrl (:$ub x8632::fixnumshift) (:%l dest)))
     879  (shrl (:$ub x8632::fixnumshift) (:%l dest))
     880
     881  (:anchored-uuo-section :resume)
     882  :bad
     883  (:anchored-uuo (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-unsigned-byte-8))))
    846884
    847885(define-x8632-vinsn %unbox-u8 (((dest :u8))
     
    853891(define-x8632-vinsn unbox-s8 (((dest :s8))
    854892                              ((src :lisp)))
     893  :resume
    855894  (movl (:%l src) (:%l dest))
    856895  (shll (:$ub (- x8632::nbits-in-word (+ 8 x8632::fixnumshift))) (:%l dest))
     
    861900  (jne :bad)
    862901  (sarl (:$ub x8632::fixnumshift) (:%l dest))
    863   (jmp :got-it)
    864   :bad
    865   (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-signed-byte-8))
    866   :got-it)
     902
     903  (:anchored-uuo-section :resume)
     904  :bad
     905  (:anchored-uuo (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-signed-byte-8))))
    867906
    868907(define-x8632-vinsn unbox-u16 (((dest :u16))
    869908                              ((src :lisp)))
     909  :resume
    870910  (testl (:$l (lognot (ash #xffff x8632::fixnumshift))) (:% src))
    871911  (movl (:%l src) (:%l dest))
    872   (je :ok)
    873   (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-unsigned-byte-16))
    874   :ok
    875   (shrl (:$ub x8632::fixnumshift) (:%l dest)))
     912  (jne :bad)
     913  (shrl (:$ub x8632::fixnumshift) (:%l dest))
     914  (:anchored-uuo-section :resume)
     915  :bad
     916  (:anchored-uuo (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-unsigned-byte-16))))
    876917
    877918(define-x8632-vinsn %unbox-u16 (((dest :u16))
     
    882923(define-x8632-vinsn unbox-s16 (((dest :s16))
    883924                              ((src :lisp)))
     925  :resume
    884926  (movl (:%l src) (:%l dest))
    885927  (shll (:$ub (- x8632::nbits-in-word (+ 16 x8632::fixnumshift))) (:%l dest))
     
    888930  (jne :bad)
    889931  (testl (:$l x8632::fixnummask) (:%l dest))
    890   (je :got-it)
    891   :bad
    892   (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-signed-byte-16))
    893   :got-it
    894   (sarl (:$ub x8632::fixnumshift) (:%l dest)))
     932  (jne :bad)
     933  (sarl (:$ub x8632::fixnumshift) (:%l dest))
     934
     935  (:anchored-uuo-section :resume)
     936  :bad
     937  (:anchored-uuo (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-signed-byte-16))))
    895938
    896939(define-x8632-vinsn %unbox-s16 (((dest :s16))
     
    905948(define-x8632-vinsn unbox-u32 (((dest :u32))
    906949                               ((src :lisp)))
     950  :resume
    907951  (movl (:$l (lognot (ash x8632::target-most-positive-fixnum x8632::fixnumshift))) (:%l dest))
    908952  (testl (:%l dest) (:%l src))
     
    922966  (movl (:@ x8632::misc-data-offset (:%l src)) (:%l dest))
    923967  (testl (:%l dest) (:%l dest))
    924   (jns :done)
    925   :bad
    926   (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-unsigned-byte-32))
     968  (js :bad)
     969  (jmp :done)
    927970  :two
    928971  (movl (:@ (+ 4 x8632::misc-data-offset) (:%l src)) (:%l dest))
     
    930973  (jne :bad)
    931974  (movl (:@ x8632::misc-data-offset (:%l src)) (:%l dest))
    932   :done)
     975  :done
     976 
     977  (:anchored-uuo-section :resume)
     978  :bad
     979  (:anchored-uuo (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-unsigned-byte-32))))
    933980
    934981;;; xxx -- review this again later
    935982(define-x8632-vinsn unbox-s32 (((dest :s32))
    936983                               ((src :lisp)))
     984  :resume
    937985  (movl (:%l src) (:%l dest))
    938986  (sarl (:$ub x8632::fixnumshift) (:%l dest))
     
    947995  (cmpl (:$l x8632::two-digit-bignum-header) (:@ x8632::misc-header-offset (:%l src)))
    948996  (movl (:@ x8632::misc-data-offset (:%l src)) (:%l dest))
    949   (je :done)
    950   :bad
    951   (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-signed-byte-32))
    952   :done)
     997  (jne :bad)
     998  :done
     999
     1000  (:anchored-uuo-section :resume)
     1001  :bad
     1002  (:anchored-uuo (uuo-error-reg-not-type (:%l src) (:$ub arch::error-object-not-signed-byte-32))))
    9531003
    9541004
     
    15041554                                          ()
    15051555                                          ((tag :u8)))
     1556  :resume
    15061557  (movb (:%b x8632::temp0) (:%b tag))
    15071558  (andb (:$b x8632::tagmask) (:%b tag))
     
    15171568  (pushl (:@ (+ x8632::nil-value (x8632::%kernel-global 'x86::ret1valaddr))))
    15181569  (jmp (:%l x8632::fn))
    1519   :bad
    1520   (uuo-error-not-callable)
    1521   ;; If we don't do this (and leave %fn as a TRA into itself), reporting
    1522   ;; the error is likely a little harder.  Tough.
    1523   ;; (leaq (@ (:apply - (:^ :bad)) (:%q x8664::rn)) (:%q x8664::fn))
     1570  (:anchored-uuo-section :resume)
     1571  :bad
     1572  (:anchored-uuo (uuo-error-not-callable))
    15241573)
    15251574
     
    22652314  ((:pred > (:apply %hard-regspec-value object) x8632::ebx)
    22662315   (testl (:$l x8632::fixnummask) (:%l object)))
    2267   (je :got-it)
    2268   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-fixnum))
    2269   (jmp :again)
    2270   :got-it)
     2316  (jne :bad)
     2317
     2318  (:anchored-uuo-section :again)
     2319  :bad
     2320  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-fixnum))))
    22712321
    22722322(define-x8632-vinsn require-integer (()
     
    22922342  (jne :bad)
    22932343  (cmpb (:$b x8632::subtag-bignum) (:@ x8632::misc-subtag-offset (:%l object)))
    2294   (je :got-it)
    2295   :bad
    2296   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-integer))
    2297   (jmp :again)
    2298   :got-it)
     2344  (jne :bad)
     2345  :got-it
     2346
     2347  (:anchored-uuo-section :again)
     2348  :bad
     2349  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-integer))))
    22992350
    23002351(define-x8632-vinsn require-simple-vector (()
     
    23072358  (jne :bad)
    23082359  (cmpb (:$b x8632::subtag-simple-vector) (:@ x8632::misc-subtag-offset (:%l object)))
    2309   (je :got-it)
    2310   :bad
    2311   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-simple-vector))
    2312   (jmp :again)
    2313   :got-it)
     2360  (jne :bad)
     2361
     2362  (:anchored-uuo-section :again)
     2363  :bad
     2364  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-simple-vector))))
    23142365
    23152366(define-x8632-vinsn require-simple-string (()
     
    23222373  (jne :bad)
    23232374  (cmpb (:$b x8632::subtag-simple-base-string) (:@ x8632::misc-subtag-offset (:%l object)))
    2324   (je :got-it)
    2325   :bad
    2326   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-simple-string))
    2327   (jmp :again)
    2328   :got-it)
     2375  (jne :bad)
     2376
     2377  (:anchored-uuo-section :again)
     2378  :bad
     2379  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-simple-string))))
    23292380
    23302381
     
    23322383(define-x8632-vinsn require-real (()
    23332384                                    ((object :lisp))
    2334                                     ((tag :u8)))
     2385                                    ((tag :u8)
     2386                                     (mask :lisp)))
    23352387  :again
    23362388  (movl (:%l object) (:%l tag))
    2337   (andb (:$b x8632::tagmask) (:%b tag))
    2338   (cmpb (:$b x8632::tag-fixnum) (:%b tag))
    2339   (je :good)
     2389  (andl (:$b x8632::tagmask) (:%l tag))
    23402390  (cmpb (:$b x8632::tag-misc) (:%b tag))
    2341   (jne :bad)
     2391  (jne :have-tag)
    23422392  (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
    2343   (cmpb (:$b x8632::subtag-single-float) (:%b tag))
    2344   (je :good)
    2345   (cmpb (:$b x8632::subtag-double-float) (:%b tag))
    2346   (je :good)
    2347   (cmpb (:$b x8632::subtag-bignum) (:%b tag))
    2348   (je :good)
    2349   (cmpb (:$b x8632::subtag-ratio) (:%b tag))
    2350   (je :good)
    2351   :bad
    2352   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-real))
    2353   (jmp :again)
    2354   :good)
     2393  :have-tag
     2394  (cmpb (:$b (1- (- x8632::nbits-in-word x8632::fixnumshift))) (:%b tag))
     2395  (movl (:$l (ash (logior (ash 1 x8632::tag-fixnum)
     2396                          (ash 1 x8632::subtag-single-float)
     2397                          (ash 1 x8632::subtag-double-float)
     2398                          (ash 1 x8632::subtag-bignum)
     2399                          (ash 1 x8632::subtag-ratio))
     2400                  x8632::fixnumshift)) (:%l mask))
     2401  (ja :bad)
     2402  (addl (:$b x8632::fixnumshift) (:%l tag))
     2403  (btl (:%l tag) (:%l mask))
     2404  (jnc :bad)
     2405
     2406  (:anchored-uuo-section :again)
     2407  :bad
     2408  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-real))))
    23552409
    23562410;;; naive
    23572411(define-x8632-vinsn require-number (()
    23582412                                    ((object :lisp))
    2359                                     ((tag :u8)))
     2413                                    ((tag :u8)
     2414                                     (mask :lisp)))
    23602415  :again
    23612416  (movl (:%l object) (:%l tag))
    2362   (andb (:$b x8632::tagmask) (:%b tag))
    2363   (cmpb (:$b x8632::tag-fixnum) (:%b tag))
    2364   (je :good)
     2417  (andl (:$b x8632::tagmask) (:%l tag))
    23652418  (cmpb (:$b x8632::tag-misc) (:%b tag))
    2366   (jne :bad)
     2419  (jne :have-tag)
    23672420  (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
    2368   (cmpb (:$b x8632::subtag-single-float) (:%b tag))
    2369   (je :good)
    2370   (cmpb (:$b x8632::subtag-double-float) (:%b tag))
    2371   (je :good)
    2372   (cmpb (:$b x8632::subtag-bignum) (:%b tag))
    2373   (je :good)
    2374   (cmpb (:$b x8632::subtag-ratio) (:%b tag))
    2375   (je :good)
    2376   (cmpb (:$b x8632::subtag-complex) (:%b tag))
    2377   (je :good)
    2378   :bad
    2379   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-number))
    2380   (jmp :again)
    2381   :good)
     2421  :have-tag
     2422  (cmpb (:$b (1- (- x8632::nbits-in-word x8632::fixnumshift))) (:%b tag))
     2423  (movl (:$l (ash (logior (ash 1 x8632::tag-fixnum)
     2424                          (ash 1 x8632::subtag-single-float)
     2425                          (ash 1 x8632::subtag-double-float)
     2426                          (ash 1 x8632::subtag-bignum)
     2427                          (ash 1 x8632::subtag-ratio)
     2428                          (ash 1 x8632::subtag-complex))
     2429                  x8632::fixnumshift)) (:%l mask))
     2430  (ja :bad)
     2431  (addl (:$b x8632::fixnumshift) (:%l tag))
     2432  (btl (:%l tag) (:%l mask))
     2433  (jnc :bad)
     2434
     2435  (:anchored-uuo-section :again)
     2436  :bad
     2437  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-number))))
    23822438
    23832439(define-x8632-vinsn require-list (()
     
    23852441                                  ((tag :u8)))
    23862442  :again
    2387   (cmpl (:$l x8632::nil-value) (:%l object))
    2388   (je :good)
    23892443  (movl (:%l object) (:%l tag))
    23902444  (andb (:$b x8632::fulltagmask) (:%b tag))
    23912445  (cmpb (:$b x8632::fulltag-cons) (:%b tag))
    2392   (je :good)
    2393   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-list))
    2394   (jmp :again)
    2395   :good)
     2446  (jne :bad)
     2447
     2448  (:anchored-uuo-section :again)
     2449  :bad
     2450  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-list))))
    23962451
    23972452(define-x8632-vinsn require-symbol (()
     
    24062461  (jne :bad)
    24072462  (cmpb (:$b x8632::subtag-symbol) (:@ x8632::misc-subtag-offset (:%l object)))
    2408   (je :got-it)
    2409   :bad
    2410   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-symbol))
    2411   (jmp :again)
    2412   :got-it)
     2463  (jne :bad)
     2464  :got-it
     2465 
     2466  (:anchored-uuo-section :again)
     2467  :bad
     2468  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-symbol)))
     2469)
    24132470
    24142471(define-x8632-vinsn require-character (()
    2415                                        ((object :lisp))
    2416                                        ((tag :u8)))
     2472                                       ((object :lisp)))
    24172473  :again
    2418   (movl (:%l object) (:%l tag))
    24192474  (cmpb (:$b x8632::subtag-character) (:%b object))
    2420   (je :ok)
    2421   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-character))
    2422   (jmp :again)
    2423   :ok)
     2475  (jne :bad)
     2476
     2477  (:anchored-uuo-section :again)
     2478  :bad
     2479  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-character))))
    24242480
    24252481(define-x8632-vinsn require-s8 (()
     
    24322488  (shll (:$ub x8632::fixnumshift) (:%l tag))
    24332489  (cmpl (:%l object) (:%l tag))
    2434   (je :ok)
    2435   :bad
    2436   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-8))
    2437   (jmp :again)
    2438   :ok)
     2490  (jne :bad)
     2491
     2492  (:anchored-uuo-section :again)
     2493  :bad
     2494  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-8))))
    24392495
    24402496(define-x8632-vinsn require-u8 (()
     
    24442500  (movl (:$l (lognot (ash #xff x8632::fixnumshift))) (:%l tag))
    24452501  (andl (:%l object) (:%l tag))
    2446   (je :ok)
    2447   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-unsigned-byte-8))
    2448   (jmp :again)
    2449   :ok)
     2502  (jne :bad)
     2503
     2504  (:anchored-uuo-section :again)
     2505  :bad
     2506  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-unsigned-byte-8))))
    24502507
    24512508(define-x8632-vinsn require-s16 (()
     
    24582515  (shll (:$ub x8632::fixnumshift) (:%l tag))
    24592516  (cmpl (:%l object) (:%l tag))
    2460   (je :ok)
    2461   :bad
    2462   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-16))
    2463   (jmp :again)
    2464   :ok)
     2517  (jne :bad)
     2518
     2519  (:anchored-uuo-section :again)
     2520  :bad
     2521  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-16))))
    24652522
    24662523(define-x8632-vinsn require-u16 (()
     
    24702527  (movl (:$l (lognot (ash #xffff x8632::fixnumshift))) (:%l tag))
    24712528  (andl (:%l object) (:%l tag))
    2472   (je :ok)
    2473   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-unsigned-byte-16))
    2474   (jmp :again)
    2475   :ok)
     2529  (jne :bad)
     2530
     2531  (:anchored-uuo-section :again)
     2532  :bad
     2533  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-unsigned-byte-16))))
    24762534
    24772535(define-x8632-vinsn require-s32 (()
     
    24862544  (jne :bad)
    24872545  (cmpl (:$l x8632::one-digit-bignum-header) (:@ x8632::misc-header-offset (:%l object)))
    2488   (je :ok)
    2489   :bad
    2490   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-32))
    2491   (jmp :again)
    2492   :ok)
     2546  (jne :bad)
     2547  :ok
     2548 
     2549  (:anchored-uuo-section :again)
     2550  :bad
     2551  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-32))))
    24932552
    24942553(define-x8632-vinsn require-u32 (()
     
    25292588  (jne :bad)
    25302589  (cmpl (:$l x8632::two-digit-bignum-header) (:@ x8632::misc-header-offset (:%l object)))
    2531   (jne :ok)
    2532   :bad
    2533   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-64))
    2534   (jmp :again)
    2535   :ok)
     2590  (jne :bad)
     2591  :ok
     2592
     2593  (:anchored-uuo-section :again)
     2594  :bad
     2595  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-signed-byte-64))))
    25362596
    25372597(define-x8632-vinsn require-u64 (()
     
    25682628  (jne :bad)
    25692629  (cmpl (:$l (ash #x110000 x8632::fixnumshift)) (:%l object))
    2570   (jb :ok)
    2571   :bad
    2572   (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-mod-char-code-limit))
    2573   (jmp :again)
    2574   :ok)
     2630  (jae :bad)
     2631
     2632  (:anchored-uuo-section :again)
     2633  :bad
     2634  (:anchored-uuo (uuo-error-reg-not-type (:%l object) (:$ub arch::error-object-not-mod-char-code-limit))))
    25752635
    25762636(define-x8632-vinsn mask-base-char (((dest :u8))
     
    27042764                                     ((src :lisp))
    27052765                                     ((tag :u8)))
     2766  :resume
    27062767  (cmpl (:$l x8632::nil-value) (:%l src))
    27072768  (je :nilsym)
     
    27182779   (movl (:% src) (:% dest)))
    27192780  (jmp :ok)
    2720   :bad
    2721   (uuo-error-reg-not-tag (:%l src) (:$ub x8632::subtag-symbol))
    27222781  :nilsym
    27232782  (movl (:$l (+ x8632::nil-value x8632::nilsym-offset)) (:%l dest))
    2724   :ok)
     2783  :ok
     2784 
     2785  (:anchored-uuo-section :resume)
     2786  :bad
     2787  (:anchored-uuo (uuo-error-reg-not-tag (:%l src) (:$ub x8632::subtag-symbol))))
     2788
    27252789
    27262790(define-x8632-vinsn zero-double-float-register (((dest :double-float))
     
    31783242                                  ()
    31793243                                  ((tag :u8)))
     3244  :resume
    31803245  (movl (:%l x8632::temp0) (:%l tag))
    31813246  ((:pred = (:apply %hard-regspec-value tag) x8632::eax)
     
    31943259  :go
    31953260  (jmp (:%l x8632::temp0))
    3196   :bad
    3197   (uuo-error-not-callable))
     3261
     3262  (:anchored-uuo-section :resume)
     3263  :bad
     3264  (:anchored-uuo (uuo-error-not-callable)))
    31983265
    31993266;;; Magic numbers in here include the address of .SPcall-closure.
     
    32293296                                             ((table :imm)
    32303297                                              (idx :imm)))
     3298  :resume
    32313299  (movl (:@ x8632::symbol.binding-index (:%l src)) (:%l idx))
    32323300  (rcmpl (:%l idx) (:@ (:%seg :rcontext) x8632::tcr.tlb-limit))
     
    32403308  :test
    32413309  (cmpl (:$l x8632::unbound-marker) (:%l dest))
    3242   (jne :done)
    3243   (uuo-error-unbound (:%l src))
    3244   :done)
     3310  (je :bad)
     3311
     3312  (:anchored-uuo-section :resume)
     3313  :bad
     3314  (:anchored-uuo (uuo-error-unbound (:%l src))))
    32453315
    32463316(define-x8632-vinsn (%ref-symbol-value :call :subprim-call)
     
    34303500                                     ((sym (:lisp (:ne val))))
    34313501                                     ((tag :u8)))
     3502  :resume
    34323503  (movl (:@ x8632::symbol.fcell (:%l sym)) (:%l val))
    34333504  (movl (:%l val) (:%l tag))
     
    34373508  (movb (:@ x8632::misc-subtag-offset (:%l val)) (:%b tag))
    34383509  (cmpb (:$b x8632::subtag-function) (:%b tag))
    3439   (je :ok)
    3440   :bad
    3441   (uuo-error-udf (:%l sym))
    3442   :ok)
     3510  (jne :bad)
     3511
     3512  (:anchored-uuo-section :resume)
     3513  :bad
     3514  (:anchored-uuo (uuo-error-udf (:%l sym))))
    34433515
    34443516(define-x8632-subprim-jump-vinsn (tail-call-fn-slide) .SPtcallnfnslide)
     
    36423714(define-x8632-vinsn eep.address (((dest t))
    36433715                                 ((src (:lisp (:ne dest )))))
     3716  :resume
    36443717  (movl (:@ (+ (ash 1 x8632::word-shift) x8632::misc-data-offset) (:%l src))
    36453718        (:%l dest))
    36463719  (cmpl (:$l x8632::nil-value) (:%l dest))
    3647   (jne :ok)
    3648   (uuo-error-eep-unresolved (:%l src) (:%l dest))
    3649   :ok)
     3720  (je :bad)
     3721
     3722  (:anchored-uuo-section :resume)
     3723  :bad
     3724  (:anchored-uuo (uuo-error-eep-unresolved (:%l src) (:%l dest))))
    36503725
    36513726(define-x8632-subprim-lea-jmp-vinsn (heap-cons-rest-arg) .SPheap-cons-rest-arg)
     
    36673742                                ((instance (:lisp (:ne dest)))
    36683743                                 (index :lisp)))
     3744  :resume
    36693745  (movl (:@ x8632::misc-data-offset (:%l instance) (:%l index)) (:%l dest))
    36703746  (cmpl (:$l x8632::slot-unbound-marker) (:%l dest))
    3671   (jne :ok)
    3672   (uuo-error-slot-unbound (:%l dest) (:%l instance) (:%l index))
    3673   :ok)
     3747  (je :bad)
     3748
     3749  (:anchored-uuo-section :resume)
     3750  :bad
     3751  (:anchored-uuo (uuo-error-slot-unbound (:%l dest) (:%l instance) (:%l index))))
    36743752
    36753753
Note: See TracChangeset for help on using the changeset viewer.