Skip to content

Commit

Permalink
Add more comments for the asm workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeltao committed Apr 29, 2016
1 parent ec64241 commit 6ffc20e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions encode_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@

#include "textflag.h"

// TODO: figure out why the XXX lines compile with Go 1.4 and Go tip but not
// Go 1.6.
// The XXX lines assemble on Go 1.4, 1.5 and 1.7, but not 1.6, due to a
// Go toolchain regression. See https://github.com/golang/go/issues/15426 and
// https://github.com/golang/snappy/issues/29
//
// This is https://github.com/golang/snappy/issues/29
// As a workaround, the package was built with a known good assembler, and
// those instructions were disassembled by "objdump -d" to yield the
// 4e 0f b7 7c 5c 78 movzwq 0x78(%rsp,%r11,2),%r15
// style comments, in AT&T asm syntax. Note that rsp here is a physical
// register, not Go/asm's SP pseudo-register (see https://golang.org/doc/asm).
// The instructions were then encoded as "BYTE $0x.." sequences, which assemble
// fine on Go 1.6.

// The asm code generally follows the pure Go code in encode_other.go, except
// where marked with a "!!!".
Expand Down
Binary file added snappy.test
Binary file not shown.

0 comments on commit 6ffc20e

Please sign in to comment.