Skip to content

Instantly share code, notes, and snippets.

@Shnatsel
Created December 18, 2022 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shnatsel/862cbed11b3d88fcea31db1633433b05 to your computer and use it in GitHub Desktop.
Save Shnatsel/862cbed11b3d88fcea31db1633433b05 to your computer and use it in GitHub Desktop.
.LBB10_8:
// /home/d22/bounds-check-cookbook/src/bin/fibvec_clever_indexing.rs : 16
fib[i] = fib[i-1] + fib[i-2]; // no more bounds checks!
ldu 8, 64(7)
ld 9, 8(7)
add 4, 8, 4
std 4, 16(7)
add 8, 9, 4
add 9, 4, 8
std 8, 24(7)
add 10, 8, 9
std 9, 32(7)
add 11, 9, 10
std 10, 40(7)
add 8, 10, 11
std 11, 48(7)
add 9, 11, 8
std 8, 56(7)
add 4, 8, 9
std 9, 64(7)
std 4, 72(7)
... // asm from other lines manually skipped
.LBB10_11:
// /home/d22/bounds-check-cookbook/src/bin/fibvec_clever_indexing.rs : 16
fib[i] = fib[i-1] + fib[i-2]; // no more bounds checks!
ldu 5, 8(3)
add 4, 5, 4
std 4, 16(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment