go/src/crypto/md5
Garrett Bodley 1e0cba8ee1 crypto/md5: Avo port of md5block_amd64.s
This implementation utilizes the same registers found in the reference
implementation, aiming to produce a minimal semantic diff between the
Avo-generated output and the original hand-written assembly.

To verify the Avo implementation, the reference and Avo-generated
assembly files are fed to `go tool asm`, capturing the debug output into
corresponding temp files. The debug output contains supplementary
metadata (line numbers, instruction offsets, and source file references)
that must be removed in order to obtain a semantic diff of the two
files. This is accomplished via a small utility script written in awk.

Metadata not found in the reference assembly file has been added to one
parameter symbol, resulting in a single line diff.

Commands used to verify Avo output:

GOROOT=$(go env GOROOT)
ASM_PATH="src/crypto/md5/md5block_amd64.s"
REFERENCE="54fe0fd43fcf8609666c16ae6d15ed92873b1564"

go tool asm -o /dev/null -I "$GOROOT"/src/runtime -debug \
  <(git cat-file -p "$REFERENCE:$ASM_PATH") \
  > /tmp/reference.s

go tool asm -o /dev/null -I "$GOROOT"/src/runtime -debug \
  "$ASM_PATH" \
  > /tmp/avo.s

normalize(){
  awk '{
    $1=$2=$3="";
    print substr($0,4)
  }'
}

diff <(normalize < /tmp/reference.s) <(normalize < /tmp/avo.s)

3c3
< MOVQ p+8(FP), SI
---
> MOVQ p_base+8(FP), SI

Change-Id: Ifecc84fd0f5a39a88350e6eaffb45ed3fdacf2fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/599935
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-09-04 20:36:18 +00:00
..
_asm crypto/md5: Avo port of md5block_amd64.s 2024-09-04 20:36:18 +00:00
example_test.go
gen.go crypto: replace encoding/binary in favour of internal/byteorder 2024-05-13 18:57:38 +00:00
md5.go crypto: implement encoding.BinaryAppender for all crypto hashes 2024-08-01 14:57:46 +00:00
md5_test.go all: omit unnecessary 0 in slice expression 2024-09-03 20:55:15 +00:00
md5block.go crypto: replace encoding/binary in favour of internal/byteorder 2024-05-13 18:57:38 +00:00
md5block_386.s
md5block_amd64.s crypto/md5: Avo port of md5block_amd64.s 2024-09-04 20:36:18 +00:00
md5block_arm.s
md5block_arm64.s
md5block_decl.go crypto/md5: implement md5block in hardware on loong64 2024-08-22 01:18:23 +00:00
md5block_generic.go crypto/md5: implement md5block in hardware on loong64 2024-08-22 01:18:23 +00:00
md5block_loong64.s crypto/md5: implement md5block in hardware on loong64 2024-08-22 01:18:23 +00:00
md5block_ppc64x.s ppc64x: code cleanup in assembly files 2024-05-20 18:05:32 +00:00
md5block_s390x.s