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
}
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)
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)
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
}
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)
default:
sprint(str, "%.5lld (%L) %A %D,%D",
p->pc, p->lineno, p->as, &p->from, &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 == TYPE_REG || p->from.type == TYPE_CONST) && p->from.index != REG_NONE)
+ sprint(strchr(str, 0), ":%R", p->from.index);
break;
}
bigP = nil;
case TYPE_CONST:
sprint(str, "$%lld", 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) {
- sprint(s, "(%R*%d)", (int)a->index, (int)a->scale);
- strcat(str, s);
- }
break;
case TYPE_TEXTSIZE:
default:
sprint(str, "%.5lld (%L) %A %D,%D",
p->pc, p->lineno, p->as, &p->from, &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 == TYPE_REG || p->from.type == TYPE_CONST) && p->from.index != 0)
+ sprint(strchr(str, 0), ":%R", p->from.index);
break;
}
bigP = nil;
break;
}
sprint(str, "%R", 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) {
- sprint(s, "(%R*%d)", (int)a->index, (int)a->scale);
- strcat(str, s);
- }
break;
case TYPE_BRANCH:
case TYPE_CONST:
sprint(str, "$%lld", 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) {
- sprint(s, "(%R*%d)", (int)a->index, (int)a->scale);
- strcat(str, s);
- }
break;
case TYPE_TEXTSIZE: