aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-08-21 10:03:07 -0700
committerKeith Randall <khr@golang.org>2023-08-21 20:52:15 +0000
commit0b47b94a6275b0d0830e5ce7a03aaa99430f7f76 (patch)
tree1602dd02a1679eb7e7f2822c60b784a532fef636 /test/codegen
parenta9bedc36a53f9d4ff6ab1c1a43c900c2fc8eba84 (diff)
downloadgo-0b47b94a6275b0d0830e5ce7a03aaa99430f7f76.tar.gz
go-0b47b94a6275b0d0830e5ce7a03aaa99430f7f76.zip
cmd/compile: remove more extension ops when not needed
If we're not using the upper bits, don't bother issuing a sign/zero extension operation. For arm64, after CL 520916 which fixed a correctness bug with extensions but as a side effect leaves many unnecessary ones still in place. Change-Id: I5f4fe4efbf2e9f80969ab5b9a6122fb812dc2ec0 Reviewed-on: https://go-review.googlesource.com/c/go/+/521496 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/noextend.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/codegen/noextend.go b/test/codegen/noextend.go
index 61c98a796a..98ad0ece89 100644
--- a/test/codegen/noextend.go
+++ b/test/codegen/noextend.go
@@ -279,3 +279,8 @@ func shouldSignEXT(x int) int64 {
return ret
}
+
+func noIntermediateExtension(a, b, c uint32) uint32 {
+ // arm64:-"MOVWU"
+ return a*b*9 + c
+}