From 0ad332d80cf3e2bbeef5f1e5f5eb50272bbde92e Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 30 Oct 2018 12:58:50 -0700 Subject: cmd/compile: implement some moves using non-overlapping reads&writes For moves >8,<16 bytes, do a move using non-overlapping loads/stores if it would require no more instructions. This helps a bit with the case when the move is from a static constant, because then the code to materialize the value being moved is smaller. Change-Id: Ie47a5a7c654afeb4973142b0a9922faea13c9b54 Reviewed-on: https://go-review.googlesource.com/c/146019 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- test/codegen/strings.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/codegen/strings.go') diff --git a/test/codegen/strings.go b/test/codegen/strings.go index 39ee2e8b9f..d688b6cbf9 100644 --- a/test/codegen/strings.go +++ b/test/codegen/strings.go @@ -44,6 +44,18 @@ func ConstantLoad() { // 386:`MOVL\t\$858927408, \(`,`DUFFCOPY` // arm64:`MOVD\t\$3978425819141910832`,`MOVD\t\$1650538808`,`MOVD\t\$25699`,`MOVD\t\$101` bsink = []byte("0123456789abcde") + + // 56 = 0x38 + // amd64:`MOVQ\t\$3978425819141910832`,`MOVB\t\$56` + bsink = []byte("012345678") + + // 14648 = 0x3938 + // amd64:`MOVQ\t\$3978425819141910832`,`MOVW\t\$14648` + bsink = []byte("0123456789") + + // 1650538808 = 0x62613938 + // amd64:`MOVQ\t\$3978425819141910832`,`MOVL\t\$1650538808` + bsink = []byte("0123456789ab") } var bsink []byte -- cgit v1.3