Commit cb4b28e0 authored by Russ Cox's avatar Russ Cox

Revert "liblink, cmd/5a: fix reglist parsing/printing after changing REG_R0 to 32"

This reverts commit da4abda2.

Change-Id: Ifd09b3dae0af0c7cef5fbbc332c63e78dc90d6b1
Reviewed-on: https://go-review.googlesource.com/3960Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent 98376204
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
%union %union
{ {
Sym *sym; Sym *sym;
int64 lval; int32 lval;
double dval; double dval;
char sval[8]; char sval[8];
Addr addr; Addr addr;
...@@ -460,20 +460,20 @@ fcon: ...@@ -460,20 +460,20 @@ fcon:
reglist: reglist:
spreg spreg
{ {
$$ = 1ULL << $1; $$ = 1 << $1;
} }
| spreg '-' spreg | spreg '-' spreg
{ {
int i; int i;
$$=0; $$=0;
for(i=$1; i<=$3; i++) for(i=$1; i<=$3; i++)
$$ |= 1ULL<<i; $$ |= 1<<i;
for(i=$3; i<=$1; i++) for(i=$3; i<=$1; i++)
$$ |= 1ULL<<i; $$ |= 1<<i;
} }
| spreg comma reglist | spreg comma reglist
{ {
$$ = (1ULL<<$1) | $3; $$ = (1<<$1) | $3;
} }
gen: gen:
......
...@@ -204,7 +204,7 @@ typedef union YYSTYPE ...@@ -204,7 +204,7 @@ typedef union YYSTYPE
#line 39 "a.y" #line 39 "a.y"
{ {
Sym *sym; Sym *sym;
int64 lval; int32 lval;
double dval; double dval;
char sval[8]; char sval[8];
Addr addr; Addr addr;
...@@ -2223,7 +2223,7 @@ yyreduce: ...@@ -2223,7 +2223,7 @@ yyreduce:
case 64: case 64:
#line 462 "a.y" #line 462 "a.y"
{ {
(yyval.lval) = 1ULL << (yyvsp[(1) - (1)].lval); (yyval.lval) = 1 << (yyvsp[(1) - (1)].lval);
} }
break; break;
...@@ -2233,16 +2233,16 @@ yyreduce: ...@@ -2233,16 +2233,16 @@ yyreduce:
int i; int i;
(yyval.lval)=0; (yyval.lval)=0;
for(i=(yyvsp[(1) - (3)].lval); i<=(yyvsp[(3) - (3)].lval); i++) for(i=(yyvsp[(1) - (3)].lval); i<=(yyvsp[(3) - (3)].lval); i++)
(yyval.lval) |= 1ULL<<i; (yyval.lval) |= 1<<i;
for(i=(yyvsp[(3) - (3)].lval); i<=(yyvsp[(1) - (3)].lval); i++) for(i=(yyvsp[(3) - (3)].lval); i<=(yyvsp[(1) - (3)].lval); i++)
(yyval.lval) |= 1ULL<<i; (yyval.lval) |= 1<<i;
} }
break; break;
case 66: case 66:
#line 475 "a.y" #line 475 "a.y"
{ {
(yyval.lval) = (1ULL<<(yyvsp[(1) - (3)].lval)) | (yyvsp[(3) - (3)].lval); (yyval.lval) = (1<<(yyvsp[(1) - (3)].lval)) | (yyvsp[(3) - (3)].lval);
} }
break; break;
......
...@@ -149,7 +149,7 @@ typedef union YYSTYPE ...@@ -149,7 +149,7 @@ typedef union YYSTYPE
#line 39 "a.y" #line 39 "a.y"
{ {
Sym *sym; Sym *sym;
int64 lval; int32 lval;
double dval; double dval;
char sval[8]; char sval[8];
Addr addr; Addr addr;
......
...@@ -1820,14 +1820,14 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na ...@@ -1820,14 +1820,14 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na
switch(o->type) { switch(o->type) {
case 38: /* movm $con,oreg -> stm */ case 38: /* movm $con,oreg -> stm */
o1 = (0x4 << 25); o1 = (0x4 << 25);
o1 |= (p->from.offset >> REG_R0) & 0xffff; o1 |= p->from.offset & 0xffff;
o1 |= (p->to.reg&15) << 16; o1 |= (p->to.reg&15) << 16;
aclass(ctxt, &p->to); aclass(ctxt, &p->to);
break; break;
case 39: /* movm oreg,$con -> ldm */ case 39: /* movm oreg,$con -> ldm */
o1 = (0x4 << 25) | (1 << 20); o1 = (0x4 << 25) | (1 << 20);
o1 |= (p->to.offset >> REG_R0) & 0xffff; o1 |= p->to.offset & 0xffff;
o1 |= (p->from.reg&15) << 16; o1 |= (p->from.reg&15) << 16;
aclass(ctxt, &p->from); aclass(ctxt, &p->from);
break; break;
......
...@@ -222,8 +222,7 @@ RAconv(Fmt *fp) ...@@ -222,8 +222,7 @@ RAconv(Fmt *fp)
{ {
char str[STRINGSZ]; char str[STRINGSZ];
Addr *a; Addr *a;
int i; int i, v;
vlong v;
a = va_arg(fp->args, Addr*); a = va_arg(fp->args, Addr*);
sprint(str, "GOK-reglist"); sprint(str, "GOK-reglist");
...@@ -233,7 +232,7 @@ RAconv(Fmt *fp) ...@@ -233,7 +232,7 @@ RAconv(Fmt *fp)
break; break;
if(a->sym != nil) if(a->sym != nil)
break; break;
v = a->offset >> REG_R0; v = a->offset;
strcpy(str, ""); strcpy(str, "");
for(i=0; i<NREG; i++) { for(i=0; i<NREG; i++) {
if(v & (1<<i)) { if(v & (1<<i)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment