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/X8664/x8664-vinsns.lisp

    r14999 r15004  
    46324632  (movq (:@ (:%q x8664::rbp)) (:%q x8664::rbp)))
    46334633
    4634 (define-x8664-vinsn (cjmp :branch) (((reg :lisp))
    4635                                     ((reg :lisp)
     4634(define-x8664-vinsn (cjmp :branch) (((reg :s64))
     4635                                    ((reg :s64)
    46364636                                     (minval :s32const)
    46374637                                     (maxval :u32const)
    46384638                                     (default :label))
    4639                                     ((temp :s32)
    4640                                     (rjmp :lisp)))
     4639                                    ((rjmp :lisp)))
    46414640  (testl (:$l x8664::fixnummask) (:%l reg))
    46424641  (jne default)
     
    46454644  (cmpq (:$l maxval) (:%q reg))
    46464645  (ja default)
    4647   (movl (:%l reg) (:%l temp))
    4648   (shrl (:%l temp))
    4649   (movl (:@ (:^ :jtab) (:%q x8664::fn) (:%q temp)) (:%l temp))
    4650   (leaq (:@ (:%q x8664::fn) (:%q temp)) (:%q rjmp))
     4646  (shrl (:%l reg))
     4647  (movl (:@ (:^ :jtab) (:%q x8664::fn) (:%q reg)) (:%l reg))
     4648  (leaq (:@ (:%q x8664::fn) (:%q reg)) (:%q rjmp))
    46514649  (jmp (:%q rjmp))
    46524650  (:uuo-section)
     
    46544652  (:long (:apply 1+ (:apply ash maxval (- x8664::fixnumshift))))
    46554653  :jtab)
    4656 
    4657 
     4654 
    46584655
    46594656(define-x8664-vinsn jtabentry (()
Note: See TracChangeset for help on using the changeset viewer.