Skip to content

Instantly share code, notes, and snippets.

@kimwalisch
Created November 9, 2015 21:01
Show Gist options
  • Select an option

  • Save kimwalisch/df939440b89081c39f6a to your computer and use it in GitHub Desktop.

Select an option

Save kimwalisch/df939440b89081c39f6a to your computer and use it in GitHub Desktop.
primesieve inner sieving loop
; primesieve inner sieving loop
; Uses only 11 instructions (x86-64) to cross-off the next 8 multiples
.L99:
andb $-3, (%rax)
andb $-9, (%rax,%r14)
andb $127, (%rax,%r12)
andb $-33, (%rax,%rbp)
andb $-2, (%rax,%r10)
andb $-65, (%rax,%rbx)
andb $-5, (%rax,%r9)
andb $-17, (%rax,%r11)
addq %r13, %rax
cmpq %rdi, %rax
jb .L99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment