Slide 7
Slide 7 text
BASIC BLOCKS
simple interfaces make complex
algorithms simple
programs are mostly linear
- until we hit a {br, jmp, ret}
- linear chunks a.k.a "basic blocks"
surprised by performance from a "clean"
implementation
- 25-50x slowdown over native
// Execute a basic block
for _, v := range bb {
v.Executor(c)
}
0x00400de8 .... ldr w4, [x2] #4
0x00400dec .... movz w3, #0xa121
0x00400df0 .... add w1, w1, #0x1
0x00400df4 .... movk w3, #0x7, lsl #16
0x00400df8 .... eor w4, w1, w4
0x00400dfc .... cmp w1, w3
0x00400e00 .... eor w19, w19, w4
0x00400e04 .... b.ne 400de8
6