Changeset 11029


Ignore:
Timestamp:
Oct 10, 2008, 12:59:32 AM (11 years ago)
Author:
rme
Message:

Avoid some partial-register writes.

File:
1 edited

Legend:

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

    r10984 r11029  
    628628   (cmpl (:$b x8632::tag-misc) (:%l tag)))
    629629  (jne :have-tag)
    630   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
     630  ;; This needs to be a sign-extending mov, since the cmpl below
     631  ;; will sign-extend the 8-bit constant operand.
     632  (movsbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
    631633  :have-tag
    632   (cmpb (:$b tagval) (:%b tag))
     634  (cmpl (:$b tagval) (:%l tag))
    633635  (jne :bad)
    634636
     
    645647  (cmpl (:$b x8632::tag-misc) (:%l tag))
    646648  (jne :bad)
    647   ;; xxx tag might not be byte-accessible
    648   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
    649   (cmpb (:$b x8632::subtag-single-float) (:%b tag))
     649  (movsbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
     650  (cmpl (:$b x8632::subtag-single-float) (:%l tag))
    650651  (jne :bad)
    651652
     
    662663  (cmpl (:$b x8632::tag-misc) (:%l tag))
    663664  (jne :bad)
    664   ;; xxx tag might not be byte-accessible
    665   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
    666   (cmpb (:$b x8632::subtag-double-float) (:%b tag))
     665  (movsbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
     666  (cmpl (:$b x8632::subtag-double-float) (:%l tag))
    667667  (jne :bad)
    668668
     
    679679  (cmpl (:$b x8632::tag-misc) (:%l tag))
    680680  (jne :have-tag)
    681   ;; xxx tag might not be byte-accessible
    682   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
     681  (movsbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
    683682  :have-tag
    684683  (cmpl (:$b x8632::subtag-macptr) (:%l tag))
     
    785784  (andl (:$b (ash x8632::fulltagmask x8632::fixnumshift)) (:%l tag)))
    786785
    787 (define-x8632-vinsn extract-typecode (((tag :imm))
     786(define-x8632-vinsn extract-typecode (((tag :u32))
    788787                                      ((object :lisp)))
    789788  (movl (:%l object) (:%l tag))
    790   ((:pred <= (:apply  %hard-regspec-value tag) x8632::ebx)
    791    (andb (:$b x8632::tagmask) (:%b tag))
    792    (cmpb (:$b x8632::tag-misc) (:%b tag)))
    793   ((:pred > (:apply  %hard-regspec-value tag) x8632::ebx)
    794    (andl (:$l x8632::tagmask) (:%l tag))
    795    (cmpl (:$l x8632::tag-misc) (:%l tag)))
     789  (andl (:$b x8632::tagmask) (:%l tag))
     790  (cmpl (:$b x8632::tag-misc) (:%l tag))
    796791  (jne :have-tag)
    797   ((:pred <= (:apply  %hard-regspec-value tag) x8632::ebx)
    798    (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag)))
    799   ((:pred > (:apply %hard-regspec-value tag) x8632::ebx)
    800    (movl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag)))
     792  (movzbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
    801793  :have-tag)
    802794
     
    808800  (cmpl (:$b x8632::tag-misc) (:%l temp))
    809801  (jne :have-tag)
    810   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b temp))
     802  (movzbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l temp))
    811803  :have-tag
    812804  (leal (:@ (:%l temp) 4) (:%l tag)))
     
    23632355                                           ((tag :u8)))
    23642356  :again
    2365   (movb (:%b object) (:%b tag))
    2366   (andb (:$b x8632::fixnummask) (:%b tag))
    2367   (cmpb (:$b x8632::tag-misc) (:%b tag))
     2357  (movl (:%l object) (:%l tag))
     2358  (andl (:$b x8632::fixnummask) (:%l tag))
     2359  (cmpl (:$b x8632::tag-misc) (:%l tag))
    23682360  (jne :bad)
    23692361  (cmpb (:$b x8632::subtag-simple-vector) (:@ x8632::misc-subtag-offset (:%l object)))
     
    23782370                                           ((tag :u8)))
    23792371  :again
    2380   (movb (:%b object) (:%b tag))
    2381   (andb (:$b x8632::fixnummask) (:%b tag))
    2382   (cmpb (:$b x8632::tag-misc) (:%b tag))
     2372  (movl (:%l object) (:%l tag))
     2373  (andl (:$b x8632::fixnummask) (:%l tag))
     2374  (cmpl (:$b x8632::tag-misc) (:%l tag))
    23832375  (jne :bad)
    23842376  (cmpb (:$b x8632::subtag-simple-base-string) (:@ x8632::misc-subtag-offset (:%l object)))
     
    23982390  (movl (:%l object) (:%l tag))
    23992391  (andl (:$b x8632::tagmask) (:%l tag))
    2400   (cmpb (:$b x8632::tag-misc) (:%b tag))
     2392  (cmpl (:$b x8632::tag-misc) (:%l tag))
    24012393  (jne :have-tag)
    2402   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
     2394  (movzbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
    24032395  :have-tag
    2404   (cmpb (:$b (1- (- x8632::nbits-in-word x8632::fixnumshift))) (:%b tag))
     2396  (cmpl (:$b (1- (- x8632::nbits-in-word x8632::fixnumshift))) (:%l tag))
    24052397  (movl (:$l (ash (logior (ash 1 x8632::tag-fixnum)
    24062398                          (ash 1 x8632::subtag-single-float)
     
    24262418  (movl (:%l object) (:%l tag))
    24272419  (andl (:$b x8632::tagmask) (:%l tag))
    2428   (cmpb (:$b x8632::tag-misc) (:%b tag))
     2420  (cmpl (:$b x8632::tag-misc) (:%l tag))
    24292421  (jne :have-tag)
    2430   (movb (:@ x8632::misc-subtag-offset (:%l object)) (:%b tag))
     2422  (movzbl (:@ x8632::misc-subtag-offset (:%l object)) (:%l tag))
    24312423  :have-tag
    2432   (cmpb (:$b (1- (- x8632::nbits-in-word x8632::fixnumshift))) (:%b tag))
     2424  (cmpl (:$b (1- (- x8632::nbits-in-word x8632::fixnumshift))) (:%l tag))
    24332425  (movl (:$l (ash (logior (ash 1 x8632::tag-fixnum)
    24342426                          (ash 1 x8632::subtag-single-float)
     
    24522444  :again
    24532445  (movl (:%l object) (:%l tag))
    2454   (andb (:$b x8632::fulltagmask) (:%b tag))
    2455   (cmpb (:$b x8632::fulltag-cons) (:%b tag))
     2446  (andl (:$b x8632::fulltagmask) (:%l tag))
     2447  (cmpl (:$b x8632::fulltag-cons) (:%l tag))
    24562448  (jne :bad)
    24572449
     
    24672459  (je :got-it)
    24682460  (movl (:%l object) (:%l tag))
    2469   (andb (:$b x8632::tagmask) (:%b tag))
    2470   (cmpb (:$b x8632::tag-misc) (:%b tag))
     2461  (andl (:$b x8632::tagmask) (:%l tag))
     2462  (cmpl (:$b x8632::tag-misc) (:%l tag))
    24712463  (jne :bad)
    24722464  (cmpb (:$b x8632::subtag-symbol) (:@ x8632::misc-subtag-offset (:%l object)))
     
    27782770  (je :nilsym)
    27792771  (movl (:%l src) (:%l tag))
    2780   (andb (:$b x8632::tagmask) (:%b tag))
    2781   (cmpb (:$b x8632::tag-misc) (:%b tag))
    2782   (jne :bad)
    2783   (movb (:@ x8632::misc-subtag-offset (:%l src)) (:%b tag))
    2784   (cmpb (:$b x8632::subtag-symbol) (:%b tag))
     2772  (andl (:$b x8632::tagmask) (:%l tag))
     2773  (cmpl (:$b x8632::tag-misc) (:%l tag))
     2774  (jne :bad)
     2775  (movsbl (:@ x8632::misc-subtag-offset (:%l src)) (:%l tag))
     2776  (cmpl (:$b x8632::subtag-symbol) (:%l tag))
    27852777  (jne :bad)
    27862778  ((:not (:pred =
     
    28172809                                               ((temp :u32)))
    28182810  (movl (:@ x8632::misc-header-offset (:%l src)) (:%l temp))
    2819   ((:and (:pred >= (:apply %hard-regspec-value temp) x8632::eax)
    2820          (:pred <= (:apply %hard-regspec-value temp) x8632::ebx))
    2821    (movb (:$b 0) (:%b temp)))
    2822   ((:pred > (:apply %hard-regspec-value temp) x8632::ebx)
    2823    (andl (:$l #xffffff00) (:%l temp)))
    2824   (movl (:%l temp) (:%l dest))
    2825   (shrl (:$ub (- x8632::num-subtag-bits x8632::fixnumshift)) (:%l dest)))
    2826 
    2827 
     2811  (shrl (:$ub x8632::num-subtag-bits) (:%l temp))
     2812  (leal (:@ (:%l temp) 4) (:%l dest)))
    28282813
    28292814(define-x8632-vinsn %logior2 (((dest :imm))
     
    32853270   (cmpl (:$b x8632::tag-misc) (:%l tag)))
    32863271  (jne :bad)
    3287   (movb (:@ x8632::misc-subtag-offset (:%l x8632::temp0)) (:%b tag))
    3288   (cmpb (:$b x8632::subtag-function) (:%b tag))
     3272  (movsbl (:@ x8632::misc-subtag-offset (:%l x8632::temp0)) (:%l tag))
     3273  (cmpl (:$b x8632::subtag-function) (:%l tag))
    32893274  (je :go)
    3290   (cmpb (:$b x8632::subtag-symbol) (:%b tag))
     3275  (cmpl (:$b x8632::subtag-symbol) (:%l tag))
    32913276  (cmovel (:@ x8632::symbol.fcell (:%l x8632::temp0)) (:%l x8632::temp0))
    32923277  (jne :bad)
     
    35373522  (movl (:@ x8632::symbol.fcell (:%l sym)) (:%l val))
    35383523  (movl (:%l val) (:%l tag))
    3539   (andb (:$b x8632::tagmask) (:%b tag))
    3540   (cmpb (:$b x8632::tag-misc) (:%b tag))
    3541   (jne :bad)
    3542   (movb (:@ x8632::misc-subtag-offset (:%l val)) (:%b tag))
    3543   (cmpb (:$b x8632::subtag-function) (:%b tag))
     3524  (andl (:$b x8632::tagmask) (:%l tag))
     3525  (cmpl (:$b x8632::tag-misc) (:%l tag))
     3526  (jne :bad)
     3527  (movsbl (:@ x8632::misc-subtag-offset (:%l val)) (:%l tag))
     3528  (cmpl (:$b x8632::subtag-function) (:%l tag))
    35443529  (jne :bad)
    35453530
Note: See TracChangeset for help on using the changeset viewer.