Commit b55791e2 authored by Russ Cox's avatar Russ Cox

[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped

I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.

Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.

Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.

Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).

Came up as part of CL 167730043.

LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
parent 87b4149b
...@@ -67,6 +67,7 @@ struct Sym ...@@ -67,6 +67,7 @@ struct Sym
int32 value; int32 value;
ushort type; ushort type;
char *name; char *name;
char* labelname;
char sym; char sym;
}; };
#define S ((Sym*)0) #define S ((Sym*)0)
...@@ -136,6 +137,8 @@ void newio(void); ...@@ -136,6 +137,8 @@ void newio(void);
void newfile(char*, int); void newfile(char*, int);
Sym* slookup(char*); Sym* slookup(char*);
Sym* lookup(void); Sym* lookup(void);
Sym* labellookup(Sym*);
void settext(LSym*);
void syminit(Sym*); void syminit(Sym*);
int32 yylex(void); int32 yylex(void);
int getc(void); int getc(void);
......
...@@ -73,15 +73,11 @@ prog: ...@@ -73,15 +73,11 @@ prog:
line line
line: line:
LLAB ':' LNAME ':'
{
if($1->value != pc)
yyerror("redeclaration of %s", $1->name);
$1->value = pc;
}
line
| LNAME ':'
{ {
$1 = labellookup($1);
if($1->type == LLAB && $1->value != pc)
yyerror("redeclaration of %s", $1->labelname);
$1->type = LLAB; $1->type = LLAB;
$1->value = pc; $1->value = pc;
} }
...@@ -218,18 +214,21 @@ inst: ...@@ -218,18 +214,21 @@ inst:
*/ */
| LTYPEB name ',' imm | LTYPEB name ',' imm
{ {
settext($2.sym);
$4.type = D_CONST2; $4.type = D_CONST2;
$4.offset2 = ArgsSizeUnknown; $4.offset2 = ArgsSizeUnknown;
outcode($1, Always, &$2, 0, &$4); outcode($1, Always, &$2, 0, &$4);
} }
| LTYPEB name ',' con ',' imm | LTYPEB name ',' con ',' imm
{ {
settext($2.sym);
$6.type = D_CONST2; $6.type = D_CONST2;
$6.offset2 = ArgsSizeUnknown; $6.offset2 = ArgsSizeUnknown;
outcode($1, Always, &$2, $4, &$6); outcode($1, Always, &$2, $4, &$6);
} }
| LTYPEB name ',' con ',' imm '-' con | LTYPEB name ',' con ',' imm '-' con
{ {
settext($2.sym);
$6.type = D_CONST2; $6.type = D_CONST2;
$6.offset2 = $8; $6.offset2 = $8;
outcode($1, Always, &$2, $4, &$6); outcode($1, Always, &$2, $4, &$6);
...@@ -373,15 +372,10 @@ rel: ...@@ -373,15 +372,10 @@ rel:
} }
| LNAME offset | LNAME offset
{ {
$1 = labellookup($1);
$$ = nullgen; $$ = nullgen;
if(pass == 2) if(pass == 2 && $1->type != LLAB)
yyerror("undefined label: %s", $1->name); yyerror("undefined label: %s", $1->labelname);
$$.type = D_BRANCH;
$$.offset = $2;
}
| LLAB offset
{
$$ = nullgen;
$$.type = D_BRANCH; $$.type = D_BRANCH;
$$.offset = $1->value + $2; $$.offset = $1->value + $2;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* A Bison parser, made by GNU Bison 2.7.12-4996. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison interface for Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -26,20 +29,10 @@ ...@@ -26,20 +29,10 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_YY_Y_TAB_H_INCLUDED
# define YY_YY_Y_TAB_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -148,41 +141,24 @@ extern int yydebug; ...@@ -148,41 +141,24 @@ extern int yydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{
/* Line 2053 of yacc.c */
#line 39 "a.y" #line 39 "a.y"
{
Sym *sym; Sym *sym;
int32 lval; int32 lval;
double dval; double dval;
char sval[8]; char sval[8];
Addr addr; Addr addr;
}
/* Line 1529 of yacc.c. */
/* Line 2053 of yacc.c */ #line 157 "y.tab.h"
#line 166 "y.tab.h" YYSTYPE;
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE yylval; extern YYSTYPE yylval;
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_Y_TAB_H_INCLUDED */
...@@ -70,6 +70,7 @@ struct Sym ...@@ -70,6 +70,7 @@ struct Sym
vlong value; vlong value;
ushort type; ushort type;
char *name; char *name;
char* labelname;
char sym; char sym;
}; };
#define S ((Sym*)0) #define S ((Sym*)0)
...@@ -148,6 +149,8 @@ void newio(void); ...@@ -148,6 +149,8 @@ void newio(void);
void newfile(char*, int); void newfile(char*, int);
Sym* slookup(char*); Sym* slookup(char*);
Sym* lookup(void); Sym* lookup(void);
Sym* labellookup(Sym*);
void settext(LSym*);
void syminit(Sym*); void syminit(Sym*);
int32 yylex(void); int32 yylex(void);
int getc(void); int getc(void);
......
...@@ -71,15 +71,11 @@ prog: ...@@ -71,15 +71,11 @@ prog:
line line
line: line:
LLAB ':' LNAME ':'
{
if($1->value != pc)
yyerror("redeclaration of %s", $1->name);
$1->value = pc;
}
line
| LNAME ':'
{ {
$1 = labellookup($1);
if($1->type == LLAB && $1->value != pc)
yyerror("redeclaration of %s (%s)", $1->labelname, $1->name);
$1->type = LLAB; $1->type = LLAB;
$1->value = pc; $1->value = pc;
} }
...@@ -197,11 +193,13 @@ spec1: /* DATA */ ...@@ -197,11 +193,13 @@ spec1: /* DATA */
spec2: /* TEXT */ spec2: /* TEXT */
mem ',' imm2 mem ',' imm2
{ {
settext($1.sym);
$$.from = $1; $$.from = $1;
$$.to = $3; $$.to = $3;
} }
| mem ',' con ',' imm2 | mem ',' con ',' imm2
{ {
settext($1.sym);
$$.from = $1; $$.from = $1;
$$.from.scale = $3; $$.from.scale = $3;
$$.to = $5; $$.to = $5;
...@@ -363,15 +361,10 @@ rel: ...@@ -363,15 +361,10 @@ rel:
} }
| LNAME offset | LNAME offset
{ {
$1 = labellookup($1);
$$ = nullgen; $$ = nullgen;
if(pass == 2) if(pass == 2 && $1->type != LLAB)
yyerror("undefined label: %s", $1->name); yyerror("undefined label: %s", $1->labelname);
$$.type = D_BRANCH;
$$.offset = $2;
}
| LLAB offset
{
$$ = nullgen;
$$.type = D_BRANCH; $$.type = D_BRANCH;
$$.offset = $1->value + $2; $$.offset = $1->value + $2;
} }
......
...@@ -411,16 +411,16 @@ union yyalloc ...@@ -411,16 +411,16 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 2 #define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
#define YYLAST 560 #define YYLAST 549
/* YYNTOKENS -- Number of terminals. */ /* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 56 #define YYNTOKENS 56
/* YYNNTS -- Number of nonterminals. */ /* YYNNTS -- Number of nonterminals. */
#define YYNNTS 42 #define YYNNTS 41
/* YYNRULES -- Number of rules. */ /* YYNRULES -- Number of rules. */
#define YYNRULES 137 #define YYNRULES 134
/* YYNRULES -- Number of states. */ /* YYNRULES -- Number of states. */
#define YYNSTATES 277 #define YYNSTATES 271
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2 #define YYUNDEFTOK 2
...@@ -469,91 +469,91 @@ static const yytype_uint8 yytranslate[] = ...@@ -469,91 +469,91 @@ static const yytype_uint8 yytranslate[] =
YYRHS. */ YYRHS. */
static const yytype_uint16 yyprhs[] = static const yytype_uint16 yyprhs[] =
{ {
0, 0, 3, 4, 5, 9, 10, 15, 16, 21, 0, 0, 3, 4, 5, 9, 10, 15, 17, 20,
23, 26, 29, 33, 37, 40, 43, 46, 49, 52, 23, 27, 31, 34, 37, 40, 43, 46, 49, 52,
55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82,
85, 88, 91, 94, 95, 97, 101, 105, 108, 110, 85, 88, 89, 91, 95, 99, 102, 104, 107, 109,
113, 115, 118, 120, 124, 130, 134, 140, 143, 145, 112, 114, 118, 124, 128, 134, 137, 139, 141, 143,
147, 149, 153, 159, 163, 169, 172, 174, 178, 184, 147, 153, 157, 163, 166, 168, 172, 178, 184, 185,
190, 191, 193, 197, 203, 207, 211, 213, 215, 217, 187, 191, 197, 201, 205, 207, 209, 211, 213, 216,
219, 222, 225, 227, 229, 231, 233, 238, 241, 244, 219, 221, 223, 225, 227, 232, 235, 237, 239, 241,
246, 248, 250, 252, 254, 256, 258, 261, 264, 267, 243, 245, 247, 249, 252, 255, 258, 261, 264, 269,
270, 273, 278, 284, 288, 290, 292, 294, 299, 304, 275, 279, 281, 283, 285, 290, 295, 300, 307, 317,
309, 316, 326, 336, 340, 344, 350, 359, 361, 368, 327, 331, 335, 341, 350, 352, 359, 365, 373, 374,
374, 382, 383, 386, 389, 391, 393, 395, 397, 399, 377, 380, 382, 384, 386, 388, 390, 393, 396, 399,
402, 405, 408, 412, 414, 417, 421, 426, 428, 432, 403, 405, 408, 412, 417, 419, 423, 427, 431, 435,
436, 440, 444, 448, 453, 458, 462, 466 439, 444, 449, 453, 457
}; };
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] = static const yytype_int8 yyrhs[] =
{ {
57, 0, -1, -1, -1, 57, 58, 59, -1, -1, 57, 0, -1, -1, -1, 57, 58, 59, -1, -1,
46, 48, 60, 59, -1, -1, 45, 48, 61, 59, 45, 48, 60, 59, -1, 49, -1, 61, 49, -1,
-1, 49, -1, 62, 49, -1, 1, 49, -1, 45, 1, 49, -1, 45, 50, 96, -1, 47, 50, 96,
50, 97, -1, 47, 50, 97, -1, 13, 63, -1, -1, 13, 62, -1, 14, 66, -1, 15, 65, -1,
14, 67, -1, 15, 66, -1, 16, 64, -1, 17, 16, 63, -1, 17, 64, -1, 21, 67, -1, 19,
65, -1, 21, 68, -1, 19, 69, -1, 22, 70, 68, -1, 22, 69, -1, 18, 70, -1, 20, 71,
-1, 18, 71, -1, 20, 72, -1, 25, 73, -1, -1, 25, 72, -1, 26, 73, -1, 27, 74, -1,
26, 74, -1, 27, 75, -1, 28, 76, -1, 29, 28, 75, -1, 29, 76, -1, 30, 77, -1, 23,
77, -1, 30, 78, -1, 23, 79, -1, 24, 80, 78, -1, 24, 79, -1, 31, 80, -1, -1, 51,
-1, 31, 81, -1, -1, 51, -1, 84, 51, 82, -1, 83, 51, 81, -1, 81, 51, 83, -1, 83,
-1, 82, 51, 84, -1, 84, 51, -1, 84, -1, 51, -1, 83, -1, 51, 81, -1, 81, -1, 51,
51, 82, -1, 82, -1, 51, 85, -1, 85, -1, 84, -1, 84, -1, 87, 51, 84, -1, 91, 11,
88, 51, 85, -1, 92, 11, 95, 51, 88, -1, 94, 51, 87, -1, 88, 51, 86, -1, 88, 51,
89, 51, 87, -1, 89, 51, 95, 51, 87, -1, 94, 51, 86, -1, 51, 82, -1, 82, -1, 62,
51, 83, -1, 83, -1, 63, -1, 67, -1, 84, -1, 66, -1, 83, 51, 81, -1, 83, 51, 81,
51, 82, -1, 84, 51, 82, 48, 37, -1, 84, 48, 37, -1, 83, 51, 81, -1, 83, 51, 81,
51, 82, -1, 84, 51, 82, 48, 38, -1, 84, 48, 38, -1, 83, 51, -1, 83, -1, 83, 51,
51, -1, 84, -1, 84, 51, 82, -1, 86, 51, 81, -1, 85, 51, 81, 51, 94, -1, 87, 51,
82, 51, 95, -1, 88, 51, 82, 51, 86, -1, 81, 51, 85, -1, -1, 87, -1, 88, 51, 87,
-1, 88, -1, 89, 51, 88, -1, 89, 51, 95, -1, 88, 51, 94, 51, 87, -1, 83, 51, 83,
51, 88, -1, 84, 51, 84, -1, 84, 51, 84, -1, 83, 51, 83, -1, 85, -1, 88, -1, 84,
-1, 86, -1, 89, -1, 85, -1, 91, -1, 10, -1, 90, -1, 10, 85, -1, 10, 89, -1, 85,
86, -1, 10, 90, -1, 86, -1, 90, -1, 82, -1, 89, -1, 81, -1, 87, -1, 94, 52, 34,
-1, 88, -1, 95, 52, 34, 53, -1, 45, 93, 53, -1, 45, 92, -1, 36, -1, 39, -1, 37,
-1, 46, 93, -1, 36, -1, 39, -1, 37, -1, -1, 40, -1, 44, -1, 38, -1, 41, -1, 54,
40, -1, 44, -1, 38, -1, 41, -1, 54, 96, 95, -1, 54, 94, -1, 54, 91, -1, 54, 43,
-1, 54, 95, -1, 54, 92, -1, 54, 43, -1, -1, 54, 42, -1, 54, 52, 42, 53, -1, 54,
54, 42, -1, 54, 52, 42, 53, -1, 54, 52, 52, 9, 42, 53, -1, 54, 9, 42, -1, 89,
9, 42, 53, -1, 54, 9, 42, -1, 90, -1, -1, 90, -1, 94, -1, 94, 52, 37, 53, -1,
91, -1, 95, -1, 95, 52, 37, 53, -1, 95, 94, 52, 44, 53, -1, 94, 52, 38, 53, -1,
52, 44, 53, -1, 95, 52, 38, 53, -1, 95, 94, 52, 37, 10, 94, 53, -1, 94, 52, 37,
52, 37, 10, 95, 53, -1, 95, 52, 37, 53, 53, 52, 37, 10, 94, 53, -1, 94, 52, 37,
52, 37, 10, 95, 53, -1, 95, 52, 37, 53, 53, 52, 38, 10, 94, 53, -1, 52, 37, 53,
52, 38, 10, 95, 53, -1, 52, 37, 53, -1, -1, 52, 44, 53, -1, 52, 37, 10, 94, 53,
52, 44, 53, -1, 52, 37, 10, 95, 53, -1, -1, 52, 37, 53, 52, 37, 10, 94, 53, -1,
52, 37, 53, 52, 37, 10, 95, 53, -1, 92, 91, -1, 91, 52, 37, 10, 94, 53, -1, 45,
-1, 92, 52, 37, 10, 95, 53, -1, 45, 93, 92, 52, 93, 53, -1, 45, 6, 7, 92, 52,
52, 94, 53, -1, 45, 6, 7, 93, 52, 35, 35, 53, -1, -1, 8, 94, -1, 9, 94, -1,
53, -1, -1, 8, 95, -1, 9, 95, -1, 35, 35, -1, 44, -1, 33, -1, 32, -1, 47, -1,
-1, 44, -1, 33, -1, 32, -1, 47, -1, 9, 9, 94, -1, 8, 94, -1, 55, 94, -1, 52,
95, -1, 8, 95, -1, 55, 95, -1, 52, 97, 96, 53, -1, 32, -1, 9, 32, -1, 32, 9,
53, -1, 32, -1, 9, 32, -1, 32, 9, 32, 32, -1, 9, 32, 9, 32, -1, 94, -1, 96,
-1, 9, 32, 9, 32, -1, 95, -1, 97, 8, 8, 96, -1, 96, 9, 96, -1, 96, 10, 96,
97, -1, 97, 9, 97, -1, 97, 10, 97, -1, -1, 96, 11, 96, -1, 96, 12, 96, -1, 96,
97, 11, 97, -1, 97, 12, 97, -1, 97, 6, 6, 6, 96, -1, 96, 7, 7, 96, -1, 96,
6, 97, -1, 97, 7, 7, 97, -1, 97, 5, 5, 96, -1, 96, 4, 96, -1, 96, 3, 96,
97, -1, 97, 4, 97, -1, 97, 3, 97, -1 -1
}; };
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 66, 66, 68, 67, 75, 74, 82, 81, 87, 0, 66, 66, 68, 67, 75, 74, 83, 84, 85,
88, 89, 92, 97, 103, 104, 105, 106, 107, 108, 88, 93, 99, 100, 101, 102, 103, 104, 105, 106,
109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
119, 120, 121, 124, 128, 135, 142, 149, 154, 161, 117, 120, 124, 131, 138, 145, 150, 157, 162, 169,
166, 173, 178, 183, 190, 198, 203, 211, 216, 223, 174, 179, 186, 194, 200, 209, 214, 221, 222, 225,
224, 227, 232, 242, 247, 257, 262, 267, 274, 282, 230, 240, 245, 255, 260, 265, 272, 280, 290, 294,
292, 296, 303, 308, 316, 325, 336, 337, 340, 341, 301, 306, 314, 323, 334, 335, 338, 339, 340, 344,
342, 346, 350, 351, 354, 355, 358, 364, 372, 380, 348, 349, 352, 353, 356, 362, 373, 378, 383, 388,
385, 390, 395, 400, 405, 410, 416, 424, 430, 441, 393, 398, 403, 409, 417, 423, 434, 440, 446, 452,
447, 453, 459, 465, 473, 474, 477, 483, 489, 495, 458, 466, 467, 470, 476, 482, 488, 494, 503, 512,
501, 510, 519, 528, 533, 538, 546, 556, 560, 569, 521, 526, 531, 539, 549, 553, 562, 569, 578, 581,
576, 585, 588, 592, 598, 599, 603, 606, 607, 611, 585, 591, 592, 596, 599, 600, 604, 608, 612, 616,
615, 619, 623, 629, 634, 639, 644, 651, 652, 656, 622, 627, 632, 637, 644, 645, 649, 653, 657, 661,
660, 664, 668, 672, 676, 680, 684, 688 665, 669, 673, 677, 681
}; };
#endif #endif
...@@ -569,7 +569,7 @@ static const char *const yytname[] = ...@@ -569,7 +569,7 @@ static const char *const yytname[] =
"LTYPEF", "LCONST", "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LTYPEF", "LCONST", "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG",
"LFREG", "LMREG", "LXREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB", "LFREG", "LMREG", "LXREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB",
"LVAR", "':'", "';'", "'='", "','", "'('", "')'", "'$'", "'~'", "LVAR", "':'", "';'", "'='", "','", "'('", "')'", "'$'", "'~'",
"$accept", "prog", "@1", "line", "@2", "@3", "inst", "nonnon", "rimrem", "$accept", "prog", "@1", "line", "@2", "inst", "nonnon", "rimrem",
"remrim", "rimnon", "nonrem", "nonrel", "spec1", "spec2", "spec3", "remrim", "rimnon", "nonrem", "nonrel", "spec1", "spec2", "spec3",
"spec4", "spec5", "spec6", "spec7", "spec8", "spec9", "spec10", "spec11", "spec4", "spec5", "spec6", "spec7", "spec8", "spec9", "spec10", "spec11",
"spec12", "spec13", "rem", "rom", "rim", "rel", "reg", "imm2", "imm", "spec12", "spec13", "rem", "rom", "rim", "rel", "reg", "imm2", "imm",
...@@ -594,39 +594,39 @@ static const yytype_uint16 yytoknum[] = ...@@ -594,39 +594,39 @@ static const yytype_uint16 yytoknum[] =
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] = static const yytype_uint8 yyr1[] =
{ {
0, 56, 57, 58, 57, 60, 59, 61, 59, 59, 0, 56, 57, 58, 57, 60, 59, 59, 59, 59,
59, 59, 62, 62, 62, 62, 62, 62, 62, 62, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
62, 62, 62, 63, 63, 64, 65, 66, 66, 67, 61, 62, 62, 63, 64, 65, 65, 66, 66, 67,
67, 68, 68, 68, 69, 70, 70, 71, 71, 72, 67, 67, 68, 69, 69, 70, 70, 71, 71, 72,
72, 73, 73, 74, 74, 75, 75, 75, 76, 77, 72, 73, 73, 74, 74, 74, 75, 76, 77, 77,
78, 78, 79, 79, 80, 81, 82, 82, 83, 83, 78, 78, 79, 80, 81, 81, 82, 82, 82, 82,
83, 83, 83, 83, 84, 84, 85, 85, 85, 86, 82, 82, 83, 83, 84, 84, 85, 85, 85, 85,
86, 86, 86, 86, 86, 86, 87, 88, 88, 88, 85, 85, 85, 86, 87, 87, 87, 87, 87, 87,
88, 88, 88, 88, 89, 89, 90, 90, 90, 90, 87, 88, 88, 89, 89, 89, 89, 89, 89, 89,
90, 90, 90, 90, 90, 90, 90, 91, 91, 92, 89, 89, 89, 89, 90, 90, 91, 91, 92, 92,
92, 93, 93, 93, 94, 94, 94, 95, 95, 95, 92, 93, 93, 93, 94, 94, 94, 94, 94, 94,
95, 95, 95, 96, 96, 96, 96, 97, 97, 97, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96,
97, 97, 97, 97, 97, 97, 97, 97 96, 96, 96, 96, 96
}; };
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] = static const yytype_uint8 yyr2[] =
{ {
0, 2, 0, 0, 3, 0, 4, 0, 4, 1, 0, 2, 0, 0, 3, 0, 4, 1, 2, 2,
2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 0, 1, 3, 3, 2, 1, 2, 2, 0, 1, 3, 3, 2, 1, 2, 1, 2,
1, 2, 1, 3, 5, 3, 5, 2, 1, 1, 1, 3, 5, 3, 5, 2, 1, 1, 1, 3,
1, 3, 5, 3, 5, 2, 1, 3, 5, 5, 5, 3, 5, 2, 1, 3, 5, 5, 0, 1,
0, 1, 3, 5, 3, 3, 1, 1, 1, 1, 3, 5, 3, 3, 1, 1, 1, 1, 2, 2,
2, 2, 1, 1, 1, 1, 4, 2, 2, 1, 1, 1, 1, 1, 4, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 4, 5,
2, 4, 5, 3, 1, 1, 1, 4, 4, 4, 3, 1, 1, 1, 4, 4, 4, 6, 9, 9,
6, 9, 9, 3, 3, 5, 8, 1, 6, 5, 3, 3, 5, 8, 1, 6, 5, 7, 0, 2,
7, 0, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 3,
2, 2, 3, 1, 2, 3, 4, 1, 3, 3, 1, 2, 3, 4, 1, 3, 3, 3, 3, 3,
3, 3, 3, 4, 4, 3, 3, 3 4, 4, 3, 3, 3
}; };
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
...@@ -634,89 +634,89 @@ static const yytype_uint8 yyr2[] = ...@@ -634,89 +634,89 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */ means the default is an error. */
static const yytype_uint8 yydefact[] = static const yytype_uint8 yydefact[] =
{ {
2, 3, 1, 0, 0, 33, 0, 0, 0, 0, 2, 3, 1, 0, 0, 31, 0, 0, 0, 0,
0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0,
0, 0, 60, 0, 0, 0, 0, 9, 4, 0, 0, 0, 58, 0, 0, 0, 7, 4, 0, 9,
11, 34, 14, 0, 0, 117, 79, 81, 84, 80, 32, 12, 0, 0, 114, 76, 78, 81, 77, 79,
82, 85, 83, 111, 118, 0, 0, 0, 15, 40, 82, 80, 108, 115, 0, 0, 0, 13, 38, 64,
66, 67, 94, 95, 107, 96, 0, 16, 74, 38, 65, 91, 92, 104, 93, 0, 14, 72, 36, 73,
75, 17, 0, 18, 0, 0, 111, 111, 0, 22, 15, 0, 16, 0, 0, 108, 0, 20, 46, 66,
48, 68, 72, 73, 69, 96, 20, 0, 34, 49, 70, 71, 67, 93, 18, 0, 32, 47, 48, 21,
50, 23, 111, 0, 0, 19, 42, 0, 0, 21, 108, 0, 0, 17, 40, 0, 0, 19, 0, 28,
0, 30, 0, 31, 0, 24, 0, 25, 0, 26, 0, 29, 0, 22, 0, 23, 0, 24, 54, 25,
56, 27, 0, 28, 0, 29, 61, 32, 0, 7, 0, 26, 0, 27, 59, 30, 0, 5, 0, 0,
0, 5, 0, 10, 120, 119, 0, 0, 0, 0, 8, 117, 116, 0, 0, 0, 0, 37, 0, 0,
39, 0, 0, 127, 0, 121, 0, 0, 0, 90, 124, 0, 118, 0, 0, 0, 87, 86, 0, 85,
89, 0, 88, 87, 37, 0, 0, 70, 71, 77, 84, 35, 0, 0, 68, 69, 75, 45, 0, 0,
78, 47, 0, 0, 77, 41, 0, 0, 0, 0, 75, 39, 0, 0, 0, 0, 0, 0, 0, 53,
0, 0, 0, 55, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 10, 11, 108, 109, 110, 0,
13, 111, 112, 113, 0, 0, 103, 104, 0, 0, 0, 100, 101, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, 119, 0, 0, 0, 0, 90, 0,
0, 0, 0, 93, 0, 0, 35, 36, 0, 0, 0, 33, 34, 0, 0, 41, 0, 43, 0, 60,
43, 0, 45, 0, 62, 0, 64, 51, 53, 57, 0, 62, 49, 51, 55, 0, 0, 63, 6, 0,
0, 0, 65, 8, 6, 0, 116, 114, 115, 0, 113, 111, 112, 0, 0, 0, 134, 133, 132, 0,
0, 0, 137, 136, 135, 0, 0, 128, 129, 130, 0, 125, 126, 127, 128, 129, 0, 0, 94, 96,
131, 132, 0, 0, 97, 99, 98, 0, 91, 76, 95, 0, 88, 74, 0, 0, 120, 83, 0, 0,
0, 0, 123, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 102, 0, 130, 131,
0, 109, 105, 0, 133, 134, 0, 0, 0, 92, 0, 0, 0, 89, 42, 121, 0, 44, 61, 50,
44, 124, 0, 46, 63, 52, 54, 58, 59, 0, 52, 56, 57, 0, 0, 105, 97, 0, 0, 0,
0, 108, 100, 0, 0, 0, 125, 110, 0, 0, 122, 107, 0, 0, 0, 123, 103, 0, 0, 98,
0, 126, 106, 0, 0, 101, 102 99
}; };
/* YYDEFGOTO[NTERM-NUM]. */ /* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] = static const yytype_int16 yydefgoto[] =
{ {
-1, 1, 3, 28, 159, 157, 29, 32, 61, 63, -1, 1, 3, 27, 153, 28, 31, 60, 62, 56,
57, 48, 85, 76, 89, 69, 81, 95, 97, 99, 47, 83, 74, 87, 67, 79, 93, 95, 97, 99,
101, 103, 105, 91, 93, 107, 58, 70, 59, 71, 101, 103, 89, 91, 105, 57, 68, 58, 69, 49,
50, 192, 60, 51, 52, 53, 54, 119, 209, 55, 187, 59, 50, 51, 52, 53, 116, 203, 54, 227,
233, 124 121
}; };
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */ STATE-NUM. */
#define YYPACT_NINF -94 #define YYPACT_NINF -89
static const yytype_int16 yypact[] = static const yytype_int16 yypact[] =
{ {
-94, 15, -94, 218, -28, -25, 264, 285, 285, 340, -89, 18, -89, 163, -5, -13, 219, 253, 253, 335,
163, 2, 319, 97, 415, 415, 285, 285, 285, 285, 194, 16, 274, 369, 418, 418, 253, 253, 253, 253,
306, -24, -24, 285, -17, -14, 4, -94, -94, 48, 240, 0, 0, 253, -17, 19, -89, -89, 24, -89,
-94, -94, -94, 481, 481, -94, -94, -94, -94, -94, -89, -89, 479, 479, -89, -89, -89, -89, -89, -89,
-94, -94, -94, 19, -94, 340, 399, 481, -94, -94, -89, -89, 111, -89, 335, 397, 479, -89, -89, -89,
-94, -94, -94, -94, 46, 47, 385, -94, -94, 52, -89, -89, -89, 33, 51, 390, -89, -89, 65, -89,
-94, -94, 59, -94, 60, 374, 19, 56, 243, -94, -89, 72, -89, 73, 356, 111, 314, -89, -89, -89,
-94, -94, -94, -94, -94, 63, -94, 106, 340, -94, -89, -89, -89, 74, -89, 30, 335, -89, -89, -89,
-94, -94, 56, 138, 481, -94, -94, 69, 72, -94, 70, 422, 479, -89, -89, 82, 86, -89, 88, -89,
74, -94, 76, -94, 77, -94, 79, -94, 80, -94, 89, -89, 90, -89, 91, -89, 92, -89, 101, -89,
81, -94, 83, -94, 89, -94, -94, -94, 94, -94, 105, -89, 114, -89, -89, -89, 116, -89, 479, 479,
481, -94, 481, -94, -94, -94, 119, 481, 481, 98, -89, -89, -89, 118, 479, 479, 120, -89, 5, 115,
-94, -1, 100, -94, 84, -94, 117, 23, 426, -94, -89, 83, -89, 133, -12, 404, -89, -89, 439, -89,
-94, 433, -94, -94, -94, 340, 285, -94, -94, 98, -89, -89, 335, 253, -89, -89, 120, -89, 9, 479,
-94, -94, 75, 481, -94, -94, 138, 122, 440, 444, -89, -89, 422, 141, 119, 452, 253, 335, 335, 335,
285, 340, 340, 340, 340, 340, 285, 218, 393, 218, 335, 335, 253, 163, 327, 327, 70, -89, -89, 4,
393, 56, -94, -94, -15, 481, 105, -94, 481, 481, 479, 143, -89, 479, 479, 479, 190, 191, 479, 479,
481, 156, 162, 481, 481, 481, 481, 481, -94, 165, 479, 479, 479, -89, 187, 6, 148, 152, -89, 470,
0, 123, 133, -94, 474, 134, -94, -94, 136, 140, 156, -89, -89, 158, 162, -89, 8, -89, 164, -89,
-94, 7, -94, 141, -94, 143, -94, 148, 149, -94, 166, -89, 170, 171, -89, 169, 172, -89, -89, 173,
147, 160, -94, -94, -94, 164, -94, -94, -94, 167, -89, -89, -89, 161, 176, 199, 102, 530, 537, 479,
168, 180, 533, 541, 548, 481, 481, 58, 58, -94, 479, 39, 39, -89, -89, -89, 479, 479, 185, -89,
-94, -94, 481, 481, 171, -94, -94, 172, -94, -94, -89, 189, -89, -89, 0, 208, 234, -89, 193, 0,
-24, 192, 217, -94, 175, -24, 219, 216, 481, 306, 211, 212, 479, 240, 217, -89, -89, 255, 55, 55,
220, -94, -94, 247, 33, 33, 205, 208, 41, -94, 214, 215, 59, -89, -89, 260, 241, -89, -89, -89,
-94, 253, 234, -94, -94, -94, -94, -94, -94, 215, -89, -89, -89, 222, 479, -89, -89, 262, 276, 256,
481, -94, -94, 259, 260, 239, -94, -94, 221, 481, -89, -89, 242, 479, 479, -89, -89, 243, 246, -89,
481, -94, -94, 223, 224, -94, -94 -89
}; };
/* YYPGOTO[NTERM-NUM]. */ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] = static const yytype_int16 yypgoto[] =
{ {
-94, -94, -94, -43, -94, -94, -94, 266, -94, -94, -89, -89, -89, 134, -89, -89, 289, -89, -89, -89,
-94, 273, -94, -94, -94, -94, -94, -94, -94, -94, 290, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-94, -94, -94, -94, -94, -94, 26, 229, 32, -11, -89, -89, -89, -89, -89, -2, 237, 11, -11, -9,
-9, 57, -8, 71, -2, -6, 1, -60, -94, -10, 76, -8, 87, -4, 2, -3, -56, -89, -10, -89,
-94, -93 -88
}; };
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
...@@ -726,124 +726,120 @@ static const yytype_int16 yypgoto[] = ...@@ -726,124 +726,120 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -1 #define YYTABLE_NINF -1
static const yytype_uint16 yytable[] = static const yytype_uint16 yytable[] =
{ {
75, 72, 86, 88, 74, 87, 139, 140, 73, 165, 73, 70, 84, 86, 48, 85, 71, 63, 75, 136,
223, 102, 77, 104, 106, 2, 231, 158, 206, 160, 48, 100, 72, 102, 104, 160, 217, 225, 2, 61,
207, 30, 144, 114, 115, 116, 31, 117, 118, 208, 154, 155, 111, 112, 140, 175, 176, 92, 94, 96,
56, 109, 49, 110, 111, 64, 123, 125, 49, 232, 98, 107, 177, 108, 106, 120, 122, 200, 30, 201,
62, 173, 174, 175, 176, 177, 133, 43, 94, 96, 226, 139, 117, 183, 29, 130, 175, 176, 202, 170,
98, 100, 166, 224, 112, 108, 137, 132, 75, 72, 171, 172, 129, 177, 55, 134, 73, 70, 161, 218,
180, 181, 74, 138, 117, 118, 73, 182, 175, 176, 135, 42, 71, 168, 169, 170, 171, 172, 72, 109,
177, 120, 145, 88, 123, 212, 213, 214, 263, 264, 141, 86, 120, 110, 117, 206, 207, 208, 114, 115,
217, 218, 219, 220, 221, 90, 92, 168, 169, 170, 211, 212, 213, 214, 215, 123, 163, 164, 165, 166,
171, 172, 173, 174, 175, 176, 177, 113, 126, 127, 167, 168, 169, 170, 171, 172, 257, 258, 120, 120,
123, 205, 123, 134, 120, 33, 34, 162, 163, 188, 199, 88, 90, 124, 157, 158, 164, 165, 166, 167,
135, 136, 180, 181, 203, 142, 204, 143, 115, 182, 168, 169, 170, 171, 172, 112, 131, 113, 120, 114,
146, 123, 244, 245, 147, 148, 161, 149, 150, 35, 115, 238, 239, 132, 133, 156, 138, 32, 33, 184,
151, 152, 153, 189, 154, 190, 88, 178, 193, 195, 181, 185, 86, 142, 188, 190, 173, 189, 143, 144,
155, 194, 82, 67, 44, 156, 33, 34, 83, 84, 145, 146, 147, 148, 182, 192, 193, 194, 195, 196,
164, 56, 47, 167, 179, 210, 188, 211, 123, 123, 204, 34, 149, 120, 120, 120, 150, 191, 120, 120,
123, 186, 215, 123, 123, 123, 123, 123, 187, 216, 120, 120, 120, 197, 4, 151, 43, 152, 162, 112,
35, 33, 34, 65, 115, 222, 225, 197, 198, 199, 174, 82, 159, 186, 46, 183, 5, 6, 7, 8,
200, 201, 196, 82, 67, 44, 226, 228, 202, 229, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
84, 230, 234, 47, 235, 35, 236, 237, 238, 36, 19, 20, 21, 22, 23, 205, 209, 216, 210, 120,
37, 38, 39, 40, 41, 123, 123, 42, 66, 67, 120, 219, 32, 33, 64, 220, 240, 241, 24, 222,
44, 239, 246, 247, 68, 46, 240, 243, 47, 4, 25, 223, 26, 224, 235, 228, 244, 229, 230, 231,
241, 242, 250, 248, 251, 249, 252, 254, 257, 191, 232, 248, 251, 233, 252, 234, 34, 32, 33, 236,
258, 5, 6, 7, 8, 9, 10, 11, 12, 13, 35, 36, 37, 38, 39, 40, 237, 242, 41, 65,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 245, 43, 243, 246, 262, 66, 45, 186, 249, 46,
268, 33, 34, 65, 256, 259, 255, 260, 261, 273, 250, 34, 253, 267, 268, 35, 36, 37, 38, 39,
274, 262, 265, 24, 25, 26, 266, 27, 267, 269, 40, 32, 33, 41, 42, 254, 43, 255, 256, 259,
270, 271, 33, 34, 272, 35, 275, 276, 79, 36, 44, 45, 263, 260, 46, 261, 35, 36, 37, 38,
37, 38, 39, 40, 41, 80, 0, 42, 66, 67, 39, 40, 32, 33, 41, 34, 264, 198, 265, 35,
44, 253, 0, 33, 34, 46, 35, 141, 47, 0, 36, 37, 38, 39, 40, 266, 269, 41, 42, 270,
36, 37, 38, 39, 40, 41, 0, 0, 42, 43, 43, 77, 78, 137, 247, 45, 34, 55, 46, 0,
0, 44, 0, 0, 0, 45, 46, 35, 0, 47, 35, 36, 37, 38, 39, 40, 0, 0, 41, 42,
0, 36, 37, 38, 39, 40, 41, 33, 34, 42, 0, 43, 32, 33, 64, 76, 45, 0, 0, 46,
43, 0, 44, 0, 0, 0, 0, 46, 0, 56, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
47, 0, 36, 37, 38, 39, 40, 41, 33, 34, 0, 0, 0, 32, 33, 0, 34, 0, 0, 0,
42, 35, 0, 0, 0, 36, 37, 38, 39, 40, 35, 36, 37, 38, 39, 40, 0, 0, 41, 65,
41, 0, 0, 42, 43, 0, 44, 0, 0, 0, 0, 43, 0, 0, 32, 33, 45, 34, 0, 46,
78, 46, 35, 0, 47, 0, 36, 37, 38, 39, 0, 35, 36, 37, 38, 39, 40, 32, 33, 41,
40, 41, 33, 34, 42, 43, 0, 44, 0, 0, 42, 0, 43, 0, 0, 0, 0, 45, 34, 0,
0, 0, 46, 33, 128, 47, 168, 169, 170, 171, 46, 0, 35, 36, 37, 38, 39, 40, 32, 125,
172, 173, 174, 175, 176, 177, 35, 33, 34, 0, 41, 34, 0, 43, 0, 32, 33, 0, 45, 0,
36, 37, 38, 39, 40, 41, 0, 35, 42, 0, 0, 46, 32, 33, 80, 0, 43, 0, 0, 0,
0, 44, 0, 33, 34, 0, 46, 129, 130, 47, 81, 82, 34, 55, 46, 0, 32, 33, 0, 34,
43, 35, 44, 0, 33, 34, 121, 131, 0, 0, 32, 33, 126, 127, 118, 42, 34, 43, 0, 0,
47, 33, 184, 122, 0, 0, 44, 35, 33, 34, 0, 119, 128, 0, 43, 46, 178, 32, 179, 82,
0, 84, 33, 34, 47, 0, 0, 0, 35, 0, 34, 43, 46, 0, 34, 0, 82, 0, 0, 46,
43, 0, 44, 0, 0, 35, 0, 46, 183, 0, 32, 33, 0, 42, 0, 43, 0, 80, 0, 43,
47, 0, 35, 44, 0, 185, 35, 0, 84, 0, 45, 34, 0, 46, 82, 0, 0, 46, 32, 33,
44, 47, 33, 34, 0, 84, 0, 44, 47, 33, 0, 180, 0, 0, 34, 0, 43, 32, 33, 0,
34, 44, 84, 0, 191, 47, 84, 0, 56, 47, 0, 82, 0, 0, 46, 0, 0, 0, 0, 43,
0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 34, 0, 82, 0, 55, 46, 0, 0,
0, 0, 0, 35, 0, 0, 227, 0, 0, 0, 0, 34, 221, 0, 0, 0, 0, 43, 0, 0,
0, 44, 0, 0, 0, 0, 84, 0, 44, 47, 0, 0, 82, 0, 0, 46, 43, 0, 0, 0,
0, 0, 0, 84, 0, 0, 47, 169, 170, 171, 0, 82, 0, 0, 46, 165, 166, 167, 168, 169,
172, 173, 174, 175, 176, 177, 170, 171, 172, 173, 170, 171, 172, 166, 167, 168, 169, 170, 171, 172
174, 175, 176, 177, 171, 172, 173, 174, 175, 176,
177
}; };
static const yytype_int16 yycheck[] = static const yytype_int16 yycheck[] =
{ {
10, 10, 13, 13, 10, 13, 66, 67, 10, 10, 10, 10, 13, 13, 6, 13, 10, 9, 11, 65,
10, 20, 11, 21, 22, 0, 9, 110, 33, 112, 12, 20, 10, 21, 22, 10, 10, 9, 0, 8,
35, 49, 82, 33, 34, 6, 51, 8, 9, 44, 108, 109, 32, 33, 80, 37, 38, 16, 17, 18,
54, 48, 6, 50, 48, 9, 46, 47, 12, 32, 19, 48, 44, 50, 23, 45, 46, 33, 51, 35,
8, 8, 9, 10, 11, 12, 56, 45, 16, 17, 32, 11, 44, 34, 49, 55, 37, 38, 44, 10,
18, 19, 53, 53, 50, 23, 65, 56, 68, 68, 11, 12, 55, 44, 54, 64, 66, 66, 53, 53,
37, 38, 68, 65, 8, 9, 68, 44, 10, 11, 64, 45, 66, 8, 9, 10, 11, 12, 66, 50,
12, 45, 83, 83, 84, 168, 169, 170, 37, 38, 81, 81, 82, 49, 76, 163, 164, 165, 8, 9,
173, 174, 175, 176, 177, 14, 15, 3, 4, 5, 168, 169, 170, 171, 172, 52, 3, 4, 5, 6,
6, 7, 8, 9, 10, 11, 12, 49, 52, 52, 7, 8, 9, 10, 11, 12, 37, 38, 108, 109,
110, 161, 112, 51, 78, 8, 9, 117, 118, 34, 156, 14, 15, 52, 114, 115, 4, 5, 6, 7,
51, 51, 37, 38, 157, 52, 159, 11, 128, 44, 8, 9, 10, 11, 12, 125, 51, 6, 128, 8,
51, 131, 215, 216, 52, 51, 7, 51, 51, 32, 9, 209, 210, 51, 51, 7, 52, 8, 9, 139,
51, 51, 51, 143, 51, 146, 146, 53, 148, 149, 132, 142, 142, 51, 144, 145, 53, 145, 52, 51,
51, 149, 45, 46, 47, 51, 8, 9, 51, 52, 51, 51, 51, 51, 133, 147, 148, 149, 150, 151,
52, 54, 55, 53, 37, 165, 34, 52, 168, 169, 160, 32, 51, 163, 164, 165, 51, 146, 168, 169,
170, 135, 6, 173, 174, 175, 176, 177, 136, 7, 170, 171, 172, 152, 1, 51, 47, 51, 53, 179,
32, 8, 9, 10, 184, 10, 53, 151, 152, 153, 37, 52, 52, 54, 55, 34, 13, 14, 15, 16,
154, 155, 150, 45, 46, 47, 53, 53, 156, 53, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
52, 51, 51, 55, 51, 32, 48, 48, 51, 36, 27, 28, 29, 30, 31, 52, 6, 10, 7, 209,
37, 38, 39, 40, 41, 215, 216, 44, 45, 46, 210, 53, 8, 9, 10, 53, 216, 217, 45, 53,
47, 51, 222, 223, 51, 52, 52, 37, 55, 1, 47, 53, 49, 51, 53, 51, 224, 51, 48, 48,
53, 53, 230, 52, 32, 53, 9, 235, 238, 54, 51, 229, 232, 51, 233, 52, 32, 8, 9, 53,
239, 13, 14, 15, 16, 17, 18, 19, 20, 21, 36, 37, 38, 39, 40, 41, 37, 52, 44, 45,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 47, 53, 9, 254, 51, 52, 54, 37, 55,
260, 8, 9, 10, 38, 35, 37, 10, 53, 269, 38, 32, 35, 263, 264, 36, 37, 38, 39, 40,
270, 53, 9, 45, 46, 47, 32, 49, 53, 10, 41, 8, 9, 44, 45, 10, 47, 53, 53, 9,
10, 32, 8, 9, 53, 32, 53, 53, 12, 36, 51, 52, 10, 32, 55, 53, 36, 37, 38, 39,
37, 38, 39, 40, 41, 12, -1, 44, 45, 46, 40, 41, 8, 9, 44, 32, 10, 153, 32, 36,
47, 234, -1, 8, 9, 52, 32, 68, 55, -1, 37, 38, 39, 40, 41, 53, 53, 44, 45, 53,
47, 12, 12, 66, 228, 52, 32, 54, 55, -1,
36, 37, 38, 39, 40, 41, -1, -1, 44, 45, 36, 37, 38, 39, 40, 41, -1, -1, 44, 45,
-1, 47, -1, -1, -1, 51, 52, 32, -1, 55, -1, 47, 8, 9, 10, 51, 52, -1, -1, 55,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
-1, -1, -1, 8, 9, -1, 32, -1, -1, -1,
36, 37, 38, 39, 40, 41, -1, -1, 44, 45,
-1, 47, -1, -1, 8, 9, 52, 32, -1, 55,
-1, 36, 37, 38, 39, 40, 41, 8, 9, 44, -1, 36, 37, 38, 39, 40, 41, 8, 9, 44,
45, -1, 47, -1, -1, -1, -1, 52, -1, 54, 45, -1, 47, -1, -1, -1, -1, 52, 32, -1,
55, -1, 36, 37, 38, 39, 40, 41, 8, 9, 55, -1, 36, 37, 38, 39, 40, 41, 8, 9,
44, 32, -1, -1, -1, 36, 37, 38, 39, 40, 44, 32, -1, 47, -1, 8, 9, -1, 52, -1,
41, -1, -1, 44, 45, -1, 47, -1, -1, -1, -1, 55, 8, 9, 45, -1, 47, -1, -1, -1,
51, 52, 32, -1, 55, -1, 36, 37, 38, 39, 51, 52, 32, 54, 55, -1, 8, 9, -1, 32,
40, 41, 8, 9, 44, 45, -1, 47, -1, -1, 8, 9, 42, 43, 37, 45, 32, 47, -1, -1,
-1, -1, 52, 8, 9, 55, 3, 4, 5, 6, -1, 44, 52, -1, 47, 55, 42, 8, 9, 52,
7, 8, 9, 10, 11, 12, 32, 8, 9, -1, 32, 47, 55, -1, 32, -1, 52, -1, -1, 55,
36, 37, 38, 39, 40, 41, -1, 32, 44, -1, 8, 9, -1, 45, -1, 47, -1, 45, -1, 47,
-1, 47, -1, 8, 9, -1, 52, 42, 43, 55, 52, 32, -1, 55, 52, -1, -1, 55, 8, 9,
45, 32, 47, -1, 8, 9, 37, 52, -1, -1, -1, 42, -1, -1, 32, -1, 47, 8, 9, -1,
55, 8, 9, 44, -1, -1, 47, 32, 8, 9, -1, 52, -1, -1, 55, -1, -1, -1, -1, 47,
-1, 52, 8, 9, 55, -1, -1, -1, 32, -1, -1, -1, 32, -1, 52, -1, 54, 55, -1, -1,
45, -1, 47, -1, -1, 32, -1, 52, 42, -1, -1, 32, 42, -1, -1, -1, -1, 47, -1, -1,
55, -1, 32, 47, -1, 42, 32, -1, 52, -1, -1, -1, 52, -1, -1, 55, 47, -1, -1, -1,
47, 55, 8, 9, -1, 52, -1, 47, 55, 8, -1, 52, -1, -1, 55, 5, 6, 7, 8, 9,
9, 47, 52, -1, 54, 55, 52, -1, 54, 55, 10, 11, 12, 6, 7, 8, 9, 10, 11, 12
-1, -1, -1, -1, -1, -1, 32, -1, -1, -1,
-1, -1, -1, 32, -1, -1, 42, -1, -1, -1,
-1, 47, -1, -1, -1, -1, 52, -1, 47, 55,
-1, -1, -1, 52, -1, -1, 55, 4, 5, 6,
7, 8, 9, 10, 11, 12, 5, 6, 7, 8,
9, 10, 11, 12, 6, 7, 8, 9, 10, 11,
12
}; };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
...@@ -852,32 +848,32 @@ static const yytype_uint8 yystos[] = ...@@ -852,32 +848,32 @@ static const yytype_uint8 yystos[] =
{ {
0, 57, 0, 58, 1, 13, 14, 15, 16, 17, 0, 57, 0, 58, 1, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 45, 46, 47, 49, 59, 62, 28, 29, 30, 31, 45, 47, 49, 59, 61, 49,
49, 51, 63, 8, 9, 32, 36, 37, 38, 39, 51, 62, 8, 9, 32, 36, 37, 38, 39, 40,
40, 41, 44, 45, 47, 51, 52, 55, 67, 82, 41, 44, 45, 47, 51, 52, 55, 66, 81, 85,
86, 89, 90, 91, 92, 95, 54, 66, 82, 84, 88, 89, 90, 91, 94, 54, 65, 81, 83, 87,
88, 64, 84, 65, 82, 10, 45, 46, 51, 71, 63, 83, 64, 81, 10, 45, 51, 70, 82, 84,
83, 85, 86, 90, 91, 95, 69, 92, 51, 63, 85, 89, 90, 94, 68, 91, 51, 62, 66, 71,
67, 72, 45, 51, 52, 68, 85, 88, 95, 70, 45, 51, 52, 67, 84, 87, 94, 69, 88, 78,
89, 79, 89, 80, 84, 73, 84, 74, 84, 75, 88, 79, 83, 72, 83, 73, 83, 74, 83, 75,
84, 76, 86, 77, 88, 78, 88, 81, 84, 48, 85, 76, 87, 77, 87, 80, 83, 48, 50, 50,
50, 48, 50, 49, 95, 95, 6, 8, 9, 93, 49, 94, 94, 6, 8, 9, 92, 81, 37, 44,
82, 37, 44, 95, 97, 95, 52, 52, 9, 42, 94, 96, 94, 52, 52, 9, 42, 43, 52, 91,
43, 52, 92, 95, 51, 51, 51, 86, 90, 93, 94, 51, 51, 51, 85, 89, 92, 82, 52, 11,
93, 83, 52, 11, 93, 85, 51, 52, 51, 51, 92, 84, 51, 52, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 61, 97, 60, 51, 51, 51, 60, 96, 96, 7, 94, 94, 52,
97, 7, 95, 95, 52, 10, 53, 53, 3, 4, 10, 53, 53, 3, 4, 5, 6, 7, 8, 9,
5, 6, 7, 8, 9, 10, 11, 12, 53, 37, 10, 11, 12, 53, 37, 37, 38, 44, 42, 9,
37, 38, 44, 42, 9, 42, 82, 84, 34, 95, 42, 81, 83, 34, 94, 84, 54, 86, 94, 87,
85, 54, 87, 95, 88, 95, 84, 82, 82, 82, 94, 83, 81, 81, 81, 81, 81, 83, 59, 92,
82, 82, 84, 59, 59, 93, 33, 35, 44, 94, 33, 35, 44, 93, 94, 52, 96, 96, 96, 6,
95, 52, 97, 97, 97, 6, 7, 97, 97, 97, 7, 96, 96, 96, 96, 96, 10, 10, 53, 53,
97, 97, 10, 10, 53, 53, 53, 42, 53, 53, 53, 42, 53, 53, 51, 9, 32, 95, 51, 51,
51, 9, 32, 96, 51, 51, 48, 48, 51, 51, 48, 48, 51, 51, 52, 53, 53, 37, 96, 96,
52, 53, 53, 37, 97, 97, 95, 95, 52, 53, 94, 94, 52, 53, 87, 32, 9, 86, 87, 37,
88, 32, 9, 87, 88, 37, 38, 95, 86, 35, 38, 94, 85, 35, 10, 53, 53, 37, 38, 9,
10, 53, 53, 37, 38, 9, 32, 53, 95, 10, 32, 53, 94, 10, 10, 32, 53, 94, 94, 53,
10, 32, 53, 95, 95, 53, 53 53
}; };
#define yyerrok (yyerrstatus = 0) #define yyerrok (yyerrstatus = 0)
...@@ -1701,30 +1697,24 @@ yyreduce: ...@@ -1701,30 +1697,24 @@ yyreduce:
case 5: case 5:
#line 75 "a.y" #line 75 "a.y"
{ {
if((yyvsp[(1) - (2)].sym)->value != pc) (yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name); if((yyvsp[(1) - (2)].sym)->type == LLAB && (yyvsp[(1) - (2)].sym)->value != pc)
(yyvsp[(1) - (2)].sym)->value = pc; yyerror("redeclaration of %s (%s)", (yyvsp[(1) - (2)].sym)->labelname, (yyvsp[(1) - (2)].sym)->name);
}
break;
case 7:
#line 82 "a.y"
{
(yyvsp[(1) - (2)].sym)->type = LLAB; (yyvsp[(1) - (2)].sym)->type = LLAB;
(yyvsp[(1) - (2)].sym)->value = pc; (yyvsp[(1) - (2)].sym)->value = pc;
} }
break; break;
case 12: case 10:
#line 93 "a.y" #line 89 "a.y"
{ {
(yyvsp[(1) - (3)].sym)->type = LVAR; (yyvsp[(1) - (3)].sym)->type = LVAR;
(yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval); (yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval);
} }
break; break;
case 13: case 11:
#line 98 "a.y" #line 94 "a.y"
{ {
if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval)) if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval))
yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name); yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name);
...@@ -1732,191 +1722,191 @@ yyreduce: ...@@ -1732,191 +1722,191 @@ yyreduce:
} }
break; break;
case 12:
#line 99 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 13:
#line 100 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 14: case 14:
#line 103 "a.y" #line 101 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 15: case 15:
#line 104 "a.y" #line 102 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 16: case 16:
#line 105 "a.y" #line 103 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 17: case 17:
#line 106 "a.y" #line 104 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 18: case 18:
#line 107 "a.y" #line 105 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 19: case 19:
#line 108 "a.y" #line 106 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 20: case 20:
#line 109 "a.y" #line 107 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 21: case 21:
#line 110 "a.y" #line 108 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 22: case 22:
#line 111 "a.y" #line 109 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 23: case 23:
#line 112 "a.y" #line 110 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 24: case 24:
#line 113 "a.y" #line 111 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 25: case 25:
#line 114 "a.y" #line 112 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 26: case 26:
#line 115 "a.y" #line 113 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 27: case 27:
#line 116 "a.y" #line 114 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 28: case 28:
#line 117 "a.y" #line 115 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 29: case 29:
#line 118 "a.y" #line 116 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 30: case 30:
#line 119 "a.y" #line 117 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 31: case 31:
#line 120 "a.y" #line 120 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 32:
#line 121 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 33:
#line 124 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 34: case 32:
#line 129 "a.y" #line 125 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 35: case 33:
#line 136 "a.y" #line 132 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 36: case 34:
#line 143 "a.y" #line 139 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 37: case 35:
#line 150 "a.y" #line 146 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (2)].addr); (yyval.addr2).from = (yyvsp[(1) - (2)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 38: case 36:
#line 155 "a.y" #line 151 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (1)].addr); (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 39: case 37:
#line 162 "a.y" #line 158 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 40: case 38:
#line 167 "a.y" #line 163 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr); (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 41: case 39:
#line 174 "a.y" #line 170 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 42: case 40:
#line 179 "a.y" #line 175 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr); (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 43: case 41:
#line 184 "a.y" #line 180 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 44: case 42:
#line 191 "a.y" #line 187 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval); (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
...@@ -1924,49 +1914,51 @@ yyreduce: ...@@ -1924,49 +1914,51 @@ yyreduce:
} }
break; break;
case 45: case 43:
#line 199 "a.y" #line 195 "a.y"
{ {
settext((yyvsp[(1) - (3)].addr).sym);
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 46: case 44:
#line 204 "a.y" #line 201 "a.y"
{ {
settext((yyvsp[(1) - (5)].addr).sym);
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval); (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr); (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
} }
break; break;
case 47: case 45:
#line 212 "a.y" #line 210 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 48: case 46:
#line 217 "a.y" #line 215 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr); (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 51: case 49:
#line 228 "a.y" #line 226 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 52: case 50:
#line 233 "a.y" #line 231 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr); (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
...@@ -1976,16 +1968,16 @@ yyreduce: ...@@ -1976,16 +1968,16 @@ yyreduce:
} }
break; break;
case 53: case 51:
#line 243 "a.y" #line 241 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 54: case 52:
#line 248 "a.y" #line 246 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr); (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
...@@ -1995,32 +1987,32 @@ yyreduce: ...@@ -1995,32 +1987,32 @@ yyreduce:
} }
break; break;
case 55: case 53:
#line 258 "a.y" #line 256 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (2)].addr); (yyval.addr2).from = (yyvsp[(1) - (2)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 56: case 54:
#line 263 "a.y" #line 261 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (1)].addr); (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 57: case 55:
#line 268 "a.y" #line 266 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 58: case 56:
#line 275 "a.y" #line 273 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr); (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
...@@ -2028,8 +2020,8 @@ yyreduce: ...@@ -2028,8 +2020,8 @@ yyreduce:
} }
break; break;
case 59: case 57:
#line 283 "a.y" #line 281 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(3) - (5)].addr); (yyval.addr2).from = (yyvsp[(3) - (5)].addr);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr); (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
...@@ -2039,32 +2031,32 @@ yyreduce: ...@@ -2039,32 +2031,32 @@ yyreduce:
} }
break; break;
case 60: case 58:
#line 292 "a.y" #line 290 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 61: case 59:
#line 297 "a.y" #line 295 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (1)].addr); (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 62: case 60:
#line 304 "a.y" #line 302 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 63: case 61:
#line 309 "a.y" #line 307 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval); (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
...@@ -2072,8 +2064,8 @@ yyreduce: ...@@ -2072,8 +2064,8 @@ yyreduce:
} }
break; break;
case 64: case 62:
#line 317 "a.y" #line 315 "a.y"
{ {
if((yyvsp[(1) - (3)].addr).type != D_CONST || (yyvsp[(3) - (3)].addr).type != D_CONST) if((yyvsp[(1) - (3)].addr).type != D_CONST || (yyvsp[(3) - (3)].addr).type != D_CONST)
yyerror("arguments to PCDATA must be integer constants"); yyerror("arguments to PCDATA must be integer constants");
...@@ -2082,8 +2074,8 @@ yyreduce: ...@@ -2082,8 +2074,8 @@ yyreduce:
} }
break; break;
case 65: case 63:
#line 326 "a.y" #line 324 "a.y"
{ {
if((yyvsp[(1) - (3)].addr).type != D_CONST) if((yyvsp[(1) - (3)].addr).type != D_CONST)
yyerror("index for FUNCDATA must be integer constant"); yyerror("index for FUNCDATA must be integer constant");
...@@ -2094,22 +2086,22 @@ yyreduce: ...@@ -2094,22 +2086,22 @@ yyreduce:
} }
break; break;
case 70: case 68:
#line 343 "a.y" #line 341 "a.y"
{ {
(yyval.addr) = (yyvsp[(2) - (2)].addr); (yyval.addr) = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 71: case 69:
#line 347 "a.y" #line 345 "a.y"
{ {
(yyval.addr) = (yyvsp[(2) - (2)].addr); (yyval.addr) = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 76: case 74:
#line 359 "a.y" #line 357 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_BRANCH; (yyval.addr).type = D_BRANCH;
...@@ -2117,84 +2109,76 @@ yyreduce: ...@@ -2117,84 +2109,76 @@ yyreduce:
} }
break; break;
case 77: case 75:
#line 365 "a.y" #line 363 "a.y"
{
(yyval.addr) = nullgen;
if(pass == 2)
yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name);
(yyval.addr).type = D_BRANCH;
(yyval.addr).offset = (yyvsp[(2) - (2)].lval);
}
break;
case 78:
#line 373 "a.y"
{ {
(yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
if(pass == 2 && (yyvsp[(1) - (2)].sym)->type != LLAB)
yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->labelname);
(yyval.addr).type = D_BRANCH; (yyval.addr).type = D_BRANCH;
(yyval.addr).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval); (yyval.addr).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
} }
break; break;
case 79: case 76:
#line 381 "a.y" #line 374 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 80: case 77:
#line 386 "a.y" #line 379 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 81: case 78:
#line 391 "a.y" #line 384 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 82: case 79:
#line 396 "a.y" #line 389 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 83: case 80:
#line 401 "a.y" #line 394 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_SP; (yyval.addr).type = D_SP;
} }
break; break;
case 84: case 81:
#line 406 "a.y" #line 399 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 85: case 82:
#line 411 "a.y" #line 404 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 86: case 83:
#line 417 "a.y" #line 410 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_CONST; (yyval.addr).type = D_CONST;
...@@ -2202,8 +2186,8 @@ yyreduce: ...@@ -2202,8 +2186,8 @@ yyreduce:
} }
break; break;
case 87: case 84:
#line 425 "a.y" #line 418 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_CONST; (yyval.addr).type = D_CONST;
...@@ -2211,8 +2195,8 @@ yyreduce: ...@@ -2211,8 +2195,8 @@ yyreduce:
} }
break; break;
case 88: case 85:
#line 431 "a.y" #line 424 "a.y"
{ {
(yyval.addr) = (yyvsp[(2) - (2)].addr); (yyval.addr) = (yyvsp[(2) - (2)].addr);
(yyval.addr).index = (yyvsp[(2) - (2)].addr).type; (yyval.addr).index = (yyvsp[(2) - (2)].addr).type;
...@@ -2225,8 +2209,8 @@ yyreduce: ...@@ -2225,8 +2209,8 @@ yyreduce:
} }
break; break;
case 89: case 86:
#line 442 "a.y" #line 435 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_SCONST; (yyval.addr).type = D_SCONST;
...@@ -2234,8 +2218,8 @@ yyreduce: ...@@ -2234,8 +2218,8 @@ yyreduce:
} }
break; break;
case 90: case 87:
#line 448 "a.y" #line 441 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2243,8 +2227,8 @@ yyreduce: ...@@ -2243,8 +2227,8 @@ yyreduce:
} }
break; break;
case 91: case 88:
#line 454 "a.y" #line 447 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2252,8 +2236,8 @@ yyreduce: ...@@ -2252,8 +2236,8 @@ yyreduce:
} }
break; break;
case 92: case 89:
#line 460 "a.y" #line 453 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2261,8 +2245,8 @@ yyreduce: ...@@ -2261,8 +2245,8 @@ yyreduce:
} }
break; break;
case 93: case 90:
#line 466 "a.y" #line 459 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2270,8 +2254,8 @@ yyreduce: ...@@ -2270,8 +2254,8 @@ yyreduce:
} }
break; break;
case 96: case 93:
#line 478 "a.y" #line 471 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_NONE; (yyval.addr).type = D_INDIR+D_NONE;
...@@ -2279,8 +2263,8 @@ yyreduce: ...@@ -2279,8 +2263,8 @@ yyreduce:
} }
break; break;
case 97: case 94:
#line 484 "a.y" #line 477 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval);
...@@ -2288,8 +2272,8 @@ yyreduce: ...@@ -2288,8 +2272,8 @@ yyreduce:
} }
break; break;
case 98: case 95:
#line 490 "a.y" #line 483 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_SP; (yyval.addr).type = D_INDIR+D_SP;
...@@ -2297,8 +2281,8 @@ yyreduce: ...@@ -2297,8 +2281,8 @@ yyreduce:
} }
break; break;
case 99: case 96:
#line 496 "a.y" #line 489 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval);
...@@ -2306,8 +2290,8 @@ yyreduce: ...@@ -2306,8 +2290,8 @@ yyreduce:
} }
break; break;
case 100: case 97:
#line 502 "a.y" #line 495 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_NONE; (yyval.addr).type = D_INDIR+D_NONE;
...@@ -2318,8 +2302,8 @@ yyreduce: ...@@ -2318,8 +2302,8 @@ yyreduce:
} }
break; break;
case 101: case 98:
#line 511 "a.y" #line 504 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval);
...@@ -2330,8 +2314,8 @@ yyreduce: ...@@ -2330,8 +2314,8 @@ yyreduce:
} }
break; break;
case 102: case 99:
#line 520 "a.y" #line 513 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval);
...@@ -2342,24 +2326,24 @@ yyreduce: ...@@ -2342,24 +2326,24 @@ yyreduce:
} }
break; break;
case 103: case 100:
#line 529 "a.y" #line 522 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(2) - (3)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(2) - (3)].lval);
} }
break; break;
case 104: case 101:
#line 534 "a.y" #line 527 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_SP; (yyval.addr).type = D_INDIR+D_SP;
} }
break; break;
case 105: case 102:
#line 539 "a.y" #line 532 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_NONE; (yyval.addr).type = D_INDIR+D_NONE;
...@@ -2369,8 +2353,8 @@ yyreduce: ...@@ -2369,8 +2353,8 @@ yyreduce:
} }
break; break;
case 106: case 103:
#line 547 "a.y" #line 540 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(2) - (8)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(2) - (8)].lval);
...@@ -2380,15 +2364,15 @@ yyreduce: ...@@ -2380,15 +2364,15 @@ yyreduce:
} }
break; break;
case 107: case 104:
#line 557 "a.y" #line 550 "a.y"
{ {
(yyval.addr) = (yyvsp[(1) - (1)].addr); (yyval.addr) = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 108: case 105:
#line 561 "a.y" #line 554 "a.y"
{ {
(yyval.addr) = (yyvsp[(1) - (6)].addr); (yyval.addr) = (yyvsp[(1) - (6)].addr);
(yyval.addr).index = (yyvsp[(3) - (6)].lval); (yyval.addr).index = (yyvsp[(3) - (6)].lval);
...@@ -2397,8 +2381,8 @@ yyreduce: ...@@ -2397,8 +2381,8 @@ yyreduce:
} }
break; break;
case 109: case 106:
#line 570 "a.y" #line 563 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(4) - (5)].lval); (yyval.addr).type = (yyvsp[(4) - (5)].lval);
...@@ -2407,8 +2391,8 @@ yyreduce: ...@@ -2407,8 +2391,8 @@ yyreduce:
} }
break; break;
case 110: case 107:
#line 577 "a.y" #line 570 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_STATIC; (yyval.addr).type = D_STATIC;
...@@ -2417,166 +2401,166 @@ yyreduce: ...@@ -2417,166 +2401,166 @@ yyreduce:
} }
break; break;
case 111: case 108:
#line 585 "a.y" #line 578 "a.y"
{ {
(yyval.lval) = 0; (yyval.lval) = 0;
} }
break; break;
case 112: case 109:
#line 589 "a.y" #line 582 "a.y"
{ {
(yyval.lval) = (yyvsp[(2) - (2)].lval); (yyval.lval) = (yyvsp[(2) - (2)].lval);
} }
break; break;
case 113: case 110:
#line 593 "a.y" #line 586 "a.y"
{ {
(yyval.lval) = -(yyvsp[(2) - (2)].lval); (yyval.lval) = -(yyvsp[(2) - (2)].lval);
} }
break; break;
case 115: case 112:
#line 600 "a.y" #line 593 "a.y"
{ {
(yyval.lval) = D_AUTO; (yyval.lval) = D_AUTO;
} }
break; break;
case 118: case 115:
#line 608 "a.y" #line 601 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value; (yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
} }
break; break;
case 119: case 116:
#line 612 "a.y" #line 605 "a.y"
{ {
(yyval.lval) = -(yyvsp[(2) - (2)].lval); (yyval.lval) = -(yyvsp[(2) - (2)].lval);
} }
break; break;
case 120: case 117:
#line 616 "a.y" #line 609 "a.y"
{ {
(yyval.lval) = (yyvsp[(2) - (2)].lval); (yyval.lval) = (yyvsp[(2) - (2)].lval);
} }
break; break;
case 121: case 118:
#line 620 "a.y" #line 613 "a.y"
{ {
(yyval.lval) = ~(yyvsp[(2) - (2)].lval); (yyval.lval) = ~(yyvsp[(2) - (2)].lval);
} }
break; break;
case 122: case 119:
#line 624 "a.y" #line 617 "a.y"
{ {
(yyval.lval) = (yyvsp[(2) - (3)].lval); (yyval.lval) = (yyvsp[(2) - (3)].lval);
} }
break; break;
case 123: case 120:
#line 630 "a.y" #line 623 "a.y"
{ {
(yyval.lval) = ((yyvsp[(1) - (1)].lval) & 0xffffffffLL) + (yyval.lval) = ((yyvsp[(1) - (1)].lval) & 0xffffffffLL) +
((vlong)ArgsSizeUnknown << 32); ((vlong)ArgsSizeUnknown << 32);
} }
break; break;
case 124: case 121:
#line 635 "a.y" #line 628 "a.y"
{ {
(yyval.lval) = (-(yyvsp[(2) - (2)].lval) & 0xffffffffLL) + (yyval.lval) = (-(yyvsp[(2) - (2)].lval) & 0xffffffffLL) +
((vlong)ArgsSizeUnknown << 32); ((vlong)ArgsSizeUnknown << 32);
} }
break; break;
case 125: case 122:
#line 640 "a.y" #line 633 "a.y"
{ {
(yyval.lval) = ((yyvsp[(1) - (3)].lval) & 0xffffffffLL) + (yyval.lval) = ((yyvsp[(1) - (3)].lval) & 0xffffffffLL) +
(((yyvsp[(3) - (3)].lval) & 0xffffLL) << 32); (((yyvsp[(3) - (3)].lval) & 0xffffLL) << 32);
} }
break; break;
case 126: case 123:
#line 645 "a.y" #line 638 "a.y"
{ {
(yyval.lval) = (-(yyvsp[(2) - (4)].lval) & 0xffffffffLL) + (yyval.lval) = (-(yyvsp[(2) - (4)].lval) & 0xffffffffLL) +
(((yyvsp[(4) - (4)].lval) & 0xffffLL) << 32); (((yyvsp[(4) - (4)].lval) & 0xffffLL) << 32);
} }
break; break;
case 128: case 125:
#line 653 "a.y" #line 646 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
} }
break; break;
case 129: case 126:
#line 657 "a.y" #line 650 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
} }
break; break;
case 130: case 127:
#line 661 "a.y" #line 654 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
} }
break; break;
case 131: case 128:
#line 665 "a.y" #line 658 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
} }
break; break;
case 132: case 129:
#line 669 "a.y" #line 662 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
} }
break; break;
case 133: case 130:
#line 673 "a.y" #line 666 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval); (yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
} }
break; break;
case 134: case 131:
#line 677 "a.y" #line 670 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval); (yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
} }
break; break;
case 135: case 132:
#line 681 "a.y" #line 674 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
} }
break; break;
case 136: case 133:
#line 685 "a.y" #line 678 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
} }
break; break;
case 137: case 134:
#line 689 "a.y" #line 682 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
} }
...@@ -2584,7 +2568,7 @@ yyreduce: ...@@ -2584,7 +2568,7 @@ yyreduce:
/* Line 1267 of yacc.c. */ /* Line 1267 of yacc.c. */
#line 2588 "y.tab.c" #line 2572 "y.tab.c"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
...@@ -70,6 +70,7 @@ struct Sym ...@@ -70,6 +70,7 @@ struct Sym
int32 value; int32 value;
ushort type; ushort type;
char *name; char *name;
char* labelname;
char sym; char sym;
}; };
#define S ((Sym*)0) #define S ((Sym*)0)
...@@ -148,6 +149,8 @@ void newio(void); ...@@ -148,6 +149,8 @@ void newio(void);
void newfile(char*, int); void newfile(char*, int);
Sym* slookup(char*); Sym* slookup(char*);
Sym* lookup(void); Sym* lookup(void);
Sym* labellookup(Sym*);
void settext(LSym*);
void syminit(Sym*); void syminit(Sym*);
int32 yylex(void); int32 yylex(void);
int getc(void); int getc(void);
......
...@@ -74,15 +74,11 @@ prog: ...@@ -74,15 +74,11 @@ prog:
line line
line: line:
LLAB ':' LNAME ':'
{
if($1->value != pc)
yyerror("redeclaration of %s", $1->name);
$1->value = pc;
}
line
| LNAME ':'
{ {
$1 = labellookup($1);
if($1->type == LLAB && $1->value != pc)
yyerror("redeclaration of %s", $1->labelname);
$1->type = LLAB; $1->type = LLAB;
$1->value = pc; $1->value = pc;
} }
...@@ -199,11 +195,13 @@ spec1: /* DATA */ ...@@ -199,11 +195,13 @@ spec1: /* DATA */
spec2: /* TEXT */ spec2: /* TEXT */
mem ',' imm2 mem ',' imm2
{ {
settext($1.sym);
$$.from = $1; $$.from = $1;
$$.to = $3; $$.to = $3;
} }
| mem ',' con ',' imm2 | mem ',' con ',' imm2
{ {
settext($1.sym);
$$.from = $1; $$.from = $1;
$$.from.scale = $3; $$.from.scale = $3;
$$.to = $5; $$.to = $5;
...@@ -362,15 +360,10 @@ rel: ...@@ -362,15 +360,10 @@ rel:
} }
| LNAME offset | LNAME offset
{ {
$1 = labellookup($1);
$$ = nullgen; $$ = nullgen;
if(pass == 2) if(pass == 2 && $1->type != LLAB)
yyerror("undefined label: %s", $1->name); yyerror("undefined label: %s", $1->labelname);
$$.type = D_BRANCH;
$$.offset = $2;
}
| LLAB offset
{
$$ = nullgen;
$$.type = D_BRANCH; $$.type = D_BRANCH;
$$.offset = $1->value + $2; $$.offset = $1->value + $2;
} }
......
...@@ -411,16 +411,16 @@ union yyalloc ...@@ -411,16 +411,16 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 2 #define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
#define YYLAST 546 #define YYLAST 561
/* YYNTOKENS -- Number of terminals. */ /* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 54 #define YYNTOKENS 54
/* YYNNTS -- Number of nonterminals. */ /* YYNNTS -- Number of nonterminals. */
#define YYNNTS 41 #define YYNNTS 40
/* YYNRULES -- Number of rules. */ /* YYNRULES -- Number of rules. */
#define YYNRULES 135 #define YYNRULES 132
/* YYNRULES -- Number of states. */ /* YYNRULES -- Number of states. */
#define YYNSTATES 276 #define YYNSTATES 270
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2 #define YYUNDEFTOK 2
...@@ -469,91 +469,90 @@ static const yytype_uint8 yytranslate[] = ...@@ -469,91 +469,90 @@ static const yytype_uint8 yytranslate[] =
YYRHS. */ YYRHS. */
static const yytype_uint16 yyprhs[] = static const yytype_uint16 yyprhs[] =
{ {
0, 0, 3, 4, 5, 9, 10, 15, 16, 21, 0, 0, 3, 4, 5, 9, 10, 15, 17, 20,
23, 26, 29, 33, 37, 40, 43, 46, 49, 52, 23, 27, 31, 34, 37, 40, 43, 46, 49, 52,
55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82,
85, 88, 91, 92, 94, 98, 102, 105, 107, 110, 85, 86, 88, 92, 96, 99, 101, 104, 106, 109,
112, 115, 117, 121, 127, 131, 137, 140, 142, 145, 111, 115, 121, 125, 131, 134, 136, 139, 141, 143,
147, 149, 153, 159, 163, 169, 172, 174, 178, 182, 147, 153, 157, 163, 166, 168, 172, 176, 182, 188,
188, 194, 200, 204, 208, 210, 212, 214, 216, 219, 194, 198, 202, 204, 206, 208, 210, 213, 216, 218,
222, 224, 226, 228, 230, 232, 237, 240, 243, 245, 220, 222, 224, 226, 231, 234, 236, 238, 240, 242,
247, 249, 251, 253, 255, 258, 261, 264, 267, 272, 244, 246, 249, 252, 255, 258, 263, 269, 273, 276,
278, 282, 285, 287, 290, 294, 299, 301, 303, 305, 278, 281, 285, 290, 292, 294, 296, 301, 306, 313,
310, 315, 322, 332, 342, 346, 350, 355, 361, 370, 323, 333, 337, 341, 346, 352, 361, 363, 370, 376,
372, 379, 385, 393, 394, 397, 400, 402, 404, 406, 384, 385, 388, 391, 393, 395, 397, 399, 401, 404,
408, 410, 413, 416, 419, 423, 425, 429, 433, 437, 407, 410, 414, 416, 420, 424, 428, 432, 436, 441,
441, 445, 450, 455, 459, 463 446, 450, 454
}; };
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] = static const yytype_int8 yyrhs[] =
{ {
55, 0, -1, -1, -1, 55, 56, 57, -1, -1, 55, 0, -1, -1, -1, 55, 56, 57, -1, -1,
44, 46, 58, 57, -1, -1, 43, 46, 59, 57, 43, 46, 58, 57, -1, 47, -1, 59, 47, -1,
-1, 47, -1, 60, 47, -1, 1, 47, -1, 43, 1, 47, -1, 43, 48, 93, -1, 45, 48, 93,
48, 94, -1, 45, 48, 94, -1, 13, 61, -1, -1, 13, 60, -1, 14, 64, -1, 15, 63, -1,
14, 65, -1, 15, 64, -1, 16, 62, -1, 17, 16, 61, -1, 17, 62, -1, 21, 65, -1, 19,
63, -1, 21, 66, -1, 19, 67, -1, 22, 68, 66, -1, 22, 67, -1, 18, 68, -1, 20, 69,
-1, 18, 69, -1, 20, 70, -1, 23, 71, -1, -1, 23, 70, -1, 24, 71, -1, 25, 72, -1,
24, 72, -1, 25, 73, -1, 26, 74, -1, 27, 26, 73, -1, 27, 74, -1, 28, 75, -1, 29,
75, -1, 28, 76, -1, 29, 77, -1, 30, 78, 76, -1, 30, 77, -1, -1, 49, -1, 80, 49,
-1, -1, 49, -1, 81, 49, 79, -1, 79, 49, 78, -1, 78, 49, 80, -1, 80, 49, -1, 80,
81, -1, 81, 49, -1, 81, -1, 49, 79, -1, -1, 49, 78, -1, 78, -1, 49, 81, -1, 81,
79, -1, 49, 82, -1, 82, -1, 84, 49, 82, -1, 83, 49, 81, -1, 89, 11, 92, 49, 83,
-1, 90, 11, 93, 49, 84, -1, 87, 49, 85, -1, 86, 49, 84, -1, 86, 49, 92, 49, 84,
-1, 87, 49, 93, 49, 85, -1, 49, 80, -1, -1, 49, 79, -1, 79, -1, 10, 89, -1, 60,
80, -1, 10, 90, -1, 61, -1, 65, -1, 81, -1, 64, -1, 80, 49, 78, -1, 80, 49, 78,
49, 79, -1, 81, 49, 79, 46, 36, -1, 81, 46, 36, -1, 80, 49, 78, -1, 80, 49, 78,
49, 79, -1, 81, 49, 79, 46, 37, -1, 81, 46, 37, -1, 80, 49, -1, 80, -1, 80, 49,
49, -1, 81, -1, 81, 49, 79, -1, 87, 49, 78, -1, 86, 49, 83, -1, 86, 49, 92, 49,
84, -1, 87, 49, 93, 49, 84, -1, 83, 49, 83, -1, 82, 49, 78, 49, 92, -1, 83, 49,
79, 49, 93, -1, 84, 49, 79, 49, 83, -1, 78, 49, 82, -1, 80, 49, 80, -1, 80, 49,
81, 49, 81, -1, 81, 49, 81, -1, 83, -1, 80, -1, 82, -1, 86, -1, 81, -1, 88, -1,
87, -1, 82, -1, 89, -1, 10, 83, -1, 10, 10, 82, -1, 10, 87, -1, 82, -1, 87, -1,
88, -1, 83, -1, 88, -1, 84, -1, 79, -1, 83, -1, 78, -1, 83, -1, 92, 50, 33, 51,
84, -1, 93, 50, 33, 51, -1, 43, 91, -1, -1, 43, 90, -1, 35, -1, 38, -1, 36, -1,
44, 91, -1, 35, -1, 38, -1, 36, -1, 39, 39, -1, 42, -1, 37, -1, 52, 92, -1, 52,
-1, 42, -1, 37, -1, 52, 93, -1, 52, 90, 89, -1, 52, 41, -1, 52, 40, -1, 52, 50,
-1, 52, 41, -1, 52, 40, -1, 52, 50, 40, 40, 51, -1, 52, 50, 9, 40, 51, -1, 52,
51, -1, 52, 50, 9, 40, 51, -1, 52, 9, 9, 40, -1, 52, 85, -1, 31, -1, 9, 31,
40, -1, 52, 86, -1, 31, -1, 9, 31, -1, -1, 31, 9, 31, -1, 9, 31, 9, 31, -1,
31, 9, 31, -1, 9, 31, 9, 31, -1, 88, 87, -1, 88, -1, 92, -1, 92, 50, 36, 51,
-1, 89, -1, 93, -1, 93, 50, 36, 51, -1, -1, 92, 50, 42, 51, -1, 92, 50, 36, 10,
93, 50, 42, 51, -1, 93, 50, 36, 10, 93, 92, 51, -1, 92, 50, 36, 51, 50, 36, 10,
51, -1, 93, 50, 36, 51, 50, 36, 10, 93, 92, 51, -1, 92, 50, 36, 51, 50, 37, 10,
51, -1, 93, 50, 36, 51, 50, 37, 10, 93, 92, 51, -1, 50, 36, 51, -1, 50, 42, 51,
51, -1, 50, 36, 51, -1, 50, 42, 51, -1, -1, 92, 50, 37, 51, -1, 50, 36, 10, 92,
93, 50, 37, 51, -1, 50, 36, 10, 93, 51, 51, -1, 50, 36, 51, 50, 36, 10, 92, 51,
-1, 50, 36, 51, 50, 36, 10, 93, 51, -1, -1, 89, -1, 89, 50, 36, 10, 92, 51, -1,
90, -1, 90, 50, 36, 10, 93, 51, -1, 43, 43, 90, 50, 91, 51, -1, 43, 6, 7, 90,
91, 50, 92, 51, -1, 43, 6, 7, 91, 50, 50, 34, 51, -1, -1, 8, 92, -1, 9, 92,
34, 51, -1, -1, 8, 93, -1, 9, 93, -1, -1, 34, -1, 42, -1, 32, -1, 31, -1, 45,
34, -1, 42, -1, 32, -1, 31, -1, 45, -1, -1, 9, 92, -1, 8, 92, -1, 53, 92, -1,
9, 93, -1, 8, 93, -1, 53, 93, -1, 50, 50, 93, 51, -1, 92, -1, 93, 8, 93, -1,
94, 51, -1, 93, -1, 94, 8, 94, -1, 94, 93, 9, 93, -1, 93, 10, 93, -1, 93, 11,
9, 94, -1, 94, 10, 94, -1, 94, 11, 94, 93, -1, 93, 12, 93, -1, 93, 6, 6, 93,
-1, 94, 12, 94, -1, 94, 6, 6, 94, -1, -1, 93, 7, 7, 93, -1, 93, 5, 93, -1,
94, 7, 7, 94, -1, 94, 5, 94, -1, 94, 93, 4, 93, -1, 93, 3, 93, -1
4, 94, -1, 94, 3, 94, -1
}; };
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 69, 69, 71, 70, 78, 77, 85, 84, 90, 0, 69, 69, 71, 70, 78, 77, 86, 87, 88,
91, 92, 95, 100, 106, 107, 108, 109, 110, 111, 91, 96, 102, 103, 104, 105, 106, 107, 108, 109,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
122, 123, 126, 130, 137, 144, 151, 156, 163, 168, 122, 126, 133, 140, 147, 152, 159, 164, 171, 176,
175, 180, 185, 192, 200, 205, 213, 218, 223, 232, 181, 188, 196, 202, 211, 216, 221, 230, 231, 234,
233, 236, 241, 251, 256, 266, 271, 276, 283, 288, 239, 249, 254, 264, 269, 274, 281, 286, 294, 302,
296, 304, 314, 323, 334, 335, 338, 339, 340, 344, 312, 321, 332, 333, 336, 337, 338, 342, 346, 347,
348, 349, 350, 353, 354, 357, 363, 371, 379, 384, 348, 351, 352, 355, 361, 372, 377, 382, 387, 392,
389, 394, 399, 404, 411, 417, 428, 434, 440, 446, 397, 404, 410, 421, 427, 433, 439, 445, 453, 462,
452, 460, 469, 474, 479, 484, 491, 492, 495, 501, 467, 472, 477, 484, 485, 488, 494, 500, 506, 515,
507, 513, 522, 531, 540, 545, 550, 556, 564, 574, 524, 533, 538, 543, 549, 557, 567, 571, 580, 587,
578, 587, 594, 603, 606, 610, 616, 617, 621, 624, 596, 599, 603, 609, 610, 614, 617, 618, 622, 626,
625, 629, 633, 637, 641, 647, 648, 652, 656, 660, 630, 634, 640, 641, 645, 649, 653, 657, 661, 665,
664, 668, 672, 676, 680, 684 669, 673, 677
}; };
#endif #endif
...@@ -569,10 +568,10 @@ static const char *const yytname[] = ...@@ -569,10 +568,10 @@ static const char *const yytname[] =
"LCONST", "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LFREG", "LCONST", "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LFREG",
"LXREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB", "LVAR", "':'", "LXREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB", "LVAR", "':'",
"';'", "'='", "','", "'('", "')'", "'$'", "'~'", "$accept", "prog", "@1", "';'", "'='", "','", "'('", "')'", "'$'", "'~'", "$accept", "prog", "@1",
"line", "@2", "@3", "inst", "nonnon", "rimrem", "remrim", "rimnon", "line", "@2", "inst", "nonnon", "rimrem", "remrim", "rimnon", "nonrem",
"nonrem", "nonrel", "spec1", "spec2", "spec3", "spec4", "spec5", "spec6", "nonrel", "spec1", "spec2", "spec3", "spec4", "spec5", "spec6", "spec7",
"spec7", "spec8", "spec9", "spec10", "spec11", "spec12", "rem", "rom", "spec8", "spec9", "spec10", "spec11", "spec12", "rem", "rom", "rim",
"rim", "rel", "reg", "imm", "imm2", "con2", "mem", "omem", "nmem", "nam", "rel", "reg", "imm", "imm2", "con2", "mem", "omem", "nmem", "nam",
"offset", "pointer", "con", "expr", 0 "offset", "pointer", "con", "expr", 0
}; };
#endif #endif
...@@ -594,39 +593,39 @@ static const yytype_uint16 yytoknum[] = ...@@ -594,39 +593,39 @@ static const yytype_uint16 yytoknum[] =
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] = static const yytype_uint8 yyr1[] =
{ {
0, 54, 55, 56, 55, 58, 57, 59, 57, 57, 0, 54, 55, 56, 55, 58, 57, 57, 57, 57,
57, 57, 60, 60, 60, 60, 60, 60, 60, 60, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
60, 60, 61, 61, 62, 63, 64, 64, 65, 65, 60, 60, 61, 62, 63, 63, 64, 64, 65, 65,
66, 66, 66, 67, 68, 68, 69, 69, 69, 70, 65, 66, 67, 67, 68, 68, 68, 69, 69, 70,
70, 71, 71, 72, 72, 73, 73, 73, 74, 74, 70, 71, 71, 72, 72, 72, 73, 73, 74, 75,
75, 76, 77, 78, 79, 79, 80, 80, 80, 80, 76, 77, 78, 78, 79, 79, 79, 79, 79, 79,
80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 79, 80, 80, 81, 81, 82, 82, 82, 82, 82,
83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 82, 83, 83, 83, 83, 83, 83, 83, 84, 85,
84, 85, 86, 86, 86, 86, 87, 87, 88, 88, 85, 85, 85, 86, 86, 87, 87, 87, 87, 87,
88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 87, 87, 87, 87, 87, 87, 88, 88, 89, 89,
89, 90, 90, 91, 91, 91, 92, 92, 92, 93, 90, 90, 90, 91, 91, 91, 92, 92, 92, 92,
93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93,
94, 94, 94, 94, 94, 94 93, 93, 93
}; };
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] = static const yytype_uint8 yyr2[] =
{ {
0, 2, 0, 0, 3, 0, 4, 0, 4, 1, 0, 2, 0, 0, 3, 0, 4, 1, 2, 2,
2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 0, 1, 3, 3, 2, 1, 2, 1, 0, 1, 3, 3, 2, 1, 2, 1, 2, 1,
2, 1, 3, 5, 3, 5, 2, 1, 2, 1, 3, 5, 3, 5, 2, 1, 2, 1, 1, 3,
1, 3, 5, 3, 5, 2, 1, 3, 3, 5, 5, 3, 5, 2, 1, 3, 3, 5, 5, 5,
5, 5, 3, 3, 1, 1, 1, 1, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 1, 1,
1, 1, 1, 1, 1, 4, 2, 2, 1, 1, 1, 1, 1, 4, 2, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 4, 5, 1, 2, 2, 2, 2, 4, 5, 3, 2, 1,
3, 2, 1, 2, 3, 4, 1, 1, 1, 4, 2, 3, 4, 1, 1, 1, 4, 4, 6, 9,
4, 6, 9, 9, 3, 3, 4, 5, 8, 1, 9, 3, 3, 4, 5, 8, 1, 6, 5, 7,
6, 5, 7, 0, 2, 2, 1, 1, 1, 1, 0, 2, 2, 1, 1, 1, 1, 1, 2, 2,
1, 2, 2, 2, 3, 1, 3, 3, 3, 3, 2, 3, 1, 3, 3, 3, 3, 3, 4, 4,
3, 4, 4, 3, 3, 3 3, 3, 3
}; };
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
...@@ -634,89 +633,85 @@ static const yytype_uint8 yyr2[] = ...@@ -634,89 +633,85 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */ means the default is an error. */
static const yytype_uint8 yydefact[] = static const yytype_uint8 yydefact[] =
{ {
2, 3, 1, 0, 0, 32, 0, 0, 0, 0, 2, 3, 1, 0, 0, 30, 0, 0, 0, 0,
0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 9, 4, 0, 11, 0, 0, 0, 0, 0, 7, 4, 0, 9, 31,
33, 14, 0, 0, 119, 78, 80, 83, 79, 81, 12, 0, 0, 116, 75, 77, 80, 76, 78, 79,
82, 113, 120, 0, 0, 0, 15, 39, 64, 65, 110, 117, 0, 0, 0, 13, 37, 62, 63, 93,
96, 97, 109, 98, 0, 16, 73, 37, 74, 17, 94, 106, 95, 0, 14, 71, 35, 72, 15, 0,
0, 18, 0, 0, 113, 113, 0, 22, 47, 66, 16, 0, 0, 110, 0, 20, 45, 64, 68, 70,
70, 72, 71, 67, 98, 20, 0, 33, 49, 50, 69, 65, 95, 18, 0, 31, 47, 48, 21, 110,
23, 113, 0, 0, 19, 41, 0, 0, 21, 0, 0, 0, 17, 39, 0, 0, 19, 0, 22, 0,
24, 0, 25, 0, 26, 56, 27, 0, 28, 0, 23, 0, 24, 54, 25, 0, 26, 0, 27, 0,
29, 0, 30, 0, 31, 0, 7, 0, 5, 0, 28, 0, 29, 0, 5, 0, 0, 8, 119, 118,
10, 122, 121, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 36, 0, 0, 122, 0, 120,
125, 0, 123, 0, 0, 0, 87, 86, 0, 85, 0, 0, 0, 84, 83, 0, 82, 81, 34, 0,
84, 36, 0, 0, 68, 69, 48, 76, 77, 0, 0, 66, 67, 46, 74, 0, 44, 0, 0, 74,
46, 0, 0, 76, 40, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 53, 0, 0, 0,
55, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 0, 0, 10, 11, 110, 111, 112, 0, 0,
113, 114, 115, 0, 0, 104, 105, 0, 0, 0, 101, 102, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 0, 121, 0, 0, 0, 0, 87, 0, 0,
0, 0, 90, 0, 0, 34, 35, 0, 0, 42, 32, 33, 0, 0, 40, 0, 42, 0, 49, 51,
0, 44, 0, 51, 53, 57, 58, 0, 0, 0, 55, 56, 0, 0, 0, 60, 61, 6, 0, 115,
62, 63, 8, 6, 0, 118, 116, 117, 0, 0, 113, 114, 0, 0, 0, 132, 131, 130, 0, 0,
0, 135, 134, 133, 0, 0, 126, 127, 128, 129, 123, 124, 125, 126, 127, 0, 0, 96, 103, 97,
130, 0, 0, 99, 106, 100, 0, 88, 75, 0, 0, 85, 73, 0, 0, 89, 88, 0, 0, 0,
0, 92, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 104, 0, 128, 129, 0,
111, 107, 0, 131, 132, 0, 0, 0, 89, 43, 0, 0, 86, 41, 90, 0, 43, 50, 52, 57,
93, 0, 45, 52, 54, 59, 60, 61, 0, 0, 58, 59, 0, 0, 107, 98, 0, 0, 0, 91,
110, 101, 0, 0, 0, 94, 112, 0, 0, 0, 109, 0, 0, 0, 92, 105, 0, 0, 99, 100
95, 108, 0, 0, 102, 103
}; };
/* YYDEFGOTO[NTERM-NUM]. */ /* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] = static const yytype_int16 yydefgoto[] =
{ {
-1, 1, 3, 27, 158, 156, 28, 31, 59, 61, -1, 1, 3, 26, 152, 27, 30, 58, 60, 54,
55, 46, 84, 75, 88, 67, 80, 90, 92, 94, 45, 82, 73, 86, 65, 78, 88, 90, 92, 94,
96, 98, 100, 102, 104, 56, 68, 57, 69, 48, 96, 98, 100, 102, 55, 66, 56, 67, 47, 57,
58, 191, 232, 49, 50, 51, 52, 116, 208, 53, 186, 226, 48, 49, 50, 51, 113, 202, 52, 118
121
}; };
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */ STATE-NUM. */
#define YYPACT_NINF -104 #define YYPACT_NINF -89
static const yytype_int16 yypact[] = static const yytype_int16 yypact[] =
{ {
-104, 4, -104, 173, -26, -25, 277, 297, 297, 349, -89, 8, -89, 211, -33, -23, 288, 308, 308, 360,
225, -14, 329, 396, 18, 297, 297, 297, 18, 171, 236, -11, 340, 54, 41, 308, 308, 308, 41, 106,
-20, 297, 297, 2, -4, 26, -104, -104, 43, -104, -13, 308, 308, 62, -4, -89, -89, 45, -89, -89,
-104, -104, 478, 478, -104, -104, -104, -104, -104, -104, -89, 484, 484, -89, -89, -89, -89, -89, -89, -89,
-104, 111, -104, 349, 402, 478, -104, -104, -104, -104, 81, -89, 360, 413, 484, -89, -89, -89, -89, -89,
-104, -104, -12, -5, 83, -104, -104, 44, -104, -104, -89, 38, 48, 407, -89, -89, -2, -89, -89, 64,
46, -104, 49, 349, 111, 113, 245, -104, -104, -104, -89, 78, 360, 81, 256, -89, -89, -89, -89, -89,
-104, -104, -104, -104, 50, -104, 100, 349, -104, -104, -89, -89, 61, -89, 107, 360, -89, -89, -89, 59,
-104, 113, 420, 478, -104, -104, 64, 66, -104, 78, 431, 484, -89, -89, 86, 79, -89, 87, -89, 89,
-104, 80, -104, 85, -104, 89, -104, 93, -104, 98, -89, 91, -89, 97, -89, 102, -89, 116, -89, 120,
-104, 101, -104, 112, -104, 121, -104, 478, -104, 478, -89, 148, -89, 151, -89, 484, 484, -89, -89, -89,
-104, -104, -104, 153, 478, 478, 135, -104, 8, 163, 123, 484, 484, 105, -89, 1, 150, -89, 169, -89,
-104, 74, -104, 179, 52, 427, -104, -104, 445, -104, 166, 9, 69, -89, -89, 456, -89, -89, -89, 360,
-104, -104, 349, 297, -104, -104, -104, 135, -104, 381, 308, -89, -89, -89, 105, 392, -89, -17, 484, -89,
-104, 33, 478, -104, -104, 420, 186, 451, 349, 349, -89, 431, 170, 460, 360, 360, 360, 469, 360, 360,
349, 460, 349, 349, 297, 297, 173, 172, 173, 172, 308, 308, 211, 179, 179, 59, -89, -89, 6, 484,
113, -104, -104, 5, 478, 180, -104, 478, 478, 478, 154, -89, 484, 484, 484, 201, 149, 484, 484, 484,
226, 224, 478, 478, 478, 478, 478, -104, 235, 36, 484, 484, -89, 198, 13, 158, 159, -89, 480, 160,
195, 196, -104, 466, 197, -104, -104, 199, 202, -104, -89, -89, 162, 165, -89, 0, -89, 167, 171, 172,
21, -104, 203, 211, 219, -104, -104, 217, 222, 223, -89, -89, 193, 199, 200, -89, -89, -89, 197, -89,
-104, -104, -104, -104, 229, -104, -104, -104, 240, 241, -89, -89, 168, 204, 214, 534, 542, 549, 484, 484,
237, 232, 527, 534, 478, 478, 134, 134, -104, -104, 113, 113, -89, -89, -89, 484, 484, 207, -89, -89,
-104, 478, 478, 243, -104, -104, 248, -104, -104, -20, 208, -89, -89, -13, 220, 251, -89, 209, 226, 231,
263, 287, -104, 249, 264, 265, -20, 478, 171, 269, -13, 484, 106, 229, -89, -89, 259, 184, 184, 219,
-104, -104, 294, 214, 214, 256, 258, 119, -104, -104, 225, 80, -89, -89, 268, 249, -89, -89, -89, -89,
301, 280, -104, -104, -104, -104, -104, -104, 266, 478, -89, -89, 232, 484, -89, -89, 272, 274, 269, -89,
-104, -104, 308, 311, 292, -104, -104, 273, 478, 478, -89, 239, 484, 484, -89, -89, 252, 253, -89, -89
-104, -104, 274, 278, -104, -104
}; };
/* YYPGOTO[NTERM-NUM]. */ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] = static const yytype_int16 yypgoto[] =
{ {
-104, -104, -104, -103, -104, -104, -104, 319, -104, -104, -89, -89, -89, 153, -89, -89, 290, -89, -89, -89,
-104, 331, -104, -104, -104, -104, -104, -104, -104, -104, 295, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-104, -104, -104, -104, -104, 19, 275, -2, -6, -9, -89, -89, -89, -89, 18, 246, 20, -7, -9, -8,
-8, 115, -104, 22, 1, -1, -3, -48, -104, -10, 84, -89, 51, -3, -6, 4, -50, -89, -10, -88
-66
}; };
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
...@@ -726,120 +721,124 @@ static const yytype_int16 yypgoto[] = ...@@ -726,120 +721,124 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -1 #define YYTABLE_NINF -1
static const yytype_uint16 yytable[] = static const yytype_uint16 yytable[] =
{ {
74, 70, 71, 87, 2, 86, 60, 85, 76, 73, 72, 68, 69, 85, 71, 84, 83, 70, 2, 224,
99, 72, 101, 91, 93, 95, 137, 138, 164, 103, 97, 159, 99, 134, 28, 74, 182, 153, 154, 174,
105, 29, 111, 112, 30, 47, 32, 33, 62, 41, 175, 108, 109, 216, 46, 176, 29, 61, 59, 139,
230, 47, 54, 143, 120, 122, 89, 205, 123, 206, 46, 225, 40, 117, 119, 89, 91, 93, 199, 53,
97, 157, 108, 159, 130, 124, 222, 207, 106, 34, 200, 101, 103, 127, 106, 174, 175, 128, 201, 31,
107, 129, 231, 202, 134, 203, 74, 70, 71, 165, 32, 176, 160, 131, 72, 68, 69, 126, 71, 132,
136, 41, 117, 42, 135, 73, 187, 72, 44, 179, 114, 70, 31, 32, 217, 87, 133, 111, 112, 95,
180, 45, 87, 120, 109, 181, 144, 167, 168, 169, 85, 117, 33, 140, 205, 206, 207, 31, 32, 210,
170, 171, 172, 173, 174, 175, 176, 223, 179, 180, 211, 212, 213, 214, 40, 33, 41, 110, 120, 111,
110, 32, 125, 131, 181, 132, 117, 120, 133, 120, 112, 43, 107, 114, 44, 117, 117, 79, 121, 41,
141, 211, 212, 213, 161, 162, 216, 217, 218, 219, 33, 156, 157, 80, 81, 198, 53, 44, 104, 177,
220, 142, 204, 145, 34, 112, 146, 113, 120, 114, 105, 137, 109, 129, 41, 117, 256, 257, 138, 81,
115, 114, 115, 126, 127, 177, 41, 147, 42, 148, 237, 238, 44, 169, 170, 171, 131, 130, 183, 142,
134, 186, 188, 128, 149, 87, 45, 192, 150, 189, 155, 85, 132, 187, 184, 141, 143, 192, 144, 191,
135, 197, 151, 196, 174, 175, 176, 152, 243, 244, 145, 34, 35, 36, 37, 38, 146, 180, 39, 203,
153, 185, 200, 201, 209, 262, 263, 120, 120, 120, 181, 147, 117, 117, 117, 158, 209, 117, 117, 117,
160, 154, 120, 120, 120, 120, 120, 193, 194, 195, 117, 117, 188, 189, 190, 148, 193, 194, 109, 149,
155, 198, 199, 112, 4, 167, 168, 169, 170, 171, 195, 196, 162, 163, 164, 165, 166, 167, 168, 169,
172, 173, 174, 175, 176, 163, 5, 6, 7, 8, 170, 171, 162, 163, 164, 165, 166, 167, 168, 169,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 170, 171, 167, 168, 169, 170, 171, 150, 117, 117,
19, 20, 21, 22, 120, 120, 35, 36, 37, 38, 151, 161, 173, 182, 204, 239, 240, 208, 215, 218,
39, 245, 246, 40, 166, 178, 23, 24, 25, 187, 219, 221, 4, 222, 223, 243, 227, 228, 229, 234,
26, 249, 172, 173, 174, 175, 176, 256, 255, 257, 172, 250, 249, 251, 5, 6, 7, 8, 9, 10,
210, 215, 214, 32, 33, 63, 168, 169, 170, 171, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
172, 173, 174, 175, 176, 221, 224, 225, 227, 267, 21, 22, 230, 261, 31, 32, 62, 233, 231, 232,
228, 229, 233, 32, 33, 139, 34, 234, 272, 273, 236, 244, 266, 267, 23, 235, 24, 241, 25, 242,
35, 36, 37, 38, 39, 235, 236, 40, 64, 65, 245, 185, 247, 252, 31, 32, 135, 33, 248, 253,
42, 237, 238, 242, 66, 44, 34, 54, 45, 239, 254, 34, 35, 36, 37, 38, 255, 258, 39, 63,
35, 36, 37, 38, 39, 32, 33, 40, 64, 65, 259, 41, 262, 260, 263, 64, 43, 33, 53, 44,
42, 240, 241, 247, 250, 44, 251, 54, 45, 248, 265, 34, 35, 36, 37, 38, 31, 32, 39, 63,
253, 190, 254, 258, 259, 32, 33, 260, 34, 261, 264, 41, 76, 268, 269, 197, 43, 77, 53, 44,
264, 265, 35, 36, 37, 38, 39, 266, 268, 40, 136, 246, 0, 0, 0, 0, 31, 32, 0, 33,
41, 269, 42, 270, 271, 274, 43, 44, 34, 275, 0, 0, 0, 34, 35, 36, 37, 38, 0, 0,
45, 78, 35, 36, 37, 38, 39, 32, 33, 40, 39, 40, 0, 41, 0, 0, 0, 42, 43, 33,
41, 140, 42, 79, 0, 0, 0, 44, 252, 54, 0, 44, 0, 34, 35, 36, 37, 38, 31, 32,
45, 0, 0, 0, 0, 0, 0, 32, 33, 0, 39, 40, 0, 41, 0, 0, 0, 0, 43, 0,
34, 0, 0, 0, 35, 36, 37, 38, 39, 0, 53, 44, 0, 0, 0, 0, 0, 0, 31, 32,
0, 40, 41, 0, 42, 0, 0, 0, 77, 44, 0, 33, 0, 0, 0, 34, 35, 36, 37, 38,
34, 0, 45, 0, 35, 36, 37, 38, 39, 32, 0, 0, 39, 40, 0, 41, 0, 0, 0, 75,
33, 40, 41, 0, 42, 0, 0, 0, 0, 44, 43, 33, 0, 44, 0, 34, 35, 36, 37, 38,
0, 0, 45, 0, 32, 33, 0, 0, 0, 0, 31, 32, 39, 40, 0, 41, 0, 0, 0, 0,
32, 33, 34, 0, 0, 0, 35, 36, 37, 38, 43, 0, 0, 44, 0, 31, 122, 0, 0, 0,
39, 0, 0, 40, 0, 0, 42, 34, 32, 33, 0, 31, 32, 33, 0, 0, 0, 34, 35, 36,
0, 44, 0, 34, 45, 32, 33, 0, 118, 81, 37, 38, 0, 0, 39, 0, 0, 41, 33, 31,
65, 42, 0, 0, 119, 82, 83, 42, 54, 45, 32, 0, 43, 0, 33, 44, 0, 123, 124, 115,
0, 34, 83, 32, 183, 45, 0, 0, 34, 32, 40, 0, 41, 0, 0, 116, 0, 125, 41, 0,
33, 0, 0, 81, 65, 42, 0, 182, 32, 33, 44, 0, 33, 81, 31, 178, 44, 0, 31, 32,
83, 0, 42, 45, 32, 33, 34, 83, 0, 0, 0, 0, 0, 0, 79, 0, 41, 31, 32, 0,
45, 0, 34, 0, 0, 184, 32, 33, 0, 0, 0, 81, 0, 0, 44, 0, 0, 33, 31, 32,
42, 34, 0, 0, 0, 83, 42, 34, 45, 0, 0, 33, 31, 32, 0, 0, 179, 0, 0, 0,
0, 83, 0, 190, 45, 42, 226, 0, 0, 34, 33, 41, 0, 0, 0, 41, 81, 0, 0, 44,
83, 42, 54, 45, 0, 0, 83, 0, 0, 45, 81, 33, 185, 44, 41, 33, 0, 0, 0, 81,
0, 0, 0, 42, 0, 0, 0, 0, 83, 0, 220, 53, 44, 0, 0, 41, 0, 0, 0, 41,
0, 45, 169, 170, 171, 172, 173, 174, 175, 176, 81, 0, 0, 44, 81, 0, 0, 44, 163, 164,
170, 171, 172, 173, 174, 175, 176 165, 166, 167, 168, 169, 170, 171, 164, 165, 166,
167, 168, 169, 170, 171, 165, 166, 167, 168, 169,
170, 171
}; };
static const yytype_int16 yycheck[] = static const yytype_int16 yycheck[] =
{ {
10, 10, 10, 13, 0, 13, 8, 13, 11, 10, 10, 10, 10, 13, 10, 13, 13, 10, 0, 9,
19, 10, 20, 15, 16, 17, 64, 65, 10, 21, 19, 10, 20, 63, 47, 11, 33, 105, 106, 36,
22, 47, 32, 33, 49, 6, 8, 9, 9, 43, 37, 31, 32, 10, 6, 42, 49, 9, 8, 79,
9, 12, 52, 81, 44, 45, 14, 32, 50, 34, 12, 31, 43, 43, 44, 15, 16, 17, 32, 52,
18, 107, 46, 109, 54, 50, 10, 42, 46, 31, 34, 21, 22, 53, 48, 36, 37, 49, 42, 8,
48, 54, 31, 156, 63, 158, 66, 66, 66, 51, 9, 42, 51, 62, 64, 64, 64, 53, 64, 62,
63, 43, 43, 45, 63, 66, 33, 66, 50, 36, 42, 64, 8, 9, 51, 14, 62, 8, 9, 18,
37, 53, 82, 83, 48, 42, 82, 3, 4, 5, 80, 81, 31, 80, 162, 163, 164, 8, 9, 167,
6, 7, 8, 9, 10, 11, 12, 51, 36, 37, 168, 169, 170, 171, 43, 31, 45, 6, 50, 8,
47, 8, 9, 49, 42, 49, 77, 107, 49, 109, 9, 50, 47, 75, 53, 105, 106, 43, 50, 45,
50, 167, 168, 169, 114, 115, 172, 173, 174, 175, 31, 111, 112, 49, 50, 155, 52, 53, 46, 40,
176, 11, 160, 49, 31, 125, 50, 6, 128, 8, 48, 50, 122, 49, 45, 125, 36, 37, 11, 50,
9, 8, 9, 40, 41, 51, 43, 49, 45, 49, 208, 209, 53, 10, 11, 12, 135, 49, 138, 50,
139, 133, 142, 50, 49, 145, 53, 147, 49, 145, 7, 141, 135, 143, 141, 49, 49, 147, 49, 147,
139, 151, 49, 151, 10, 11, 12, 49, 214, 215, 49, 35, 36, 37, 38, 39, 49, 129, 42, 159,
49, 132, 154, 155, 164, 36, 37, 167, 168, 169, 130, 49, 162, 163, 164, 50, 7, 167, 168, 169,
7, 49, 172, 173, 174, 175, 176, 148, 149, 150, 170, 171, 144, 145, 146, 49, 148, 149, 178, 49,
49, 152, 153, 183, 1, 3, 4, 5, 6, 7, 150, 151, 3, 4, 5, 6, 7, 8, 9, 10,
8, 9, 10, 11, 12, 50, 13, 14, 15, 16, 11, 12, 3, 4, 5, 6, 7, 8, 9, 10,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 11, 12, 8, 9, 10, 11, 12, 49, 208, 209,
27, 28, 29, 30, 214, 215, 35, 36, 37, 38, 49, 51, 36, 33, 50, 215, 216, 6, 10, 51,
39, 221, 222, 42, 51, 36, 43, 44, 45, 33, 51, 51, 1, 51, 49, 223, 49, 46, 46, 51,
47, 229, 8, 9, 10, 11, 12, 237, 236, 238, 51, 231, 230, 232, 13, 14, 15, 16, 17, 18,
50, 7, 6, 8, 9, 10, 4, 5, 6, 7, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
8, 9, 10, 11, 12, 10, 51, 51, 51, 259, 29, 30, 49, 253, 8, 9, 10, 50, 49, 49,
51, 49, 49, 8, 9, 10, 31, 46, 268, 269, 36, 31, 262, 263, 43, 51, 45, 50, 47, 51,
35, 36, 37, 38, 39, 46, 49, 42, 43, 44, 9, 52, 36, 34, 8, 9, 10, 31, 37, 10,
45, 49, 49, 36, 49, 50, 31, 52, 53, 50, 51, 35, 36, 37, 38, 39, 51, 9, 42, 43,
35, 36, 37, 38, 39, 8, 9, 42, 43, 44, 31, 45, 10, 51, 10, 49, 50, 31, 52, 53,
45, 51, 51, 50, 31, 50, 9, 52, 53, 51, 51, 35, 36, 37, 38, 39, 8, 9, 42, 43,
36, 52, 37, 34, 10, 8, 9, 51, 31, 51, 31, 45, 12, 51, 51, 152, 50, 12, 52, 53,
9, 31, 35, 36, 37, 38, 39, 51, 10, 42, 64, 227, -1, -1, -1, -1, 8, 9, -1, 31,
43, 10, 45, 31, 51, 51, 49, 50, 31, 51, -1, -1, -1, 35, 36, 37, 38, 39, -1, -1,
53, 12, 35, 36, 37, 38, 39, 8, 9, 42, 42, 43, -1, 45, -1, -1, -1, 49, 50, 31,
43, 66, 45, 12, -1, -1, -1, 50, 233, 52, -1, 53, -1, 35, 36, 37, 38, 39, 8, 9,
53, -1, -1, -1, -1, -1, -1, 8, 9, -1, 42, 43, -1, 45, -1, -1, -1, -1, 50, -1,
31, -1, -1, -1, 35, 36, 37, 38, 39, -1, 52, 53, -1, -1, -1, -1, -1, -1, 8, 9,
-1, 42, 43, -1, 45, -1, -1, -1, 49, 50, -1, 31, -1, -1, -1, 35, 36, 37, 38, 39,
31, -1, 53, -1, 35, 36, 37, 38, 39, 8, -1, -1, 42, 43, -1, 45, -1, -1, -1, 49,
9, 42, 43, -1, 45, -1, -1, -1, -1, 50, 50, 31, -1, 53, -1, 35, 36, 37, 38, 39,
-1, -1, 53, -1, 8, 9, -1, -1, -1, -1, 8, 9, 42, 43, -1, 45, -1, -1, -1, -1,
8, 9, 31, -1, -1, -1, 35, 36, 37, 38, 50, -1, -1, 53, -1, 8, 9, -1, -1, -1,
39, -1, -1, 42, -1, -1, 45, 31, 8, 9, -1, 8, 9, 31, -1, -1, -1, 35, 36, 37,
-1, 50, -1, 31, 53, 8, 9, -1, 36, 43, 38, 39, -1, -1, 42, -1, -1, 45, 31, 8,
44, 45, -1, -1, 42, 49, 50, 45, 52, 53, 9, -1, 50, -1, 31, 53, -1, 40, 41, 36,
-1, 31, 50, 8, 9, 53, -1, -1, 31, 8, 43, -1, 45, -1, -1, 42, -1, 50, 45, -1,
9, -1, -1, 43, 44, 45, -1, 40, 8, 9, 53, -1, 31, 50, 8, 9, 53, -1, 8, 9,
50, -1, 45, 53, 8, 9, 31, 50, -1, -1, -1, -1, -1, -1, 43, -1, 45, 8, 9, -1,
53, -1, 31, -1, -1, 40, 8, 9, -1, -1, -1, 50, -1, -1, 53, -1, -1, 31, 8, 9,
45, 31, -1, -1, -1, 50, 45, 31, 53, -1, -1, 31, 8, 9, -1, -1, 40, -1, -1, -1,
-1, 50, -1, 52, 53, 45, 40, -1, -1, 31, 31, 45, -1, -1, -1, 45, 50, -1, -1, 53,
50, 45, 52, 53, -1, -1, 50, -1, -1, 53, 50, 31, 52, 53, 45, 31, -1, -1, -1, 50,
-1, -1, -1, 45, -1, -1, -1, -1, 50, -1, 40, 52, 53, -1, -1, 45, -1, -1, -1, 45,
-1, 53, 5, 6, 7, 8, 9, 10, 11, 12, 50, -1, -1, 53, 50, -1, -1, 53, 4, 5,
6, 7, 8, 9, 10, 11, 12 6, 7, 8, 9, 10, 11, 12, 5, 6, 7,
8, 9, 10, 11, 12, 6, 7, 8, 9, 10,
11, 12
}; };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
...@@ -848,32 +847,31 @@ static const yytype_uint8 yystos[] = ...@@ -848,32 +847,31 @@ static const yytype_uint8 yystos[] =
{ {
0, 55, 0, 56, 1, 13, 14, 15, 16, 17, 0, 55, 0, 56, 1, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 43, 44, 45, 47, 57, 60, 47, 28, 29, 30, 43, 45, 47, 57, 59, 47, 49,
49, 61, 8, 9, 31, 35, 36, 37, 38, 39, 60, 8, 9, 31, 35, 36, 37, 38, 39, 42,
42, 43, 45, 49, 50, 53, 65, 79, 83, 87, 43, 45, 49, 50, 53, 64, 78, 82, 86, 87,
88, 89, 90, 93, 52, 64, 79, 81, 84, 62, 88, 89, 92, 52, 63, 78, 80, 83, 61, 80,
81, 63, 79, 10, 43, 44, 49, 69, 80, 82, 62, 78, 10, 43, 49, 68, 79, 81, 82, 83,
83, 84, 88, 89, 93, 67, 90, 49, 61, 65, 87, 88, 92, 66, 89, 49, 60, 64, 69, 43,
70, 43, 49, 50, 66, 82, 84, 93, 68, 87, 49, 50, 65, 81, 83, 92, 67, 86, 70, 80,
71, 81, 72, 81, 73, 81, 74, 87, 75, 83, 71, 80, 72, 80, 73, 86, 74, 82, 75, 83,
76, 84, 77, 81, 78, 81, 46, 48, 46, 48, 76, 80, 77, 80, 46, 48, 48, 47, 92, 92,
47, 93, 93, 6, 8, 9, 91, 79, 36, 42, 6, 8, 9, 90, 78, 36, 42, 92, 93, 92,
93, 94, 93, 50, 50, 9, 40, 41, 50, 90, 50, 50, 9, 40, 41, 50, 89, 92, 49, 49,
93, 49, 49, 49, 83, 88, 90, 91, 91, 10, 49, 82, 87, 89, 90, 10, 79, 50, 11, 90,
80, 50, 11, 91, 82, 49, 50, 49, 49, 49, 81, 49, 50, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 59, 94, 58, 94, 49, 49, 58, 93, 93, 7, 92, 92, 50, 10,
7, 93, 93, 50, 10, 51, 51, 3, 4, 5, 51, 51, 3, 4, 5, 6, 7, 8, 9, 10,
6, 7, 8, 9, 10, 11, 12, 51, 36, 36, 11, 12, 51, 36, 36, 37, 42, 40, 9, 40,
37, 42, 40, 9, 40, 79, 81, 33, 93, 82, 78, 80, 33, 92, 81, 52, 84, 92, 78, 78,
52, 85, 93, 79, 79, 79, 84, 93, 79, 79, 78, 83, 92, 78, 78, 80, 80, 57, 90, 32,
81, 81, 57, 57, 91, 32, 34, 42, 92, 93, 34, 42, 91, 92, 50, 93, 93, 93, 6, 7,
50, 94, 94, 94, 6, 7, 94, 94, 94, 94, 93, 93, 93, 93, 93, 10, 10, 51, 51, 51,
94, 10, 10, 51, 51, 51, 40, 51, 51, 49, 40, 51, 51, 49, 9, 31, 85, 49, 46, 46,
9, 31, 86, 49, 46, 46, 49, 49, 49, 50, 49, 49, 49, 50, 51, 51, 36, 93, 93, 92,
51, 51, 36, 94, 94, 93, 93, 50, 51, 84, 92, 50, 51, 83, 31, 9, 84, 36, 37, 83,
31, 9, 85, 36, 37, 84, 93, 83, 34, 10, 92, 82, 34, 10, 51, 51, 36, 37, 9, 31,
51, 51, 36, 37, 9, 31, 51, 93, 10, 10, 51, 92, 10, 10, 31, 51, 92, 92, 51, 51
31, 51, 93, 93, 51, 51
}; };
#define yyerrok (yyerrstatus = 0) #define yyerrok (yyerrstatus = 0)
...@@ -1697,30 +1695,24 @@ yyreduce: ...@@ -1697,30 +1695,24 @@ yyreduce:
case 5: case 5:
#line 78 "a.y" #line 78 "a.y"
{ {
if((yyvsp[(1) - (2)].sym)->value != pc) (yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name); if((yyvsp[(1) - (2)].sym)->type == LLAB && (yyvsp[(1) - (2)].sym)->value != pc)
(yyvsp[(1) - (2)].sym)->value = pc; yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->labelname);
}
break;
case 7:
#line 85 "a.y"
{
(yyvsp[(1) - (2)].sym)->type = LLAB; (yyvsp[(1) - (2)].sym)->type = LLAB;
(yyvsp[(1) - (2)].sym)->value = pc; (yyvsp[(1) - (2)].sym)->value = pc;
} }
break; break;
case 12: case 10:
#line 96 "a.y" #line 92 "a.y"
{ {
(yyvsp[(1) - (3)].sym)->type = LVAR; (yyvsp[(1) - (3)].sym)->type = LVAR;
(yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval); (yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval);
} }
break; break;
case 13: case 11:
#line 101 "a.y" #line 97 "a.y"
{ {
if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval)) if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval))
yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name); yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name);
...@@ -1728,186 +1720,186 @@ yyreduce: ...@@ -1728,186 +1720,186 @@ yyreduce:
} }
break; break;
case 12:
#line 102 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 13:
#line 103 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 14: case 14:
#line 106 "a.y" #line 104 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 15: case 15:
#line 107 "a.y" #line 105 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 16: case 16:
#line 108 "a.y" #line 106 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 17: case 17:
#line 109 "a.y" #line 107 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 18: case 18:
#line 110 "a.y" #line 108 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 19: case 19:
#line 111 "a.y" #line 109 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 20: case 20:
#line 112 "a.y" #line 110 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 21: case 21:
#line 113 "a.y" #line 111 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 22: case 22:
#line 114 "a.y" #line 112 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 23: case 23:
#line 115 "a.y" #line 113 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 24: case 24:
#line 116 "a.y" #line 114 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 25: case 25:
#line 117 "a.y" #line 115 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 26: case 26:
#line 118 "a.y" #line 116 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 27: case 27:
#line 119 "a.y" #line 117 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 28: case 28:
#line 120 "a.y" #line 118 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 29: case 29:
#line 121 "a.y" #line 119 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); } { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break; break;
case 30: case 30:
#line 122 "a.y" #line 122 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 31:
#line 123 "a.y"
{ outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 32:
#line 126 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 33: case 31:
#line 131 "a.y" #line 127 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 34: case 32:
#line 138 "a.y" #line 134 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 35: case 33:
#line 145 "a.y" #line 141 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 36: case 34:
#line 152 "a.y" #line 148 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (2)].addr); (yyval.addr2).from = (yyvsp[(1) - (2)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 37: case 35:
#line 157 "a.y" #line 153 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (1)].addr); (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 38: case 36:
#line 164 "a.y" #line 160 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 39: case 37:
#line 169 "a.y" #line 165 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr); (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 40: case 38:
#line 176 "a.y" #line 172 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 41: case 39:
#line 181 "a.y" #line 177 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr); (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 42: case 40:
#line 186 "a.y" #line 182 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 43: case 41:
#line 193 "a.y" #line 189 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval); (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
...@@ -1915,41 +1907,43 @@ yyreduce: ...@@ -1915,41 +1907,43 @@ yyreduce:
} }
break; break;
case 44: case 42:
#line 201 "a.y" #line 197 "a.y"
{ {
settext((yyvsp[(1) - (3)].addr).sym);
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 45: case 43:
#line 206 "a.y" #line 203 "a.y"
{ {
settext((yyvsp[(1) - (5)].addr).sym);
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval); (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr); (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
} }
break; break;
case 46: case 44:
#line 214 "a.y" #line 212 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 47: case 45:
#line 219 "a.y" #line 217 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(1) - (1)].addr); (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 48: case 46:
#line 224 "a.y" #line 222 "a.y"
{ {
(yyval.addr2).from = nullgen; (yyval.addr2).from = nullgen;
(yyval.addr2).to = (yyvsp[(2) - (2)].addr); (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
...@@ -1958,16 +1952,16 @@ yyreduce: ...@@ -1958,16 +1952,16 @@ yyreduce:
} }
break; break;
case 51: case 49:
#line 237 "a.y" #line 235 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 52: case 50:
#line 242 "a.y" #line 240 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr); (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
...@@ -1977,16 +1971,16 @@ yyreduce: ...@@ -1977,16 +1971,16 @@ yyreduce:
} }
break; break;
case 53: case 51:
#line 252 "a.y" #line 250 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 54: case 52:
#line 257 "a.y" #line 255 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr); (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
...@@ -1996,40 +1990,40 @@ yyreduce: ...@@ -1996,40 +1990,40 @@ yyreduce:
} }
break; break;
case 55: case 53:
#line 267 "a.y" #line 265 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (2)].addr); (yyval.addr2).from = (yyvsp[(1) - (2)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 56: case 54:
#line 272 "a.y" #line 270 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (1)].addr); (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
(yyval.addr2).to = nullgen; (yyval.addr2).to = nullgen;
} }
break; break;
case 57: case 55:
#line 277 "a.y" #line 275 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 58: case 56:
#line 284 "a.y" #line 282 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (3)].addr); (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
(yyval.addr2).to = (yyvsp[(3) - (3)].addr); (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
} }
break; break;
case 59: case 57:
#line 289 "a.y" #line 287 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval); (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
...@@ -2037,8 +2031,8 @@ yyreduce: ...@@ -2037,8 +2031,8 @@ yyreduce:
} }
break; break;
case 60: case 58:
#line 297 "a.y" #line 295 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(1) - (5)].addr); (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
(yyval.addr2).to = (yyvsp[(3) - (5)].addr); (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
...@@ -2046,8 +2040,8 @@ yyreduce: ...@@ -2046,8 +2040,8 @@ yyreduce:
} }
break; break;
case 61: case 59:
#line 305 "a.y" #line 303 "a.y"
{ {
(yyval.addr2).from = (yyvsp[(3) - (5)].addr); (yyval.addr2).from = (yyvsp[(3) - (5)].addr);
(yyval.addr2).to = (yyvsp[(5) - (5)].addr); (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
...@@ -2057,8 +2051,8 @@ yyreduce: ...@@ -2057,8 +2051,8 @@ yyreduce:
} }
break; break;
case 62: case 60:
#line 315 "a.y" #line 313 "a.y"
{ {
if((yyvsp[(1) - (3)].addr).type != D_CONST || (yyvsp[(3) - (3)].addr).type != D_CONST) if((yyvsp[(1) - (3)].addr).type != D_CONST || (yyvsp[(3) - (3)].addr).type != D_CONST)
yyerror("arguments to PCDATA must be integer constants"); yyerror("arguments to PCDATA must be integer constants");
...@@ -2067,8 +2061,8 @@ yyreduce: ...@@ -2067,8 +2061,8 @@ yyreduce:
} }
break; break;
case 63: case 61:
#line 324 "a.y" #line 322 "a.y"
{ {
if((yyvsp[(1) - (3)].addr).type != D_CONST) if((yyvsp[(1) - (3)].addr).type != D_CONST)
yyerror("index for FUNCDATA must be integer constant"); yyerror("index for FUNCDATA must be integer constant");
...@@ -2079,22 +2073,22 @@ yyreduce: ...@@ -2079,22 +2073,22 @@ yyreduce:
} }
break; break;
case 68: case 66:
#line 341 "a.y" #line 339 "a.y"
{ {
(yyval.addr) = (yyvsp[(2) - (2)].addr); (yyval.addr) = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 69: case 67:
#line 345 "a.y" #line 343 "a.y"
{ {
(yyval.addr) = (yyvsp[(2) - (2)].addr); (yyval.addr) = (yyvsp[(2) - (2)].addr);
} }
break; break;
case 75: case 73:
#line 358 "a.y" #line 356 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_BRANCH; (yyval.addr).type = D_BRANCH;
...@@ -2102,76 +2096,68 @@ yyreduce: ...@@ -2102,76 +2096,68 @@ yyreduce:
} }
break; break;
case 76: case 74:
#line 364 "a.y" #line 362 "a.y"
{
(yyval.addr) = nullgen;
if(pass == 2)
yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name);
(yyval.addr).type = D_BRANCH;
(yyval.addr).offset = (yyvsp[(2) - (2)].lval);
}
break;
case 77:
#line 372 "a.y"
{ {
(yyvsp[(1) - (2)].sym) = labellookup((yyvsp[(1) - (2)].sym));
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
if(pass == 2 && (yyvsp[(1) - (2)].sym)->type != LLAB)
yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->labelname);
(yyval.addr).type = D_BRANCH; (yyval.addr).type = D_BRANCH;
(yyval.addr).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval); (yyval.addr).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
} }
break; break;
case 78: case 75:
#line 380 "a.y" #line 373 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 79: case 76:
#line 385 "a.y" #line 378 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 80: case 77:
#line 390 "a.y" #line 383 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 81: case 78:
#line 395 "a.y" #line 388 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 82: case 79:
#line 400 "a.y" #line 393 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_SP; (yyval.addr).type = D_SP;
} }
break; break;
case 83: case 80:
#line 405 "a.y" #line 398 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(1) - (1)].lval); (yyval.addr).type = (yyvsp[(1) - (1)].lval);
} }
break; break;
case 84: case 81:
#line 412 "a.y" #line 405 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_CONST; (yyval.addr).type = D_CONST;
...@@ -2179,8 +2165,8 @@ yyreduce: ...@@ -2179,8 +2165,8 @@ yyreduce:
} }
break; break;
case 85: case 82:
#line 418 "a.y" #line 411 "a.y"
{ {
(yyval.addr) = (yyvsp[(2) - (2)].addr); (yyval.addr) = (yyvsp[(2) - (2)].addr);
(yyval.addr).index = (yyvsp[(2) - (2)].addr).type; (yyval.addr).index = (yyvsp[(2) - (2)].addr).type;
...@@ -2193,8 +2179,8 @@ yyreduce: ...@@ -2193,8 +2179,8 @@ yyreduce:
} }
break; break;
case 86: case 83:
#line 429 "a.y" #line 422 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_SCONST; (yyval.addr).type = D_SCONST;
...@@ -2202,8 +2188,8 @@ yyreduce: ...@@ -2202,8 +2188,8 @@ yyreduce:
} }
break; break;
case 87: case 84:
#line 435 "a.y" #line 428 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2211,8 +2197,8 @@ yyreduce: ...@@ -2211,8 +2197,8 @@ yyreduce:
} }
break; break;
case 88: case 85:
#line 441 "a.y" #line 434 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2220,8 +2206,8 @@ yyreduce: ...@@ -2220,8 +2206,8 @@ yyreduce:
} }
break; break;
case 89: case 86:
#line 447 "a.y" #line 440 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2229,8 +2215,8 @@ yyreduce: ...@@ -2229,8 +2215,8 @@ yyreduce:
} }
break; break;
case 90: case 87:
#line 453 "a.y" #line 446 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_FCONST; (yyval.addr).type = D_FCONST;
...@@ -2238,8 +2224,8 @@ yyreduce: ...@@ -2238,8 +2224,8 @@ yyreduce:
} }
break; break;
case 91: case 88:
#line 461 "a.y" #line 454 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_CONST2; (yyval.addr).type = D_CONST2;
...@@ -2248,40 +2234,40 @@ yyreduce: ...@@ -2248,40 +2234,40 @@ yyreduce:
} }
break; break;
case 92: case 89:
#line 470 "a.y" #line 463 "a.y"
{ {
(yyval.con2).v1 = (yyvsp[(1) - (1)].lval); (yyval.con2).v1 = (yyvsp[(1) - (1)].lval);
(yyval.con2).v2 = ArgsSizeUnknown; (yyval.con2).v2 = ArgsSizeUnknown;
} }
break; break;
case 93: case 90:
#line 475 "a.y" #line 468 "a.y"
{ {
(yyval.con2).v1 = -(yyvsp[(2) - (2)].lval); (yyval.con2).v1 = -(yyvsp[(2) - (2)].lval);
(yyval.con2).v2 = ArgsSizeUnknown; (yyval.con2).v2 = ArgsSizeUnknown;
} }
break; break;
case 94: case 91:
#line 480 "a.y" #line 473 "a.y"
{ {
(yyval.con2).v1 = (yyvsp[(1) - (3)].lval); (yyval.con2).v1 = (yyvsp[(1) - (3)].lval);
(yyval.con2).v2 = (yyvsp[(3) - (3)].lval); (yyval.con2).v2 = (yyvsp[(3) - (3)].lval);
} }
break; break;
case 95: case 92:
#line 485 "a.y" #line 478 "a.y"
{ {
(yyval.con2).v1 = -(yyvsp[(2) - (4)].lval); (yyval.con2).v1 = -(yyvsp[(2) - (4)].lval);
(yyval.con2).v2 = (yyvsp[(4) - (4)].lval); (yyval.con2).v2 = (yyvsp[(4) - (4)].lval);
} }
break; break;
case 98: case 95:
#line 496 "a.y" #line 489 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_NONE; (yyval.addr).type = D_INDIR+D_NONE;
...@@ -2289,8 +2275,8 @@ yyreduce: ...@@ -2289,8 +2275,8 @@ yyreduce:
} }
break; break;
case 99: case 96:
#line 502 "a.y" #line 495 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval);
...@@ -2298,8 +2284,8 @@ yyreduce: ...@@ -2298,8 +2284,8 @@ yyreduce:
} }
break; break;
case 100: case 97:
#line 508 "a.y" #line 501 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_SP; (yyval.addr).type = D_INDIR+D_SP;
...@@ -2307,8 +2293,8 @@ yyreduce: ...@@ -2307,8 +2293,8 @@ yyreduce:
} }
break; break;
case 101: case 98:
#line 514 "a.y" #line 507 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_NONE; (yyval.addr).type = D_INDIR+D_NONE;
...@@ -2319,8 +2305,8 @@ yyreduce: ...@@ -2319,8 +2305,8 @@ yyreduce:
} }
break; break;
case 102: case 99:
#line 523 "a.y" #line 516 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval);
...@@ -2331,8 +2317,8 @@ yyreduce: ...@@ -2331,8 +2317,8 @@ yyreduce:
} }
break; break;
case 103: case 100:
#line 532 "a.y" #line 525 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval);
...@@ -2343,24 +2329,24 @@ yyreduce: ...@@ -2343,24 +2329,24 @@ yyreduce:
} }
break; break;
case 104: case 101:
#line 541 "a.y" #line 534 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(2) - (3)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(2) - (3)].lval);
} }
break; break;
case 105: case 102:
#line 546 "a.y" #line 539 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_SP; (yyval.addr).type = D_INDIR+D_SP;
} }
break; break;
case 106: case 103:
#line 551 "a.y" #line 544 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval);
...@@ -2368,8 +2354,8 @@ yyreduce: ...@@ -2368,8 +2354,8 @@ yyreduce:
} }
break; break;
case 107: case 104:
#line 557 "a.y" #line 550 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+D_NONE; (yyval.addr).type = D_INDIR+D_NONE;
...@@ -2379,8 +2365,8 @@ yyreduce: ...@@ -2379,8 +2365,8 @@ yyreduce:
} }
break; break;
case 108: case 105:
#line 565 "a.y" #line 558 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_INDIR+(yyvsp[(2) - (8)].lval); (yyval.addr).type = D_INDIR+(yyvsp[(2) - (8)].lval);
...@@ -2390,15 +2376,15 @@ yyreduce: ...@@ -2390,15 +2376,15 @@ yyreduce:
} }
break; break;
case 109: case 106:
#line 575 "a.y" #line 568 "a.y"
{ {
(yyval.addr) = (yyvsp[(1) - (1)].addr); (yyval.addr) = (yyvsp[(1) - (1)].addr);
} }
break; break;
case 110: case 107:
#line 579 "a.y" #line 572 "a.y"
{ {
(yyval.addr) = (yyvsp[(1) - (6)].addr); (yyval.addr) = (yyvsp[(1) - (6)].addr);
(yyval.addr).index = (yyvsp[(3) - (6)].lval); (yyval.addr).index = (yyvsp[(3) - (6)].lval);
...@@ -2407,8 +2393,8 @@ yyreduce: ...@@ -2407,8 +2393,8 @@ yyreduce:
} }
break; break;
case 111: case 108:
#line 588 "a.y" #line 581 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = (yyvsp[(4) - (5)].lval); (yyval.addr).type = (yyvsp[(4) - (5)].lval);
...@@ -2417,8 +2403,8 @@ yyreduce: ...@@ -2417,8 +2403,8 @@ yyreduce:
} }
break; break;
case 112: case 109:
#line 595 "a.y" #line 588 "a.y"
{ {
(yyval.addr) = nullgen; (yyval.addr) = nullgen;
(yyval.addr).type = D_STATIC; (yyval.addr).type = D_STATIC;
...@@ -2427,134 +2413,134 @@ yyreduce: ...@@ -2427,134 +2413,134 @@ yyreduce:
} }
break; break;
case 113: case 110:
#line 603 "a.y" #line 596 "a.y"
{ {
(yyval.lval) = 0; (yyval.lval) = 0;
} }
break; break;
case 114: case 111:
#line 607 "a.y" #line 600 "a.y"
{ {
(yyval.lval) = (yyvsp[(2) - (2)].lval); (yyval.lval) = (yyvsp[(2) - (2)].lval);
} }
break; break;
case 115: case 112:
#line 611 "a.y" #line 604 "a.y"
{ {
(yyval.lval) = -(yyvsp[(2) - (2)].lval); (yyval.lval) = -(yyvsp[(2) - (2)].lval);
} }
break; break;
case 117: case 114:
#line 618 "a.y" #line 611 "a.y"
{ {
(yyval.lval) = D_AUTO; (yyval.lval) = D_AUTO;
} }
break; break;
case 120: case 117:
#line 626 "a.y" #line 619 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value; (yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
} }
break; break;
case 121: case 118:
#line 630 "a.y" #line 623 "a.y"
{ {
(yyval.lval) = -(yyvsp[(2) - (2)].lval); (yyval.lval) = -(yyvsp[(2) - (2)].lval);
} }
break; break;
case 122: case 119:
#line 634 "a.y" #line 627 "a.y"
{ {
(yyval.lval) = (yyvsp[(2) - (2)].lval); (yyval.lval) = (yyvsp[(2) - (2)].lval);
} }
break; break;
case 123: case 120:
#line 638 "a.y" #line 631 "a.y"
{ {
(yyval.lval) = ~(yyvsp[(2) - (2)].lval); (yyval.lval) = ~(yyvsp[(2) - (2)].lval);
} }
break; break;
case 124: case 121:
#line 642 "a.y" #line 635 "a.y"
{ {
(yyval.lval) = (yyvsp[(2) - (3)].lval); (yyval.lval) = (yyvsp[(2) - (3)].lval);
} }
break; break;
case 126: case 123:
#line 649 "a.y" #line 642 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
} }
break; break;
case 127: case 124:
#line 653 "a.y" #line 646 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
} }
break; break;
case 128: case 125:
#line 657 "a.y" #line 650 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
} }
break; break;
case 129: case 126:
#line 661 "a.y" #line 654 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
} }
break; break;
case 130: case 127:
#line 665 "a.y" #line 658 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
} }
break; break;
case 131: case 128:
#line 669 "a.y" #line 662 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval); (yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
} }
break; break;
case 132: case 129:
#line 673 "a.y" #line 666 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval); (yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
} }
break; break;
case 133: case 130:
#line 677 "a.y" #line 670 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
} }
break; break;
case 134: case 131:
#line 681 "a.y" #line 674 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
} }
break; break;
case 135: case 132:
#line 685 "a.y" #line 678 "a.y"
{ {
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval); (yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
} }
...@@ -2562,7 +2548,7 @@ yyreduce: ...@@ -2562,7 +2548,7 @@ yyreduce:
/* Line 1267 of yacc.c. */ /* Line 1267 of yacc.c. */
#line 2566 "y.tab.c" #line 2552 "y.tab.c"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
...@@ -68,6 +68,7 @@ struct Sym ...@@ -68,6 +68,7 @@ struct Sym
vlong value; vlong value;
ushort type; ushort type;
char *name; char *name;
char* labelname;
char sym; char sym;
}; };
#define S ((Sym*)0) #define S ((Sym*)0)
...@@ -135,6 +136,8 @@ void newio(void); ...@@ -135,6 +136,8 @@ void newio(void);
void newfile(char*, int); void newfile(char*, int);
Sym* slookup(char*); Sym* slookup(char*);
Sym* lookup(void); Sym* lookup(void);
Sym* labellookup(Sym*);
void settext(LSym*);
void syminit(Sym*); void syminit(Sym*);
int32 yylex(void); int32 yylex(void);
int getc(void); int getc(void);
......
...@@ -67,15 +67,11 @@ prog: ...@@ -67,15 +67,11 @@ prog:
| prog line | prog line
line: line:
LLAB ':' LNAME ':'
{
if($1->value != pc)
yyerror("redeclaration of %s", $1->name);
$1->value = pc;
}
line
| LNAME ':'
{ {
$1 = labellookup($1);
if($1->type == LLAB && $1->value != pc)
yyerror("redeclaration of %s", $1->labelname);
$1->type = LLAB; $1->type = LLAB;
$1->value = pc; $1->value = pc;
} }
...@@ -623,16 +619,19 @@ inst: ...@@ -623,16 +619,19 @@ inst:
*/ */
| LTEXT name ',' imm | LTEXT name ',' imm
{ {
settext($2.sym);
outcode($1, &$2, NREG, &$4); outcode($1, &$2, NREG, &$4);
} }
| LTEXT name ',' con ',' imm | LTEXT name ',' con ',' imm
{ {
settext($2.sym);
$6.offset &= 0xffffffffull; $6.offset &= 0xffffffffull;
$6.offset |= (vlong)ArgsSizeUnknown << 32; $6.offset |= (vlong)ArgsSizeUnknown << 32;
outcode($1, &$2, $4, &$6); outcode($1, &$2, $4, &$6);
} }
| LTEXT name ',' con ',' imm '-' con | LTEXT name ',' con ',' imm '-' con
{ {
settext($2.sym);
$6.offset &= 0xffffffffull; $6.offset &= 0xffffffffull;
$6.offset |= ($8 & 0xffffffffull) << 32; $6.offset |= ($8 & 0xffffffffull) << 32;
outcode($1, &$2, $4, &$6); outcode($1, &$2, $4, &$6);
...@@ -669,15 +668,10 @@ rel: ...@@ -669,15 +668,10 @@ rel:
} }
| LNAME offset | LNAME offset
{ {
$1 = labellookup($1);
$$ = nullgen; $$ = nullgen;
if(pass == 2) if(pass == 2 && $1->type != LLAB)
yyerror("undefined label: %s", $1->name); yyerror("undefined label: %s", $1->labelname);
$$.type = D_BRANCH;
$$.offset = $2;
}
| LLAB offset
{
$$ = nullgen;
$$.type = D_BRANCH; $$.type = D_BRANCH;
$$.offset = $1->value + $2; $$.offset = $1->value + $2;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* A Bison parser, made by GNU Bison 2.5. */ /* A Bison parser, made by GNU Bison 2.3. */
/* Bison interface for Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation; either version 2, or (at your option)
(at your option) any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -26,11 +29,10 @@ ...@@ -26,11 +29,10 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -166,27 +168,21 @@ ...@@ -166,27 +168,21 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{
/* Line 2068 of yacc.c */
#line 38 "a.y" #line 38 "a.y"
{
Sym *sym; Sym *sym;
vlong lval; vlong lval;
double dval; double dval;
char sval[8]; char sval[8];
Addr addr; Addr addr;
}
/* Line 1529 of yacc.c. */
#line 181 "y.tab.h"
/* Line 2068 of yacc.c */ YYSTYPE;
#line 184 "y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE yylval; extern YYSTYPE yylval;
...@@ -220,6 +220,31 @@ slookup(char *s) ...@@ -220,6 +220,31 @@ slookup(char *s)
return lookup(); return lookup();
} }
LSym *thetext;
void
settext(LSym *s)
{
thetext = s;
}
Sym*
labellookup(Sym *s)
{
char *p;
Sym *lab;
if(thetext == nil) {
s->labelname = s->name;
return s;
}
p = smprint("%s.%s", thetext->name, s->name);
lab = slookup(p);
free(p);
lab->labelname = s->name;
return lab;
}
Sym* Sym*
lookup(void) lookup(void)
{ {
......
...@@ -486,11 +486,11 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-21 ...@@ -486,11 +486,11 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-21
MOVL new_hi+16(FP), CX MOVL new_hi+16(FP), CX
LOCK LOCK
CMPXCHG8B 0(BP) CMPXCHG8B 0(BP)
JNZ cas64_fail JNZ fail
MOVL $1, AX MOVL $1, AX
MOVB AX, ret+20(FP) MOVB AX, ret+20(FP)
RET RET
cas64_fail: fail:
MOVL $0, AX MOVL $0, AX
MOVB AX, ret+20(FP) MOVB AX, ret+20(FP)
RET RET
...@@ -1342,29 +1342,29 @@ TEXT strings·IndexByte(SB),NOSPLIT,$0 ...@@ -1342,29 +1342,29 @@ TEXT strings·IndexByte(SB),NOSPLIT,$0
// AX = 1/0/-1 // AX = 1/0/-1
TEXT runtime·cmpbody(SB),NOSPLIT,$0-0 TEXT runtime·cmpbody(SB),NOSPLIT,$0-0
CMPL SI, DI CMPL SI, DI
JEQ cmp_allsame JEQ allsame
CMPL BX, DX CMPL BX, DX
MOVL DX, BP MOVL DX, BP
CMOVLLT BX, BP // BP = min(alen, blen) CMOVLLT BX, BP // BP = min(alen, blen)
CMPL BP, $4 CMPL BP, $4
JB cmp_small JB small
TESTL $0x4000000, runtime·cpuid_edx(SB) // check for sse2 TESTL $0x4000000, runtime·cpuid_edx(SB) // check for sse2
JE cmp_mediumloop JE mediumloop
cmp_largeloop: largeloop:
CMPL BP, $16 CMPL BP, $16
JB cmp_mediumloop JB mediumloop
MOVOU (SI), X0 MOVOU (SI), X0
MOVOU (DI), X1 MOVOU (DI), X1
PCMPEQB X0, X1 PCMPEQB X0, X1
PMOVMSKB X1, AX PMOVMSKB X1, AX
XORL $0xffff, AX // convert EQ to NE XORL $0xffff, AX // convert EQ to NE
JNE cmp_diff16 // branch if at least one byte is not equal JNE diff16 // branch if at least one byte is not equal
ADDL $16, SI ADDL $16, SI
ADDL $16, DI ADDL $16, DI
SUBL $16, BP SUBL $16, BP
JMP cmp_largeloop JMP largeloop
cmp_diff16: diff16:
BSFL AX, BX // index of first byte that differs BSFL AX, BX // index of first byte that differs
XORL AX, AX XORL AX, AX
MOVB (SI)(BX*1), CX MOVB (SI)(BX*1), CX
...@@ -1373,25 +1373,25 @@ cmp_diff16: ...@@ -1373,25 +1373,25 @@ cmp_diff16:
LEAL -1(AX*2), AX // convert 1/0 to +1/-1 LEAL -1(AX*2), AX // convert 1/0 to +1/-1
RET RET
cmp_mediumloop: mediumloop:
CMPL BP, $4 CMPL BP, $4
JBE cmp_0through4 JBE _0through4
MOVL (SI), AX MOVL (SI), AX
MOVL (DI), CX MOVL (DI), CX
CMPL AX, CX CMPL AX, CX
JNE cmp_diff4 JNE diff4
ADDL $4, SI ADDL $4, SI
ADDL $4, DI ADDL $4, DI
SUBL $4, BP SUBL $4, BP
JMP cmp_mediumloop JMP mediumloop
cmp_0through4: _0through4:
MOVL -4(SI)(BP*1), AX MOVL -4(SI)(BP*1), AX
MOVL -4(DI)(BP*1), CX MOVL -4(DI)(BP*1), CX
CMPL AX, CX CMPL AX, CX
JEQ cmp_allsame JEQ allsame
cmp_diff4: diff4:
BSWAPL AX // reverse order of bytes BSWAPL AX // reverse order of bytes
BSWAPL CX BSWAPL CX
XORL AX, CX // find bit differences XORL AX, CX // find bit differences
...@@ -1402,37 +1402,37 @@ cmp_diff4: ...@@ -1402,37 +1402,37 @@ cmp_diff4:
RET RET
// 0-3 bytes in common // 0-3 bytes in common
cmp_small: small:
LEAL (BP*8), CX LEAL (BP*8), CX
NEGL CX NEGL CX
JEQ cmp_allsame JEQ allsame
// load si // load si
CMPB SI, $0xfc CMPB SI, $0xfc
JA cmp_si_high JA si_high
MOVL (SI), SI MOVL (SI), SI
JMP cmp_si_finish JMP si_finish
cmp_si_high: si_high:
MOVL -4(SI)(BP*1), SI MOVL -4(SI)(BP*1), SI
SHRL CX, SI SHRL CX, SI
cmp_si_finish: si_finish:
SHLL CX, SI SHLL CX, SI
// same for di // same for di
CMPB DI, $0xfc CMPB DI, $0xfc
JA cmp_di_high JA di_high
MOVL (DI), DI MOVL (DI), DI
JMP cmp_di_finish JMP di_finish
cmp_di_high: di_high:
MOVL -4(DI)(BP*1), DI MOVL -4(DI)(BP*1), DI
SHRL CX, DI SHRL CX, DI
cmp_di_finish: di_finish:
SHLL CX, DI SHLL CX, DI
BSWAPL SI // reverse order of bytes BSWAPL SI // reverse order of bytes
BSWAPL DI BSWAPL DI
XORL SI, DI // find bit differences XORL SI, DI // find bit differences
JEQ cmp_allsame JEQ allsame
BSRL DI, CX // index of highest bit difference BSRL DI, CX // index of highest bit difference
SHRL CX, SI // move a's bit to bottom SHRL CX, SI // move a's bit to bottom
ANDL $1, SI // mask bit ANDL $1, SI // mask bit
...@@ -1441,7 +1441,7 @@ cmp_di_finish: ...@@ -1441,7 +1441,7 @@ cmp_di_finish:
// all the bytes in common are the same, so we just need // all the bytes in common are the same, so we just need
// to compare the lengths. // to compare the lengths.
cmp_allsame: allsame:
XORL AX, AX XORL AX, AX
XORL CX, CX XORL CX, CX
CMPL BX, DX CMPL BX, DX
......
...@@ -461,11 +461,11 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25 ...@@ -461,11 +461,11 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25
MOVQ new+16(FP), CX MOVQ new+16(FP), CX
LOCK LOCK
CMPXCHGQ CX, 0(BX) CMPXCHGQ CX, 0(BX)
JNZ cas64_fail JNZ fail
MOVL $1, AX MOVL $1, AX
MOVB AX, ret+24(FP) MOVB AX, ret+24(FP)
RET RET
cas64_fail: fail:
MOVL $0, AX MOVL $0, AX
MOVB AX, ret+24(FP) MOVB AX, ret+24(FP)
RET RET
...@@ -876,24 +876,24 @@ TEXT runtime·aeshashbody(SB),NOSPLIT,$0-32 ...@@ -876,24 +876,24 @@ TEXT runtime·aeshashbody(SB),NOSPLIT,$0-32
MOVO runtime·aeskeysched+0(SB), X2 MOVO runtime·aeskeysched+0(SB), X2
MOVO runtime·aeskeysched+16(SB), X3 MOVO runtime·aeskeysched+16(SB), X3
CMPQ CX, $16 CMPQ CX, $16
JB aessmall JB small
aesloop: loop:
CMPQ CX, $16 CMPQ CX, $16
JBE aesloopend JBE loopend
MOVOU (AX), X1 MOVOU (AX), X1
AESENC X2, X0 AESENC X2, X0
AESENC X1, X0 AESENC X1, X0
SUBQ $16, CX SUBQ $16, CX
ADDQ $16, AX ADDQ $16, AX
JMP aesloop JMP loop
// 1-16 bytes remaining // 1-16 bytes remaining
aesloopend: loopend:
// This load may overlap with the previous load above. // This load may overlap with the previous load above.
// We'll hash some bytes twice, but that's ok. // We'll hash some bytes twice, but that's ok.
MOVOU -16(AX)(CX*1), X1 MOVOU -16(AX)(CX*1), X1
JMP partial JMP partial
// 0-15 bytes // 0-15 bytes
aessmall: small:
TESTQ CX, CX TESTQ CX, CX
JE finalize // 0 bytes JE finalize // 0 bytes
...@@ -1036,18 +1036,18 @@ TEXT runtime·eqstring(SB),NOSPLIT,$0-33 ...@@ -1036,18 +1036,18 @@ TEXT runtime·eqstring(SB),NOSPLIT,$0-33
MOVQ s1len+8(FP), AX MOVQ s1len+8(FP), AX
MOVQ s2len+24(FP), BX MOVQ s2len+24(FP), BX
CMPQ AX, BX CMPQ AX, BX
JNE different JNE noteq
MOVQ s1str+0(FP), SI MOVQ s1str+0(FP), SI
MOVQ s2str+16(FP), DI MOVQ s2str+16(FP), DI
CMPQ SI, DI CMPQ SI, DI
JEQ same JEQ eq
CALL runtime·memeqbody(SB) CALL runtime·memeqbody(SB)
MOVB AX, v+32(FP) MOVB AX, v+32(FP)
RET RET
same: eq:
MOVB $1, v+32(FP) MOVB $1, v+32(FP)
RET RET
different: noteq:
MOVB $0, v+32(FP) MOVB $0, v+32(FP)
RET RET
...@@ -1170,29 +1170,29 @@ TEXT runtime·cmpbytes(SB),NOSPLIT,$0-56 ...@@ -1170,29 +1170,29 @@ TEXT runtime·cmpbytes(SB),NOSPLIT,$0-56
// AX = 1/0/-1 // AX = 1/0/-1
TEXT runtime·cmpbody(SB),NOSPLIT,$0-0 TEXT runtime·cmpbody(SB),NOSPLIT,$0-0
CMPQ SI, DI CMPQ SI, DI
JEQ cmp_allsame JEQ allsame
CMPQ BX, DX CMPQ BX, DX
MOVQ DX, BP MOVQ DX, BP
CMOVQLT BX, BP // BP = min(alen, blen) = # of bytes to compare CMOVQLT BX, BP // BP = min(alen, blen) = # of bytes to compare
CMPQ BP, $8 CMPQ BP, $8
JB cmp_small JB small
cmp_loop: loop:
CMPQ BP, $16 CMPQ BP, $16
JBE cmp_0through16 JBE _0through16
MOVOU (SI), X0 MOVOU (SI), X0
MOVOU (DI), X1 MOVOU (DI), X1
PCMPEQB X0, X1 PCMPEQB X0, X1
PMOVMSKB X1, AX PMOVMSKB X1, AX
XORQ $0xffff, AX // convert EQ to NE XORQ $0xffff, AX // convert EQ to NE
JNE cmp_diff16 // branch if at least one byte is not equal JNE diff16 // branch if at least one byte is not equal
ADDQ $16, SI ADDQ $16, SI
ADDQ $16, DI ADDQ $16, DI
SUBQ $16, BP SUBQ $16, BP
JMP cmp_loop JMP loop
// AX = bit mask of differences // AX = bit mask of differences
cmp_diff16: diff16:
BSFQ AX, BX // index of first byte that differs BSFQ AX, BX // index of first byte that differs
XORQ AX, AX XORQ AX, AX
MOVB (SI)(BX*1), CX MOVB (SI)(BX*1), CX
...@@ -1202,21 +1202,21 @@ cmp_diff16: ...@@ -1202,21 +1202,21 @@ cmp_diff16:
RET RET
// 0 through 16 bytes left, alen>=8, blen>=8 // 0 through 16 bytes left, alen>=8, blen>=8
cmp_0through16: _0through16:
CMPQ BP, $8 CMPQ BP, $8
JBE cmp_0through8 JBE _0through8
MOVQ (SI), AX MOVQ (SI), AX
MOVQ (DI), CX MOVQ (DI), CX
CMPQ AX, CX CMPQ AX, CX
JNE cmp_diff8 JNE diff8
cmp_0through8: _0through8:
MOVQ -8(SI)(BP*1), AX MOVQ -8(SI)(BP*1), AX
MOVQ -8(DI)(BP*1), CX MOVQ -8(DI)(BP*1), CX
CMPQ AX, CX CMPQ AX, CX
JEQ cmp_allsame JEQ allsame
// AX and CX contain parts of a and b that differ. // AX and CX contain parts of a and b that differ.
cmp_diff8: diff8:
BSWAPQ AX // reverse order of bytes BSWAPQ AX // reverse order of bytes
BSWAPQ CX BSWAPQ CX
XORQ AX, CX XORQ AX, CX
...@@ -1227,44 +1227,44 @@ cmp_diff8: ...@@ -1227,44 +1227,44 @@ cmp_diff8:
RET RET
// 0-7 bytes in common // 0-7 bytes in common
cmp_small: small:
LEAQ (BP*8), CX // bytes left -> bits left LEAQ (BP*8), CX // bytes left -> bits left
NEGQ CX // - bits lift (== 64 - bits left mod 64) NEGQ CX // - bits lift (== 64 - bits left mod 64)
JEQ cmp_allsame JEQ allsame
// load bytes of a into high bytes of AX // load bytes of a into high bytes of AX
CMPB SI, $0xf8 CMPB SI, $0xf8
JA cmp_si_high JA si_high
MOVQ (SI), SI MOVQ (SI), SI
JMP cmp_si_finish JMP si_finish
cmp_si_high: si_high:
MOVQ -8(SI)(BP*1), SI MOVQ -8(SI)(BP*1), SI
SHRQ CX, SI SHRQ CX, SI
cmp_si_finish: si_finish:
SHLQ CX, SI SHLQ CX, SI
// load bytes of b in to high bytes of BX // load bytes of b in to high bytes of BX
CMPB DI, $0xf8 CMPB DI, $0xf8
JA cmp_di_high JA di_high
MOVQ (DI), DI MOVQ (DI), DI
JMP cmp_di_finish JMP di_finish
cmp_di_high: di_high:
MOVQ -8(DI)(BP*1), DI MOVQ -8(DI)(BP*1), DI
SHRQ CX, DI SHRQ CX, DI
cmp_di_finish: di_finish:
SHLQ CX, DI SHLQ CX, DI
BSWAPQ SI // reverse order of bytes BSWAPQ SI // reverse order of bytes
BSWAPQ DI BSWAPQ DI
XORQ SI, DI // find bit differences XORQ SI, DI // find bit differences
JEQ cmp_allsame JEQ allsame
BSRQ DI, CX // index of highest bit difference BSRQ DI, CX // index of highest bit difference
SHRQ CX, SI // move a's bit to bottom SHRQ CX, SI // move a's bit to bottom
ANDQ $1, SI // mask bit ANDQ $1, SI // mask bit
LEAQ -1(SI*2), AX // 1/0 => +1/-1 LEAQ -1(SI*2), AX // 1/0 => +1/-1
RET RET
cmp_allsame: allsame:
XORQ AX, AX XORQ AX, AX
XORQ CX, CX XORQ CX, CX
CMPQ BX, DX CMPQ BX, DX
...@@ -1299,7 +1299,7 @@ TEXT runtime·indexbytebody(SB),NOSPLIT,$0 ...@@ -1299,7 +1299,7 @@ TEXT runtime·indexbytebody(SB),NOSPLIT,$0
MOVQ SI, DI MOVQ SI, DI
CMPQ BX, $16 CMPQ BX, $16
JLT indexbyte_small JLT small
// round up to first 16-byte boundary // round up to first 16-byte boundary
TESTQ $15, SI TESTQ $15, SI
...@@ -1357,7 +1357,7 @@ failure: ...@@ -1357,7 +1357,7 @@ failure:
RET RET
// handle for lengths < 16 // handle for lengths < 16
indexbyte_small: small:
MOVQ BX, CX MOVQ BX, CX
REPN; SCASB REPN; SCASB
JZ success JZ success
......
...@@ -444,11 +444,11 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25 ...@@ -444,11 +444,11 @@ TEXT runtime·cas64(SB), NOSPLIT, $0-25
MOVQ new+16(FP), CX MOVQ new+16(FP), CX
LOCK LOCK
CMPXCHGQ CX, 0(BX) CMPXCHGQ CX, 0(BX)
JNZ cas64_fail JNZ fail
MOVL $1, AX MOVL $1, AX
MOVB AX, ret+24(FP) MOVB AX, ret+24(FP)
RET RET
cas64_fail: fail:
MOVL $0, AX MOVL $0, AX
MOVB AX, ret+24(FP) MOVB AX, ret+24(FP)
RET RET
...@@ -834,29 +834,29 @@ TEXT runtime·cmpbytes(SB),NOSPLIT,$0-28 ...@@ -834,29 +834,29 @@ TEXT runtime·cmpbytes(SB),NOSPLIT,$0-28
// AX = 1/0/-1 // AX = 1/0/-1
TEXT runtime·cmpbody(SB),NOSPLIT,$0-0 TEXT runtime·cmpbody(SB),NOSPLIT,$0-0
CMPQ SI, DI CMPQ SI, DI
JEQ cmp_allsame JEQ allsame
CMPQ BX, DX CMPQ BX, DX
MOVQ DX, R8 MOVQ DX, R8
CMOVQLT BX, R8 // R8 = min(alen, blen) = # of bytes to compare CMOVQLT BX, R8 // R8 = min(alen, blen) = # of bytes to compare
CMPQ R8, $8 CMPQ R8, $8
JB cmp_small JB small
cmp_loop: loop:
CMPQ R8, $16 CMPQ R8, $16
JBE cmp_0through16 JBE _0through16
MOVOU (SI), X0 MOVOU (SI), X0
MOVOU (DI), X1 MOVOU (DI), X1
PCMPEQB X0, X1 PCMPEQB X0, X1
PMOVMSKB X1, AX PMOVMSKB X1, AX
XORQ $0xffff, AX // convert EQ to NE XORQ $0xffff, AX // convert EQ to NE
JNE cmp_diff16 // branch if at least one byte is not equal JNE diff16 // branch if at least one byte is not equal
ADDQ $16, SI ADDQ $16, SI
ADDQ $16, DI ADDQ $16, DI
SUBQ $16, R8 SUBQ $16, R8
JMP cmp_loop JMP loop
// AX = bit mask of differences // AX = bit mask of differences
cmp_diff16: diff16:
BSFQ AX, BX // index of first byte that differs BSFQ AX, BX // index of first byte that differs
XORQ AX, AX XORQ AX, AX
ADDQ BX, SI ADDQ BX, SI
...@@ -868,23 +868,23 @@ cmp_diff16: ...@@ -868,23 +868,23 @@ cmp_diff16:
RET RET
// 0 through 16 bytes left, alen>=8, blen>=8 // 0 through 16 bytes left, alen>=8, blen>=8
cmp_0through16: _0through16:
CMPQ R8, $8 CMPQ R8, $8
JBE cmp_0through8 JBE _0through8
MOVQ (SI), AX MOVQ (SI), AX
MOVQ (DI), CX MOVQ (DI), CX
CMPQ AX, CX CMPQ AX, CX
JNE cmp_diff8 JNE diff8
cmp_0through8: _0through8:
ADDQ R8, SI ADDQ R8, SI
ADDQ R8, DI ADDQ R8, DI
MOVQ -8(SI), AX MOVQ -8(SI), AX
MOVQ -8(DI), CX MOVQ -8(DI), CX
CMPQ AX, CX CMPQ AX, CX
JEQ cmp_allsame JEQ allsame
// AX and CX contain parts of a and b that differ. // AX and CX contain parts of a and b that differ.
cmp_diff8: diff8:
BSWAPQ AX // reverse order of bytes BSWAPQ AX // reverse order of bytes
BSWAPQ CX BSWAPQ CX
XORQ AX, CX XORQ AX, CX
...@@ -895,46 +895,46 @@ cmp_diff8: ...@@ -895,46 +895,46 @@ cmp_diff8:
RET RET
// 0-7 bytes in common // 0-7 bytes in common
cmp_small: small:
LEAQ (R8*8), CX // bytes left -> bits left LEAQ (R8*8), CX // bytes left -> bits left
NEGQ CX // - bits lift (== 64 - bits left mod 64) NEGQ CX // - bits lift (== 64 - bits left mod 64)
JEQ cmp_allsame JEQ allsame
// load bytes of a into high bytes of AX // load bytes of a into high bytes of AX
CMPB SI, $0xf8 CMPB SI, $0xf8
JA cmp_si_high JA si_high
MOVQ (SI), SI MOVQ (SI), SI
JMP cmp_si_finish JMP si_finish
cmp_si_high: si_high:
ADDQ R8, SI ADDQ R8, SI
MOVQ -8(SI), SI MOVQ -8(SI), SI
SHRQ CX, SI SHRQ CX, SI
cmp_si_finish: si_finish:
SHLQ CX, SI SHLQ CX, SI
// load bytes of b in to high bytes of BX // load bytes of b in to high bytes of BX
CMPB DI, $0xf8 CMPB DI, $0xf8
JA cmp_di_high JA di_high
MOVQ (DI), DI MOVQ (DI), DI
JMP cmp_di_finish JMP di_finish
cmp_di_high: di_high:
ADDQ R8, DI ADDQ R8, DI
MOVQ -8(DI), DI MOVQ -8(DI), DI
SHRQ CX, DI SHRQ CX, DI
cmp_di_finish: di_finish:
SHLQ CX, DI SHLQ CX, DI
BSWAPQ SI // reverse order of bytes BSWAPQ SI // reverse order of bytes
BSWAPQ DI BSWAPQ DI
XORQ SI, DI // find bit differences XORQ SI, DI // find bit differences
JEQ cmp_allsame JEQ allsame
BSRQ DI, CX // index of highest bit difference BSRQ DI, CX // index of highest bit difference
SHRQ CX, SI // move a's bit to bottom SHRQ CX, SI // move a's bit to bottom
ANDQ $1, SI // mask bit ANDQ $1, SI // mask bit
LEAQ -1(SI*2), AX // 1/0 => +1/-1 LEAQ -1(SI*2), AX // 1/0 => +1/-1
RET RET
cmp_allsame: allsame:
XORQ AX, AX XORQ AX, AX
XORQ CX, CX XORQ CX, CX
CMPQ BX, DX CMPQ BX, DX
...@@ -969,7 +969,7 @@ TEXT runtime·indexbytebody(SB),NOSPLIT,$0 ...@@ -969,7 +969,7 @@ TEXT runtime·indexbytebody(SB),NOSPLIT,$0
MOVL SI, DI MOVL SI, DI
CMPL BX, $16 CMPL BX, $16
JLT indexbyte_small JLT small
// round up to first 16-byte boundary // round up to first 16-byte boundary
TESTL $15, SI TESTL $15, SI
...@@ -1027,7 +1027,7 @@ failure: ...@@ -1027,7 +1027,7 @@ failure:
RET RET
// handle for lengths < 16 // handle for lengths < 16
indexbyte_small: small:
MOVL BX, CX MOVL BX, CX
REPN; SCASB REPN; SCASB
JZ success JZ success
......
...@@ -492,7 +492,7 @@ TEXT asmcgocall<>(SB),NOSPLIT,$0-0 ...@@ -492,7 +492,7 @@ TEXT asmcgocall<>(SB),NOSPLIT,$0-0
MOVW g_m(g), R8 MOVW g_m(g), R8
MOVW m_g0(R8), R3 MOVW m_g0(R8), R3
CMP R3, g CMP R3, g
BEQ asmcgocall_g0 BEQ g0
BL gosave<>(SB) BL gosave<>(SB)
MOVW R0, R5 MOVW R0, R5
MOVW R3, R0 MOVW R3, R0
...@@ -501,7 +501,7 @@ TEXT asmcgocall<>(SB),NOSPLIT,$0-0 ...@@ -501,7 +501,7 @@ TEXT asmcgocall<>(SB),NOSPLIT,$0-0
MOVW (g_sched+gobuf_sp)(g), R13 MOVW (g_sched+gobuf_sp)(g), R13
// Now on a scheduling stack (a pthread-created stack). // Now on a scheduling stack (a pthread-created stack).
asmcgocall_g0: g0:
SUB $24, R13 SUB $24, R13
BIC $0x7, R13 // alignment for gcc ABI BIC $0x7, R13 // alignment for gcc ABI
MOVW R4, 20(R13) // save old g MOVW R4, 20(R13) // save old g
...@@ -736,13 +736,13 @@ TEXT runtime·memeq(SB),NOSPLIT,$-4-13 ...@@ -736,13 +736,13 @@ TEXT runtime·memeq(SB),NOSPLIT,$-4-13
ADD R1, R3, R6 ADD R1, R3, R6
MOVW $1, R0 MOVW $1, R0
MOVB R0, ret+12(FP) MOVB R0, ret+12(FP)
_next2: loop:
CMP R1, R6 CMP R1, R6
RET.EQ RET.EQ
MOVBU.P 1(R1), R4 MOVBU.P 1(R1), R4
MOVBU.P 1(R2), R5 MOVBU.P 1(R2), R5
CMP R4, R5 CMP R4, R5
BEQ _next2 BEQ loop
MOVW $0, R0 MOVW $0, R0
MOVB R0, ret+12(FP) MOVB R0, ret+12(FP)
...@@ -765,13 +765,13 @@ TEXT runtime·eqstring(SB),NOSPLIT,$-4-17 ...@@ -765,13 +765,13 @@ TEXT runtime·eqstring(SB),NOSPLIT,$-4-17
CMP R2, R3 CMP R2, R3
RET.EQ RET.EQ
ADD R2, R0, R6 ADD R2, R0, R6
_eqnext: loop:
CMP R2, R6 CMP R2, R6
RET.EQ RET.EQ
MOVBU.P 1(R2), R4 MOVBU.P 1(R2), R4
MOVBU.P 1(R3), R5 MOVBU.P 1(R3), R5
CMP R4, R5 CMP R4, R5
BEQ _eqnext BEQ loop
MOVB R7, v+16(FP) MOVB R7, v+16(FP)
RET RET
...@@ -786,26 +786,26 @@ TEXT bytes·Equal(SB),NOSPLIT,$0 ...@@ -786,26 +786,26 @@ TEXT bytes·Equal(SB),NOSPLIT,$0
MOVW b_len+16(FP), R3 MOVW b_len+16(FP), R3
CMP R1, R3 // unequal lengths are not equal CMP R1, R3 // unequal lengths are not equal
B.NE _notequal B.NE notequal
MOVW a+0(FP), R0 MOVW a+0(FP), R0
MOVW b+12(FP), R2 MOVW b+12(FP), R2
ADD R0, R1 // end ADD R0, R1 // end
_byteseq_next: loop:
CMP R0, R1 CMP R0, R1
B.EQ _equal // reached the end B.EQ equal // reached the end
MOVBU.P 1(R0), R4 MOVBU.P 1(R0), R4
MOVBU.P 1(R2), R5 MOVBU.P 1(R2), R5
CMP R4, R5 CMP R4, R5
B.EQ _byteseq_next B.EQ loop
_notequal: notequal:
MOVW $0, R0 MOVW $0, R0
MOVBU R0, ret+24(FP) MOVBU R0, ret+24(FP)
RET RET
_equal: equal:
MOVW $1, R0 MOVW $1, R0
MOVBU R0, ret+24(FP) MOVBU R0, ret+24(FP)
RET RET
......
...@@ -699,7 +699,7 @@ TEXT runtime·memeq(SB),NOSPLIT,$-8-25 ...@@ -699,7 +699,7 @@ TEXT runtime·memeq(SB),NOSPLIT,$-8-25
SUB $1, R3 SUB $1, R3
SUB $1, R4 SUB $1, R4
ADD R3, R5, R8 ADD R3, R5, R8
_next: loop:
CMP R3, R8 CMP R3, R8
BNE 4(PC) BNE 4(PC)
MOVD $1, R3 MOVD $1, R3
...@@ -708,7 +708,7 @@ _next: ...@@ -708,7 +708,7 @@ _next:
MOVBZU 1(R3), R6 MOVBZU 1(R3), R6
MOVBZU 1(R4), R7 MOVBZU 1(R4), R7
CMP R6, R7 CMP R6, R7
BEQ _next BEQ loop
MOVB R0, ret+24(FP) MOVB R0, ret+24(FP)
RETURN RETURN
...@@ -720,14 +720,14 @@ TEXT runtime·eqstring(SB),NOSPLIT,$0-33 ...@@ -720,14 +720,14 @@ TEXT runtime·eqstring(SB),NOSPLIT,$0-33
MOVD s1len+8(FP), R4 MOVD s1len+8(FP), R4
MOVD s2len+24(FP), R5 MOVD s2len+24(FP), R5
CMP R4, R5 CMP R4, R5
BNE str_noteq BNE noteq
MOVD s1str+0(FP), R3 MOVD s1str+0(FP), R3
MOVD s2str+16(FP), R4 MOVD s2str+16(FP), R4
SUB $1, R3 SUB $1, R3
SUB $1, R4 SUB $1, R4
ADD R3, R5, R8 ADD R3, R5, R8
eq_next: loop:
CMP R3, R8 CMP R3, R8
BNE 4(PC) BNE 4(PC)
MOVD $1, R3 MOVD $1, R3
...@@ -736,8 +736,8 @@ eq_next: ...@@ -736,8 +736,8 @@ eq_next:
MOVBZU 1(R3), R6 MOVBZU 1(R3), R6
MOVBZU 1(R4), R7 MOVBZU 1(R4), R7
CMP R6, R7 CMP R6, R7
BEQ eq_next BEQ loop
str_noteq: noteq:
MOVB R0, ret+32(FP) MOVB R0, ret+32(FP)
RETURN RETURN
...@@ -747,7 +747,7 @@ TEXT bytes·Equal(SB),NOSPLIT,$0-49 ...@@ -747,7 +747,7 @@ TEXT bytes·Equal(SB),NOSPLIT,$0-49
MOVD b_len+32(FP), R4 MOVD b_len+32(FP), R4
CMP R3, R4 // unequal lengths are not equal CMP R3, R4 // unequal lengths are not equal
BNE _notequal BNE noteq
MOVD a+0(FP), R5 MOVD a+0(FP), R5
MOVD b+24(FP), R6 MOVD b+24(FP), R6
...@@ -755,19 +755,19 @@ TEXT bytes·Equal(SB),NOSPLIT,$0-49 ...@@ -755,19 +755,19 @@ TEXT bytes·Equal(SB),NOSPLIT,$0-49
SUB $1, R6 SUB $1, R6
ADD R5, R3 // end-1 ADD R5, R3 // end-1
_byteseq_next: loop:
CMP R5, R3 CMP R5, R3
BEQ _equal // reached the end BEQ equal // reached the end
MOVBZU 1(R5), R4 MOVBZU 1(R5), R4
MOVBZU 1(R6), R7 MOVBZU 1(R6), R7
CMP R4, R7 CMP R4, R7
BEQ _byteseq_next BEQ loop
_notequal: noteq:
MOVBZ R0, ret+48(FP) MOVBZ R0, ret+48(FP)
RETURN RETURN
_equal: equal:
MOVD $1, R3 MOVD $1, R3
MOVBZ R3, ret+48(FP) MOVBZ R3, ret+48(FP)
RETURN RETURN
...@@ -780,18 +780,18 @@ TEXT bytes·IndexByte(SB),NOSPLIT,$0-40 ...@@ -780,18 +780,18 @@ TEXT bytes·IndexByte(SB),NOSPLIT,$0-40
SUB $1, R3 SUB $1, R3
ADD R3, R4 // end-1 ADD R3, R4 // end-1
_index_loop: loop:
CMP R3, R4 CMP R3, R4
BEQ _index_notfound BEQ notfound
MOVBZU 1(R3), R7 MOVBZU 1(R3), R7
CMP R7, R5 CMP R7, R5
BNE _index_loop BNE loop
SUB R6, R3 // remove base SUB R6, R3 // remove base
MOVD R3, ret+32(FP) MOVD R3, ret+32(FP)
RETURN RETURN
_index_notfound: notfound:
MOVD $-1, R3 MOVD $-1, R3
MOVD R3, ret+32(FP) MOVD R3, ret+32(FP)
RETURN RETURN
...@@ -804,18 +804,18 @@ TEXT strings·IndexByte(SB),NOSPLIT,$0 ...@@ -804,18 +804,18 @@ TEXT strings·IndexByte(SB),NOSPLIT,$0
SUB $1, R3 SUB $1, R3
ADD R3, R4 // end-1 ADD R3, R4 // end-1
_index2_loop: loop:
CMP R3, R4 CMP R3, R4
BEQ _index2_notfound BEQ notfound
MOVBZU 1(R3), R7 MOVBZU 1(R3), R7
CMP R7, R5 CMP R7, R5
BNE _index2_loop BNE loop
SUB R6, R3 // remove base SUB R6, R3 // remove base
MOVD R3, ret+24(FP) MOVD R3, ret+24(FP)
RETURN RETURN
_index2_notfound: notfound:
MOVD $-1, R3 MOVD $-1, R3
MOVD R3, ret+24(FP) MOVD R3, ret+24(FP)
RETURN RETURN
......
...@@ -15,31 +15,31 @@ TEXT runtime·memclr(SB), NOSPLIT, $0-8 ...@@ -15,31 +15,31 @@ TEXT runtime·memclr(SB), NOSPLIT, $0-8
XORL AX, AX XORL AX, AX
// MOVOU seems always faster than REP STOSL. // MOVOU seems always faster than REP STOSL.
clr_tail: tail:
TESTL BX, BX TESTL BX, BX
JEQ clr_0 JEQ _0
CMPL BX, $2 CMPL BX, $2
JBE clr_1or2 JBE _1or2
CMPL BX, $4 CMPL BX, $4
JBE clr_3or4 JBE _3or4
CMPL BX, $8 CMPL BX, $8
JBE clr_5through8 JBE _5through8
CMPL BX, $16 CMPL BX, $16
JBE clr_9through16 JBE _9through16
TESTL $0x4000000, runtime·cpuid_edx(SB) // check for sse2 TESTL $0x4000000, runtime·cpuid_edx(SB) // check for sse2
JEQ nosse2 JEQ nosse2
PXOR X0, X0 PXOR X0, X0
CMPL BX, $32 CMPL BX, $32
JBE clr_17through32 JBE _17through32
CMPL BX, $64 CMPL BX, $64
JBE clr_33through64 JBE _33through64
CMPL BX, $128 CMPL BX, $128
JBE clr_65through128 JBE _65through128
CMPL BX, $256 CMPL BX, $256
JBE clr_129through256 JBE _129through256
// TODO: use branch table and BSR to make this just a single dispatch // TODO: use branch table and BSR to make this just a single dispatch
clr_loop: loop:
MOVOU X0, 0(DI) MOVOU X0, 0(DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, 32(DI) MOVOU X0, 32(DI)
...@@ -59,40 +59,40 @@ clr_loop: ...@@ -59,40 +59,40 @@ clr_loop:
SUBL $256, BX SUBL $256, BX
ADDL $256, DI ADDL $256, DI
CMPL BX, $256 CMPL BX, $256
JAE clr_loop JAE loop
JMP clr_tail JMP tail
clr_1or2: _1or2:
MOVB AX, (DI) MOVB AX, (DI)
MOVB AX, -1(DI)(BX*1) MOVB AX, -1(DI)(BX*1)
RET RET
clr_0: _0:
RET RET
clr_3or4: _3or4:
MOVW AX, (DI) MOVW AX, (DI)
MOVW AX, -2(DI)(BX*1) MOVW AX, -2(DI)(BX*1)
RET RET
clr_5through8: _5through8:
MOVL AX, (DI) MOVL AX, (DI)
MOVL AX, -4(DI)(BX*1) MOVL AX, -4(DI)(BX*1)
RET RET
clr_9through16: _9through16:
MOVL AX, (DI) MOVL AX, (DI)
MOVL AX, 4(DI) MOVL AX, 4(DI)
MOVL AX, -8(DI)(BX*1) MOVL AX, -8(DI)(BX*1)
MOVL AX, -4(DI)(BX*1) MOVL AX, -4(DI)(BX*1)
RET RET
clr_17through32: _17through32:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, -16(DI)(BX*1) MOVOU X0, -16(DI)(BX*1)
RET RET
clr_33through64: _33through64:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, -32(DI)(BX*1) MOVOU X0, -32(DI)(BX*1)
MOVOU X0, -16(DI)(BX*1) MOVOU X0, -16(DI)(BX*1)
RET RET
clr_65through128: _65through128:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, 32(DI) MOVOU X0, 32(DI)
...@@ -102,7 +102,7 @@ clr_65through128: ...@@ -102,7 +102,7 @@ clr_65through128:
MOVOU X0, -32(DI)(BX*1) MOVOU X0, -32(DI)(BX*1)
MOVOU X0, -16(DI)(BX*1) MOVOU X0, -16(DI)(BX*1)
RET RET
clr_129through256: _129through256:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, 32(DI) MOVOU X0, 32(DI)
...@@ -126,5 +126,5 @@ nosse2: ...@@ -126,5 +126,5 @@ nosse2:
REP REP
STOSL STOSL
ANDL $3, BX ANDL $3, BX
JNE clr_tail JNE tail
RET RET
...@@ -15,30 +15,30 @@ TEXT runtime·memclr(SB), NOSPLIT, $0-16 ...@@ -15,30 +15,30 @@ TEXT runtime·memclr(SB), NOSPLIT, $0-16
XORQ AX, AX XORQ AX, AX
// MOVOU seems always faster than REP STOSQ. // MOVOU seems always faster than REP STOSQ.
clr_tail: tail:
TESTQ BX, BX TESTQ BX, BX
JEQ clr_0 JEQ _0
CMPQ BX, $2 CMPQ BX, $2
JBE clr_1or2 JBE _1or2
CMPQ BX, $4 CMPQ BX, $4
JBE clr_3or4 JBE _3or4
CMPQ BX, $8 CMPQ BX, $8
JBE clr_5through8 JBE _5through8
CMPQ BX, $16 CMPQ BX, $16
JBE clr_9through16 JBE _9through16
PXOR X0, X0 PXOR X0, X0
CMPQ BX, $32 CMPQ BX, $32
JBE clr_17through32 JBE _17through32
CMPQ BX, $64 CMPQ BX, $64
JBE clr_33through64 JBE _33through64
CMPQ BX, $128 CMPQ BX, $128
JBE clr_65through128 JBE _65through128
CMPQ BX, $256 CMPQ BX, $256
JBE clr_129through256 JBE _129through256
// TODO: use branch table and BSR to make this just a single dispatch // TODO: use branch table and BSR to make this just a single dispatch
// TODO: for really big clears, use MOVNTDQ. // TODO: for really big clears, use MOVNTDQ.
clr_loop: loop:
MOVOU X0, 0(DI) MOVOU X0, 0(DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, 32(DI) MOVOU X0, 32(DI)
...@@ -58,38 +58,38 @@ clr_loop: ...@@ -58,38 +58,38 @@ clr_loop:
SUBQ $256, BX SUBQ $256, BX
ADDQ $256, DI ADDQ $256, DI
CMPQ BX, $256 CMPQ BX, $256
JAE clr_loop JAE loop
JMP clr_tail JMP tail
clr_1or2: _1or2:
MOVB AX, (DI) MOVB AX, (DI)
MOVB AX, -1(DI)(BX*1) MOVB AX, -1(DI)(BX*1)
RET RET
clr_0: _0:
RET RET
clr_3or4: _3or4:
MOVW AX, (DI) MOVW AX, (DI)
MOVW AX, -2(DI)(BX*1) MOVW AX, -2(DI)(BX*1)
RET RET
clr_5through8: _5through8:
MOVL AX, (DI) MOVL AX, (DI)
MOVL AX, -4(DI)(BX*1) MOVL AX, -4(DI)(BX*1)
RET RET
clr_9through16: _9through16:
MOVQ AX, (DI) MOVQ AX, (DI)
MOVQ AX, -8(DI)(BX*1) MOVQ AX, -8(DI)(BX*1)
RET RET
clr_17through32: _17through32:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, -16(DI)(BX*1) MOVOU X0, -16(DI)(BX*1)
RET RET
clr_33through64: _33through64:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, -32(DI)(BX*1) MOVOU X0, -32(DI)(BX*1)
MOVOU X0, -16(DI)(BX*1) MOVOU X0, -16(DI)(BX*1)
RET RET
clr_65through128: _65through128:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, 32(DI) MOVOU X0, 32(DI)
...@@ -99,7 +99,7 @@ clr_65through128: ...@@ -99,7 +99,7 @@ clr_65through128:
MOVOU X0, -32(DI)(BX*1) MOVOU X0, -32(DI)(BX*1)
MOVOU X0, -16(DI)(BX*1) MOVOU X0, -16(DI)(BX*1)
RET RET
clr_129through256: _129through256:
MOVOU X0, (DI) MOVOU X0, (DI)
MOVOU X0, 16(DI) MOVOU X0, 16(DI)
MOVOU X0, 32(DI) MOVOU X0, 32(DI)
......
...@@ -10,40 +10,40 @@ TEXT runtime·memclr(SB), NOSPLIT, $0-8 ...@@ -10,40 +10,40 @@ TEXT runtime·memclr(SB), NOSPLIT, $0-8
MOVL n+4(FP), BX MOVL n+4(FP), BX
XORL AX, AX XORL AX, AX
clr_tail: tail:
TESTL BX, BX TESTL BX, BX
JEQ clr_0 JEQ _0
CMPL BX, $2 CMPL BX, $2
JBE clr_1or2 JBE _1or2
CMPL BX, $4 CMPL BX, $4
JBE clr_3or4 JBE _3or4
CMPL BX, $8 CMPL BX, $8
JBE clr_5through8 JBE _5through8
CMPL BX, $16 CMPL BX, $16
JBE clr_9through16 JBE _9through16
MOVL BX, CX MOVL BX, CX
SHRL $2, CX SHRL $2, CX
REP REP
STOSL STOSL
ANDL $3, BX ANDL $3, BX
JNE clr_tail JNE tail
RET RET
clr_1or2: _1or2:
MOVB AX, (DI) MOVB AX, (DI)
MOVB AX, -1(DI)(BX*1) MOVB AX, -1(DI)(BX*1)
RET RET
clr_0: _0:
RET RET
clr_3or4: _3or4:
MOVW AX, (DI) MOVW AX, (DI)
MOVW AX, -2(DI)(BX*1) MOVW AX, -2(DI)(BX*1)
RET RET
clr_5through8: _5through8:
MOVL AX, (DI) MOVL AX, (DI)
MOVL AX, -4(DI)(BX*1) MOVL AX, -4(DI)(BX*1)
RET RET
clr_9through16: _9through16:
MOVL AX, (DI) MOVL AX, (DI)
MOVL AX, 4(DI) MOVL AX, 4(DI)
MOVL AX, -8(DI)(BX*1) MOVL AX, -8(DI)(BX*1)
......
...@@ -140,20 +140,20 @@ TEXT racecalladdr<>(SB), NOSPLIT, $0-0 ...@@ -140,20 +140,20 @@ TEXT racecalladdr<>(SB), NOSPLIT, $0-0
MOVQ g_racectx(R14), RARG0 // goroutine context MOVQ g_racectx(R14), RARG0 // goroutine context
// Check that addr is within [arenastart, arenaend) or within [noptrdata, enoptrbss). // Check that addr is within [arenastart, arenaend) or within [noptrdata, enoptrbss).
CMPQ RARG1, runtime·racearenastart(SB) CMPQ RARG1, runtime·racearenastart(SB)
JB racecalladdr_data JB data
CMPQ RARG1, runtime·racearenaend(SB) CMPQ RARG1, runtime·racearenaend(SB)
JB racecalladdr_call JB call
racecalladdr_data: data:
MOVQ $runtime·noptrdata(SB), R13 MOVQ $runtime·noptrdata(SB), R13
CMPQ RARG1, R13 CMPQ RARG1, R13
JB racecalladdr_ret JB ret
MOVQ $runtime·enoptrbss(SB), R13 MOVQ $runtime·enoptrbss(SB), R13
CMPQ RARG1, R13 CMPQ RARG1, R13
JAE racecalladdr_ret JAE ret
racecalladdr_call: call:
MOVQ AX, AX // w/o this 6a miscompiles this function MOVQ AX, AX // w/o this 6a miscompiles this function
JMP racecall<>(SB) JMP racecall<>(SB)
racecalladdr_ret: ret:
RET RET
// func runtime·racefuncenter(pc uintptr) // func runtime·racefuncenter(pc uintptr)
...@@ -335,9 +335,9 @@ TEXT racecall<>(SB), NOSPLIT, $0-0 ...@@ -335,9 +335,9 @@ TEXT racecall<>(SB), NOSPLIT, $0-0
MOVQ SP, R12 // callee-saved, preserved across the CALL MOVQ SP, R12 // callee-saved, preserved across the CALL
MOVQ m_g0(R13), R10 MOVQ m_g0(R13), R10
CMPQ R10, R14 CMPQ R10, R14
JE racecall_cont // already on g0 JE call // already on g0
MOVQ (g_sched+gobuf_sp)(R10), SP MOVQ (g_sched+gobuf_sp)(R10), SP
racecall_cont: call:
ANDQ $~15, SP // alignment for gcc ABI ANDQ $~15, SP // alignment for gcc ABI
CALL AX CALL AX
MOVQ R12, SP MOVQ R12, SP
......
...@@ -248,7 +248,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$40 ...@@ -248,7 +248,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$40
MOVL BX, 0(SP) MOVL BX, 0(SP)
MOVL $runtime·badsignal(SB), AX MOVL $runtime·badsignal(SB), AX
CALL AX CALL AX
JMP sigtramp_ret JMP ret
// save g // save g
MOVL DI, 20(SP) MOVL DI, 20(SP)
...@@ -275,7 +275,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$40 ...@@ -275,7 +275,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$40
MOVL 20(SP), DI MOVL 20(SP), DI
MOVL DI, g(CX) MOVL DI, g(CX)
sigtramp_ret: ret:
// call sigreturn // call sigreturn
MOVL context+16(FP), CX MOVL context+16(FP), CX
MOVL style+4(FP), BX MOVL style+4(FP), BX
......
...@@ -211,7 +211,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$64 ...@@ -211,7 +211,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$64
MOVL DX, 0(SP) MOVL DX, 0(SP)
MOVQ $runtime·badsignal(SB), AX MOVQ $runtime·badsignal(SB), AX
CALL AX CALL AX
JMP sigtramp_ret JMP ret
// save g // save g
MOVQ R10, 48(SP) MOVQ R10, 48(SP)
...@@ -233,7 +233,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$64 ...@@ -233,7 +233,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$64
MOVQ 48(SP), R10 MOVQ 48(SP), R10
MOVQ R10, g(BX) MOVQ R10, g(BX)
sigtramp_ret: ret:
// call sigreturn // call sigreturn
MOVL $(0x2000000+184), AX // sigreturn(ucontext, infostyle) MOVL $(0x2000000+184), AX // sigreturn(ucontext, infostyle)
MOVQ 32(SP), DI // saved ucontext MOVQ 32(SP), DI // saved ucontext
......
...@@ -217,7 +217,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44 ...@@ -217,7 +217,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL BX, 0(SP) MOVL BX, 0(SP)
MOVL $runtime·badsignal(SB), AX MOVL $runtime·badsignal(SB), AX
CALL AX CALL AX
JMP sigtramp_ret JMP ret
// save g // save g
MOVL DI, 20(SP) MOVL DI, 20(SP)
...@@ -243,7 +243,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44 ...@@ -243,7 +243,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL 20(SP), BX MOVL 20(SP), BX
MOVL BX, g(CX) MOVL BX, g(CX)
sigtramp_ret: ret:
// call sigreturn // call sigreturn
MOVL context+8(FP), AX MOVL context+8(FP), AX
MOVL $0, 0(SP) // syscall gap MOVL $0, 0(SP) // syscall gap
......
...@@ -197,7 +197,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44 ...@@ -197,7 +197,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL BX, 0(SP) MOVL BX, 0(SP)
MOVL $runtime·badsignal(SB), AX MOVL $runtime·badsignal(SB), AX
CALL AX CALL AX
JMP sigtramp_ret JMP ret
// save g // save g
MOVL DI, 20(SP) MOVL DI, 20(SP)
...@@ -223,7 +223,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44 ...@@ -223,7 +223,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL 20(SP), BX MOVL 20(SP), BX
MOVL BX, g(CX) MOVL BX, g(CX)
sigtramp_ret: ret:
// call sigreturn // call sigreturn
MOVL context+8(FP), AX MOVL context+8(FP), AX
MOVL $0, 0(SP) // syscall gap MOVL $0, 0(SP) // syscall gap
......
...@@ -115,7 +115,7 @@ TEXT time·now(SB),NOSPLIT,$16 ...@@ -115,7 +115,7 @@ TEXT time·now(SB),NOSPLIT,$16
// That leaves 104 for the gettime code to use. Hope that's enough! // That leaves 104 for the gettime code to use. Hope that's enough!
MOVQ runtime·__vdso_clock_gettime_sym(SB), AX MOVQ runtime·__vdso_clock_gettime_sym(SB), AX
CMPQ AX, $0 CMPQ AX, $0
JEQ fallback_gtod JEQ fallback
MOVL $0, DI // CLOCK_REALTIME MOVL $0, DI // CLOCK_REALTIME
LEAQ 0(SP), SI LEAQ 0(SP), SI
CALL AX CALL AX
...@@ -124,7 +124,7 @@ TEXT time·now(SB),NOSPLIT,$16 ...@@ -124,7 +124,7 @@ TEXT time·now(SB),NOSPLIT,$16
MOVQ AX, sec+0(FP) MOVQ AX, sec+0(FP)
MOVL DX, nsec+8(FP) MOVL DX, nsec+8(FP)
RET RET
fallback_gtod: fallback:
LEAQ 0(SP), DI LEAQ 0(SP), DI
MOVQ $0, SI MOVQ $0, SI
MOVQ runtime·__vdso_gettimeofday_sym(SB), AX MOVQ runtime·__vdso_gettimeofday_sym(SB), AX
...@@ -141,7 +141,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$16 ...@@ -141,7 +141,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$16
// See comment above in time.now. // See comment above in time.now.
MOVQ runtime·__vdso_clock_gettime_sym(SB), AX MOVQ runtime·__vdso_clock_gettime_sym(SB), AX
CMPQ AX, $0 CMPQ AX, $0
JEQ fallback_gtod_nt JEQ fallback
MOVL $1, DI // CLOCK_MONOTONIC MOVL $1, DI // CLOCK_MONOTONIC
LEAQ 0(SP), SI LEAQ 0(SP), SI
CALL AX CALL AX
...@@ -153,7 +153,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$16 ...@@ -153,7 +153,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$16
ADDQ DX, AX ADDQ DX, AX
MOVQ AX, ret+0(FP) MOVQ AX, ret+0(FP)
RET RET
fallback_gtod_nt: fallback:
LEAQ 0(SP), DI LEAQ 0(SP), DI
MOVQ $0, SI MOVQ $0, SI
MOVQ runtime·__vdso_gettimeofday_sym(SB), AX MOVQ runtime·__vdso_gettimeofday_sym(SB), AX
......
...@@ -373,20 +373,20 @@ TEXT cas<>(SB),NOSPLIT,$0 ...@@ -373,20 +373,20 @@ TEXT cas<>(SB),NOSPLIT,$0
TEXT runtime·cas(SB),NOSPLIT,$0 TEXT runtime·cas(SB),NOSPLIT,$0
MOVW ptr+0(FP), R2 MOVW ptr+0(FP), R2
MOVW old+4(FP), R0 MOVW old+4(FP), R0
casagain: loop:
MOVW new+8(FP), R1 MOVW new+8(FP), R1
BL cas<>(SB) BL cas<>(SB)
BCC cascheck BCC check
MOVW $1, R0 MOVW $1, R0
MOVB R0, ret+12(FP) MOVB R0, ret+12(FP)
RET RET
cascheck: check:
// Kernel lies; double-check. // Kernel lies; double-check.
MOVW ptr+0(FP), R2 MOVW ptr+0(FP), R2
MOVW old+4(FP), R0 MOVW old+4(FP), R0
MOVW 0(R2), R3 MOVW 0(R2), R3
CMP R0, R3 CMP R0, R3
BEQ casagain BEQ loop
MOVW $0, R0 MOVW $0, R0
MOVB R0, ret+12(FP) MOVB R0, ret+12(FP)
RET RET
......
...@@ -293,7 +293,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 ...@@ -293,7 +293,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0
MOVL $0, 0(SP) MOVL $0, 0(SP)
MOVL $runtime·badsignal(SB), AX MOVL $runtime·badsignal(SB), AX
CALL AX CALL AX
JMP sigtramp_ret JMP ret
// save g // save g
MOVL DI, 20(SP) MOVL DI, 20(SP)
...@@ -317,7 +317,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 ...@@ -317,7 +317,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0
MOVL 20(SP), BX MOVL 20(SP), BX
MOVL BX, g(CX) MOVL BX, g(CX)
sigtramp_ret: ret:
// Enable exceptions again. // Enable exceptions again.
NACL_SYSCALL(SYS_exception_clear_flag) NACL_SYSCALL(SYS_exception_clear_flag)
......
...@@ -338,7 +338,6 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$80 ...@@ -338,7 +338,6 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$80
MOVL 20(SP), BX MOVL 20(SP), BX
MOVL BX, g(CX) MOVL BX, g(CX)
sigtramp_ret:
// Enable exceptions again. // Enable exceptions again.
NACL_SYSCALL(SYS_exception_clear_flag) NACL_SYSCALL(SYS_exception_clear_flag)
......
...@@ -269,7 +269,6 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$80 ...@@ -269,7 +269,6 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$80
// restore g // restore g
MOVW 20(R13), g MOVW 20(R13), g
sigtramp_ret:
// Enable exceptions again. // Enable exceptions again.
NACL_SYSCALL(SYS_exception_clear_flag) NACL_SYSCALL(SYS_exception_clear_flag)
......
...@@ -186,7 +186,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44 ...@@ -186,7 +186,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL BX, 0(SP) MOVL BX, 0(SP)
MOVL $runtime·badsignal(SB), AX MOVL $runtime·badsignal(SB), AX
CALL AX CALL AX
JMP sigtramp_ret JMP ret
// save g // save g
MOVL DI, 20(SP) MOVL DI, 20(SP)
...@@ -212,7 +212,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44 ...@@ -212,7 +212,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL 20(SP), BX MOVL 20(SP), BX
MOVL BX, g(CX) MOVL BX, g(CX)
sigtramp_ret: ret:
// call sigreturn // call sigreturn
MOVL context+8(FP), AX MOVL context+8(FP), AX
MOVL $0, 0(SP) // syscall gap MOVL $0, 0(SP) // syscall gap
......
...@@ -287,24 +287,24 @@ TEXT runtime·usleep1(SB),NOSPLIT,$0 ...@@ -287,24 +287,24 @@ TEXT runtime·usleep1(SB),NOSPLIT,$0
// Execute call on m->g0. // Execute call on m->g0.
get_tls(R15) get_tls(R15)
CMPQ R15, $0 CMPQ R15, $0
JE usleep1_noswitch JE noswitch
MOVQ g(R15), R13 MOVQ g(R15), R13
CMPQ R13, $0 CMPQ R13, $0
JE usleep1_noswitch JE noswitch
MOVQ g_m(R13), R13 MOVQ g_m(R13), R13
CMPQ R13, $0 CMPQ R13, $0
JE usleep1_noswitch JE noswitch
// TODO(aram): do something about the cpu profiler here. // TODO(aram): do something about the cpu profiler here.
MOVQ m_g0(R13), R14 MOVQ m_g0(R13), R14
CMPQ g(R15), R14 CMPQ g(R15), R14
JNE usleep1_switch JNE switch
// executing on m->g0 already // executing on m->g0 already
CALL AX CALL AX
RET RET
usleep1_switch: switch:
// Switch to m->g0 stack and back. // Switch to m->g0 stack and back.
MOVQ (g_sched+gobuf_sp)(R14), R14 MOVQ (g_sched+gobuf_sp)(R14), R14
MOVQ SP, -8(R14) MOVQ SP, -8(R14)
...@@ -313,7 +313,7 @@ usleep1_switch: ...@@ -313,7 +313,7 @@ usleep1_switch:
MOVQ 0(SP), SP MOVQ 0(SP), SP
RET RET
usleep1_noswitch: noswitch:
// Not a Go-managed thread. Do not switch stack. // Not a Go-managed thread. Do not switch stack.
CALL AX CALL AX
RET RET
......
...@@ -106,7 +106,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 ...@@ -106,7 +106,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0
MOVL g_m(DX), BX MOVL g_m(DX), BX
MOVL m_g0(BX), BX MOVL m_g0(BX), BX
CMPL DX, BX CMPL DX, BX
JEQ sigtramp_g0 JEQ g0
// switch to the g0 stack // switch to the g0 stack
get_tls(BP) get_tls(BP)
...@@ -123,7 +123,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 ...@@ -123,7 +123,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0
MOVL SP, 36(DI) MOVL SP, 36(DI)
MOVL DI, SP MOVL DI, SP
sigtramp_g0: g0:
MOVL 0(CX), BX // ExceptionRecord* MOVL 0(CX), BX // ExceptionRecord*
MOVL 4(CX), CX // Context* MOVL 4(CX), CX // Context*
MOVL BX, 0(SP) MOVL BX, 0(SP)
...@@ -383,12 +383,12 @@ TEXT runtime·usleep1(SB),NOSPLIT,$0 ...@@ -383,12 +383,12 @@ TEXT runtime·usleep1(SB),NOSPLIT,$0
MOVL m_g0(BP), SI MOVL m_g0(BP), SI
CMPL g(CX), SI CMPL g(CX), SI
JNE usleep1_switch JNE switch
// executing on m->g0 already // executing on m->g0 already
CALL AX CALL AX
JMP usleep1_ret JMP ret
usleep1_switch: switch:
// Switch to m->g0 stack and back. // Switch to m->g0 stack and back.
MOVL (g_sched+gobuf_sp)(SI), SI MOVL (g_sched+gobuf_sp)(SI), SI
MOVL SP, -4(SI) MOVL SP, -4(SI)
...@@ -396,7 +396,7 @@ usleep1_switch: ...@@ -396,7 +396,7 @@ usleep1_switch:
CALL AX CALL AX
MOVL 0(SP), SP MOVL 0(SP), SP
usleep1_ret: ret:
get_tls(CX) get_tls(CX)
MOVL g(CX), BP MOVL g(CX), BP
MOVL g_m(BP), BP MOVL g_m(BP), BP
......
...@@ -138,7 +138,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 ...@@ -138,7 +138,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0
MOVQ g_m(DX), BX MOVQ g_m(DX), BX
MOVQ m_g0(BX), BX MOVQ m_g0(BX), BX
CMPQ DX, BX CMPQ DX, BX
JEQ sigtramp_g0 JEQ g0
// switch to g0 stack // switch to g0 stack
get_tls(BP) get_tls(BP)
...@@ -157,7 +157,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 ...@@ -157,7 +157,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0
MOVQ SP, 104(DI) MOVQ SP, 104(DI)
MOVQ DI, SP MOVQ DI, SP
sigtramp_g0: g0:
MOVQ 0(CX), BX // ExceptionRecord* MOVQ 0(CX), BX // ExceptionRecord*
MOVQ 8(CX), CX // Context* MOVQ 8(CX), CX // Context*
MOVQ BX, 0(SP) MOVQ BX, 0(SP)
...@@ -407,12 +407,12 @@ TEXT runtime·usleep1(SB),NOSPLIT,$0 ...@@ -407,12 +407,12 @@ TEXT runtime·usleep1(SB),NOSPLIT,$0
MOVQ m_g0(R13), R14 MOVQ m_g0(R13), R14
CMPQ g(R15), R14 CMPQ g(R15), R14
JNE usleep1_switch JNE switch
// executing on m->g0 already // executing on m->g0 already
CALL AX CALL AX
JMP usleep1_ret JMP ret
usleep1_switch: switch:
// Switch to m->g0 stack and back. // Switch to m->g0 stack and back.
MOVQ (g_sched+gobuf_sp)(R14), R14 MOVQ (g_sched+gobuf_sp)(R14), R14
MOVQ SP, -8(R14) MOVQ SP, -8(R14)
...@@ -420,7 +420,7 @@ usleep1_switch: ...@@ -420,7 +420,7 @@ usleep1_switch:
CALL AX CALL AX
MOVQ 0(SP), SP MOVQ 0(SP), SP
usleep1_ret: ret:
MOVQ $0, m_libcallsp(R13) MOVQ $0, m_libcallsp(R13)
RET RET
......
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