mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj: switch to one global Aconv
Aconv is the pretty-printer for instruction opcodes like AMOVQ. There was one for each architecture. Make the space of A names have a different region for each architecture, much as we did for the registers, so a single global Aconv function can do the work. Each architecture registers its region as a slice of names at a given offset. The global names like CALL and JMP are now defined only once. The A values are used for indexing tables, so make it easy to do the indexing by making the offset maskable. Remove a bunch of now-duplicated architecture-specific code. Change-Id: Ib15647b7145a1c089e21e36543691a19e146b60e Reviewed-on: https://go-review.googlesource.com/6620 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
91e7ca588d
commit
74e88dfdee
24 changed files with 560 additions and 625 deletions
|
|
@ -424,6 +424,10 @@ const (
|
|||
// These are the portable opcodes, common to all architectures.
|
||||
// Each architecture defines many more arch-specific opcodes,
|
||||
// with values starting at A_ARCHSPECIFIC.
|
||||
// Each architecture adds an offset to this so each machine has
|
||||
// distinct space for its instructions. The offset is a power of
|
||||
// two so it can be masked to return to origin zero.
|
||||
// See the definitions of ABase386 etc.
|
||||
const (
|
||||
AXXX = 0 + iota
|
||||
ACALL
|
||||
|
|
@ -570,30 +574,4 @@ const (
|
|||
LinkExternal
|
||||
)
|
||||
|
||||
// asm5.c
|
||||
|
||||
// asm6.c
|
||||
|
||||
// asm8.c
|
||||
|
||||
// asm9.c
|
||||
|
||||
// data.c
|
||||
|
||||
// go.c
|
||||
|
||||
// ld.c
|
||||
|
||||
// list[5689].c
|
||||
|
||||
// obj.c
|
||||
|
||||
// objfile.c
|
||||
|
||||
// pass.c
|
||||
|
||||
// pcln.c
|
||||
|
||||
// sym.c
|
||||
|
||||
var linkbasepointer int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue