Changeset 11030


Ignore:
Timestamp:
Oct 10, 2008, 1:26:11 AM (11 years ago)
Author:
rme
Message:

A couple more little tweaks to avoid partial register writes.

File:
1 edited

Legend:

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

    r11029 r11030  
    566566                                         ((tag (:u32 #.x8632::imm0))))
    567567  (movl (:%l object) (:%accl tag))
    568   (andb (:$b x8632::fulltagmask) (:%accb tag))
     568  (andl (:$b x8632::fulltagmask) (:%accl tag))
    569569  (cmpb (:$b x8632::fulltag-cons) (:%accb tag))
    570570  (setne (:%b x8632::ah))
     
    742742  (movl (:$l (:apply target-t-value)) (:%l dest)))
    743743
    744 ;;; use something like this for the other extract-whatevers, too,
    745 ;;; once it's established that it works.
    746744(define-x8632-vinsn extract-tag (((tag :u8))
    747745                                 ((object :lisp)))
    748746  (movl (:%l object) (:%l tag))
    749   ((:pred = (:apply %hard-regspec-value tag) x8632::eax)
    750    ;; tag is the accumulator (2 bytes)
    751    (andb (:$b x8632::tagmask) (:%accb tag)))
    752   ((:and (:pred > (:apply %hard-regspec-value tag) x8632::eax)
    753          (:pred <= (:apply %hard-regspec-value tag) x8632::ebx))
    754    ;; tag is in a register whose low 8 bits can be accessed by byte
    755    ;; insns (3 bytes)
    756    (andb (:$b x8632::tagmask) (:%b tag)))
    757   ((:pred > (:apply %hard-regspec-value tag) x8632::ebx)
    758    ;; tag is somewhere else (6 bytes) (could use andw and get a length
    759    ;; of 5 bytes, but Intel's optimization manual advises avoiding
    760    ;; length-changing prefixes to change the size of immediates.
    761    ;; (section 3.4.2.3)
    762    (andl (:$l x8632::tagmask) (:%l tag))))
     747  (andl (:$b x8632::tagmask) (:%l tag)))
    763748
    764749(define-x8632-vinsn extract-tag-fixnum (((tag :imm))
     
    15501535                                          ((tag :u8)))
    15511536  :resume
    1552   (movb (:%b x8632::temp0) (:%b tag))
    1553   (andb (:$b x8632::tagmask) (:%b tag))
    1554   (cmpb (:$b x8632::tag-misc) (:%b tag))
    1555   (jne :bad)
    1556   (cmpb (:$b x8632::subtag-function) (:@ x8632::misc-subtag-offset (:%l x8632::temp0)))
     1537  (movl (:%l x8632::temp0) (:%l tag))
     1538  (andl (:$b x8632::tagmask) (:%l tag))
     1539  (cmpl (:$b x8632::tag-misc) (:%l tag))
     1540  (jne :bad)
     1541  (movsbl (:@ x8632::misc-subtag-offset (:%l x8632::temp0)) (:%l tag))
     1542  (cmpl (:$b x8632::subtag-function) (:%l tag))
    15571543  (cmovel (:%l x8632::temp0) (:%l x8632::fn))
    15581544  (je :go)
    1559   (cmpb (:$b x8632::subtag-symbol) (:@ x8632::misc-subtag-offset (:%l x8632::temp0)))
     1545  (cmpl (:$b x8632::subtag-symbol) (:%l tag))
    15601546  (cmovel (:@ x8632::symbol.fcell (:%l x8632::fname)) (:%l x8632::fn))
    15611547  (jne :bad)
     
    19031889  (xorl (:%l valtype) (:%l valtype))
    19041890  (movl (:%l val) (:%l tag))
    1905   (andb (:$b x8632::tagmask) (:%b tag))
    1906   (cmpb (:$b x8632::tag-misc) (:%b tag))
     1891  (andl (:$b x8632::tagmask) (:%l tag))
     1892  (cmpl (:$b x8632::tag-misc) (:%l tag))
    19071893  (jne :have-tag)
    1908   (movb (:@ x8632::misc-subtag-offset (:%l val)) (:%b tag))
     1894  (movsbl (:@ x8632::misc-subtag-offset (:%l val)) (:%l tag))
    19091895  :have-tag
    1910   (cmpb (:$b x8632::subtag-istruct) (:%b tag))
     1896  (cmpl (:$b x8632::subtag-istruct) (:%l tag))
    19111897  (jne :do-compare)
    19121898  (movl (:@ x8632::misc-data-offset (:%l val)) (:%l valtype))
Note: See TracChangeset for help on using the changeset viewer.