Paste: stuff

Author: slava
Mode: c
Date: Wed, 29 Apr 2009 04:58:35
Plain Text |
#1:

if(x & 7 == 6)
    x = get(x & ~7)
else
    x = (x & 7) << 3

#2:

if(x & 7 == 6)
    x = get(x & ~7)
else if(x & 7 == 7)
    x = get((x & ~7) + 4)
else
    x = (x & 7) << 3

// get(addr) is just a word-size memory load

Annotation: asm

Author: pruned
Mode: factor
Date: Wed, 29 Apr 2009 05:12:13
Plain Text |
mov r1, x
mov r2, x -- not needed if you can stomp it
and  r2, BYTE ~7
and  r1, 7
cmp  r1, %tag
cmove r2, class_%tag_addr ; *(void*)(class_6_addr) == %tag << 3
mov  r3, [r2]

Annotation: rice

Author: slava
Mode: factor
Date: Wed, 29 Apr 2009 05:18:20
Plain Text |
mov r1, x
mov r2, x
and  r1, 7
cmp  r1, 6
cmovne r2, lo_tag_map
sub  r2, r1
mov  r3, [r2]

Annotation: breaking a dep

Author: pruned
Mode: factor
Date: Wed, 29 Apr 2009 05:51:25
Plain Text |
mov  r1, x
mov  r2, x
 and  r1, 7
mov  r3, r1
 cmp  r1, %tag
cmovne r2, lo_tag_map
 neg  r3
mov  r4, [r2+r3]

Annotation: for #2

Author: pruned
Mode: factor
Date: Wed, 29 Apr 2009 06:42:43
Plain Text |
mov  r1, x
mov  r2, x
 and  r1, 7
mov  r3, r1
 cmp  r1, %tag
cmovne r2, lo_tag_map
 sub r3, 7
sar  r3, 31  ; -1 or 0 if tag=7
 sub r2, r1
mov  r4, [r2+r3*4+4]

New Annotation

Summary:
Author:
Mode:
Body: