Ignore:
Timestamp:
Sep 29, 2011, 9:52:16 AM (9 years ago)
Author:
gb
Message:

Do some cases of CASE (and similar constructs) in constant time by
using a jump table in the x86 backends. This -seems- to do the right
things (wrt stack discipline, multiple values, etc.) in all cases that
I've tried (including a handful of things in CCL itself); it can
currently be disabled by setting CCL::*X862-GENERATE-CASEJUMP* to NIL
before compiling.

Get the x86 disassembler to recognize and display jump tables.
Persuade it to print the instruction address in a comment after the
instruction. (We're a ways from being able to re-assemble disassembled
code on x86 for several other reasons, but I think that this makes the
disassembly a little easier to read.)

File:
1 edited

Legend:

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

    r14999 r15004  
    42174217  (movl (:@ (:% x8632::ebp)) (:% x8632::ebp)))
    42184218
    4219 (define-x8632-vinsn (cjmp :branch) (((reg :lisp))
    4220                                     ((reg :lisp)
     4219(define-x8632-vinsn (cjmp :branch) (((reg :s32))
     4220                                    ((reg :s32)
    42214221                                     (minval :s32const)
    42224222                                     (maxval :u32const)
    42234223                                     (default :label))
    4224                                     ((temp :s32)
    4225                                     (rjmp :lisp)))
    4226   (testl (:$l x8664::fixnummask) (:%l reg))
     4224                                    ((rjmp :lisp)))
     4225  (testl (:$l x8632::fixnummask) (:%l reg))
    42274226  (jne default)
    42284227  ((:not (:pred zerop minval))
     
    42304229  (cmpl (:$l maxval) (:%l reg))
    42314230  (ja default)
    4232   (movl (:%l reg) (:%l temp))
    4233   (movl (:@ (:^ :jtab) (:%l x8632::fn) (:%l temp)) (:%l temp))
    4234   (leal (:@ (:%l x8632::fn) (:%l temp)) (:%l rjmp))
     4231  (movl (:@ (:^ :jtab) (:%l x8632::fn) (:%l reg)) (:%l reg))
     4232  (leal (:@ (:%l x8632::fn) (:%l reg)) (:%l rjmp))
    42354233  (jmp (:%l rjmp))
    42364234  (:uuo-section)
Note: See TracChangeset for help on using the changeset viewer.