Changeset 7133


Ignore:
Timestamp:
Sep 4, 2007, 9:41:18 PM (12 years ago)
Author:
rme
Message:

Mildly hairy extract-tag vinsn, which tries to minimize insn length.
(Similar vinsns will do the same thing if this works.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/compiler/X86/X8632/x8632-vinsns.lisp

    r7114 r7133  
    406406  )
    407407
    408 ;;; note that NIL is just a distinguised CONS.
     408;;; note that NIL is just a distinguished CONS.
    409409;;; the tag formerly known as fulltag-nil is now
    410410;;; for tagged return addresses.
     
    570570                                 ((object :lisp)))
    571571  (movl (:%l object) (:%l tag))
    572   ((:pred <= (:apply %hard-regspec-value tag) x8632::ebx)
     572  ((:pred = (:apply %hard-regspec-value tag) x8632::al)
     573   ;; tag is the accumulator (2 bytes)
     574   (andb (:$b x8632::tagmask) (:%accb tag)))
     575  ((:and (:pred > (:apply %hard-regspec-value tag) x8632::al)
     576         (:pred <= (:apply %hard-regspec-value tag) x8632::bl))
     577   ;; tag is in a register whose low 8 bits can be accessed by byte
     578   ;; insns (3 bytes)
    573579   (andb (:$b x8632::tagmask) (:%b tag)))
    574580  ((:pred > (:apply %hard-regspec-value tag) x8632::ebx)
     581   ;; tag is somewhere else (6 bytes) (could use andw and get a length
     582   ;; of 5 bytes, but Intel's optimization manual advises avoiding
     583   ;; length-changing prefixes to change the size of immediates.
     584   ;; (section 3.4.2.3)
    575585   (andl (:$l x8632::tagmask) (:%l tag))))
    576586
     
    863873  (shrl (:$ub (- x8632::charcode-shift x8632::fixnumshift)) (:%l dest)))
    864874
     875(define-x8632-vinsn compare (()
     876                             ((x t)
     877                              (y t)))
     878  (rcmpl (:%l x) (:%l y)))
     879
    865880(define-x8632-vinsn negate-fixnum (((val :lisp))
    866881                                   ((val :imm)))
Note: See TracChangeset for help on using the changeset viewer.