diff options
| author | Rob Pike <r@golang.org> | 2015-03-03 09:14:31 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2015-03-04 00:00:51 +0000 |
| commit | f05f273525e7547d5dd4ee17d97f53dd210bde97 (patch) | |
| tree | dcc313f34e6138f263caf4a96007fef0e378c6a0 /src/cmd/internal | |
| parent | d5f690609fd7ffd0d21b27f5a474052839beb0d3 (diff) | |
| download | go-f05f273525e7547d5dd4ee17d97f53dd210bde97.tar.xz | |
cmd/internal/obj: print g for the g register on arm and ppc64
The name g is an alias for R10 and R30, respectively. Have Rconv
print the alias, for consistency with the input language.
Change-Id: Ic3f40037884a0c8de5089d8c8a8efbcdc38c0d56
Reviewed-on: https://go-review.googlesource.com/6630
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/internal')
| -rw-r--r-- | src/cmd/internal/obj/arm/list5.go | 4 | ||||
| -rw-r--r-- | src/cmd/internal/obj/ppc64/list9.go | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/arm/list5.go b/src/cmd/internal/obj/arm/list5.go index 0625cffcf9..321c1f8583 100644 --- a/src/cmd/internal/obj/arm/list5.go +++ b/src/cmd/internal/obj/arm/list5.go @@ -105,6 +105,10 @@ func Rconv(r int) string { if r == 0 { return "NONE" } + if r == REGG { + // Special case. + return "g" + } if REG_R0 <= r && r <= REG_R15 { return fmt.Sprintf("R%d", r-REG_R0) } diff --git a/src/cmd/internal/obj/ppc64/list9.go b/src/cmd/internal/obj/ppc64/list9.go index f9de6f34a6..048928442a 100644 --- a/src/cmd/internal/obj/ppc64/list9.go +++ b/src/cmd/internal/obj/ppc64/list9.go @@ -122,6 +122,10 @@ func Rconv(r int) string { if r == 0 { return "NONE" } + if r == REGG { + // Special case. + return "g" + } if REG_R0 <= r && r <= REG_R31 { return fmt.Sprintf("R%d", r-REG_R0) } |
