]> Cypherpunks repositories - gostls13.git/commit
test: adjust load and store test
authorWayne Zuo <wdvxdr@golangcn.org>
Mon, 4 Apr 2022 08:32:29 +0000 (16:32 +0800)
committerKeith Randall <khr@golang.org>
Mon, 11 Apr 2022 15:41:04 +0000 (15:41 +0000)
commit615d3c304077f1f3ca249151fb87d7d7a802cab2
tree67805b839bcd1af27578102d83db94860fde64fe
parenta6f6932b3ee87d9607ce246228e23f9a08dacc31
test: adjust load and store test

In the load tests, we only want to test the assembly produced by
the load operations. If we use the global variable sink, it will produce
one load operation and one store operation(assign to sink).

For example:

func load_be64(b []byte) uint64 {
sink64 = binary.BigEndian.Uint64(b)
}

If we compile this function with GOAMD64=v3, it may produce MOVBEQload
and MOVQstore or MOVQload and MOVBEQstore, but we only want MOVBEQload.
Discovered when developing CL 395474.

Same for the store tests.

Change-Id: I65c3c742f1eff657c3a0d2dd103f51140ae8079e
Reviewed-on: https://go-review.googlesource.com/c/go/+/397875
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
test/codegen/memcombine.go