1
0
mirror of https://github.com/golang/go synced 2024-11-23 16:20:04 -07:00

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

This reverts commit da4abda2a1.

Change-Id: Ifd09b3dae0af0c7cef5fbbc332c63e78dc90d6b1
Reviewed-on: https://go-review.googlesource.com/3960
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Russ Cox 2015-02-05 10:23:26 +00:00
parent 98376204e8
commit cb4b28e013
5 changed files with 15 additions and 16 deletions

View File

@ -38,7 +38,7 @@
%union
{
Sym *sym;
int64 lval;
int32 lval;
double dval;
char sval[8];
Addr addr;
@ -460,20 +460,20 @@ fcon:
reglist:
spreg
{
$$ = 1ULL << $1;
$$ = 1 << $1;
}
| spreg '-' spreg
{
int i;
$$=0;
for(i=$1; i<=$3; i++)
$$ |= 1ULL<<i;
$$ |= 1<<i;
for(i=$3; i<=$1; i++)
$$ |= 1ULL<<i;
$$ |= 1<<i;
}
| spreg comma reglist
{
$$ = (1ULL<<$1) | $3;
$$ = (1<<$1) | $3;
}
gen:

View File

@ -204,7 +204,7 @@ typedef union YYSTYPE
#line 39 "a.y"
{
Sym *sym;
int64 lval;
int32 lval;
double dval;
char sval[8];
Addr addr;
@ -2223,7 +2223,7 @@ yyreduce:
case 64:
#line 462 "a.y"
{
(yyval.lval) = 1ULL << (yyvsp[(1) - (1)].lval);
(yyval.lval) = 1 << (yyvsp[(1) - (1)].lval);
}
break;
@ -2233,16 +2233,16 @@ yyreduce:
int i;
(yyval.lval)=0;
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++)
(yyval.lval) |= 1ULL<<i;
(yyval.lval) |= 1<<i;
}
break;
case 66:
#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;

View File

@ -149,7 +149,7 @@ typedef union YYSTYPE
#line 39 "a.y"
{
Sym *sym;
int64 lval;
int32 lval;
double dval;
char sval[8];
Addr addr;

View File

@ -1820,14 +1820,14 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na
switch(o->type) {
case 38: /* movm $con,oreg -> stm */
o1 = (0x4 << 25);
o1 |= (p->from.offset >> REG_R0) & 0xffff;
o1 |= p->from.offset & 0xffff;
o1 |= (p->to.reg&15) << 16;
aclass(ctxt, &p->to);
break;
case 39: /* movm oreg,$con -> ldm */
o1 = (0x4 << 25) | (1 << 20);
o1 |= (p->to.offset >> REG_R0) & 0xffff;
o1 |= p->to.offset & 0xffff;
o1 |= (p->from.reg&15) << 16;
aclass(ctxt, &p->from);
break;

View File

@ -222,8 +222,7 @@ RAconv(Fmt *fp)
{
char str[STRINGSZ];
Addr *a;
int i;
vlong v;
int i, v;
a = va_arg(fp->args, Addr*);
sprint(str, "GOK-reglist");
@ -233,7 +232,7 @@ RAconv(Fmt *fp)
break;
if(a->sym != nil)
break;
v = a->offset >> REG_R0;
v = a->offset;
strcpy(str, "");
for(i=0; i<NREG; i++) {
if(v & (1<<i)) {