diff --git a/decode_test.go b/decode_test.go index 318ffe5..e71bb1c 100644 --- a/decode_test.go +++ b/decode_test.go @@ -78,9 +78,9 @@ func TestDec16blk8(t *testing.T) { } n, _ := Base{bit: 8}.EncodeLen(32) out := make([]byte, n) - enc16blk8(0x2333, in[:], out) + enc16blk8(0x1100, in[:], out) t.Log(out) - dec16blk8(0x2333, out[:], tmp[:]) + dec16blk8(0x1100, out[:], tmp[:]) assert.Equal(t, in, tmp) } diff --git a/encode_amd64.s b/encode_amd64.s index f735295..61691c6 100644 --- a/encode_amd64.s +++ b/encode_amd64.s @@ -146,8 +146,9 @@ TEXT ·enc16blk8(SB), NOSPLIT, $0-56 CLD lop: LODSB + ANDW $0xff, AX // add mask - LEAW 0(AX)(BX*1), AX + ADDW BX, AX RORW $8, AX STOSW LOOP lop