mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj: reduce per-architecture opcode space
s390x took up the last available chunk of int16 opcodes. There are RISC-V and sparc64 ports in progress out of tree, and there will likely be other architectures. Reduce the opcode space to allow more architectures to fit without increasing to int32. This is the smallest power of two that accomodates all existing architectures. All else being equal, smaller is better--smaller numbers are easier to generate immediates for and easier on the eyes when debugging. Change-Id: I4d0824b28913892fbd0579d3f90bea34e44c8946 Reviewed-on: https://go-review.googlesource.com/24223 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
b4e9f70412
commit
9b88fac00c
1 changed files with 2 additions and 2 deletions
|
|
@ -300,7 +300,7 @@ const (
|
|||
// Subspaces are aligned to a power of two so opcodes can be masked
|
||||
// with AMask and used as compact array indices.
|
||||
const (
|
||||
ABase386 = (1 + iota) << 12
|
||||
ABase386 = (1 + iota) << 10
|
||||
ABaseARM
|
||||
ABaseAMD64
|
||||
ABasePPC64
|
||||
|
|
@ -308,7 +308,7 @@ const (
|
|||
ABaseMIPS64
|
||||
ABaseS390X
|
||||
|
||||
AllowedOpCodes = 1 << 12 // The number of opcodes available for any given architecture.
|
||||
AllowedOpCodes = 1 << 10 // The number of opcodes available for any given architecture.
|
||||
AMask = AllowedOpCodes - 1 // AND with this to use the opcode as an array index.
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue