From f05f273525e7547d5dd4ee17d97f53dd210bde97 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 3 Mar 2015 09:14:31 -0800 Subject: 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 Reviewed-by: Russ Cox --- src/cmd/internal/obj/arm/list5.go | 4 ++++ src/cmd/internal/obj/ppc64/list9.go | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/cmd/internal/obj') 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) } -- cgit v1.3-5-g9baa