]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.cc] liblink, cmd/internal/obj: fix printing of TYPE_REGREG and TYPE_REGREG2
authorRuss Cox <rsc@golang.org>
Thu, 12 Feb 2015 02:16:00 +0000 (21:16 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 12 Feb 2015 03:15:41 +0000 (03:15 +0000)
Now:

0x0000 00000 (/tmp/x.s:2) MULLU R6,R3,(R7, R6)

The space is a little odd but I'd rather fix the usual printing to add spaces
than delete that one. But in a different CL, once C is gone.

Change-Id: I344e0b06eedaaf53cd79d370fa13c444a1e69c81
Reviewed-on: https://go-review.googlesource.com/4647
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/internal/obj/arm/list5.go
src/liblink/list5.c

index c37a563621a28e7f8a05da272e83d9bd8662ffc7..9986d14931803fee9cc6047415d97deed764d29b 100644 (file)
@@ -190,7 +190,12 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
 
        case obj.TYPE_SCONST:
                str = fmt.Sprintf("$\"%q\"", a.U.Sval)
-               break
+
+       case obj.TYPE_REGREG:
+               str = fmt.Sprintf("(%v, %v)", Rconv(int(a.Reg)), Rconv(int(a.Offset)))
+
+       case obj.TYPE_REGREG2:
+               str = fmt.Sprintf("%v, %v", Rconv(int(a.Reg)), Rconv(int(a.Offset)))
        }
 
        fp += str
index 3d3e8e7d122853ba91d3b833e73fd1f79fb87b26..bca10f6899d9755e056928e164673beb6c7cf156 100644 (file)
@@ -213,6 +213,14 @@ Dconv(Fmt *fp)
        case TYPE_SCONST:
                sprint(str, "$\"%$\"", a->u.sval);
                break;
+       
+       case TYPE_REGREG:
+               sprint(str, "(%R, %R)", a->reg, (int)a->offset);
+               break;
+       
+       case TYPE_REGREG2:
+               sprint(str, "%R, %R", a->reg, (int)a->offset);
+               break;
        }
        return fmtstrcpy(fp, str);
 }