Commit 3ac37c72 authored by Russ Cox's avatar Russ Cox

liblink: place DATA size in from3.offset always

Like the TEXT/GLOBL flags, this was split between from.scale and reg,
neither of which is appropriate.

Change-Id: I2a16ef066a53b6edb7afb16cce108c0d1d26389c
Reviewed-on: https://go-review.googlesource.com/3576Reviewed-by: default avatarAram Hăvărneanu <aram@mgk.ro>
Reviewed-by: default avatarAustin Clements <austin@google.com>
parent 76fed542
......@@ -598,7 +598,6 @@ struct LinkArch
void (*preprocess)(Link*, LSym*);
void (*assemble)(Link*, LSym*);
int (*datasize)(Prog*);
void (*follow)(Link*, LSym*);
int (*iscall)(Prog*);
int (*isdata)(Prog*);
......
......@@ -248,7 +248,11 @@ inst:
*/
| LTYPEC name '/' con ',' ximm
{
outcode($1, Always, &$2, $4, &$6);
outcode($1, Always, &$2, 0, &$6);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = $4;
}
}
/*
* CASE
......
......@@ -577,17 +577,17 @@ static const yytype_uint16 yyrline[] =
0, 68, 68, 70, 69, 77, 76, 85, 90, 96,
97, 98, 104, 108, 112, 119, 126, 133, 137, 144,
151, 158, 165, 172, 181, 193, 197, 201, 208, 215,
220, 232, 237, 249, 256, 263, 270, 274, 278, 282,
289, 311, 319, 328, 335, 344, 355, 361, 364, 368,
373, 374, 377, 383, 394, 400, 406, 412, 419, 425,
430, 436, 439, 445, 453, 457, 466, 472, 473, 474,
475, 480, 486, 492, 498, 499, 502, 503, 511, 520,
521, 530, 531, 537, 540, 541, 542, 544, 552, 560,
569, 575, 581, 587, 595, 601, 609, 610, 614, 622,
623, 629, 630, 638, 639, 642, 648, 656, 664, 672,
682, 685, 689, 695, 696, 697, 700, 701, 705, 709,
713, 717, 723, 726, 732, 733, 737, 741, 745, 749,
753, 757, 761, 765, 769
220, 232, 237, 249, 260, 267, 274, 278, 282, 286,
293, 315, 323, 332, 339, 348, 359, 365, 368, 372,
377, 378, 381, 387, 398, 404, 410, 416, 423, 429,
434, 440, 443, 449, 457, 461, 470, 476, 477, 478,
479, 484, 490, 496, 502, 503, 506, 507, 515, 524,
525, 534, 535, 541, 544, 545, 546, 548, 556, 564,
573, 579, 585, 591, 599, 605, 613, 614, 618, 626,
627, 633, 634, 642, 643, 646, 652, 660, 668, 676,
686, 689, 693, 699, 700, 701, 704, 705, 709, 713,
717, 721, 727, 730, 736, 737, 741, 745, 749, 753,
757, 761, 765, 769, 773
};
#endif
......@@ -1972,54 +1972,58 @@ yyreduce:
case 33:
#line 250 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), Always, &(yyvsp[(2) - (6)].addr), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].addr));
outcode((yyvsp[(1) - (6)].lval), Always, &(yyvsp[(2) - (6)].addr), 0, &(yyvsp[(6) - (6)].addr));
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = (yyvsp[(4) - (6)].lval);
}
}
break;
case 34:
#line 257 "a.y"
#line 261 "a.y"
{
outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &(yyvsp[(3) - (4)].addr), 0, &nullgen);
}
break;
case 35:
#line 264 "a.y"
#line 268 "a.y"
{
outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, 0, &(yyvsp[(3) - (3)].addr));
}
break;
case 36:
#line 271 "a.y"
#line 275 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].addr), 0, &(yyvsp[(5) - (5)].addr));
}
break;
case 37:
#line 275 "a.y"
#line 279 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].addr), 0, &(yyvsp[(5) - (5)].addr));
}
break;
case 38:
#line 279 "a.y"
#line 283 "a.y"
{
outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].addr), (yyvsp[(5) - (7)].lval), &(yyvsp[(7) - (7)].addr));
}
break;
case 39:
#line 283 "a.y"
#line 287 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr).reg, &nullgen);
}
break;
case 40:
#line 290 "a.y"
#line 294 "a.y"
{
Addr g;
......@@ -2041,14 +2045,14 @@ yyreduce:
break;
case 41:
#line 312 "a.y"
#line 316 "a.y"
{
outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].addr), (yyvsp[(5) - (7)].addr).reg, &(yyvsp[(7) - (7)].addr));
}
break;
case 42:
#line 320 "a.y"
#line 324 "a.y"
{
(yyvsp[(7) - (9)].addr).type = TYPE_REGREG2;
(yyvsp[(7) - (9)].addr).offset = (yyvsp[(9) - (9)].lval);
......@@ -2057,14 +2061,14 @@ yyreduce:
break;
case 43:
#line 329 "a.y"
#line 333 "a.y"
{
outcode((yyvsp[(1) - (2)].lval), Always, &(yyvsp[(2) - (2)].addr), 0, &nullgen);
}
break;
case 44:
#line 336 "a.y"
#line 340 "a.y"
{
if((yyvsp[(2) - (4)].addr).type != TYPE_CONST || (yyvsp[(4) - (4)].addr).type != TYPE_CONST)
yyerror("arguments to PCDATA must be integer constants");
......@@ -2073,7 +2077,7 @@ yyreduce:
break;
case 45:
#line 345 "a.y"
#line 349 "a.y"
{
if((yyvsp[(2) - (4)].addr).type != TYPE_CONST)
yyerror("index for FUNCDATA must be integer constant");
......@@ -2084,35 +2088,35 @@ yyreduce:
break;
case 46:
#line 356 "a.y"
#line 360 "a.y"
{
outcode((yyvsp[(1) - (2)].lval), Always, &nullgen, 0, &nullgen);
}
break;
case 47:
#line 361 "a.y"
#line 365 "a.y"
{
(yyval.lval) = Always;
}
break;
case 48:
#line 365 "a.y"
#line 369 "a.y"
{
(yyval.lval) = ((yyvsp[(1) - (2)].lval) & ~C_SCOND) | (yyvsp[(2) - (2)].lval);
}
break;
case 49:
#line 369 "a.y"
#line 373 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (2)].lval) | (yyvsp[(2) - (2)].lval);
}
break;
case 52:
#line 378 "a.y"
#line 382 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_BRANCH;
......@@ -2121,7 +2125,7 @@ yyreduce:
break;
case 53:
#line 384 "a.y"
#line 388 "a.y"
{
(yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
(yyval.addr) = nullgen;
......@@ -2133,7 +2137,7 @@ yyreduce:
break;
case 54:
#line 395 "a.y"
#line 399 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (1)].lval);
......@@ -2142,7 +2146,7 @@ yyreduce:
break;
case 55:
#line 401 "a.y"
#line 405 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (2)].lval);
......@@ -2151,7 +2155,7 @@ yyreduce:
break;
case 56:
#line 407 "a.y"
#line 411 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (3)].lval);
......@@ -2160,7 +2164,7 @@ yyreduce:
break;
case 57:
#line 413 "a.y"
#line 417 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (4)].lval);
......@@ -2169,7 +2173,7 @@ yyreduce:
break;
case 58:
#line 420 "a.y"
#line 424 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_CONST;
......@@ -2178,7 +2182,7 @@ yyreduce:
break;
case 59:
#line 426 "a.y"
#line 430 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
(yyval.addr).type = TYPE_CONST;
......@@ -2186,7 +2190,7 @@ yyreduce:
break;
case 60:
#line 431 "a.y"
#line 435 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SCONST;
......@@ -2195,7 +2199,7 @@ yyreduce:
break;
case 62:
#line 440 "a.y"
#line 444 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2204,7 +2208,7 @@ yyreduce:
break;
case 63:
#line 446 "a.y"
#line 450 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2213,14 +2217,14 @@ yyreduce:
break;
case 64:
#line 454 "a.y"
#line 458 "a.y"
{
(yyval.lval) = 1 << (yyvsp[(1) - (1)].lval);
}
break;
case 65:
#line 458 "a.y"
#line 462 "a.y"
{
int i;
(yyval.lval)=0;
......@@ -2232,14 +2236,14 @@ yyreduce:
break;
case 66:
#line 467 "a.y"
#line 471 "a.y"
{
(yyval.lval) = (1<<(yyvsp[(1) - (3)].lval)) | (yyvsp[(3) - (3)].lval);
}
break;
case 70:
#line 476 "a.y"
#line 480 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (4)].addr);
(yyval.addr).reg = (yyvsp[(3) - (4)].lval);
......@@ -2247,7 +2251,7 @@ yyreduce:
break;
case 71:
#line 481 "a.y"
#line 485 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2256,7 +2260,7 @@ yyreduce:
break;
case 72:
#line 487 "a.y"
#line 491 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2265,7 +2269,7 @@ yyreduce:
break;
case 73:
#line 493 "a.y"
#line 497 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2274,7 +2278,7 @@ yyreduce:
break;
case 77:
#line 504 "a.y"
#line 508 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (1)].addr);
if((yyvsp[(1) - (1)].addr).name != NAME_EXTERN && (yyvsp[(1) - (1)].addr).name != NAME_STATIC) {
......@@ -2283,7 +2287,7 @@ yyreduce:
break;
case 78:
#line 512 "a.y"
#line 516 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2293,7 +2297,7 @@ yyreduce:
break;
case 80:
#line 522 "a.y"
#line 526 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2303,7 +2307,7 @@ yyreduce:
break;
case 82:
#line 532 "a.y"
#line 536 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (4)].addr);
(yyval.addr).type = TYPE_MEM;
......@@ -2312,7 +2316,7 @@ yyreduce:
break;
case 87:
#line 545 "a.y"
#line 549 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_CONST;
......@@ -2321,7 +2325,7 @@ yyreduce:
break;
case 88:
#line 553 "a.y"
#line 557 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2330,7 +2334,7 @@ yyreduce:
break;
case 89:
#line 561 "a.y"
#line 565 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REGREG;
......@@ -2340,7 +2344,7 @@ yyreduce:
break;
case 90:
#line 570 "a.y"
#line 574 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SHIFT;
......@@ -2349,7 +2353,7 @@ yyreduce:
break;
case 91:
#line 576 "a.y"
#line 580 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SHIFT;
......@@ -2358,7 +2362,7 @@ yyreduce:
break;
case 92:
#line 582 "a.y"
#line 586 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SHIFT;
......@@ -2367,7 +2371,7 @@ yyreduce:
break;
case 93:
#line 588 "a.y"
#line 592 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SHIFT;
......@@ -2376,7 +2380,7 @@ yyreduce:
break;
case 94:
#line 596 "a.y"
#line 600 "a.y"
{
if((yyval.lval) < REG_R0 || (yyval.lval) > REG_R15)
print("register value out of range in shift\n");
......@@ -2385,7 +2389,7 @@ yyreduce:
break;
case 95:
#line 602 "a.y"
#line 606 "a.y"
{
if((yyval.lval) < 0 || (yyval.lval) >= 32)
print("shift value out of range\n");
......@@ -2394,14 +2398,14 @@ yyreduce:
break;
case 97:
#line 611 "a.y"
#line 615 "a.y"
{
(yyval.lval) = REGPC;
}
break;
case 98:
#line 615 "a.y"
#line 619 "a.y"
{
if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= NREG)
print("register value out of range in R(...)\n");
......@@ -2410,14 +2414,14 @@ yyreduce:
break;
case 100:
#line 624 "a.y"
#line 628 "a.y"
{
(yyval.lval) = REGSP;
}
break;
case 102:
#line 631 "a.y"
#line 635 "a.y"
{
if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= NREG)
print("register value out of range in C(...)\n");
......@@ -2426,7 +2430,7 @@ yyreduce:
break;
case 105:
#line 643 "a.y"
#line 647 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2435,7 +2439,7 @@ yyreduce:
break;
case 106:
#line 649 "a.y"
#line 653 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2444,7 +2448,7 @@ yyreduce:
break;
case 107:
#line 657 "a.y"
#line 661 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2455,7 +2459,7 @@ yyreduce:
break;
case 108:
#line 665 "a.y"
#line 669 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2466,7 +2470,7 @@ yyreduce:
break;
case 109:
#line 673 "a.y"
#line 677 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2477,140 +2481,140 @@ yyreduce:
break;
case 110:
#line 682 "a.y"
#line 686 "a.y"
{
(yyval.lval) = 0;
}
break;
case 111:
#line 686 "a.y"
#line 690 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 112:
#line 690 "a.y"
#line 694 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 117:
#line 702 "a.y"
#line 706 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
}
break;
case 118:
#line 706 "a.y"
#line 710 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 119:
#line 710 "a.y"
#line 714 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 120:
#line 714 "a.y"
#line 718 "a.y"
{
(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
}
break;
case 121:
#line 718 "a.y"
#line 722 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (3)].lval);
}
break;
case 122:
#line 723 "a.y"
#line 727 "a.y"
{
(yyval.lval) = 0;
}
break;
case 123:
#line 727 "a.y"
#line 731 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 125:
#line 734 "a.y"
#line 738 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
}
break;
case 126:
#line 738 "a.y"
#line 742 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
}
break;
case 127:
#line 742 "a.y"
#line 746 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
}
break;
case 128:
#line 746 "a.y"
#line 750 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
}
break;
case 129:
#line 750 "a.y"
#line 754 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
}
break;
case 130:
#line 754 "a.y"
#line 758 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
}
break;
case 131:
#line 758 "a.y"
#line 762 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
}
break;
case 132:
#line 762 "a.y"
#line 766 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
}
break;
case 133:
#line 766 "a.y"
#line 770 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
}
break;
case 134:
#line 770 "a.y"
#line 774 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
}
......@@ -2618,7 +2622,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
#line 2622 "y.tab.c"
#line 2626 "y.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
......@@ -45,7 +45,8 @@ dsname(Sym *sym, int off, char *t, int n)
p->from.reg = 0;
p->from.sym = linksym(sym);
p->reg = n;
p->from3.type = TYPE_CONST;
p->from3.offset = n;
p->to.type = TYPE_SCONST;
p->to.name = NAME_NONE;
......@@ -113,14 +114,17 @@ gdata(Node *nam, Node *nr, int wid)
if(wid == 8 && is64(nr->type)) {
v = mpgetfix(nr->val.u.xval);
p = gins(ADATA, nam, nodintconst(v));
p->reg = 4;
p->from3.type = TYPE_CONST;
p->from3.offset = 4;
p = gins(ADATA, nam, nodintconst(v>>32));
p->reg = 4;
p->from3.type = TYPE_CONST;
p->from3.offset = 4;
p->from.offset += 4;
return;
}
p = gins(ADATA, nam, nr);
p->reg = wid;
p->from3.type = TYPE_CONST;
p->from3.offset = wid;
}
void
......@@ -133,12 +137,14 @@ gdatacomplex(Node *nam, Mpcplx *cval)
w = types[w]->width;
p = gins(ADATA, nam, N);
p->reg = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->real);
p = gins(ADATA, nam, N);
p->reg = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->from.offset += w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->imag);
......@@ -152,14 +158,16 @@ gdatastring(Node *nam, Strlit *sval)
p = gins(ADATA, nam, N);
datastring(sval->s, sval->len, &p->to);
p->reg = types[tptr]->width;
p->from3.type = TYPE_CONST;
p->from3.offset = types[tptr]->width;
p->to.type = TYPE_CONST;
p->to.etype = TINT32;
//print("%P\n", p);
nodconst(&nod1, types[TINT32], sval->len);
p = gins(ADATA, nam, &nod1);
p->reg = types[TINT32]->width;
p->from3.type = TYPE_CONST;
p->from3.offset = types[TINT32]->width;
p->from.offset += types[tptr]->width;
}
......@@ -174,7 +182,8 @@ dstringptr(Sym *s, int off, char *str)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->reg = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datastring(str, strlen(str)+1, &p->to);
p->to.type = TYPE_CONST;
......@@ -198,7 +207,8 @@ dgostrlitptr(Sym *s, int off, Strlit *lit)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->reg = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datagostring(lit, &p->to);
p->to.type = TYPE_CONST;
p->to.etype = TINT32;
......@@ -235,7 +245,8 @@ dsymptr(Sym *s, int off, Sym *x, int xoff)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->reg = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
p->to.type = TYPE_CONST;
p->to.name = NAME_EXTERN;
p->to.sym = linksym(x);
......
......@@ -60,7 +60,7 @@
%type <lval> con expr pointer offset
%type <addr> mem imm reg nam rel rem rim rom omem nmem textsize
%type <addr2> nonnon nonrel nonrem rimnon rimrem remrim
%type <addr2> spec1 spec3 spec4 spec5 spec6 spec7 spec8 spec9
%type <addr2> spec3 spec4 spec5 spec6 spec7 spec8 spec9
%type <addr2> spec10 spec12 spec13
%%
prog:
......@@ -102,7 +102,7 @@ inst:
| LTYPE3 rimrem { outcode($1, &$2); }
| LTYPE4 remrim { outcode($1, &$2); }
| LTYPER nonrel { outcode($1, &$2); }
| LTYPED spec1 { outcode($1, &$2); }
| spec1
| spec2
| LTYPEC spec3 { outcode($1, &$2); }
| LTYPEN spec4 { outcode($1, &$2); }
......@@ -183,11 +183,16 @@ nonrel:
}
spec1: /* DATA */
nam '/' con ',' imm
LTYPED nam '/' con ',' imm
{
$$.from = $1;
$$.from.scale = $3;
$$.to = $5;
Addr2 a;
a.from = $2;
a.to = $6;
outcode(ADATA, &a);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = $4;
}
}
spec2: /* TEXT */
......
......@@ -411,7 +411,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 515
#define YYLAST 524
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 56
......@@ -470,10 +470,10 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 4, 5, 9, 10, 15, 17, 20,
23, 27, 31, 34, 37, 40, 43, 46, 49, 52,
54, 57, 60, 63, 66, 69, 72, 75, 78, 80,
83, 86, 87, 89, 93, 97, 100, 102, 105, 107,
110, 112, 116, 122, 128, 136, 141, 148, 151, 153,
23, 27, 31, 34, 37, 40, 43, 46, 49, 51,
53, 56, 59, 62, 65, 68, 71, 74, 77, 79,
82, 85, 86, 88, 92, 96, 99, 101, 104, 106,
109, 111, 115, 122, 128, 136, 141, 148, 151, 153,
155, 157, 161, 167, 171, 177, 180, 182, 186, 192,
198, 199, 201, 205, 209, 211, 213, 215, 217, 220,
223, 225, 227, 229, 231, 236, 239, 241, 243, 245,
......@@ -492,14 +492,14 @@ static const yytype_int8 yyrhs[] =
45, 48, 60, 59, -1, 49, -1, 61, 49, -1,
1, 49, -1, 45, 50, 95, -1, 47, 50, 95,
-1, 13, 62, -1, 14, 66, -1, 15, 65, -1,
16, 63, -1, 17, 64, -1, 21, 67, -1, 19,
68, -1, 69, -1, 18, 71, -1, 20, 72, -1,
25, 73, -1, 26, 74, -1, 27, 75, -1, 28,
76, -1, 29, 77, -1, 30, 78, -1, 70, -1,
24, 79, -1, 31, 80, -1, -1, 51, -1, 83,
51, 81, -1, 81, 51, 83, -1, 83, 51, -1,
83, -1, 51, 81, -1, 81, -1, 51, 84, -1,
84, -1, 86, 51, 84, -1, 90, 11, 93, 51,
16, 63, -1, 17, 64, -1, 21, 67, -1, 68,
-1, 69, -1, 18, 71, -1, 20, 72, -1, 25,
73, -1, 26, 74, -1, 27, 75, -1, 28, 76,
-1, 29, 77, -1, 30, 78, -1, 70, -1, 24,
79, -1, 31, 80, -1, -1, 51, -1, 83, 51,
81, -1, 81, 51, 83, -1, 83, 51, -1, 83,
-1, 51, 81, -1, 81, -1, 51, 84, -1, 84,
-1, 86, 51, 84, -1, 19, 90, 11, 93, 51,
86, -1, 22, 87, 51, 52, 94, -1, 22, 87,
51, 93, 51, 52, 94, -1, 23, 87, 51, 86,
-1, 23, 87, 51, 93, 51, 86, -1, 51, 82,
......@@ -544,16 +544,16 @@ static const yytype_uint16 yyrline[] =
88, 93, 99, 100, 101, 102, 103, 104, 105, 106,
107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
117, 120, 124, 131, 138, 145, 150, 157, 162, 169,
174, 179, 186, 194, 202, 216, 224, 238, 243, 250,
251, 254, 259, 269, 274, 284, 289, 294, 301, 309,
319, 323, 330, 339, 350, 351, 354, 355, 356, 360,
364, 365, 368, 369, 372, 378, 389, 395, 401, 407,
413, 419, 425, 433, 439, 449, 455, 461, 467, 473,
481, 482, 485, 491, 498, 505, 512, 521, 531, 541,
547, 553, 561, 572, 576, 585, 593, 603, 606, 610,
616, 617, 621, 624, 625, 629, 633, 637, 641, 647,
653, 659, 665, 673, 674, 678, 682, 686, 690, 694,
698, 702, 706, 710
174, 179, 186, 199, 207, 221, 229, 243, 248, 255,
256, 259, 264, 274, 279, 289, 294, 299, 306, 314,
324, 328, 335, 344, 355, 356, 359, 360, 361, 365,
369, 370, 373, 374, 377, 383, 394, 400, 406, 412,
418, 424, 430, 438, 444, 454, 460, 466, 472, 478,
486, 487, 490, 496, 503, 510, 517, 526, 536, 546,
552, 558, 566, 577, 581, 590, 598, 608, 611, 615,
621, 622, 626, 629, 630, 634, 638, 642, 646, 652,
658, 664, 670, 678, 679, 683, 687, 691, 695, 699,
703, 707, 711, 715
};
#endif
......@@ -614,10 +614,10 @@ static const yytype_uint8 yyr1[] =
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 0, 3, 0, 4, 1, 2, 2,
3, 3, 2, 2, 2, 2, 2, 2, 2, 1,
3, 3, 2, 2, 2, 2, 2, 2, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 1, 2,
2, 0, 1, 3, 3, 2, 1, 2, 1, 2,
1, 3, 5, 5, 7, 4, 6, 2, 1, 1,
1, 3, 6, 5, 7, 4, 6, 2, 1, 1,
1, 3, 5, 3, 5, 2, 1, 3, 5, 5,
0, 1, 3, 3, 1, 1, 1, 1, 2, 2,
1, 1, 1, 1, 4, 2, 1, 1, 1, 1,
......@@ -636,12 +636,12 @@ static const yytype_uint8 yydefact[] =
{
2, 3, 1, 0, 0, 31, 0, 0, 0, 0,
0, 0, 31, 0, 0, 0, 0, 0, 0, 0,
0, 0, 60, 0, 0, 0, 7, 4, 0, 19,
28, 9, 32, 12, 0, 0, 113, 76, 78, 81,
77, 79, 82, 80, 107, 114, 0, 0, 0, 13,
38, 64, 65, 90, 91, 103, 92, 0, 14, 72,
36, 73, 15, 0, 16, 0, 0, 107, 0, 20,
48, 66, 70, 71, 67, 92, 18, 0, 32, 49,
0, 0, 60, 0, 0, 0, 7, 4, 0, 18,
19, 28, 9, 32, 12, 0, 0, 113, 76, 78,
81, 77, 79, 82, 80, 107, 114, 0, 0, 0,
13, 38, 64, 65, 90, 91, 103, 92, 0, 14,
72, 36, 73, 15, 0, 16, 0, 0, 107, 0,
20, 48, 66, 70, 71, 67, 92, 0, 32, 49,
50, 21, 107, 0, 0, 17, 40, 0, 0, 0,
0, 29, 0, 22, 0, 23, 0, 24, 56, 25,
0, 26, 0, 27, 61, 30, 0, 5, 0, 0,
......@@ -667,10 +667,10 @@ static const yytype_uint8 yydefact[] =
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 1, 3, 27, 153, 28, 33, 62, 64, 58,
49, 85, 76, 29, 30, 69, 81, 93, 95, 97,
99, 101, 103, 91, 105, 59, 70, 60, 71, 51,
61, 52, 53, 54, 55, 116, 202, 56, 226, 121
-1, 1, 3, 27, 153, 28, 34, 63, 65, 59,
50, 85, 29, 30, 31, 70, 81, 93, 95, 97,
99, 101, 103, 91, 105, 60, 71, 61, 72, 52,
62, 53, 54, 55, 56, 116, 202, 57, 226, 121
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
......@@ -678,43 +678,43 @@ static const yytype_int16 yydefgoto[] =
#define YYPACT_NINF -87
static const yytype_int16 yypact[] =
{
-87, 8, -87, 211, -34, -31, 236, 256, 256, 330,
156, -19, 290, 9, 384, 384, 256, 256, 256, 256,
72, -20, -20, 256, -15, -5, -87, -87, 4, -87,
-87, -87, -87, -87, 34, 34, -87, -87, -87, -87,
-87, -87, -87, -87, 119, -87, 330, 364, 34, -87,
-87, -87, -87, -87, -87, -13, 10, 270, -87, -87,
20, -87, -87, 37, -87, 39, 350, 119, 310, -87,
-87, -87, -87, -87, -87, 41, -87, 44, 330, -87,
-87, -87, 60, 391, 34, -87, -87, 45, 50, 55,
66, -87, 70, -87, 73, -87, 85, -87, 92, -87,
105, -87, 116, -87, -87, -87, 117, -87, 34, 34,
-87, -87, -87, 107, 34, 34, 80, -87, 21, 135,
-87, 168, -87, 133, 82, 398, -87, -87, 401, -87,
-87, -87, 330, 256, -87, -87, 80, -87, 63, 34,
-87, -87, 391, 157, 417, 426, 256, 330, 330, 330,
330, 330, 256, 211, 486, 486, 60, -87, -87, 58,
34, 149, -87, 34, 34, 34, 184, 197, 34, 34,
34, 34, 34, -87, 198, 26, 159, 160, -87, 433,
162, -87, -87, 163, 167, -87, 7, 195, -87, 196,
-87, 171, 200, -87, 199, 201, -87, -87, 202, -87,
-87, -87, 203, 205, 173, 495, 503, 175, 34, 34,
128, 128, -87, -87, -87, 34, 34, 208, -87, -87,
209, -87, -87, -20, 217, 242, -87, 210, -20, 229,
231, 34, 72, 232, -87, -87, 260, 40, 40, 228,
230, 104, -87, -87, 262, 253, 7, -87, -87, -87,
-87, -87, 250, 34, -87, -87, 276, 280, 273, -87,
-87, -87, 252, 34, 34, -87, -87, 267, 278, -87,
-87, 24, -87, 211, 20, -5, 236, 256, 256, 330,
156, 25, 290, 55, 364, 364, 256, 256, 256, 256,
145, 29, 29, 256, 17, 46, -87, -87, 26, -87,
-87, -87, -87, -87, -87, 451, 451, -87, -87, -87,
-87, -87, -87, -87, -87, 27, -87, 330, 270, 451,
-87, -87, -87, -87, -87, -87, 39, 44, 48, -87,
-87, 65, -87, -87, 66, -87, 68, 350, 27, 310,
-87, -87, -87, -87, -87, -87, 71, 110, 330, -87,
-87, -87, 23, 384, 451, -87, -87, 75, 72, 77,
82, -87, 85, -87, 87, -87, 88, -87, 89, -87,
90, -87, 91, -87, -87, -87, 92, -87, 451, 451,
-87, -87, -87, 120, 451, 451, 98, -87, 7, 113,
-87, 168, -87, 115, 5, 391, -87, -87, 398, -87,
-87, -87, 330, 256, -87, -87, 98, -87, 3, 451,
-87, -87, 384, 122, 416, 426, 256, 330, 330, 330,
330, 330, 256, 211, 504, 504, 23, -87, -87, 76,
451, 117, -87, 451, 451, 451, 162, 180, 451, 451,
451, 451, 451, -87, 181, 8, 136, 148, -87, 433,
150, -87, -87, 154, 159, -87, 12, 163, -87, 165,
-87, 169, 170, -87, 204, 206, -87, -87, 160, -87,
-87, -87, 205, 207, 182, 485, 512, 240, 451, 451,
102, 102, -87, -87, -87, 451, 451, 209, -87, -87,
212, -87, -87, 29, 231, 258, -87, 217, 29, 233,
244, 451, 145, 249, -87, -87, 261, 42, 42, 232,
250, -22, -87, -87, 276, 273, 12, -87, -87, -87,
-87, -87, 252, 451, -87, -87, 280, 300, 281, -87,
-87, -87, 262, 451, 451, -87, -87, 267, 278, -87,
-87
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-87, -87, -87, 154, -87, -87, 298, -87, -87, -87,
302, -87, -87, -87, -87, -87, -87, -87, -87, -87,
-87, -87, -87, -87, -87, -2, 248, 11, -11, -9,
-8, 137, -1, 2, 35, -61, -87, -10, 78, -86
-87, -87, -87, 171, -87, -87, 303, -87, -87, -87,
321, -87, -87, -87, -87, -87, -87, -87, -87, -87,
-87, -87, -87, -87, -87, -2, 243, 11, -11, -9,
-8, 74, -1, 2, -3, -62, -87, -10, 94, -86
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
......@@ -724,114 +724,116 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -1
static const yytype_uint16 yytable[] =
{
75, 72, 86, 88, 50, 87, 136, 65, 2, 73,
50, 100, 74, 102, 104, 31, 224, 34, 35, 63,
32, 140, 154, 155, 111, 112, 44, 92, 94, 96,
98, 160, 57, 107, 106, 108, 216, 120, 122, 225,
123, 36, 34, 35, 117, 109, 77, 130, 168, 169,
170, 171, 172, 110, 82, 139, 45, 134, 75, 72,
83, 57, 84, 124, 48, 135, 36, 73, 114, 115,
74, 131, 141, 88, 120, 161, 117, 205, 206, 207,
217, 45, 210, 211, 212, 213, 214, 84, 132, 48,
133, 199, 129, 200, 138, 198, 142, 183, 120, 120,
175, 176, 201, 143, 157, 158, 144, 177, 37, 38,
39, 40, 41, 42, 156, 112, 43, 145, 120, 175,
176, 146, 237, 238, 147, 113, 177, 114, 115, 184,
181, 185, 88, 159, 187, 189, 148, 188, 170, 171,
172, 256, 257, 149, 182, 191, 192, 193, 194, 195,
203, 89, 90, 120, 120, 120, 150, 190, 120, 120,
120, 120, 120, 196, 34, 35, 66, 151, 152, 112,
174, 163, 164, 165, 166, 167, 168, 169, 170, 171,
172, 166, 167, 168, 169, 170, 171, 172, 36, 162,
208, 183, 37, 38, 39, 40, 41, 42, 120, 120,
43, 67, 204, 45, 209, 239, 240, 68, 215, 47,
236, 48, 4, 218, 219, 243, 221, 222, 223, 229,
76, 73, 86, 88, 51, 87, 136, 66, 77, 74,
51, 100, 75, 102, 104, 256, 257, 160, 216, 64,
140, 224, 154, 155, 2, 111, 112, 92, 94, 96,
98, 114, 115, 113, 106, 114, 115, 183, 120, 122,
175, 176, 175, 176, 225, 117, 33, 177, 130, 177,
168, 169, 170, 171, 172, 129, 35, 125, 134, 76,
73, 161, 217, 35, 36, 107, 135, 108, 74, 32,
45, 75, 141, 88, 120, 110, 117, 205, 206, 207,
37, 58, 210, 211, 212, 213, 214, 37, 89, 90,
126, 127, 123, 45, 198, 46, 109, 124, 120, 120,
82, 128, 46, 49, 157, 158, 83, 58, 84, 199,
49, 200, 170, 171, 172, 112, 131, 132, 120, 133,
201, 139, 237, 238, 138, 143, 142, 156, 144, 184,
181, 185, 88, 145, 187, 189, 146, 188, 147, 148,
149, 150, 151, 152, 182, 191, 192, 193, 194, 195,
203, 159, 174, 120, 120, 120, 183, 190, 120, 120,
120, 120, 120, 196, 35, 36, 67, 162, 208, 112,
204, 163, 164, 165, 166, 167, 168, 169, 170, 171,
172, 38, 39, 40, 41, 42, 43, 209, 37, 44,
218, 215, 38, 39, 40, 41, 42, 43, 120, 120,
44, 68, 219, 46, 221, 239, 240, 69, 222, 48,
223, 49, 4, 233, 227, 243, 228, 229, 230, 236,
247, 250, 173, 251, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 262, 34, 35, 227, 228, 230, 244,
231, 245, 232, 267, 268, 233, 24, 234, 25, 235,
26, 241, 246, 242, 34, 35, 248, 252, 36, 249,
253, 258, 37, 38, 39, 40, 41, 42, 34, 125,
43, 44, 254, 45, 255, 259, 263, 46, 36, 47,
264, 48, 37, 38, 39, 40, 41, 42, 34, 35,
43, 44, 36, 45, 261, 265, 266, 197, 57, 47,
79, 48, 126, 127, 80, 44, 137, 45, 34, 35,
66, 269, 36, 128, 260, 48, 37, 38, 39, 40,
41, 42, 270, 0, 43, 44, 0, 45, 34, 35,
0, 78, 36, 47, 0, 48, 37, 38, 39, 40,
41, 42, 0, 0, 43, 67, 0, 45, 34, 35,
0, 0, 36, 47, 0, 48, 37, 38, 39, 40,
41, 42, 34, 35, 43, 44, 0, 45, 0, 0,
0, 0, 36, 47, 0, 48, 37, 38, 39, 40,
41, 42, 34, 35, 43, 0, 36, 45, 0, 34,
35, 118, 0, 47, 0, 48, 34, 35, 119, 34,
179, 45, 0, 0, 0, 0, 36, 84, 0, 48,
0, 0, 0, 36, 0, 34, 35, 0, 0, 44,
36, 45, 0, 36, 34, 35, 82, 47, 45, 48,
178, 34, 35, 180, 84, 45, 48, 0, 45, 36,
0, 84, 0, 48, 84, 0, 48, 0, 36, 0,
0, 0, 0, 0, 45, 36, 0, 0, 0, 186,
84, 0, 48, 45, 0, 220, 0, 0, 57, 84,
45, 48, 0, 0, 0, 0, 84, 0, 48, 163,
164, 165, 166, 167, 168, 169, 170, 171, 172, 164,
165, 166, 167, 168, 169, 170, 171, 172, 165, 166,
167, 168, 169, 170, 171, 172
21, 22, 23, 262, 35, 36, 166, 167, 168, 169,
170, 171, 172, 267, 268, 231, 24, 232, 25, 234,
26, 235, 241, 244, 35, 36, 242, 245, 37, 246,
248, 253, 38, 39, 40, 41, 42, 43, 35, 36,
44, 45, 249, 46, 252, 258, 254, 47, 37, 48,
263, 49, 38, 39, 40, 41, 42, 43, 35, 36,
44, 45, 37, 46, 255, 259, 261, 118, 58, 48,
264, 49, 137, 265, 119, 79, 266, 46, 35, 36,
67, 269, 37, 84, 197, 49, 38, 39, 40, 41,
42, 43, 270, 80, 44, 45, 0, 46, 35, 36,
260, 78, 37, 48, 0, 49, 38, 39, 40, 41,
42, 43, 0, 0, 44, 68, 0, 46, 35, 36,
0, 0, 37, 48, 0, 49, 38, 39, 40, 41,
42, 43, 35, 36, 44, 45, 0, 46, 0, 0,
0, 0, 37, 48, 0, 49, 38, 39, 40, 41,
42, 43, 35, 36, 44, 0, 37, 46, 0, 35,
36, 0, 0, 48, 0, 49, 35, 179, 0, 45,
0, 46, 0, 0, 0, 0, 37, 48, 0, 49,
0, 0, 0, 37, 35, 36, 0, 0, 0, 82,
37, 46, 0, 178, 35, 36, 0, 84, 46, 49,
180, 35, 36, 0, 84, 46, 49, 0, 37, 0,
0, 84, 0, 49, 0, 0, 0, 0, 37, 35,
36, 0, 0, 46, 0, 37, 0, 0, 186, 84,
0, 49, 0, 46, 0, 220, 0, 0, 58, 84,
46, 49, 0, 37, 0, 0, 84, 0, 49, 164,
165, 166, 167, 168, 169, 170, 171, 172, 46, 0,
0, 0, 0, 0, 84, 0, 49, 163, 164, 165,
166, 167, 168, 169, 170, 171, 172, 165, 166, 167,
168, 169, 170, 171, 172
};
static const yytype_int16 yycheck[] =
{
10, 10, 13, 13, 6, 13, 67, 9, 0, 10,
12, 20, 10, 21, 22, 49, 9, 8, 9, 8,
51, 82, 108, 109, 34, 35, 45, 16, 17, 18,
19, 10, 52, 48, 23, 50, 10, 47, 48, 32,
53, 32, 8, 9, 46, 50, 11, 57, 8, 9,
10, 11, 12, 49, 45, 11, 47, 66, 68, 68,
51, 52, 53, 53, 55, 66, 32, 68, 8, 9,
68, 51, 83, 83, 84, 54, 78, 163, 164, 165,
54, 47, 168, 169, 170, 171, 172, 53, 51, 55,
51, 33, 57, 35, 53, 156, 51, 34, 108, 109,
37, 38, 44, 53, 114, 115, 51, 44, 36, 37,
38, 39, 40, 41, 7, 125, 44, 51, 128, 37,
38, 51, 208, 209, 51, 6, 44, 8, 9, 139,
132, 142, 142, 53, 144, 145, 51, 145, 10, 11,
12, 37, 38, 51, 133, 147, 148, 149, 150, 151,
160, 14, 15, 163, 164, 165, 51, 146, 168, 169,
170, 171, 172, 152, 8, 9, 10, 51, 51, 179,
37, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 6, 7, 8, 9, 10, 11, 12, 32, 54,
6, 34, 36, 37, 38, 39, 40, 41, 208, 209,
44, 45, 53, 47, 7, 215, 216, 51, 10, 53,
37, 55, 1, 54, 54, 223, 54, 54, 51, 48,
10, 10, 13, 13, 6, 13, 68, 9, 11, 10,
12, 20, 10, 21, 22, 37, 38, 10, 10, 8,
82, 9, 108, 109, 0, 35, 36, 16, 17, 18,
19, 8, 9, 6, 23, 8, 9, 34, 48, 49,
37, 38, 37, 38, 32, 47, 51, 44, 58, 44,
8, 9, 10, 11, 12, 58, 8, 9, 67, 69,
69, 54, 54, 8, 9, 48, 67, 50, 69, 49,
45, 69, 83, 83, 84, 49, 78, 163, 164, 165,
32, 52, 168, 169, 170, 171, 172, 32, 14, 15,
42, 43, 53, 45, 156, 47, 50, 53, 108, 109,
45, 53, 47, 55, 114, 115, 51, 52, 53, 33,
55, 35, 10, 11, 12, 125, 51, 51, 128, 51,
44, 11, 208, 209, 53, 53, 51, 7, 51, 139,
132, 142, 142, 51, 144, 145, 51, 145, 51, 51,
51, 51, 51, 51, 133, 147, 148, 149, 150, 151,
160, 53, 37, 163, 164, 165, 34, 146, 168, 169,
170, 171, 172, 152, 8, 9, 10, 54, 6, 179,
53, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 36, 37, 38, 39, 40, 41, 7, 32, 44,
54, 10, 36, 37, 38, 39, 40, 41, 208, 209,
44, 45, 54, 47, 54, 215, 216, 51, 54, 53,
51, 55, 1, 53, 51, 223, 51, 48, 48, 37,
228, 231, 54, 232, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 253, 8, 9, 51, 51, 48, 32,
51, 9, 51, 263, 264, 53, 45, 54, 47, 54,
49, 53, 52, 54, 8, 9, 37, 35, 32, 38,
10, 9, 36, 37, 38, 39, 40, 41, 8, 9,
44, 45, 54, 47, 54, 32, 10, 51, 32, 53,
29, 30, 31, 253, 8, 9, 6, 7, 8, 9,
10, 11, 12, 263, 264, 51, 45, 51, 47, 54,
49, 54, 53, 32, 8, 9, 54, 9, 32, 52,
37, 10, 36, 37, 38, 39, 40, 41, 8, 9,
44, 45, 38, 47, 35, 9, 54, 51, 32, 53,
10, 55, 36, 37, 38, 39, 40, 41, 8, 9,
44, 45, 32, 47, 54, 32, 54, 153, 52, 53,
12, 55, 42, 43, 12, 45, 68, 47, 8, 9,
10, 54, 32, 53, 246, 55, 36, 37, 38, 39,
40, 41, 54, -1, 44, 45, -1, 47, 8, 9,
-1, 51, 32, 53, -1, 55, 36, 37, 38, 39,
44, 45, 32, 47, 54, 32, 54, 37, 52, 53,
10, 55, 69, 32, 44, 12, 54, 47, 8, 9,
10, 54, 32, 53, 153, 55, 36, 37, 38, 39,
40, 41, 54, 12, 44, 45, -1, 47, 8, 9,
246, 51, 32, 53, -1, 55, 36, 37, 38, 39,
40, 41, -1, -1, 44, 45, -1, 47, 8, 9,
-1, -1, 32, 53, -1, 55, 36, 37, 38, 39,
40, 41, 8, 9, 44, 45, -1, 47, -1, -1,
-1, -1, 32, 53, -1, 55, 36, 37, 38, 39,
40, 41, 8, 9, 44, -1, 32, 47, -1, 8,
9, 37, -1, 53, -1, 55, 8, 9, 44, 8,
9, 47, -1, -1, -1, -1, 32, 53, -1, 55,
-1, -1, -1, 32, -1, 8, 9, -1, -1, 45,
32, 47, -1, 32, 8, 9, 45, 53, 47, 55,
42, 8, 9, 42, 53, 47, 55, -1, 47, 32,
-1, 53, -1, 55, 53, -1, 55, -1, 32, -1,
-1, -1, -1, -1, 47, 32, -1, -1, -1, 52,
53, -1, 55, 47, -1, 42, -1, -1, 52, 53,
47, 55, -1, -1, -1, -1, 53, -1, 55, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
5, 6, 7, 8, 9, 10, 11, 12, 5, 6,
7, 8, 9, 10, 11, 12
9, -1, -1, 53, -1, 55, 8, 9, -1, 45,
-1, 47, -1, -1, -1, -1, 32, 53, -1, 55,
-1, -1, -1, 32, 8, 9, -1, -1, -1, 45,
32, 47, -1, 42, 8, 9, -1, 53, 47, 55,
42, 8, 9, -1, 53, 47, 55, -1, 32, -1,
-1, 53, -1, 55, -1, -1, -1, -1, 32, 8,
9, -1, -1, 47, -1, 32, -1, -1, 52, 53,
-1, 55, -1, 47, -1, 42, -1, -1, 52, 53,
47, 55, -1, 32, -1, -1, 53, -1, 55, 4,
5, 6, 7, 8, 9, 10, 11, 12, 47, -1,
-1, -1, -1, -1, 53, -1, 55, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 5, 6, 7,
8, 9, 10, 11, 12
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
......@@ -840,12 +842,12 @@ static const yytype_uint8 yystos[] =
{
0, 57, 0, 58, 1, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 45, 47, 49, 59, 61, 69,
70, 49, 51, 62, 8, 9, 32, 36, 37, 38,
39, 40, 41, 44, 45, 47, 51, 53, 55, 66,
81, 85, 87, 88, 89, 90, 93, 52, 65, 81,
83, 86, 63, 83, 64, 81, 10, 45, 51, 71,
82, 84, 85, 88, 89, 93, 68, 90, 51, 62,
28, 29, 30, 31, 45, 47, 49, 59, 61, 68,
69, 70, 49, 51, 62, 8, 9, 32, 36, 37,
38, 39, 40, 41, 44, 45, 47, 51, 53, 55,
66, 81, 85, 87, 88, 89, 90, 93, 52, 65,
81, 83, 86, 63, 83, 64, 81, 10, 45, 51,
71, 82, 84, 85, 88, 89, 93, 90, 51, 62,
66, 72, 45, 51, 53, 67, 84, 86, 93, 87,
87, 79, 83, 73, 83, 74, 83, 75, 83, 76,
85, 77, 86, 78, 86, 80, 83, 48, 50, 50,
......@@ -1744,11 +1746,6 @@ yyreduce:
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 18:
#line 105 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 20:
#line 107 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
......@@ -1890,14 +1887,19 @@ yyreduce:
case 42:
#line 187 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr);
Addr2 a;
a.from = (yyvsp[(2) - (6)].addr);
a.to = (yyvsp[(6) - (6)].addr);
outcode(ADATA, &a);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = (yyvsp[(4) - (6)].lval);
}
}
break;
case 43:
#line 195 "a.y"
#line 200 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (5)].addr).sym);
......@@ -1908,7 +1910,7 @@ yyreduce:
break;
case 44:
#line 203 "a.y"
#line 208 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (7)].addr).sym);
......@@ -1923,7 +1925,7 @@ yyreduce:
break;
case 45:
#line 217 "a.y"
#line 222 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (4)].addr).sym);
......@@ -1934,7 +1936,7 @@ yyreduce:
break;
case 46:
#line 225 "a.y"
#line 230 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (6)].addr).sym);
......@@ -1949,7 +1951,7 @@ yyreduce:
break;
case 47:
#line 239 "a.y"
#line 244 "a.y"
{
(yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr);
......@@ -1957,7 +1959,7 @@ yyreduce:
break;
case 48:
#line 244 "a.y"
#line 249 "a.y"
{
(yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr);
......@@ -1965,7 +1967,7 @@ yyreduce:
break;
case 51:
#line 255 "a.y"
#line 260 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr);
......@@ -1973,7 +1975,7 @@ yyreduce:
break;
case 52:
#line 260 "a.y"
#line 265 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr);
......@@ -1984,7 +1986,7 @@ yyreduce:
break;
case 53:
#line 270 "a.y"
#line 275 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr);
......@@ -1992,7 +1994,7 @@ yyreduce:
break;
case 54:
#line 275 "a.y"
#line 280 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr);
......@@ -2003,7 +2005,7 @@ yyreduce:
break;
case 55:
#line 285 "a.y"
#line 290 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (2)].addr);
(yyval.addr2).to = nullgen;
......@@ -2011,7 +2013,7 @@ yyreduce:
break;
case 56:
#line 290 "a.y"
#line 295 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen;
......@@ -2019,7 +2021,7 @@ yyreduce:
break;
case 57:
#line 295 "a.y"
#line 300 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr);
......@@ -2027,7 +2029,7 @@ yyreduce:
break;
case 58:
#line 302 "a.y"
#line 307 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr);
......@@ -2036,7 +2038,7 @@ yyreduce:
break;
case 59:
#line 310 "a.y"
#line 315 "a.y"
{
(yyval.addr2).from = (yyvsp[(3) - (5)].addr);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr);
......@@ -2047,7 +2049,7 @@ yyreduce:
break;
case 60:
#line 319 "a.y"
#line 324 "a.y"
{
(yyval.addr2).from = nullgen;
(yyval.addr2).to = nullgen;
......@@ -2055,7 +2057,7 @@ yyreduce:
break;
case 61:
#line 324 "a.y"
#line 329 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen;
......@@ -2063,7 +2065,7 @@ yyreduce:
break;
case 62:
#line 331 "a.y"
#line 336 "a.y"
{
if((yyvsp[(1) - (3)].addr).type != TYPE_CONST || (yyvsp[(3) - (3)].addr).type != TYPE_CONST)
yyerror("arguments to PCDATA must be integer constants");
......@@ -2073,7 +2075,7 @@ yyreduce:
break;
case 63:
#line 340 "a.y"
#line 345 "a.y"
{
if((yyvsp[(1) - (3)].addr).type != TYPE_CONST)
yyerror("index for FUNCDATA must be integer constant");
......@@ -2085,21 +2087,21 @@ yyreduce:
break;
case 68:
#line 357 "a.y"
#line 362 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
}
break;
case 69:
#line 361 "a.y"
#line 366 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
}
break;
case 74:
#line 373 "a.y"
#line 378 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_BRANCH;
......@@ -2108,7 +2110,7 @@ yyreduce:
break;
case 75:
#line 379 "a.y"
#line 384 "a.y"
{
(yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
(yyval.addr) = nullgen;
......@@ -2120,7 +2122,7 @@ yyreduce:
break;
case 76:
#line 390 "a.y"
#line 395 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2129,7 +2131,7 @@ yyreduce:
break;
case 77:
#line 396 "a.y"
#line 401 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2138,7 +2140,7 @@ yyreduce:
break;
case 78:
#line 402 "a.y"
#line 407 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2147,7 +2149,7 @@ yyreduce:
break;
case 79:
#line 408 "a.y"
#line 413 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2156,7 +2158,7 @@ yyreduce:
break;
case 80:
#line 414 "a.y"
#line 419 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2165,7 +2167,7 @@ yyreduce:
break;
case 81:
#line 420 "a.y"
#line 425 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2174,7 +2176,7 @@ yyreduce:
break;
case 82:
#line 426 "a.y"
#line 431 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2183,7 +2185,7 @@ yyreduce:
break;
case 83:
#line 434 "a.y"
#line 439 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_CONST;
......@@ -2192,7 +2194,7 @@ yyreduce:
break;
case 84:
#line 440 "a.y"
#line 445 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
(yyval.addr).type = TYPE_ADDR;
......@@ -2205,7 +2207,7 @@ yyreduce:
break;
case 85:
#line 450 "a.y"
#line 455 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SCONST;
......@@ -2214,7 +2216,7 @@ yyreduce:
break;
case 86:
#line 456 "a.y"
#line 461 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2223,7 +2225,7 @@ yyreduce:
break;
case 87:
#line 462 "a.y"
#line 467 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2232,7 +2234,7 @@ yyreduce:
break;
case 88:
#line 468 "a.y"
#line 473 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2241,7 +2243,7 @@ yyreduce:
break;
case 89:
#line 474 "a.y"
#line 479 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2250,7 +2252,7 @@ yyreduce:
break;
case 92:
#line 486 "a.y"
#line 491 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2259,7 +2261,7 @@ yyreduce:
break;
case 93:
#line 492 "a.y"
#line 497 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2269,7 +2271,7 @@ yyreduce:
break;
case 94:
#line 499 "a.y"
#line 504 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2279,7 +2281,7 @@ yyreduce:
break;
case 95:
#line 506 "a.y"
#line 511 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2289,7 +2291,7 @@ yyreduce:
break;
case 96:
#line 513 "a.y"
#line 518 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2301,7 +2303,7 @@ yyreduce:
break;
case 97:
#line 522 "a.y"
#line 527 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2314,7 +2316,7 @@ yyreduce:
break;
case 98:
#line 532 "a.y"
#line 537 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2327,7 +2329,7 @@ yyreduce:
break;
case 99:
#line 542 "a.y"
#line 547 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2336,7 +2338,7 @@ yyreduce:
break;
case 100:
#line 548 "a.y"
#line 553 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2345,7 +2347,7 @@ yyreduce:
break;
case 101:
#line 554 "a.y"
#line 559 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2356,7 +2358,7 @@ yyreduce:
break;
case 102:
#line 562 "a.y"
#line 567 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2368,14 +2370,14 @@ yyreduce:
break;
case 103:
#line 573 "a.y"
#line 578 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (1)].addr);
}
break;
case 104:
#line 577 "a.y"
#line 582 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (6)].addr);
(yyval.addr).index = (yyvsp[(3) - (6)].lval);
......@@ -2385,7 +2387,7 @@ yyreduce:
break;
case 105:
#line 586 "a.y"
#line 591 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2396,7 +2398,7 @@ yyreduce:
break;
case 106:
#line 594 "a.y"
#line 599 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2407,70 +2409,70 @@ yyreduce:
break;
case 107:
#line 603 "a.y"
#line 608 "a.y"
{
(yyval.lval) = 0;
}
break;
case 108:
#line 607 "a.y"
#line 612 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 109:
#line 611 "a.y"
#line 616 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 111:
#line 618 "a.y"
#line 623 "a.y"
{
(yyval.lval) = NAME_AUTO;
}
break;
case 114:
#line 626 "a.y"
#line 631 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
}
break;
case 115:
#line 630 "a.y"
#line 635 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 116:
#line 634 "a.y"
#line 639 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 117:
#line 638 "a.y"
#line 643 "a.y"
{
(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
}
break;
case 118:
#line 642 "a.y"
#line 647 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (3)].lval);
}
break;
case 119:
#line 648 "a.y"
#line 653 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (1)].lval);
......@@ -2479,7 +2481,7 @@ yyreduce:
break;
case 120:
#line 654 "a.y"
#line 659 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (2)].lval);
......@@ -2488,7 +2490,7 @@ yyreduce:
break;
case 121:
#line 660 "a.y"
#line 665 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (3)].lval);
......@@ -2497,7 +2499,7 @@ yyreduce:
break;
case 122:
#line 666 "a.y"
#line 671 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (4)].lval);
......@@ -2506,70 +2508,70 @@ yyreduce:
break;
case 124:
#line 675 "a.y"
#line 680 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
}
break;
case 125:
#line 679 "a.y"
#line 684 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
}
break;
case 126:
#line 683 "a.y"
#line 688 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
}
break;
case 127:
#line 687 "a.y"
#line 692 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
}
break;
case 128:
#line 691 "a.y"
#line 696 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
}
break;
case 129:
#line 695 "a.y"
#line 700 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
}
break;
case 130:
#line 699 "a.y"
#line 704 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
}
break;
case 131:
#line 703 "a.y"
#line 708 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
}
break;
case 132:
#line 707 "a.y"
#line 712 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
}
break;
case 133:
#line 711 "a.y"
#line 716 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
}
......@@ -2577,7 +2579,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
#line 2581 "y.tab.c"
#line 2583 "y.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
......@@ -41,8 +41,9 @@ dsname(Sym *s, int off, char *t, int n)
p->from.type = TYPE_MEM;
p->from.name = NAME_EXTERN;
p->from.offset = off;
p->from.scale = n;
p->from.sym = linksym(s);
p->from3.type = TYPE_CONST;
p->from3.offset = n;
p->to.type = TYPE_SCONST;
memmove(p->to.u.sval, t, n);
......@@ -101,7 +102,8 @@ gdata(Node *nam, Node *nr, int wid)
}
}
p = gins(ADATA, nam, nr);
p->from.scale = wid;
p->from3.type = TYPE_CONST;
p->from3.offset = wid;
}
void
......@@ -114,12 +116,14 @@ gdatacomplex(Node *nam, Mpcplx *cval)
w = types[w]->width;
p = gins(ADATA, nam, N);
p->from.scale = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->real);
p = gins(ADATA, nam, N);
p->from.scale = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->from.offset += w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->imag);
......@@ -133,13 +137,15 @@ gdatastring(Node *nam, Strlit *sval)
p = gins(ADATA, nam, N);
datastring(sval->s, sval->len, &p->to);
p->from.scale = types[tptr]->width;
p->from3.type = TYPE_CONST;
p->from3.offset = types[tptr]->width;
p->to.type = TYPE_ADDR;
//print("%P\n", p);
nodconst(&nod1, types[TINT], sval->len);
p = gins(ADATA, nam, &nod1);
p->from.scale = widthint;
p->from3.type = TYPE_CONST;
p->from3.offset = widthint;
p->from.offset += widthptr;
}
......@@ -154,7 +160,8 @@ dstringptr(Sym *s, int off, char *str)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->from.scale = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datastring(str, strlen(str)+1, &p->to);
p->to.type = TYPE_ADDR;
......@@ -178,7 +185,8 @@ dgostrlitptr(Sym *s, int off, Strlit *lit)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->from.scale = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datagostring(lit, &p->to);
p->to.type = TYPE_ADDR;
p->to.etype = simtype[TINT];
......@@ -215,7 +223,8 @@ dsymptr(Sym *s, int off, Sym *x, int xoff)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->from.scale = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
p->to.type = TYPE_ADDR;
p->to.name = NAME_EXTERN;
p->to.sym = linksym(x);
......
......@@ -59,7 +59,7 @@
%type <lval> con expr pointer offset
%type <addr> mem imm reg nam rel rem rim rom omem nmem textsize
%type <addr2> nonnon nonrel nonrem rimnon rimrem remrim
%type <addr2> spec1 spec3 spec4 spec5 spec6 spec7 spec9 spec10 spec11 spec12
%type <addr2> spec3 spec4 spec5 spec6 spec7 spec9 spec10 spec11 spec12
%%
prog:
| prog
......@@ -100,7 +100,7 @@ inst:
| LTYPE3 rimrem { outcode($1, &$2); }
| LTYPE4 remrim { outcode($1, &$2); }
| LTYPER nonrel { outcode($1, &$2); }
| LTYPED spec1 { outcode($1, &$2); }
| spec1
| spec2
| LTYPEC spec3 { outcode($1, &$2); }
| LTYPEN spec4 { outcode($1, &$2); }
......@@ -180,11 +180,16 @@ nonrel:
}
spec1: /* DATA */
nam '/' con ',' imm
LTYPED nam '/' con ',' imm
{
$$.from = $1;
$$.from.scale = $3;
$$.to = $5;
Addr2 a;
a.from = $2;
a.to = $6;
outcode(ADATA, &a);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = $4;
}
}
spec2: /* TEXT */
......
......@@ -407,7 +407,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 561
#define YYLAST 544
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 54
......@@ -466,10 +466,10 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 4, 5, 9, 10, 15, 17, 20,
23, 27, 31, 34, 37, 40, 43, 46, 49, 52,
54, 57, 60, 63, 66, 69, 71, 74, 77, 80,
83, 84, 86, 90, 94, 97, 99, 102, 104, 107,
109, 113, 119, 125, 133, 138, 145, 148, 150, 153,
23, 27, 31, 34, 37, 40, 43, 46, 49, 51,
53, 56, 59, 62, 65, 68, 70, 73, 76, 79,
82, 83, 85, 89, 93, 96, 98, 101, 103, 106,
108, 112, 119, 125, 133, 138, 145, 148, 150, 153,
155, 157, 161, 167, 171, 177, 180, 182, 186, 192,
198, 202, 206, 208, 210, 212, 214, 217, 220, 222,
224, 226, 228, 230, 235, 238, 240, 242, 244, 246,
......@@ -488,14 +488,14 @@ static const yytype_int8 yyrhs[] =
43, 46, 58, 57, -1, 47, -1, 59, 47, -1,
1, 47, -1, 43, 48, 92, -1, 45, 48, 92,
-1, 13, 60, -1, 14, 64, -1, 15, 63, -1,
16, 61, -1, 17, 62, -1, 21, 65, -1, 19,
66, -1, 67, -1, 18, 69, -1, 20, 70, -1,
23, 71, -1, 24, 72, -1, 25, 73, -1, 68,
-1, 27, 74, -1, 28, 75, -1, 29, 76, -1,
30, 77, -1, -1, 49, -1, 80, 49, 78, -1,
78, 49, 80, -1, 80, 49, -1, 80, -1, 49,
78, -1, 78, -1, 49, 81, -1, 81, -1, 83,
49, 81, -1, 88, 11, 91, 49, 83, -1, 22,
16, 61, -1, 17, 62, -1, 21, 65, -1, 66,
-1, 67, -1, 18, 69, -1, 20, 70, -1, 23,
71, -1, 24, 72, -1, 25, 73, -1, 68, -1,
27, 74, -1, 28, 75, -1, 29, 76, -1, 30,
77, -1, -1, 49, -1, 80, 49, 78, -1, 78,
49, 80, -1, 80, 49, -1, 80, -1, 49, 78,
-1, 78, -1, 49, 81, -1, 81, -1, 83, 49,
81, -1, 19, 88, 11, 91, 49, 83, -1, 22,
85, 49, 50, 84, -1, 22, 85, 49, 91, 49,
50, 84, -1, 26, 85, 49, 83, -1, 26, 85,
49, 91, 49, 83, -1, 49, 79, -1, 79, -1,
......@@ -539,16 +539,16 @@ static const yytype_uint16 yyrline[] =
86, 91, 97, 98, 99, 100, 101, 102, 103, 104,
105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
117, 121, 128, 135, 142, 147, 154, 159, 166, 171,
176, 183, 191, 199, 213, 221, 235, 240, 245, 253,
254, 257, 262, 272, 277, 287, 292, 297, 304, 312,
322, 331, 342, 343, 346, 347, 348, 352, 356, 357,
358, 361, 362, 365, 371, 382, 388, 394, 400, 406,
412, 420, 426, 436, 442, 448, 454, 460, 468, 474,
480, 486, 494, 495, 498, 505, 512, 519, 529, 539,
549, 555, 561, 568, 577, 588, 592, 601, 609, 619,
622, 626, 632, 633, 637, 640, 641, 645, 649, 653,
657, 663, 664, 668, 672, 676, 680, 684, 688, 692,
696, 700
176, 183, 196, 204, 218, 226, 240, 245, 250, 258,
259, 262, 267, 277, 282, 292, 297, 302, 309, 317,
327, 336, 347, 348, 351, 352, 353, 357, 361, 362,
363, 366, 367, 370, 376, 387, 393, 399, 405, 411,
417, 425, 431, 441, 447, 453, 459, 465, 473, 479,
485, 491, 499, 500, 503, 510, 517, 524, 534, 544,
554, 560, 566, 573, 582, 593, 597, 606, 614, 624,
627, 631, 637, 638, 642, 645, 646, 650, 654, 658,
662, 668, 669, 673, 677, 681, 685, 689, 693, 697,
701, 705
};
#endif
......@@ -609,10 +609,10 @@ static const yytype_uint8 yyr1[] =
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 0, 3, 0, 4, 1, 2, 2,
3, 3, 2, 2, 2, 2, 2, 2, 2, 1,
3, 3, 2, 2, 2, 2, 2, 2, 1, 1,
2, 2, 2, 2, 2, 1, 2, 2, 2, 2,
0, 1, 3, 3, 2, 1, 2, 1, 2, 1,
3, 5, 5, 7, 4, 6, 2, 1, 2, 1,
3, 6, 5, 7, 4, 6, 2, 1, 2, 1,
1, 3, 5, 3, 5, 2, 1, 3, 5, 5,
3, 3, 1, 1, 1, 1, 2, 2, 1, 1,
1, 1, 1, 4, 2, 1, 1, 1, 1, 1,
......@@ -631,12 +631,12 @@ static const yytype_uint8 yydefact[] =
{
2, 3, 1, 0, 0, 30, 0, 0, 0, 0,
0, 0, 30, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 7, 4, 0, 19, 25,
9, 31, 12, 0, 0, 115, 75, 77, 80, 76,
78, 79, 109, 116, 0, 0, 0, 13, 37, 62,
63, 92, 93, 105, 94, 0, 14, 71, 35, 72,
15, 0, 16, 0, 0, 109, 0, 20, 47, 64,
68, 70, 69, 65, 94, 18, 0, 31, 49, 50,
0, 0, 0, 0, 0, 7, 4, 0, 18, 19,
25, 9, 31, 12, 0, 0, 115, 75, 77, 80,
76, 78, 79, 109, 116, 0, 0, 0, 13, 37,
62, 63, 92, 93, 105, 94, 0, 14, 71, 35,
72, 15, 0, 16, 0, 0, 109, 0, 20, 47,
64, 68, 70, 69, 65, 94, 0, 31, 49, 50,
21, 109, 0, 0, 17, 39, 0, 0, 0, 22,
0, 23, 0, 24, 56, 0, 26, 0, 27, 0,
28, 0, 29, 0, 5, 0, 0, 8, 118, 117,
......@@ -661,10 +661,10 @@ static const yytype_uint8 yydefact[] =
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 1, 3, 26, 152, 27, 32, 60, 62, 56,
47, 84, 75, 28, 29, 67, 80, 89, 91, 93,
96, 98, 100, 102, 57, 68, 58, 69, 49, 59,
225, 50, 51, 52, 53, 113, 201, 54, 118
-1, 1, 3, 26, 152, 27, 33, 61, 63, 57,
48, 84, 28, 29, 30, 68, 80, 89, 91, 93,
96, 98, 100, 102, 58, 69, 59, 70, 50, 60,
225, 51, 52, 53, 54, 113, 201, 55, 118
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
......@@ -672,42 +672,42 @@ static const yytype_int16 yydefgoto[] =
#define YYPACT_NINF -87
static const yytype_int16 yypact[] =
{
-87, 14, -87, 242, -29, -23, 164, 313, 313, 361,
265, -14, 337, 180, 417, 313, 313, 313, 417, 81,
24, 313, 313, 16, 31, -87, -87, 33, -87, -87,
-87, -87, -87, 498, 498, -87, -87, -87, -87, -87,
-87, -87, 43, -87, 361, 58, 498, -87, -87, -87,
-87, -87, -87, 37, 39, 400, -87, -87, 42, -87,
-87, 44, -87, 48, 361, 43, 289, -87, -87, -87,
-87, -87, -87, -87, 62, -87, 99, 361, -87, -87,
-87, 13, 424, 498, -87, -87, 65, 73, 76, -87,
78, -87, 80, -87, 86, 87, -87, 89, -87, 102,
-87, 106, -87, 113, -87, 498, 498, -87, -87, -87,
123, 498, 498, 112, -87, -2, 119, -87, 175, -87,
128, 50, 441, -87, -87, 448, -87, -87, -87, 361,
313, -87, -87, -87, 112, 385, -87, -5, 498, -87,
-87, 424, 141, 465, 361, 361, 361, 474, 361, 361,
313, 313, 242, 549, 549, 13, -87, -87, 12, 498,
124, -87, 498, 498, 498, 184, 185, 498, 498, 498,
498, 498, -87, 181, 1, 142, 144, -87, 481, 156,
-87, -87, 158, 163, -87, 7, 167, 147, 172, -87,
-87, 170, 177, 179, -87, -87, -87, 173, -87, -87,
-87, 199, 202, 196, 136, 229, 238, 498, 498, 59,
59, -87, -87, -87, 498, 498, 225, -87, -87, 226,
-87, -87, 24, 246, 270, -87, 230, 245, 247, 24,
498, 81, 248, -87, -87, 273, 96, 96, 234, 236,
3, -87, -87, 281, 260, 7, -87, -87, -87, -87,
-87, 240, 498, -87, -87, 283, 284, 264, -87, -87,
-87, 253, 498, 498, -87, -87, 254, 257, -87, -87
-87, 35, -87, 242, 2, -4, 164, 313, 313, 361,
265, 8, 337, 60, 410, 313, 313, 313, 410, 241,
-11, 313, 313, -31, 17, -87, -87, 23, -87, -87,
-87, -87, -87, -87, 474, 474, -87, -87, -87, -87,
-87, -87, -87, 20, -87, 361, 401, 474, -87, -87,
-87, -87, -87, -87, 16, 28, 185, -87, -87, 22,
-87, -87, 25, -87, 31, 361, 20, 289, -87, -87,
-87, -87, -87, -87, -87, 48, 29, 361, -87, -87,
-87, 13, 417, 474, -87, -87, 51, 53, 57, -87,
58, -87, 59, -87, 70, 71, -87, 75, -87, 80,
-87, 86, -87, 102, -87, 474, 474, -87, -87, -87,
37, 474, 474, 76, -87, 1, 103, -87, 175, -87,
126, 50, 85, -87, -87, 426, -87, -87, -87, 361,
313, -87, -87, -87, 76, 385, -87, 81, 474, -87,
-87, 417, 130, 436, 361, 361, 361, 464, 361, 361,
313, 313, 242, 525, 525, 13, -87, -87, 18, 474,
113, -87, 474, 474, 474, 165, 167, 474, 474, 474,
474, 474, -87, 186, 3, 123, 156, -87, 467, 158,
-87, -87, 159, 163, -87, 7, 169, 173, 177, -87,
-87, 182, 183, 184, -87, -87, -87, 178, -87, -87,
-87, 172, 187, 198, 136, 239, 532, 474, 474, 78,
78, -87, -87, -87, 474, 474, 189, -87, -87, 202,
-87, -87, -11, 204, 228, -87, 191, 245, 247, -11,
474, 241, 248, -87, -87, 276, 180, 180, 236, 238,
-5, -87, -87, 282, 261, 7, -87, -87, -87, -87,
-87, 243, 474, -87, -87, 283, 284, 274, -87, -87,
-87, 254, 474, 474, -87, -87, 257, 259, -87, -87
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-87, -87, -87, 159, -87, -87, 300, -87, -87, -87,
301, -87, -87, -87, -87, -87, -87, -87, -87, -87,
-87, -87, -87, -87, 21, 251, 26, -7, -9, -8,
74, -1, -3, -6, 4, -56, -87, -10, -86
-87, -87, -87, 160, -87, -87, 301, -87, -87, -87,
305, -87, -87, -87, -87, -87, -87, -87, -87, -87,
-87, -87, -87, -87, 21, 252, 26, -7, -9, -8,
84, 0, -3, -6, -2, -58, -87, -10, -86
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
......@@ -717,100 +717,98 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -1
static const yytype_uint16 yytable[] =
{
74, 70, 71, 87, 73, 86, 85, 72, 159, 134,
97, 215, 99, 88, 2, 76, 223, 95, 30, 153,
154, 111, 112, 108, 109, 139, 31, 48, 182, 42,
63, 174, 175, 48, 61, 117, 119, 176, 224, 255,
256, 90, 92, 94, 198, 127, 199, 101, 103, 110,
160, 111, 112, 216, 200, 131, 74, 70, 71, 126,
73, 132, 104, 72, 105, 114, 33, 34, 133, 169,
170, 171, 87, 117, 55, 140, 204, 205, 206, 106,
107, 209, 210, 211, 212, 213, 174, 175, 120, 35,
121, 128, 176, 129, 115, 117, 117, 130, 114, 197,
116, 156, 157, 43, 167, 168, 169, 170, 171, 83,
138, 46, 109, 137, 141, 117, 36, 37, 38, 39,
40, 236, 237, 41, 142, 143, 131, 144, 183, 145,
155, 87, 132, 186, 184, 146, 147, 191, 148, 190,
75, 71, 72, 87, 74, 86, 85, 73, 134, 76,
97, 159, 99, 215, 88, 104, 223, 105, 95, 153,
154, 111, 112, 139, 108, 109, 110, 49, 111, 112,
64, 255, 256, 49, 62, 2, 117, 119, 224, 56,
138, 90, 92, 94, 155, 32, 127, 101, 103, 31,
198, 43, 199, 160, 126, 216, 131, 75, 71, 72,
200, 74, 132, 133, 73, 106, 114, 120, 34, 35,
107, 128, 87, 117, 129, 140, 204, 205, 206, 121,
130, 209, 210, 211, 212, 213, 174, 175, 169, 170,
171, 36, 176, 34, 35, 117, 117, 197, 114, 137,
141, 156, 157, 81, 142, 44, 143, 144, 145, 82,
56, 83, 109, 47, 182, 117, 36, 174, 175, 146,
147, 236, 237, 176, 148, 177, 131, 158, 183, 149,
44, 87, 132, 186, 184, 150, 83, 191, 47, 190,
163, 164, 165, 166, 167, 168, 169, 170, 171, 202,
180, 149, 117, 117, 117, 150, 181, 117, 117, 117,
117, 117, 151, 158, 173, 187, 188, 189, 109, 192,
193, 161, 33, 34, 182, 203, 194, 195, 162, 163,
164, 165, 166, 167, 168, 169, 170, 171, 33, 34,
207, 214, 208, 227, 217, 35, 218, 117, 117, 36,
37, 38, 39, 40, 238, 239, 41, 42, 220, 43,
221, 35, 222, 44, 242, 45, 226, 46, 228, 229,
249, 248, 250, 81, 232, 43, 230, 172, 231, 82,
55, 83, 235, 46, 164, 165, 166, 167, 168, 169,
170, 171, 261, 4, 165, 166, 167, 168, 169, 170,
171, 233, 266, 267, 234, 5, 6, 7, 8, 9,
180, 151, 117, 117, 117, 161, 181, 117, 117, 117,
117, 117, 173, 182, 203, 187, 188, 189, 109, 192,
193, 207, 34, 35, 208, 217, 194, 195, 162, 163,
164, 165, 166, 167, 168, 169, 170, 171, 167, 168,
169, 170, 171, 34, 122, 36, 214, 117, 117, 37,
38, 39, 40, 41, 238, 239, 42, 43, 218, 44,
220, 221, 222, 45, 242, 46, 36, 47, 226, 227,
249, 248, 250, 228, 233, 123, 124, 172, 43, 232,
44, 229, 230, 231, 235, 243, 125, 244, 47, 234,
240, 245, 261, 4, 164, 165, 166, 167, 168, 169,
170, 171, 266, 267, 241, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 33, 34, 64, 240, 243, 241, 244,
245, 246, 251, 252, 247, 23, 253, 24, 254, 25,
257, 258, 260, 262, 263, 264, 35, 33, 34, 135,
36, 37, 38, 39, 40, 265, 268, 41, 65, 269,
43, 196, 78, 79, 66, 55, 45, 136, 46, 259,
35, 33, 34, 0, 36, 37, 38, 39, 40, 0,
0, 41, 65, 0, 43, 0, 0, 0, 0, 55,
45, 0, 46, 0, 35, 33, 34, 0, 36, 37,
38, 39, 40, 0, 0, 41, 42, 0, 43, 0,
0, 0, 0, 55, 45, 0, 46, 0, 35, 33,
34, 0, 36, 37, 38, 39, 40, 0, 0, 41,
42, 0, 43, 0, 0, 0, 77, 0, 45, 0,
46, 0, 35, 33, 34, 0, 36, 37, 38, 39,
40, 0, 0, 41, 42, 0, 43, 0, 33, 122,
0, 0, 45, 0, 46, 0, 35, 0, 0, 0,
36, 37, 38, 39, 40, 33, 34, 41, 0, 0,
43, 35, 33, 34, 0, 0, 45, 0, 46, 0,
123, 124, 0, 42, 0, 43, 0, 0, 35, 33,
34, 125, 0, 46, 0, 35, 33, 178, 0, 0,
42, 0, 43, 0, 0, 0, 0, 81, 45, 43,
46, 0, 35, 33, 34, 83, 0, 46, 0, 35,
0, 177, 33, 34, 0, 0, 43, 0, 179, 33,
34, 0, 83, 43, 46, 0, 35, 0, 0, 83,
0, 46, 0, 0, 0, 35, 33, 34, 0, 0,
43, 0, 35, 0, 0, 185, 83, 0, 46, 43,
0, 219, 0, 0, 55, 83, 43, 46, 0, 35,
0, 0, 83, 0, 46, 0, 0, 0, 0, 0,
0, 0, 0, 43, 0, 0, 0, 0, 0, 83,
0, 46, 162, 163, 164, 165, 166, 167, 168, 169,
170, 171
20, 21, 22, 34, 35, 65, 37, 38, 39, 40,
41, 246, 251, 42, 247, 23, 252, 24, 253, 25,
254, 257, 258, 262, 263, 260, 36, 34, 35, 135,
37, 38, 39, 40, 41, 264, 265, 42, 66, 268,
44, 269, 196, 78, 67, 56, 46, 79, 47, 136,
36, 34, 35, 0, 37, 38, 39, 40, 41, 259,
0, 42, 66, 0, 44, 0, 0, 0, 0, 56,
46, 0, 47, 0, 36, 34, 35, 0, 37, 38,
39, 40, 41, 0, 0, 42, 43, 0, 44, 0,
0, 0, 0, 56, 46, 0, 47, 0, 36, 34,
35, 0, 37, 38, 39, 40, 41, 0, 0, 42,
43, 0, 44, 0, 0, 0, 77, 0, 46, 0,
47, 0, 36, 34, 35, 0, 37, 38, 39, 40,
41, 0, 0, 42, 43, 0, 44, 0, 0, 34,
35, 0, 46, 0, 47, 0, 36, 0, 34, 35,
37, 38, 39, 40, 41, 34, 35, 42, 0, 0,
44, 0, 36, 0, 34, 178, 46, 115, 47, 0,
0, 36, 0, 116, 34, 35, 44, 0, 36, 0,
0, 0, 83, 43, 47, 44, 0, 36, 0, 0,
81, 46, 44, 47, 0, 0, 179, 36, 83, 0,
47, 44, 34, 35, 0, 34, 35, 83, 0, 47,
0, 44, 34, 35, 0, 0, 185, 83, 0, 47,
0, 0, 0, 0, 0, 36, 0, 0, 36, 0,
0, 0, 0, 0, 0, 36, 0, 219, 0, 44,
0, 0, 44, 0, 56, 83, 0, 47, 83, 44,
47, 0, 0, 0, 0, 83, 0, 47, 162, 163,
164, 165, 166, 167, 168, 169, 170, 171, 165, 166,
167, 168, 169, 170, 171
};
static const yytype_int16 yycheck[] =
{
10, 10, 10, 13, 10, 13, 13, 10, 10, 65,
19, 10, 20, 14, 0, 11, 9, 18, 47, 105,
106, 8, 9, 33, 34, 81, 49, 6, 33, 43,
9, 36, 37, 12, 8, 45, 46, 42, 31, 36,
37, 15, 16, 17, 32, 55, 34, 21, 22, 6,
52, 8, 9, 52, 42, 64, 66, 66, 66, 55,
66, 64, 46, 66, 48, 44, 8, 9, 64, 10,
11, 12, 82, 83, 50, 82, 162, 163, 164, 48,
47, 167, 168, 169, 170, 171, 36, 37, 51, 31,
51, 49, 42, 49, 36, 105, 106, 49, 77, 155,
42, 111, 112, 45, 8, 9, 10, 11, 12, 51,
11, 53, 122, 51, 49, 125, 35, 36, 37, 38,
39, 207, 208, 42, 51, 49, 135, 49, 138, 49,
7, 141, 135, 143, 141, 49, 49, 147, 49, 147,
10, 10, 10, 13, 10, 13, 13, 10, 66, 11,
19, 10, 20, 10, 14, 46, 9, 48, 18, 105,
106, 8, 9, 81, 34, 35, 6, 6, 8, 9,
9, 36, 37, 12, 8, 0, 46, 47, 31, 50,
11, 15, 16, 17, 7, 49, 56, 21, 22, 47,
32, 43, 34, 52, 56, 52, 65, 67, 67, 67,
42, 67, 65, 65, 67, 48, 45, 51, 8, 9,
47, 49, 82, 83, 49, 82, 162, 163, 164, 51,
49, 167, 168, 169, 170, 171, 36, 37, 10, 11,
12, 31, 42, 8, 9, 105, 106, 155, 77, 51,
49, 111, 112, 43, 51, 45, 49, 49, 49, 49,
50, 51, 122, 53, 33, 125, 31, 36, 37, 49,
49, 207, 208, 42, 49, 40, 135, 51, 138, 49,
45, 141, 135, 143, 141, 49, 51, 147, 53, 147,
4, 5, 6, 7, 8, 9, 10, 11, 12, 159,
129, 49, 162, 163, 164, 49, 130, 167, 168, 169,
170, 171, 49, 51, 36, 144, 145, 146, 178, 148,
149, 52, 8, 9, 33, 51, 150, 151, 3, 4,
129, 49, 162, 163, 164, 52, 130, 167, 168, 169,
170, 171, 36, 33, 51, 144, 145, 146, 178, 148,
149, 6, 8, 9, 7, 52, 150, 151, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 8, 9,
6, 10, 7, 46, 52, 31, 52, 207, 208, 35,
10, 11, 12, 8, 9, 31, 10, 207, 208, 35,
36, 37, 38, 39, 214, 215, 42, 43, 52, 45,
52, 31, 49, 49, 222, 51, 49, 53, 46, 49,
230, 229, 231, 43, 51, 45, 49, 52, 49, 49,
50, 51, 36, 53, 5, 6, 7, 8, 9, 10,
11, 12, 252, 1, 6, 7, 8, 9, 10, 11,
12, 52, 262, 263, 52, 13, 14, 15, 16, 17,
52, 52, 49, 49, 222, 51, 31, 53, 49, 46,
230, 229, 231, 46, 52, 40, 41, 52, 43, 51,
45, 49, 49, 49, 36, 31, 51, 9, 53, 52,
51, 50, 252, 1, 5, 6, 7, 8, 9, 10,
11, 12, 262, 263, 52, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 8, 9, 10, 51, 31, 52, 9,
50, 36, 34, 10, 37, 43, 52, 45, 52, 47,
9, 31, 52, 10, 10, 31, 31, 8, 9, 10,
35, 36, 37, 38, 39, 52, 52, 42, 43, 52,
45, 152, 12, 12, 49, 50, 51, 66, 53, 245,
31, 8, 9, -1, 35, 36, 37, 38, 39, -1,
28, 29, 30, 8, 9, 10, 35, 36, 37, 38,
39, 36, 34, 42, 37, 43, 10, 45, 52, 47,
52, 9, 31, 10, 10, 52, 31, 8, 9, 10,
35, 36, 37, 38, 39, 31, 52, 42, 43, 52,
45, 52, 152, 12, 49, 50, 51, 12, 53, 67,
31, 8, 9, -1, 35, 36, 37, 38, 39, 245,
-1, 42, 43, -1, 45, -1, -1, -1, -1, 50,
51, -1, 53, -1, 31, 8, 9, -1, 35, 36,
37, 38, 39, -1, -1, 42, 43, -1, 45, -1,
......@@ -818,23 +816,21 @@ static const yytype_int16 yycheck[] =
9, -1, 35, 36, 37, 38, 39, -1, -1, 42,
43, -1, 45, -1, -1, -1, 49, -1, 51, -1,
53, -1, 31, 8, 9, -1, 35, 36, 37, 38,
39, -1, -1, 42, 43, -1, 45, -1, 8, 9,
-1, -1, 51, -1, 53, -1, 31, -1, -1, -1,
39, -1, -1, 42, 43, -1, 45, -1, -1, 8,
9, -1, 51, -1, 53, -1, 31, -1, 8, 9,
35, 36, 37, 38, 39, 8, 9, 42, -1, -1,
45, 31, 8, 9, -1, -1, 51, -1, 53, -1,
40, 41, -1, 43, -1, 45, -1, -1, 31, 8,
9, 51, -1, 53, -1, 31, 8, 9, -1, -1,
43, -1, 45, -1, -1, -1, -1, 43, 51, 45,
53, -1, 31, 8, 9, 51, -1, 53, -1, 31,
-1, 40, 8, 9, -1, -1, 45, -1, 40, 8,
9, -1, 51, 45, 53, -1, 31, -1, -1, 51,
-1, 53, -1, -1, -1, 31, 8, 9, -1, -1,
45, -1, 31, -1, -1, 50, 51, -1, 53, 45,
-1, 40, -1, -1, 50, 51, 45, 53, -1, 31,
-1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
-1, -1, -1, 45, -1, -1, -1, -1, -1, 51,
-1, 53, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12
45, -1, 31, -1, 8, 9, 51, 36, 53, -1,
-1, 31, -1, 42, 8, 9, 45, -1, 31, -1,
-1, -1, 51, 43, 53, 45, -1, 31, -1, -1,
43, 51, 45, 53, -1, -1, 40, 31, 51, -1,
53, 45, 8, 9, -1, 8, 9, 51, -1, 53,
-1, 45, 8, 9, -1, -1, 50, 51, -1, 53,
-1, -1, -1, -1, -1, 31, -1, -1, 31, -1,
-1, -1, -1, -1, -1, 31, -1, 40, -1, 45,
-1, -1, 45, -1, 50, 51, -1, 53, 51, 45,
53, -1, -1, -1, -1, 51, -1, 53, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 6, 7,
8, 9, 10, 11, 12
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
......@@ -843,12 +839,12 @@ static const yytype_uint8 yystos[] =
{
0, 55, 0, 56, 1, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 43, 45, 47, 57, 59, 67, 68,
47, 49, 60, 8, 9, 31, 35, 36, 37, 38,
39, 42, 43, 45, 49, 51, 53, 64, 78, 82,
85, 86, 87, 88, 91, 50, 63, 78, 80, 83,
61, 80, 62, 78, 10, 43, 49, 69, 79, 81,
82, 83, 86, 87, 91, 66, 88, 49, 60, 64,
28, 29, 30, 43, 45, 47, 57, 59, 66, 67,
68, 47, 49, 60, 8, 9, 31, 35, 36, 37,
38, 39, 42, 43, 45, 49, 51, 53, 64, 78,
82, 85, 86, 87, 88, 91, 50, 63, 78, 80,
83, 61, 80, 62, 78, 10, 43, 49, 69, 79,
81, 82, 83, 86, 87, 91, 88, 49, 60, 64,
70, 43, 49, 51, 65, 81, 83, 91, 85, 71,
80, 72, 80, 73, 80, 85, 74, 82, 75, 83,
76, 80, 77, 80, 46, 48, 48, 47, 91, 91,
......@@ -1746,11 +1742,6 @@ yyreduce:
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 18:
#line 103 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 20:
#line 105 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
......@@ -1887,14 +1878,19 @@ yyreduce:
case 41:
#line 184 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr);
Addr2 a;
a.from = (yyvsp[(2) - (6)].addr);
a.to = (yyvsp[(6) - (6)].addr);
outcode(ADATA, &a);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = (yyvsp[(4) - (6)].lval);
}
}
break;
case 42:
#line 192 "a.y"
#line 197 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (5)].addr).sym);
......@@ -1905,7 +1901,7 @@ yyreduce:
break;
case 43:
#line 200 "a.y"
#line 205 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (7)].addr).sym);
......@@ -1920,7 +1916,7 @@ yyreduce:
break;
case 44:
#line 214 "a.y"
#line 219 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (4)].addr).sym);
......@@ -1931,7 +1927,7 @@ yyreduce:
break;
case 45:
#line 222 "a.y"
#line 227 "a.y"
{
Addr2 a;
settext((yyvsp[(2) - (6)].addr).sym);
......@@ -1946,7 +1942,7 @@ yyreduce:
break;
case 46:
#line 236 "a.y"
#line 241 "a.y"
{
(yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr);
......@@ -1954,7 +1950,7 @@ yyreduce:
break;
case 47:
#line 241 "a.y"
#line 246 "a.y"
{
(yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr);
......@@ -1962,7 +1958,7 @@ yyreduce:
break;
case 48:
#line 246 "a.y"
#line 251 "a.y"
{
(yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr);
......@@ -1971,7 +1967,7 @@ yyreduce:
break;
case 51:
#line 258 "a.y"
#line 263 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr);
......@@ -1979,7 +1975,7 @@ yyreduce:
break;
case 52:
#line 263 "a.y"
#line 268 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr);
......@@ -1990,7 +1986,7 @@ yyreduce:
break;
case 53:
#line 273 "a.y"
#line 278 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr);
......@@ -1998,7 +1994,7 @@ yyreduce:
break;
case 54:
#line 278 "a.y"
#line 283 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr);
......@@ -2009,7 +2005,7 @@ yyreduce:
break;
case 55:
#line 288 "a.y"
#line 293 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (2)].addr);
(yyval.addr2).to = nullgen;
......@@ -2017,7 +2013,7 @@ yyreduce:
break;
case 56:
#line 293 "a.y"
#line 298 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen;
......@@ -2025,7 +2021,7 @@ yyreduce:
break;
case 57:
#line 298 "a.y"
#line 303 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr);
......@@ -2033,7 +2029,7 @@ yyreduce:
break;
case 58:
#line 305 "a.y"
#line 310 "a.y"
{
(yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr);
......@@ -2042,7 +2038,7 @@ yyreduce:
break;
case 59:
#line 313 "a.y"
#line 318 "a.y"
{
(yyval.addr2).from = (yyvsp[(3) - (5)].addr);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr);
......@@ -2053,7 +2049,7 @@ yyreduce:
break;
case 60:
#line 323 "a.y"
#line 328 "a.y"
{
if((yyvsp[(1) - (3)].addr).type != TYPE_CONST || (yyvsp[(3) - (3)].addr).type != TYPE_CONST)
yyerror("arguments to PCDATA must be integer constants");
......@@ -2063,7 +2059,7 @@ yyreduce:
break;
case 61:
#line 332 "a.y"
#line 337 "a.y"
{
if((yyvsp[(1) - (3)].addr).type != TYPE_CONST)
yyerror("index for FUNCDATA must be integer constant");
......@@ -2075,21 +2071,21 @@ yyreduce:
break;
case 66:
#line 349 "a.y"
#line 354 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
}
break;
case 67:
#line 353 "a.y"
#line 358 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
}
break;
case 73:
#line 366 "a.y"
#line 371 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_BRANCH;
......@@ -2098,7 +2094,7 @@ yyreduce:
break;
case 74:
#line 372 "a.y"
#line 377 "a.y"
{
(yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
(yyval.addr) = nullgen;
......@@ -2110,7 +2106,7 @@ yyreduce:
break;
case 75:
#line 383 "a.y"
#line 388 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2119,7 +2115,7 @@ yyreduce:
break;
case 76:
#line 389 "a.y"
#line 394 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2128,7 +2124,7 @@ yyreduce:
break;
case 77:
#line 395 "a.y"
#line 400 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2137,7 +2133,7 @@ yyreduce:
break;
case 78:
#line 401 "a.y"
#line 406 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2146,7 +2142,7 @@ yyreduce:
break;
case 79:
#line 407 "a.y"
#line 412 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2155,7 +2151,7 @@ yyreduce:
break;
case 80:
#line 413 "a.y"
#line 418 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2164,7 +2160,7 @@ yyreduce:
break;
case 81:
#line 421 "a.y"
#line 426 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_CONST;
......@@ -2173,7 +2169,7 @@ yyreduce:
break;
case 82:
#line 427 "a.y"
#line 432 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
(yyval.addr).type = TYPE_ADDR;
......@@ -2186,7 +2182,7 @@ yyreduce:
break;
case 83:
#line 437 "a.y"
#line 442 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SCONST;
......@@ -2195,7 +2191,7 @@ yyreduce:
break;
case 84:
#line 443 "a.y"
#line 448 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2204,7 +2200,7 @@ yyreduce:
break;
case 85:
#line 449 "a.y"
#line 454 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2213,7 +2209,7 @@ yyreduce:
break;
case 86:
#line 455 "a.y"
#line 460 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2222,7 +2218,7 @@ yyreduce:
break;
case 87:
#line 461 "a.y"
#line 466 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -2231,7 +2227,7 @@ yyreduce:
break;
case 88:
#line 469 "a.y"
#line 474 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (1)].lval);
......@@ -2240,7 +2236,7 @@ yyreduce:
break;
case 89:
#line 475 "a.y"
#line 480 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (2)].lval);
......@@ -2249,7 +2245,7 @@ yyreduce:
break;
case 90:
#line 481 "a.y"
#line 486 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (3)].lval);
......@@ -2258,7 +2254,7 @@ yyreduce:
break;
case 91:
#line 487 "a.y"
#line 492 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (4)].lval);
......@@ -2267,7 +2263,7 @@ yyreduce:
break;
case 94:
#line 499 "a.y"
#line 504 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2277,7 +2273,7 @@ yyreduce:
break;
case 95:
#line 506 "a.y"
#line 511 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2287,7 +2283,7 @@ yyreduce:
break;
case 96:
#line 513 "a.y"
#line 518 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2297,7 +2293,7 @@ yyreduce:
break;
case 97:
#line 520 "a.y"
#line 525 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2310,7 +2306,7 @@ yyreduce:
break;
case 98:
#line 530 "a.y"
#line 535 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2323,7 +2319,7 @@ yyreduce:
break;
case 99:
#line 540 "a.y"
#line 545 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2336,7 +2332,7 @@ yyreduce:
break;
case 100:
#line 550 "a.y"
#line 555 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2345,7 +2341,7 @@ yyreduce:
break;
case 101:
#line 556 "a.y"
#line 561 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2354,7 +2350,7 @@ yyreduce:
break;
case 102:
#line 562 "a.y"
#line 567 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2364,7 +2360,7 @@ yyreduce:
break;
case 103:
#line 569 "a.y"
#line 574 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2376,7 +2372,7 @@ yyreduce:
break;
case 104:
#line 578 "a.y"
#line 583 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2388,14 +2384,14 @@ yyreduce:
break;
case 105:
#line 589 "a.y"
#line 594 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (1)].addr);
}
break;
case 106:
#line 593 "a.y"
#line 598 "a.y"
{
(yyval.addr) = (yyvsp[(1) - (6)].addr);
(yyval.addr).index = (yyvsp[(3) - (6)].lval);
......@@ -2405,7 +2401,7 @@ yyreduce:
break;
case 107:
#line 602 "a.y"
#line 607 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2416,7 +2412,7 @@ yyreduce:
break;
case 108:
#line 610 "a.y"
#line 615 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -2427,133 +2423,133 @@ yyreduce:
break;
case 109:
#line 619 "a.y"
#line 624 "a.y"
{
(yyval.lval) = 0;
}
break;
case 110:
#line 623 "a.y"
#line 628 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 111:
#line 627 "a.y"
#line 632 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 113:
#line 634 "a.y"
#line 639 "a.y"
{
(yyval.lval) = NAME_AUTO;
}
break;
case 116:
#line 642 "a.y"
#line 647 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
}
break;
case 117:
#line 646 "a.y"
#line 651 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 118:
#line 650 "a.y"
#line 655 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 119:
#line 654 "a.y"
#line 659 "a.y"
{
(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
}
break;
case 120:
#line 658 "a.y"
#line 663 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (3)].lval);
}
break;
case 122:
#line 665 "a.y"
#line 670 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
}
break;
case 123:
#line 669 "a.y"
#line 674 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
}
break;
case 124:
#line 673 "a.y"
#line 678 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
}
break;
case 125:
#line 677 "a.y"
#line 682 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
}
break;
case 126:
#line 681 "a.y"
#line 686 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
}
break;
case 127:
#line 685 "a.y"
#line 690 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
}
break;
case 128:
#line 689 "a.y"
#line 694 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
}
break;
case 129:
#line 693 "a.y"
#line 698 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
}
break;
case 130:
#line 697 "a.y"
#line 702 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
}
break;
case 131:
#line 701 "a.y"
#line 706 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
}
......@@ -2561,7 +2557,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
#line 2565 "y.tab.c"
#line 2561 "y.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
......@@ -41,7 +41,8 @@ dsname(Sym *s, int off, char *t, int n)
p->from.type = TYPE_MEM;
p->from.name = NAME_EXTERN;
p->from.offset = off;
p->from.scale = n;
p->from3.type = TYPE_CONST;
p->from3.offset = n;
p->from.sym = linksym(s);
p->to.type = TYPE_SCONST;
......@@ -105,14 +106,17 @@ gdata(Node *nam, Node *nr, int wid)
if(wid == 8 && is64(nr->type)) {
v = mpgetfix(nr->val.u.xval);
p = gins(ADATA, nam, nodintconst(v));
p->from.scale = 4;
p->from3.type = TYPE_CONST;
p->from3.offset = 4;
p = gins(ADATA, nam, nodintconst(v>>32));
p->from.scale = 4;
p->from3.type = TYPE_CONST;
p->from3.offset = 4;
p->from.offset += 4;
return;
}
p = gins(ADATA, nam, nr);
p->from.scale = wid;
p->from3.type = TYPE_CONST;
p->from3.offset = wid;
}
void
......@@ -125,12 +129,14 @@ gdatacomplex(Node *nam, Mpcplx *cval)
w = types[w]->width;
p = gins(ADATA, nam, N);
p->from.scale = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->real);
p = gins(ADATA, nam, N);
p->from.scale = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->from.offset += w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->imag);
......@@ -144,13 +150,15 @@ gdatastring(Node *nam, Strlit *sval)
p = gins(ADATA, nam, N);
datastring(sval->s, sval->len, &p->to);
p->from.scale = types[tptr]->width;
p->from3.type = TYPE_CONST;
p->from3.offset = types[tptr]->width;
p->to.type = TYPE_ADDR;
//print("%P\n", p);
nodconst(&nod1, types[TINT32], sval->len);
p = gins(ADATA, nam, &nod1);
p->from.scale = types[TINT32]->width;
p->from3.type = TYPE_CONST;
p->from3.offset = types[TINT32]->width;
p->from.offset += types[tptr]->width;
}
......@@ -165,7 +173,8 @@ dstringptr(Sym *s, int off, char *str)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->from.scale = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datastring(str, strlen(str)+1, &p->to);
p->to.type = TYPE_ADDR;
......@@ -189,7 +198,8 @@ dgostrlitptr(Sym *s, int off, Strlit *lit)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->from.scale = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datagostring(lit, &p->to);
p->to.type = TYPE_ADDR;
p->to.etype = TINT32;
......@@ -226,7 +236,8 @@ dsymptr(Sym *s, int off, Sym *x, int xoff)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->from.scale = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
p->to.type = TYPE_ADDR;
p->to.name = NAME_EXTERN;
p->to.sym = linksym(x);
......
......@@ -650,15 +650,27 @@ inst:
*/
| LDATA name '/' con ',' imm
{
outcode($1, &$2, $4, &$6);
outcode($1, &$2, 0, &$6);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = $4;
}
}
| LDATA name '/' con ',' ximm
{
outcode($1, &$2, $4, &$6);
outcode($1, &$2, 0, &$6);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = $4;
}
}
| LDATA name '/' con ',' fimm
{
outcode($1, &$2, $4, &$6);
outcode($1, &$2, 0, &$6);
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = $4;
}
}
/*
* RETURN
......
......@@ -649,13 +649,13 @@ static const yytype_uint16 yyrline[] =
474, 478, 482, 489, 493, 497, 501, 508, 512, 520,
524, 528, 532, 536, 540, 544, 551, 555, 559, 563,
567, 571, 578, 582, 589, 598, 609, 616, 621, 633,
638, 651, 655, 659, 666, 672, 678, 689, 697, 698,
701, 709, 717, 725, 733, 739, 747, 750, 758, 764,
772, 778, 786, 794, 815, 821, 827, 833, 841, 846,
854, 860, 867, 875, 876, 884, 891, 901, 902, 911,
919, 927, 936, 937, 940, 943, 947, 953, 954, 955,
958, 959, 963, 967, 971, 975, 981, 982, 986, 990,
994, 998, 1002, 1006, 1010, 1014, 1018
638, 651, 659, 667, 678, 684, 690, 701, 709, 710,
713, 721, 729, 737, 745, 751, 759, 762, 770, 776,
784, 790, 798, 806, 827, 833, 839, 845, 853, 858,
866, 872, 879, 887, 888, 896, 903, 913, 914, 923,
931, 939, 948, 949, 952, 955, 959, 965, 966, 967,
970, 971, 975, 979, 983, 987, 993, 994, 998, 1002,
1006, 1010, 1014, 1018, 1022, 1026, 1030
};
#endif
......@@ -2768,33 +2768,45 @@ yyreduce:
case 121:
#line 652 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), &(yyvsp[(2) - (6)].addr), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].addr));
outcode((yyvsp[(1) - (6)].lval), &(yyvsp[(2) - (6)].addr), 0, &(yyvsp[(6) - (6)].addr));
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = (yyvsp[(4) - (6)].lval);
}
}
break;
case 122:
#line 656 "a.y"
#line 660 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), &(yyvsp[(2) - (6)].addr), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].addr));
outcode((yyvsp[(1) - (6)].lval), &(yyvsp[(2) - (6)].addr), 0, &(yyvsp[(6) - (6)].addr));
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = (yyvsp[(4) - (6)].lval);
}
}
break;
case 123:
#line 660 "a.y"
#line 668 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), &(yyvsp[(2) - (6)].addr), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].addr));
outcode((yyvsp[(1) - (6)].lval), &(yyvsp[(2) - (6)].addr), 0, &(yyvsp[(6) - (6)].addr));
if(pass > 1) {
lastpc->from3.type = TYPE_CONST;
lastpc->from3.offset = (yyvsp[(4) - (6)].lval);
}
}
break;
case 124:
#line 667 "a.y"
#line 679 "a.y"
{
outcode((yyvsp[(1) - (2)].lval), &nullgen, 0, &nullgen);
}
break;
case 125:
#line 673 "a.y"
#line 685 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_BRANCH;
......@@ -2803,7 +2815,7 @@ yyreduce:
break;
case 126:
#line 679 "a.y"
#line 691 "a.y"
{
(yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
(yyval.addr) = nullgen;
......@@ -2815,7 +2827,7 @@ yyreduce:
break;
case 127:
#line 690 "a.y"
#line 702 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2824,7 +2836,7 @@ yyreduce:
break;
case 130:
#line 702 "a.y"
#line 714 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2833,7 +2845,7 @@ yyreduce:
break;
case 131:
#line 710 "a.y"
#line 722 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2842,7 +2854,7 @@ yyreduce:
break;
case 132:
#line 718 "a.y"
#line 730 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2851,7 +2863,7 @@ yyreduce:
break;
case 133:
#line 726 "a.y"
#line 738 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2860,7 +2872,7 @@ yyreduce:
break;
case 134:
#line 734 "a.y"
#line 746 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2869,7 +2881,7 @@ yyreduce:
break;
case 135:
#line 740 "a.y"
#line 752 "a.y"
{
if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= 1024)
yyerror("SPR/DCR out of range");
......@@ -2880,7 +2892,7 @@ yyreduce:
break;
case 137:
#line 751 "a.y"
#line 763 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2889,7 +2901,7 @@ yyreduce:
break;
case 138:
#line 759 "a.y"
#line 771 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2898,7 +2910,7 @@ yyreduce:
break;
case 139:
#line 765 "a.y"
#line 777 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2907,7 +2919,7 @@ yyreduce:
break;
case 140:
#line 773 "a.y"
#line 785 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2916,7 +2928,7 @@ yyreduce:
break;
case 141:
#line 779 "a.y"
#line 791 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2925,7 +2937,7 @@ yyreduce:
break;
case 142:
#line 787 "a.y"
#line 799 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_REG;
......@@ -2934,7 +2946,7 @@ yyreduce:
break;
case 143:
#line 795 "a.y"
#line 807 "a.y"
{
int mb, me;
uint32 v;
......@@ -2956,7 +2968,7 @@ yyreduce:
break;
case 144:
#line 816 "a.y"
#line 828 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (1)].lval);
......@@ -2965,7 +2977,7 @@ yyreduce:
break;
case 145:
#line 822 "a.y"
#line 834 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (2)].lval);
......@@ -2974,7 +2986,7 @@ yyreduce:
break;
case 146:
#line 828 "a.y"
#line 840 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = (yyvsp[(1) - (3)].lval);
......@@ -2983,7 +2995,7 @@ yyreduce:
break;
case 147:
#line 834 "a.y"
#line 846 "a.y"
{
(yyval.addr).type = TYPE_TEXTSIZE;
(yyval.addr).offset = -(yyvsp[(2) - (4)].lval);
......@@ -2992,7 +3004,7 @@ yyreduce:
break;
case 148:
#line 842 "a.y"
#line 854 "a.y"
{
(yyval.addr) = (yyvsp[(2) - (2)].addr);
(yyval.addr).type = TYPE_CONST;
......@@ -3000,7 +3012,7 @@ yyreduce:
break;
case 149:
#line 847 "a.y"
#line 859 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_SCONST;
......@@ -3009,7 +3021,7 @@ yyreduce:
break;
case 150:
#line 855 "a.y"
#line 867 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -3018,7 +3030,7 @@ yyreduce:
break;
case 151:
#line 861 "a.y"
#line 873 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_FCONST;
......@@ -3027,7 +3039,7 @@ yyreduce:
break;
case 152:
#line 868 "a.y"
#line 880 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_CONST;
......@@ -3036,7 +3048,7 @@ yyreduce:
break;
case 154:
#line 877 "a.y"
#line 889 "a.y"
{
if((yyval.lval) < 0 || (yyval.lval) >= NREG)
print("register value out of range\n");
......@@ -3045,7 +3057,7 @@ yyreduce:
break;
case 155:
#line 885 "a.y"
#line 897 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -3055,7 +3067,7 @@ yyreduce:
break;
case 156:
#line 892 "a.y"
#line 904 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -3066,7 +3078,7 @@ yyreduce:
break;
case 158:
#line 903 "a.y"
#line 915 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -3076,7 +3088,7 @@ yyreduce:
break;
case 159:
#line 912 "a.y"
#line 924 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -3087,7 +3099,7 @@ yyreduce:
break;
case 160:
#line 920 "a.y"
#line 932 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -3098,7 +3110,7 @@ yyreduce:
break;
case 161:
#line 928 "a.y"
#line 940 "a.y"
{
(yyval.addr) = nullgen;
(yyval.addr).type = TYPE_MEM;
......@@ -3109,126 +3121,126 @@ yyreduce:
break;
case 164:
#line 940 "a.y"
#line 952 "a.y"
{
(yyval.lval) = 0;
}
break;
case 165:
#line 944 "a.y"
#line 956 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 166:
#line 948 "a.y"
#line 960 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 171:
#line 960 "a.y"
#line 972 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
}
break;
case 172:
#line 964 "a.y"
#line 976 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 173:
#line 968 "a.y"
#line 980 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 174:
#line 972 "a.y"
#line 984 "a.y"
{
(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
}
break;
case 175:
#line 976 "a.y"
#line 988 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (3)].lval);
}
break;
case 177:
#line 983 "a.y"
#line 995 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
}
break;
case 178:
#line 987 "a.y"
#line 999 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
}
break;
case 179:
#line 991 "a.y"
#line 1003 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
}
break;
case 180:
#line 995 "a.y"
#line 1007 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
}
break;
case 181:
#line 999 "a.y"
#line 1011 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
}
break;
case 182:
#line 1003 "a.y"
#line 1015 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
}
break;
case 183:
#line 1007 "a.y"
#line 1019 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
}
break;
case 184:
#line 1011 "a.y"
#line 1023 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
}
break;
case 185:
#line 1015 "a.y"
#line 1027 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
}
break;
case 186:
#line 1019 "a.y"
#line 1031 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
}
......@@ -3236,7 +3248,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
#line 3240 "y.tab.c"
#line 3252 "y.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
......@@ -43,7 +43,8 @@ dsname(Sym *s, int off, char *t, int n)
p->from.offset = off;
p->from.sym = linksym(s);
p->reg = n;
p->from3.type = TYPE_CONST;
p->from3.offset = n;
p->to.type = TYPE_SCONST;
p->to.name = NAME_NONE;
......@@ -106,7 +107,8 @@ gdata(Node *nam, Node *nr, int wid)
}
}
p = gins(ADATA, nam, nr);
p->reg = wid;
p->from3.type = TYPE_CONST;
p->from3.offset = wid;
}
void
......@@ -119,12 +121,14 @@ gdatacomplex(Node *nam, Mpcplx *cval)
w = types[w]->width;
p = gins(ADATA, nam, N);
p->reg = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->real);
p = gins(ADATA, nam, N);
p->reg = w;
p->from3.type = TYPE_CONST;
p->from3.offset = w;
p->from.offset += w;
p->to.type = TYPE_FCONST;
p->to.u.dval = mpgetflt(&cval->imag);
......@@ -138,13 +142,15 @@ gdatastring(Node *nam, Strlit *sval)
p = gins(ADATA, nam, N);
datastring(sval->s, sval->len, &p->to);
p->reg = types[tptr]->width;
p->from3.type = TYPE_CONST;
p->from3.offset = types[tptr]->width;
p->to.type = TYPE_CONST;
p->to.etype = simtype[tptr];
nodconst(&nod1, types[TINT], sval->len);
p = gins(ADATA, nam, &nod1);
p->reg = widthint;
p->from3.type = TYPE_CONST;
p->from3.offset = widthint;
p->from.offset += widthptr;
}
......@@ -159,7 +165,8 @@ dstringptr(Sym *s, int off, char *str)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->reg = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datastring(str, strlen(str)+1, &p->to);
p->to.type = TYPE_CONST;
......@@ -183,7 +190,8 @@ dgostrlitptr(Sym *s, int off, Strlit *lit)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->reg = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
datagostring(lit, &p->to);
p->to.type = TYPE_CONST;
p->to.etype = simtype[TINT];
......@@ -220,7 +228,8 @@ dsymptr(Sym *s, int off, Sym *x, int xoff)
p->from.name = NAME_EXTERN;
p->from.sym = linksym(s);
p->from.offset = off;
p->reg = widthptr;
p->from3.type = TYPE_CONST;
p->from3.offset = widthptr;
p->to.type = TYPE_CONST;
p->to.name = NAME_EXTERN;
p->to.sym = linksym(x);
......
......@@ -80,7 +80,7 @@ savedata(Link *ctxt, LSym *s, Prog *p, char *pn)
Reloc *r;
off = p->from.offset;
siz = ctxt->arch->datasize(p);
siz = p->from3.offset;
if(off < 0 || siz < 0 || off >= 1<<30 || siz >= 100)
mangle(pn);
if(ctxt->enforce_data_order && off < s->np)
......
......@@ -109,7 +109,7 @@ Pconv(Fmt *fp)
sprint(str, "%.5lld (%L) %A%s %D,%D", p->pc, p->lineno, a, sc, &p->from, &p->to);
} else
if(a == ADATA)
sprint(str, "%.5lld (%L) %A %D/%d,%D", p->pc, p->lineno, a, &p->from, p->reg, &p->to);
sprint(str, "%.5lld (%L) %A %D/%lld,%D", p->pc, p->lineno, a, &p->from, p->from3.offset, &p->to);
else
if(p->as == ATEXT)
sprint(str, "%.5lld (%L) %A %D,%lld,%D", p->pc, p->lineno, a, &p->from, p->from3.offset, &p->to);
......
......@@ -85,8 +85,8 @@ Pconv(Fmt *fp)
switch(p->as) {
case ADATA:
sprint(str, "%.5lld (%L) %A %D/%d,%D",
p->pc, p->lineno, p->as, &p->from, p->from.scale, &p->to);
sprint(str, "%.5lld (%L) %A %D/%lld,%D",
p->pc, p->lineno, p->as, &p->from, p->from3.offset, &p->to);
break;
case ATEXT:
......
......@@ -72,8 +72,8 @@ Pconv(Fmt *fp)
bigP = p;
switch(p->as) {
case ADATA:
sprint(str, "%.5lld (%L) %A %D/%d,%D",
p->pc, p->lineno, p->as, &p->from, p->from.scale, &p->to);
sprint(str, "%.5lld (%L) %A %D/%lld,%D",
p->pc, p->lineno, p->as, &p->from, p->from3.offset, &p->to);
break;
case ATEXT:
......
......@@ -94,7 +94,7 @@ Pconv(Fmt *fp)
str[0] = 0;
if(a == ADATA || a == AINIT || a == ADYNT)
sprint(str, "%.5lld (%L) %A %D/%d,%D", p->pc, p->lineno, a, &p->from, p->reg, &p->to);
sprint(str, "%.5lld (%L) %A %D/%lld,%D", p->pc, p->lineno, a, &p->from, p->from3.offset, &p->to);
else if(a == ATEXT || a == AGLOBL) {
if(p->from3.offset != 0)
sprint(str, "%.5lld (%L) %A %D,%lld,%D", p->pc, p->lineno, a, &p->from, p->from3.offset, &p->to);
......
......@@ -47,12 +47,6 @@ iscall(Prog *p)
return p->as == ABL;
}
static int
datasize(Prog *p)
{
return p->reg;
}
static void
progedit(Link *ctxt, Prog *p)
{
......@@ -1015,7 +1009,6 @@ LinkArch linkarm = {
.preprocess = preprocess,
.assemble = span5,
.datasize = datasize,
.follow = follow,
.iscall = iscall,
.isdata = isdata,
......
......@@ -59,12 +59,6 @@ iscall(Prog *p)
return p->as == ACALL;
}
static int
datasize(Prog *p)
{
return p->from.scale;
}
static void nacladdr(Link*, Prog*, Addr*);
static int
......@@ -1052,7 +1046,6 @@ LinkArch linkamd64 = {
.preprocess = preprocess,
.assemble = span6,
.datasize = datasize,
.follow = follow,
.iscall = iscall,
.isdata = isdata,
......@@ -1083,7 +1076,6 @@ LinkArch linkamd64p32 = {
.preprocess = preprocess,
.assemble = span6,
.datasize = datasize,
.follow = follow,
.iscall = iscall,
.isdata = isdata,
......
......@@ -47,12 +47,6 @@ iscall(Prog *p)
return p->as == ACALL;
}
static int
datasize(Prog *p)
{
return p->from.scale;
}
static int
canuselocaltls(Link *ctxt)
{
......@@ -851,7 +845,6 @@ LinkArch link386 = {
.preprocess = preprocess,
.assemble = span8,
.datasize = datasize,
.follow = follow,
.iscall = iscall,
.isdata = isdata,
......
......@@ -47,12 +47,6 @@ iscall(Prog *p)
return p->as == ABL;
}
static int
datasize(Prog *p)
{
return p->reg;
}
static void
progedit(Link *ctxt, Prog *p)
{
......@@ -938,7 +932,6 @@ LinkArch linkppc64 = {
.preprocess = preprocess,
.assemble = span9,
.datasize = datasize,
.follow = follow,
.iscall = iscall,
.isdata = isdata,
......@@ -969,7 +962,6 @@ LinkArch linkppc64le = {
.preprocess = preprocess,
.assemble = span9,
.datasize = datasize,
.follow = follow,
.iscall = iscall,
.isdata = isdata,
......
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