Skip to content

Instantly share code, notes, and snippets.

@klauspost
Created December 25, 2015 10:24
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 klauspost/3ae5dd42dd4f53d59247 to your computer and use it in GitHub Desktop.
Save klauspost/3ae5dd42dd4f53d59247 to your computer and use it in GitHub Desktop.
//+build !appengine
package prefetch
func prefetchBS(b [][]byte)
// func prefetchBS(b [][]byte)
TEXT ·prefetchBS(SB), 7, $0
MOVQ b(FP), SI // SI: &b
MOVQ b_len+8(FP), DX // DX: len(b)
TESTQ DX, DX
JZ end
loop:
MOVQ (SI), AX // AX: b[0]
PREFETCHT0 (AX) // Prefetch first entry
ADDQ $24, SI // Move to next entry in b
SUBQ $1, DX // b--
JNZ loop
end:
RET
//+build !amd64 appengine
package prefetch
func prefetchBS(b [][]byte) {
// doest nothing on other platforms
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment