mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add support for arm64 bit-test instructions
Add support for generating TBZ/TBNZ instructions. The bit-test-and-branch pattern shows up in a number of important places, including the runtime (gc bitmaps). Before this change, there were 3 TB[N]?Z instructions in the Go tool, all of which were in hand-written assembly. After this change, there are 285. Also, the go1 benchmark binary gets about 4.5kB smaller. Fixes #21361 Change-Id: I170c138b852754b9b8df149966ca5e62e6dfa771 Reviewed-on: https://go-review.googlesource.com/54470 Run-TryBot: Philip Hofer <phofer@umich.edu> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
583a941d4e
commit
c59b495963
15 changed files with 743 additions and 50 deletions
|
|
@ -512,10 +512,12 @@ func init() {
|
|||
{name: "ULE"},
|
||||
{name: "UGT"},
|
||||
{name: "UGE"},
|
||||
{name: "Z"}, // Control == 0 (take a register instead of flags)
|
||||
{name: "NZ"}, // Control != 0
|
||||
{name: "ZW"}, // Control == 0, 32-bit
|
||||
{name: "NZW"}, // Control != 0, 32-bit
|
||||
{name: "Z"}, // Control == 0 (take a register instead of flags)
|
||||
{name: "NZ"}, // Control != 0
|
||||
{name: "ZW"}, // Control == 0, 32-bit
|
||||
{name: "NZW"}, // Control != 0, 32-bit
|
||||
{name: "TBZ"}, // Control & (1 << Aux.(int64)) == 0
|
||||
{name: "TBNZ"}, // Control & (1 << Aux.(int64)) != 0
|
||||
}
|
||||
|
||||
archs = append(archs, arch{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue