DISQUS

Phil Dawes' Stuff: Searching arrays in X86 assembler with a bloom filter pt 3

  • Anonymous · 1 year ago
    You can shift by the contents of the CL register, e.g. shl %cl, %eax .
  • Asm · 1 year ago
    Variable shifts have the count in %cl.

    But why bother? bt r,r and bt r,i are only 1 uop on a Core2. Check the instruction timings here: http://www.agner.org/optimize/

    Use mov (%eax,%edi,4), %edi and drop the shl $0x2, %edi.
  • Phil Dawes · 1 year ago
    @Asm - thanks for the link, that's a handy resource
  • Phil Dawes · 1 year ago
    Slava Pestov wrote:
    > Hi Phil,
    >
    > I couldn't post a comment on your blog for some reason so I'm posting
    > this to the list instead.
    >
    > The seq>hash word you write already exists in the sets vocabulary, its
    > called unique.
    >
    > And (prepare-filter) looks nicer if you use fry:
    >
    > : (prepare-filter) ( filter seq -- )
    > '[ 1048576 mod _ set-bit ] each ;
    >
    > Slava