]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: omit redundant sign/unsign extension on arm64
authorruinan <ruinan.sun@arm.com>
Thu, 18 Aug 2022 01:31:57 +0000 (01:31 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 28 Feb 2023 03:16:44 +0000 (03:16 +0000)
commit4d180f71dca041a39b50b9dec8a0ebec5cc02b90
treede718da37f917630d4dab3620a23fba111fbee52
parentdd16258f48bc9e328ef2086a49da0432fe46f413
cmd/compile: omit redundant sign/unsign extension on arm64

On Arm64, all 32-bit instructions will ignore the upper 32 bits and
clear them to zero for the result. No need to do an unsign extend before
a 32 bit op.

This CL removes the redundant unsign extension only for the existing
32-bit opcodes, and also omits the sign extension when the upper bit of
the result can be predicted.

Fixes #42162

Change-Id: I61e6670bfb8982572430e67a4fa61134a3ea240a
CustomizedGitHooks: yes
Reviewed-on: https://go-review.googlesource.com/c/go/+/427454
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Eric Fang <eric.fang@arm.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Eric Fang <eric.fang@arm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/ssa/_gen/ARM64.rules
src/cmd/compile/internal/ssa/_gen/ARM64Ops.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteARM64.go
test/codegen/noextend.go