aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/i386/list8.go22
-rw-r--r--src/cmd/internal/obj/x86/list6.go14
2 files changed, 12 insertions, 24 deletions
diff --git a/src/cmd/internal/obj/i386/list8.go b/src/cmd/internal/obj/i386/list8.go
index 087da7e4d0..33dfea44ad 100644
--- a/src/cmd/internal/obj/i386/list8.go
+++ b/src/cmd/internal/obj/i386/list8.go
@@ -59,6 +59,12 @@ func Pconv(p *obj.Prog) string {
default:
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%v", p.Pc, p.Line(), Aconv(int(p.As)), Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
+ // TODO(rsc): This special case is for SHRQ $32, AX:DX, which encodes as
+ // SHRQ $32(DX*0), AX
+ // Remove.
+ if (p.From.Type == obj.TYPE_REG || p.From.Type == obj.TYPE_CONST) && p.From.Index != 0 {
+ str += fmt.Sprintf(":%s", Rconv(int(p.From.Index)))
+ }
break
}
@@ -97,14 +103,6 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
str = fmt.Sprintf("%v", Rconv(int(a.Reg)))
- // TODO(rsc): This special case is for SHRQ $32, AX:DX, which encodes as
- // SHRQ $32(DX*0), AX
- // Remove.
- if a.Index != REG_NONE {
- s = fmt.Sprintf("(%v*%d)", Rconv(int(a.Index)), int(a.Scale))
- str += s
- }
-
case obj.TYPE_BRANCH:
if a.Sym != nil {
str = fmt.Sprintf("%s(SB)", a.Sym.Name)
@@ -158,14 +156,6 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
case obj.TYPE_CONST:
str = fmt.Sprintf("$%d", a.Offset)
- // TODO(rsc): This special case is for SHRQ $32, AX:DX, which encodes as
- // SHRQ $32(DX*0), AX
- // Remove.
- if a.Index != REG_NONE {
- s = fmt.Sprintf("(%v*%d)", Rconv(int(a.Index)), int(a.Scale))
- str += s
- }
-
case obj.TYPE_TEXTSIZE:
if a.U.Argsize == obj.ArgsSizeUnknown {
str = fmt.Sprintf("$%d", a.Offset)
diff --git a/src/cmd/internal/obj/x86/list6.go b/src/cmd/internal/obj/x86/list6.go
index c782f6387a..af10f38ef0 100644
--- a/src/cmd/internal/obj/x86/list6.go
+++ b/src/cmd/internal/obj/x86/list6.go
@@ -71,6 +71,12 @@ func Pconv(p *obj.Prog) string {
default:
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%v", p.Pc, p.Line(), Aconv(int(p.As)), Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
+ // TODO(rsc): This special case is for SHRQ $32, AX:DX, which encodes as
+ // SHRQ $32(DX*0), AX
+ // Remove.
+ if (p.From.Type == obj.TYPE_REG || p.From.Type == obj.TYPE_CONST) && p.From.Index != 0 {
+ str += fmt.Sprintf(":%s", Rconv(int(p.From.Index)))
+ }
break
}
@@ -162,14 +168,6 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
case obj.TYPE_CONST:
str = fmt.Sprintf("$%d", a.Offset)
- // TODO(rsc): This special case is for SHRQ $32, AX:DX, which encodes as
- // SHRQ $32(DX*0), AX
- // Remove.
- if a.Index != REG_NONE {
- s = fmt.Sprintf("(%v*%d)", Rconv(int(a.Index)), int(a.Scale))
- str += s
- }
-
case obj.TYPE_TEXTSIZE:
if a.U.Argsize == obj.ArgsSizeUnknown {
str = fmt.Sprintf("$%d", a.Offset)