From: Russ Cox Date: Tue, 29 May 2012 16:09:27 +0000 (-0400) Subject: cmd/6g, cmd/8g: move panicindex calls out of line X-Git-Tag: go1.1rc2~3092 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fefae6eed1df88397b4a53ed932e3cf3b32345ad;p=gostls13.git cmd/6g, cmd/8g: move panicindex calls out of line The old code generated for a bounds check was CMP JLT ok CALL panicindex ok: ... The new code is (once the linker finishes with it): CMP JGE panic ... panic: CALL panicindex which moves the calls out of line, putting more useful code in each cache line. This matters especially in tight loops, such as in Fannkuch. The benefit is more modest elsewhere, but real. From test/bench/go1, amd64: benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 6096092000 6088808000 -0.12% BenchmarkFannkuch11 6151404000 4020463000 -34.64% BenchmarkGobDecode 28990050 28894630 -0.33% BenchmarkGobEncode 12406310 12136730 -2.17% BenchmarkGzip 179923 179903 -0.01% BenchmarkGunzip 11219 11130 -0.79% BenchmarkJSONEncode 86429350 86515900 +0.10% BenchmarkJSONDecode 334593800 315728400 -5.64% BenchmarkRevcomp25M 1219763000 1180767000 -3.20% BenchmarkTemplate 492947600 483646800 -1.89% And 386: benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 6354902000 6243000000 -1.76% BenchmarkFannkuch11 8043769000 7326965000 -8.91% BenchmarkGobDecode 19010800 18941230 -0.37% BenchmarkGobEncode 14077500 13792460 -2.02% BenchmarkGzip 194087 193619 -0.24% BenchmarkGunzip 12495 12457 -0.30% BenchmarkJSONEncode 125636400 125451400 -0.15% BenchmarkJSONDecode 696648600 685032800 -1.67% BenchmarkRevcomp25M 2058088000 2052545000 -0.27% BenchmarkTemplate 602140000 589876800 -2.04% To implement this, two new instruction forms: JLT target // same as always JLT $0, target // branch expected not taken JLT $1, target // branch expected taken The linker could also emit the prediction prefixes, but it does not: expected taken branches are reversed so that the expected case is not taken (as in example above), and the default expectaton for such a jump is not taken already. R=golang-dev, gri, r, dave CC=golang-dev https://golang.org/cl/6248049 --- diff --git a/src/cmd/6a/a.y b/src/cmd/6a/a.y index 8459ff3233..42af65e35f 100644 --- a/src/cmd/6a/a.y +++ b/src/cmd/6a/a.y @@ -176,6 +176,11 @@ nonrel: $$.from = nullgen; $$.to = $1; } +| imm ',' rel + { + $$.from = $1; + $$.to = $3; + } spec1: /* DATA */ nam '/' con ',' imm diff --git a/src/cmd/6a/y.tab.c b/src/cmd/6a/y.tab.c index 2da8a1fac5..75c4ad5ea3 100644 --- a/src/cmd/6a/y.tab.c +++ b/src/cmd/6a/y.tab.c @@ -406,16 +406,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 548 +#define YYLAST 554 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 54 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 40 /* YYNRULES -- Number of rules. */ -#define YYNRULES 131 +#define YYNRULES 132 /* YYNRULES -- Number of states. */ -#define YYNSTATES 260 +#define YYNSTATES 263 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -468,16 +468,16 @@ static const yytype_uint16 yyprhs[] = 23, 26, 29, 33, 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88, 89, 91, 95, 99, 102, 104, 107, 109, - 112, 114, 120, 124, 130, 133, 135, 137, 139, 143, - 149, 153, 159, 162, 164, 168, 174, 180, 181, 183, - 187, 193, 195, 197, 199, 201, 204, 207, 209, 211, - 213, 215, 220, 223, 226, 228, 230, 232, 234, 236, - 238, 240, 243, 246, 249, 252, 255, 260, 266, 270, - 272, 274, 276, 281, 286, 291, 298, 308, 312, 316, - 322, 331, 333, 340, 346, 354, 355, 358, 361, 363, - 365, 367, 369, 371, 374, 377, 380, 384, 386, 389, - 393, 398, 400, 404, 408, 412, 416, 420, 425, 430, - 434, 438 + 112, 114, 118, 124, 128, 134, 137, 139, 141, 143, + 147, 153, 157, 163, 166, 168, 172, 178, 184, 185, + 187, 191, 197, 199, 201, 203, 205, 208, 211, 213, + 215, 217, 219, 224, 227, 230, 232, 234, 236, 238, + 240, 242, 244, 247, 250, 253, 256, 259, 264, 270, + 274, 276, 278, 280, 285, 290, 295, 302, 312, 316, + 320, 326, 335, 337, 344, 350, 358, 359, 362, 365, + 367, 369, 371, 373, 375, 378, 381, 384, 388, 390, + 393, 397, 402, 404, 408, 412, 416, 420, 424, 429, + 434, 438, 442 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -494,40 +494,40 @@ static const yytype_int8 yyrhs[] = 75, -1, 29, 76, -1, 23, 77, -1, -1, 49, -1, 80, 49, 78, -1, 78, 49, 80, -1, 80, 49, -1, 80, -1, 49, 78, -1, 78, -1, 49, - 81, -1, 81, -1, 88, 11, 91, 49, 84, -1, - 85, 49, 83, -1, 85, 49, 91, 49, 83, -1, - 49, 79, -1, 79, -1, 61, -1, 65, -1, 80, - 49, 78, -1, 80, 49, 78, 46, 35, -1, 80, - 49, 78, -1, 80, 49, 78, 46, 36, -1, 80, - 49, -1, 80, -1, 80, 49, 78, -1, 82, 49, - 78, 49, 91, -1, 84, 49, 78, 49, 82, -1, - -1, 84, -1, 85, 49, 84, -1, 85, 49, 91, - 49, 84, -1, 82, -1, 85, -1, 81, -1, 87, - -1, 10, 82, -1, 10, 86, -1, 82, -1, 86, - -1, 78, -1, 84, -1, 91, 50, 32, 51, -1, - 43, 89, -1, 44, 89, -1, 34, -1, 37, -1, - 35, -1, 38, -1, 42, -1, 36, -1, 39, -1, - 52, 92, -1, 52, 91, -1, 52, 88, -1, 52, - 41, -1, 52, 40, -1, 52, 50, 40, 51, -1, - 52, 50, 9, 40, 51, -1, 52, 9, 40, -1, - 86, -1, 87, -1, 91, -1, 91, 50, 35, 51, - -1, 91, 50, 42, 51, -1, 91, 50, 36, 51, - -1, 91, 50, 35, 10, 91, 51, -1, 91, 50, - 35, 51, 50, 35, 10, 91, 51, -1, 50, 35, - 51, -1, 50, 42, 51, -1, 50, 35, 10, 91, - 51, -1, 50, 35, 51, 50, 35, 10, 91, 51, - -1, 88, -1, 88, 50, 35, 10, 91, 51, -1, - 43, 89, 50, 90, 51, -1, 43, 6, 7, 89, - 50, 33, 51, -1, -1, 8, 91, -1, 9, 91, - -1, 33, -1, 42, -1, 31, -1, 30, -1, 45, - -1, 9, 91, -1, 8, 91, -1, 53, 91, -1, - 50, 93, 51, -1, 30, -1, 9, 30, -1, 30, - 9, 30, -1, 9, 30, 9, 30, -1, 91, -1, - 93, 8, 93, -1, 93, 9, 93, -1, 93, 10, - 93, -1, 93, 11, 93, -1, 93, 12, 93, -1, - 93, 6, 6, 93, -1, 93, 7, 7, 93, -1, - 93, 5, 93, -1, 93, 4, 93, -1, 93, 3, - 93, -1 + 81, -1, 81, -1, 84, 49, 81, -1, 88, 11, + 91, 49, 84, -1, 85, 49, 83, -1, 85, 49, + 91, 49, 83, -1, 49, 79, -1, 79, -1, 61, + -1, 65, -1, 80, 49, 78, -1, 80, 49, 78, + 46, 35, -1, 80, 49, 78, -1, 80, 49, 78, + 46, 36, -1, 80, 49, -1, 80, -1, 80, 49, + 78, -1, 82, 49, 78, 49, 91, -1, 84, 49, + 78, 49, 82, -1, -1, 84, -1, 85, 49, 84, + -1, 85, 49, 91, 49, 84, -1, 82, -1, 85, + -1, 81, -1, 87, -1, 10, 82, -1, 10, 86, + -1, 82, -1, 86, -1, 78, -1, 84, -1, 91, + 50, 32, 51, -1, 43, 89, -1, 44, 89, -1, + 34, -1, 37, -1, 35, -1, 38, -1, 42, -1, + 36, -1, 39, -1, 52, 92, -1, 52, 91, -1, + 52, 88, -1, 52, 41, -1, 52, 40, -1, 52, + 50, 40, 51, -1, 52, 50, 9, 40, 51, -1, + 52, 9, 40, -1, 86, -1, 87, -1, 91, -1, + 91, 50, 35, 51, -1, 91, 50, 42, 51, -1, + 91, 50, 36, 51, -1, 91, 50, 35, 10, 91, + 51, -1, 91, 50, 35, 51, 50, 35, 10, 91, + 51, -1, 50, 35, 51, -1, 50, 42, 51, -1, + 50, 35, 10, 91, 51, -1, 50, 35, 51, 50, + 35, 10, 91, 51, -1, 88, -1, 88, 50, 35, + 10, 91, 51, -1, 43, 89, 50, 90, 51, -1, + 43, 6, 7, 89, 50, 33, 51, -1, -1, 8, + 91, -1, 9, 91, -1, 33, -1, 42, -1, 31, + -1, 30, -1, 45, -1, 9, 91, -1, 8, 91, + -1, 53, 91, -1, 50, 93, 51, -1, 30, -1, + 9, 30, -1, 30, 9, 30, -1, 9, 30, 9, + 30, -1, 91, -1, 93, 8, 93, -1, 93, 9, + 93, -1, 93, 10, 93, -1, 93, 11, 93, -1, + 93, 12, 93, -1, 93, 6, 6, 93, -1, 93, + 7, 7, 93, -1, 93, 5, 93, -1, 93, 4, + 93, -1, 93, 3, 93, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -537,16 +537,16 @@ static const yytype_uint16 yyrline[] = 86, 87, 90, 95, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 120, 124, 131, 138, 145, 150, 157, 162, 169, - 174, 181, 189, 194, 202, 207, 214, 215, 218, 223, - 233, 238, 248, 253, 258, 265, 273, 283, 287, 294, - 299, 307, 308, 311, 312, 313, 317, 321, 322, 325, - 326, 329, 335, 344, 353, 358, 363, 368, 373, 378, - 383, 389, 397, 403, 414, 420, 426, 432, 438, 446, - 447, 450, 456, 462, 468, 474, 483, 492, 497, 502, - 510, 520, 524, 533, 540, 549, 552, 556, 562, 563, - 567, 570, 571, 575, 579, 583, 587, 593, 597, 601, - 606, 613, 614, 618, 622, 626, 630, 634, 638, 642, - 646, 650 + 174, 179, 186, 194, 199, 207, 212, 219, 220, 223, + 228, 238, 243, 253, 258, 263, 270, 278, 288, 292, + 299, 304, 312, 313, 316, 317, 318, 322, 326, 327, + 330, 331, 334, 340, 349, 358, 363, 368, 373, 378, + 383, 388, 394, 402, 408, 419, 425, 431, 437, 443, + 451, 452, 455, 461, 467, 473, 479, 488, 497, 502, + 507, 515, 525, 529, 538, 545, 554, 557, 561, 567, + 568, 572, 575, 576, 580, 584, 588, 592, 598, 602, + 606, 611, 618, 619, 623, 627, 631, 635, 639, 643, + 647, 651, 655 }; #endif @@ -591,16 +591,16 @@ static const yytype_uint8 yyr1[] = 57, 57, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 61, 61, 62, 63, 64, 64, 65, 65, 66, - 66, 67, 68, 68, 69, 69, 70, 70, 71, 71, - 72, 72, 73, 73, 73, 74, 75, 76, 76, 77, - 77, 78, 78, 79, 79, 79, 79, 79, 79, 80, - 80, 81, 81, 81, 82, 82, 82, 82, 82, 82, - 82, 83, 84, 84, 84, 84, 84, 84, 84, 85, - 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, - 90, 91, 91, 91, 91, 91, 91, 92, 92, 92, - 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93 + 66, 66, 67, 68, 68, 69, 69, 70, 70, 71, + 71, 72, 72, 73, 73, 73, 74, 75, 76, 76, + 77, 77, 78, 78, 79, 79, 79, 79, 79, 79, + 80, 80, 81, 81, 81, 82, 82, 82, 82, 82, + 82, 82, 83, 84, 84, 84, 84, 84, 84, 84, + 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 87, 87, 88, 88, 89, 89, 89, 90, + 90, 90, 91, 91, 91, 91, 91, 91, 92, 92, + 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 93 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -610,16 +610,16 @@ static const yytype_uint8 yyr2[] = 2, 2, 3, 3, 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, 2, - 1, 5, 3, 5, 2, 1, 1, 1, 3, 5, - 3, 5, 2, 1, 3, 5, 5, 0, 1, 3, - 5, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 1, 4, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 4, 5, 3, 1, - 1, 1, 4, 4, 4, 6, 9, 3, 3, 5, - 8, 1, 6, 5, 7, 0, 2, 2, 1, 1, - 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, - 4, 1, 3, 3, 3, 3, 3, 4, 4, 3, - 3, 3 + 1, 3, 5, 3, 5, 2, 1, 1, 1, 3, + 5, 3, 5, 2, 1, 3, 5, 5, 0, 1, + 3, 5, 1, 1, 1, 1, 2, 2, 1, 1, + 1, 1, 4, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 4, 5, 3, + 1, 1, 1, 4, 4, 4, 6, 9, 3, 3, + 5, 8, 1, 6, 5, 7, 0, 2, 2, 1, + 1, 1, 1, 1, 2, 2, 2, 3, 1, 2, + 3, 4, 1, 3, 3, 3, 3, 3, 4, 4, + 3, 3, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -629,39 +629,40 @@ static const yytype_uint8 yydefact[] = { 2, 3, 1, 0, 0, 31, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, - 0, 57, 0, 0, 0, 9, 4, 0, 11, 32, - 14, 0, 0, 111, 74, 76, 79, 75, 77, 80, - 78, 105, 112, 0, 0, 0, 15, 38, 61, 62, - 89, 90, 101, 91, 0, 16, 69, 36, 70, 17, - 0, 18, 0, 0, 105, 105, 0, 22, 45, 63, - 67, 68, 64, 91, 20, 0, 32, 46, 47, 23, - 105, 0, 0, 19, 40, 0, 21, 0, 30, 0, - 24, 0, 25, 0, 26, 53, 27, 0, 28, 0, - 29, 58, 7, 0, 5, 0, 10, 114, 113, 0, - 0, 0, 0, 37, 0, 0, 121, 0, 115, 0, - 0, 0, 85, 84, 0, 83, 82, 35, 0, 0, - 65, 66, 72, 73, 44, 0, 0, 72, 39, 0, - 0, 0, 0, 0, 52, 0, 0, 0, 12, 0, - 13, 105, 106, 107, 0, 0, 97, 98, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 116, 0, - 0, 0, 0, 88, 0, 0, 33, 34, 0, 0, - 0, 42, 0, 59, 0, 48, 50, 54, 0, 0, - 8, 6, 0, 110, 108, 109, 0, 0, 0, 131, - 130, 129, 0, 0, 122, 123, 124, 125, 126, 0, - 0, 92, 94, 93, 0, 86, 71, 0, 0, 117, - 81, 0, 0, 0, 0, 0, 0, 0, 103, 99, - 0, 127, 128, 0, 0, 0, 87, 41, 118, 0, - 43, 60, 49, 51, 55, 56, 0, 0, 102, 95, - 0, 0, 119, 104, 0, 0, 120, 100, 0, 96 + 0, 58, 0, 0, 0, 9, 4, 0, 11, 32, + 14, 0, 0, 112, 75, 77, 80, 76, 78, 81, + 79, 106, 113, 0, 0, 0, 15, 38, 62, 63, + 90, 91, 102, 92, 0, 16, 70, 36, 71, 17, + 0, 18, 0, 0, 106, 106, 0, 22, 46, 64, + 68, 69, 65, 92, 20, 0, 32, 47, 48, 23, + 106, 0, 0, 19, 40, 0, 0, 21, 0, 30, + 0, 24, 0, 25, 0, 26, 54, 27, 0, 28, + 0, 29, 59, 7, 0, 5, 0, 10, 115, 114, + 0, 0, 0, 0, 37, 0, 0, 122, 0, 116, + 0, 0, 0, 86, 85, 0, 84, 83, 35, 0, + 0, 66, 67, 73, 74, 45, 0, 0, 73, 39, + 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, + 12, 0, 13, 106, 107, 108, 0, 0, 98, 99, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 117, 0, 0, 0, 0, 89, 0, 0, 33, 34, + 0, 0, 41, 0, 43, 0, 60, 0, 49, 51, + 55, 0, 0, 8, 6, 0, 111, 109, 110, 0, + 0, 0, 132, 131, 130, 0, 0, 123, 124, 125, + 126, 127, 0, 0, 93, 95, 94, 0, 87, 72, + 0, 0, 118, 82, 0, 0, 0, 0, 0, 0, + 0, 104, 100, 0, 128, 129, 0, 0, 0, 88, + 42, 119, 0, 44, 61, 50, 52, 56, 57, 0, + 0, 103, 96, 0, 0, 120, 105, 0, 0, 121, + 101, 0, 97 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 3, 26, 149, 147, 27, 30, 59, 61, - 55, 46, 83, 74, 86, 67, 79, 90, 92, 94, - 96, 98, 100, 88, 56, 68, 57, 69, 48, 181, - 58, 49, 50, 51, 52, 112, 196, 53, 220, 117 + -1, 1, 3, 26, 151, 149, 27, 30, 59, 61, + 55, 46, 83, 74, 87, 67, 79, 91, 93, 95, + 97, 99, 101, 89, 56, 68, 57, 69, 48, 184, + 58, 49, 50, 51, 52, 113, 199, 53, 223, 118 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing @@ -669,41 +670,42 @@ static const yytype_int16 yydefgoto[] = #define YYPACT_NINF -97 static const yytype_int16 yypact[] = { - -97, 29, -97, 206, -39, -36, 254, 278, 278, 326, - 230, 15, 302, 59, 412, 412, 278, 278, 278, 82, - -20, -20, -22, -6, 2, -97, -97, 12, -97, -97, - -97, 476, 476, -97, -97, -97, -97, -97, -97, -97, - -97, 88, -97, 326, 366, 476, -97, -97, -97, -97, - -97, -97, 14, 16, 364, -97, -97, 33, -97, -97, - 39, -97, 41, 350, 88, 11, 152, -97, -97, -97, - -97, -97, -97, 31, -97, 51, 326, -97, -97, -97, - 11, 382, 476, -97, -97, 42, -97, 50, -97, 56, - -97, 58, -97, 61, -97, 64, -97, 66, -97, 79, - -97, -97, -97, 476, -97, 476, -97, -97, -97, 84, - 476, 476, 92, -97, 18, 78, -97, 129, -97, 108, - -5, 414, -97, -97, 421, -97, -97, -97, 326, 278, - -97, -97, 92, -97, -97, 13, 476, -97, -97, 112, - 428, 438, 326, 326, 326, 326, 326, 206, 527, 206, - 527, 11, -97, -97, 10, 476, 96, -97, 476, 476, - 476, 141, 144, 476, 476, 476, 476, 476, -97, 142, - 23, 126, 127, -97, 467, 128, -97, -97, 130, 110, - 8, -97, 114, -97, 134, 138, 139, -97, 149, 154, - -97, -97, 163, -97, -97, -97, 153, 165, 179, 536, - 493, 159, 476, 476, 65, 65, -97, -97, -97, 476, - 476, 168, -97, -97, 185, -97, -97, -20, 211, 233, - -97, 191, -20, 209, 210, 476, 82, 214, -97, -97, - 238, 200, 200, 201, 203, 220, -97, -97, 247, 227, - -97, -97, -97, -97, -97, -97, 207, 476, -97, -97, - 249, 231, -97, -97, 219, 476, -97, -97, 225, -97 + -97, 40, -97, 208, 5, -4, 140, 295, 295, 343, + 233, 15, 319, 381, 91, 91, 295, 295, 295, 222, + 24, 24, -15, 22, 14, -97, -97, 30, -97, -97, + -97, 486, 486, -97, -97, -97, -97, -97, -97, -97, + -97, 42, -97, 343, 406, 486, -97, -97, -97, -97, + -97, -97, 45, 48, 399, -97, -97, 20, -97, -97, + 67, -97, 68, 367, 42, 19, 271, -97, -97, -97, + -97, -97, -97, 87, -97, 127, 343, -97, -97, -97, + 19, 437, 486, -97, -97, 90, 92, -97, 94, -97, + 96, -97, 104, -97, 105, -97, 111, -97, 118, -97, + 119, -97, -97, -97, 486, -97, 486, -97, -97, -97, + 133, 486, 486, 121, -97, 8, 122, -97, 80, -97, + 134, 78, 413, -97, -97, 446, -97, -97, -97, 343, + 295, -97, -97, 121, -97, -97, 7, 486, -97, -97, + 437, 148, 453, 462, 343, 343, 343, 343, 343, 208, + 284, 208, 284, 19, -97, -97, -1, 486, 131, -97, + 486, 486, 486, 166, 177, 486, 486, 486, 486, 486, + -97, 176, 10, 136, 137, -97, 480, 141, -97, -97, + 143, 142, -97, 16, -97, 149, -97, 150, 151, 154, + -97, 152, 155, -97, -97, 156, -97, -97, -97, 157, + 159, 170, 99, 535, 542, 486, 486, 26, 26, -97, + -97, -97, 486, 486, 161, -97, -97, 162, -97, -97, + 24, 184, 198, -97, 163, 24, 181, 183, 486, 222, + 205, -97, -97, 229, 114, 114, 193, 194, 211, -97, + -97, 238, 219, -97, -97, -97, -97, -97, -97, 199, + 486, -97, -97, 244, 232, -97, -97, 214, 486, -97, + -97, 215, -97 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -97, -97, -97, -96, -97, -97, -97, 259, -97, -97, - -97, 265, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, -97, 30, 212, -2, -11, -9, 60, - -16, 32, -3, -1, 7, -53, -97, -10, -97, -80 + -97, -97, -97, -96, -97, -97, -97, 261, -97, -97, + -97, 262, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, 17, 218, -2, -11, -9, 61, + -8, 51, 1, -3, -7, -56, -97, -10, -97, -87 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -713,120 +715,122 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint16 yytable[] = { - 73, 70, 84, 85, 99, 101, 60, 71, 28, 72, - 97, 132, 133, 29, 91, 93, 95, 218, 75, 110, - 111, 107, 108, 148, 102, 150, 103, 137, 155, 2, - 170, 171, 54, 210, 116, 118, 47, 172, 219, 62, - 104, 193, 47, 194, 126, 178, 87, 89, 170, 171, - 105, 190, 195, 191, 130, 172, 73, 70, 41, 106, - 131, 125, 136, 71, 119, 72, 120, 31, 32, 156, - 138, 85, 116, 113, 211, 165, 166, 167, 199, 200, - 201, 135, 127, 204, 205, 206, 207, 208, 128, 33, - 129, 151, 139, 116, 109, 116, 110, 111, 192, 140, - 152, 153, 80, 65, 42, 141, 113, 142, 81, 82, - 143, 108, 45, 144, 116, 145, 34, 35, 36, 37, - 38, 39, 231, 232, 40, 183, 179, 177, 146, 157, - 182, 184, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 154, 169, 178, 197, 198, 202, 116, 116, - 116, 203, 209, 116, 116, 116, 116, 116, 176, 217, - 31, 32, 63, 221, 108, 161, 162, 163, 164, 165, - 166, 167, 185, 186, 187, 188, 189, 212, 213, 215, - 168, 216, 33, 222, 223, 224, 34, 35, 36, 37, - 38, 39, 116, 116, 40, 64, 65, 42, 225, 233, - 234, 237, 44, 226, 228, 45, 241, 4, 163, 164, - 165, 166, 167, 227, 230, 244, 229, 245, 235, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 236, 254, 31, 32, - 63, 238, 239, 180, 242, 258, 243, 246, 247, 22, - 23, 24, 248, 25, 249, 250, 251, 252, 253, 255, - 33, 256, 31, 32, 34, 35, 36, 37, 38, 39, - 257, 77, 40, 64, 65, 42, 259, 78, 134, 66, - 44, 240, 0, 45, 33, 0, 31, 32, 34, 35, - 36, 37, 38, 39, 0, 0, 40, 41, 0, 42, - 0, 0, 0, 43, 44, 0, 0, 45, 33, 0, - 31, 32, 34, 35, 36, 37, 38, 39, 0, 0, - 40, 41, 0, 42, 0, 0, 0, 0, 44, 0, - 54, 45, 33, 0, 31, 32, 34, 35, 36, 37, - 38, 39, 0, 0, 40, 41, 0, 42, 0, 0, - 0, 76, 44, 0, 0, 45, 33, 0, 31, 32, - 34, 35, 36, 37, 38, 39, 0, 0, 40, 41, - 0, 42, 31, 121, 31, 32, 44, 0, 0, 45, - 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, - 31, 32, 40, 0, 33, 42, 33, 0, 0, 0, - 44, 114, 0, 45, 122, 123, 0, 41, 115, 42, - 0, 42, 33, 0, 124, 0, 82, 45, 0, 45, - 31, 32, 31, 32, 0, 80, 65, 42, 0, 31, - 174, 0, 82, 0, 0, 45, 31, 32, 0, 0, - 0, 0, 33, 0, 33, 0, 31, 32, 0, 0, - 0, 33, 0, 0, 173, 41, 0, 42, 33, 42, - 0, 175, 44, 0, 82, 45, 42, 45, 33, 0, - 0, 82, 0, 42, 45, 31, 32, 0, 82, 0, - 180, 45, 0, 42, 31, 32, 0, 0, 82, 0, - 54, 45, 0, 0, 0, 0, 0, 33, 160, 161, - 162, 163, 164, 165, 166, 167, 33, 214, 0, 0, - 0, 0, 42, 0, 0, 0, 0, 82, 0, 0, - 45, 42, 0, 0, 0, 0, 82, 0, 0, 45, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 159, 160, 161, 162, 163, 164, 165, 166, 167 + 73, 70, 84, 86, 75, 85, 60, 72, 133, 134, + 98, 71, 100, 102, 92, 94, 96, 150, 157, 152, + 213, 108, 109, 47, 138, 221, 62, 111, 112, 47, + 196, 103, 197, 104, 117, 119, 167, 168, 169, 180, + 2, 198, 172, 173, 127, 29, 222, 126, 110, 174, + 111, 112, 28, 193, 131, 194, 73, 70, 41, 158, + 114, 214, 106, 72, 132, 88, 90, 71, 105, 128, + 139, 86, 117, 202, 203, 204, 54, 107, 207, 208, + 209, 210, 211, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 114, 117, 120, 117, 195, 121, 31, + 32, 154, 155, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 109, 172, 173, 117, 129, 130, 234, 235, + 174, 33, 165, 166, 167, 168, 169, 181, 179, 182, + 86, 170, 185, 187, 41, 186, 42, 136, 137, 140, + 153, 44, 141, 142, 45, 143, 178, 200, 31, 32, + 117, 117, 117, 144, 145, 117, 117, 117, 117, 117, + 146, 188, 189, 190, 191, 192, 109, 147, 148, 171, + 33, 156, 205, 159, 34, 35, 36, 37, 38, 39, + 180, 201, 40, 41, 206, 42, 212, 215, 216, 43, + 44, 220, 218, 45, 219, 117, 117, 226, 224, 225, + 227, 228, 236, 237, 229, 233, 230, 242, 231, 4, + 232, 238, 240, 239, 241, 183, 245, 244, 247, 246, + 248, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 249, 250, + 257, 31, 32, 63, 251, 252, 253, 254, 261, 255, + 256, 22, 23, 24, 258, 25, 34, 35, 36, 37, + 38, 39, 259, 33, 40, 260, 262, 34, 35, 36, + 37, 38, 39, 77, 78, 40, 64, 65, 42, 31, + 32, 63, 66, 44, 135, 243, 45, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 0, 0, 0, + 0, 33, 0, 31, 32, 34, 35, 36, 37, 38, + 39, 0, 0, 40, 64, 65, 42, 0, 0, 0, + 0, 44, 0, 0, 45, 33, 0, 31, 32, 34, + 35, 36, 37, 38, 39, 0, 0, 40, 41, 0, + 42, 0, 0, 0, 0, 44, 0, 54, 45, 33, + 0, 31, 32, 34, 35, 36, 37, 38, 39, 0, + 0, 40, 41, 0, 42, 0, 0, 0, 76, 44, + 0, 0, 45, 33, 0, 31, 32, 34, 35, 36, + 37, 38, 39, 0, 0, 40, 41, 0, 42, 31, + 32, 0, 0, 44, 0, 0, 45, 33, 0, 0, + 0, 34, 35, 36, 37, 38, 39, 31, 122, 40, + 0, 33, 42, 0, 31, 32, 0, 44, 0, 0, + 45, 31, 32, 0, 80, 65, 42, 0, 0, 33, + 81, 82, 0, 54, 45, 0, 33, 0, 0, 123, + 124, 115, 41, 33, 42, 31, 32, 0, 116, 125, + 0, 42, 45, 175, 31, 176, 82, 0, 42, 45, + 0, 31, 32, 82, 0, 0, 45, 33, 0, 0, + 31, 32, 0, 0, 0, 0, 33, 0, 0, 0, + 80, 65, 42, 33, 0, 0, 177, 82, 31, 32, + 45, 42, 33, 0, 31, 32, 82, 0, 42, 45, + 0, 0, 0, 82, 0, 183, 45, 42, 0, 0, + 33, 0, 82, 0, 54, 45, 33, 0, 0, 0, + 217, 0, 0, 0, 0, 42, 0, 0, 0, 0, + 82, 42, 0, 45, 0, 0, 82, 0, 0, 45, + 162, 163, 164, 165, 166, 167, 168, 169, 163, 164, + 165, 166, 167, 168, 169 }; static const yytype_int16 yycheck[] = { - 10, 10, 13, 13, 20, 21, 8, 10, 47, 10, - 19, 64, 65, 49, 16, 17, 18, 9, 11, 8, - 9, 31, 32, 103, 46, 105, 48, 80, 10, 0, - 35, 36, 52, 10, 44, 45, 6, 42, 30, 9, - 46, 31, 12, 33, 54, 32, 14, 15, 35, 36, - 48, 147, 42, 149, 63, 42, 66, 66, 43, 47, - 63, 54, 11, 66, 50, 66, 50, 8, 9, 51, - 81, 81, 82, 43, 51, 10, 11, 12, 158, 159, - 160, 50, 49, 163, 164, 165, 166, 167, 49, 30, - 49, 7, 50, 103, 6, 105, 8, 9, 151, 49, - 110, 111, 43, 44, 45, 49, 76, 49, 49, 50, - 49, 121, 53, 49, 124, 49, 34, 35, 36, 37, - 38, 39, 202, 203, 42, 141, 136, 129, 49, 51, - 140, 141, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 50, 35, 32, 155, 50, 6, 158, 159, - 160, 7, 10, 163, 164, 165, 166, 167, 128, 49, - 8, 9, 10, 49, 174, 6, 7, 8, 9, 10, - 11, 12, 142, 143, 144, 145, 146, 51, 51, 51, - 51, 51, 30, 49, 46, 46, 34, 35, 36, 37, - 38, 39, 202, 203, 42, 43, 44, 45, 49, 209, - 210, 217, 50, 49, 51, 53, 222, 1, 8, 9, - 10, 11, 12, 50, 35, 225, 51, 226, 50, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 51, 247, 8, 9, - 10, 30, 9, 52, 35, 255, 36, 33, 10, 43, - 44, 45, 51, 47, 51, 35, 9, 30, 51, 10, - 30, 30, 8, 9, 34, 35, 36, 37, 38, 39, - 51, 12, 42, 43, 44, 45, 51, 12, 66, 49, - 50, 221, -1, 53, 30, -1, 8, 9, 34, 35, - 36, 37, 38, 39, -1, -1, 42, 43, -1, 45, - -1, -1, -1, 49, 50, -1, -1, 53, 30, -1, - 8, 9, 34, 35, 36, 37, 38, 39, -1, -1, - 42, 43, -1, 45, -1, -1, -1, -1, 50, -1, - 52, 53, 30, -1, 8, 9, 34, 35, 36, 37, - 38, 39, -1, -1, 42, 43, -1, 45, -1, -1, - -1, 49, 50, -1, -1, 53, 30, -1, 8, 9, - 34, 35, 36, 37, 38, 39, -1, -1, 42, 43, - -1, 45, 8, 9, 8, 9, 50, -1, -1, 53, - 30, -1, -1, -1, 34, 35, 36, 37, 38, 39, - 8, 9, 42, -1, 30, 45, 30, -1, -1, -1, - 50, 35, -1, 53, 40, 41, -1, 43, 42, 45, - -1, 45, 30, -1, 50, -1, 50, 53, -1, 53, - 8, 9, 8, 9, -1, 43, 44, 45, -1, 8, - 9, -1, 50, -1, -1, 53, 8, 9, -1, -1, - -1, -1, 30, -1, 30, -1, 8, 9, -1, -1, - -1, 30, -1, -1, 40, 43, -1, 45, 30, 45, - -1, 40, 50, -1, 50, 53, 45, 53, 30, -1, - -1, 50, -1, 45, 53, 8, 9, -1, 50, -1, - 52, 53, -1, 45, 8, 9, -1, -1, 50, -1, - 52, 53, -1, -1, -1, -1, -1, 30, 5, 6, - 7, 8, 9, 10, 11, 12, 30, 40, -1, -1, - -1, -1, 45, -1, -1, -1, -1, 50, -1, -1, - 53, 45, -1, -1, -1, -1, 50, -1, -1, 53, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 4, 5, 6, 7, 8, 9, 10, 11, 12 + 10, 10, 13, 13, 11, 13, 8, 10, 64, 65, + 19, 10, 20, 21, 16, 17, 18, 104, 10, 106, + 10, 31, 32, 6, 80, 9, 9, 8, 9, 12, + 31, 46, 33, 48, 44, 45, 10, 11, 12, 32, + 0, 42, 35, 36, 54, 49, 30, 54, 6, 42, + 8, 9, 47, 149, 63, 151, 66, 66, 43, 51, + 43, 51, 48, 66, 63, 14, 15, 66, 46, 49, + 81, 81, 82, 160, 161, 162, 52, 47, 165, 166, + 167, 168, 169, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 76, 104, 50, 106, 153, 50, 8, + 9, 111, 112, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 122, 35, 36, 125, 49, 49, 205, 206, + 42, 30, 8, 9, 10, 11, 12, 137, 130, 140, + 140, 51, 142, 143, 43, 143, 45, 50, 11, 49, + 7, 50, 50, 49, 53, 49, 129, 157, 8, 9, + 160, 161, 162, 49, 49, 165, 166, 167, 168, 169, + 49, 144, 145, 146, 147, 148, 176, 49, 49, 35, + 30, 50, 6, 51, 34, 35, 36, 37, 38, 39, + 32, 50, 42, 43, 7, 45, 10, 51, 51, 49, + 50, 49, 51, 53, 51, 205, 206, 46, 49, 49, + 46, 49, 212, 213, 49, 35, 50, 9, 51, 1, + 51, 50, 220, 51, 30, 52, 35, 225, 228, 36, + 229, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 33, 10, + 250, 8, 9, 10, 51, 51, 35, 9, 258, 30, + 51, 43, 44, 45, 10, 47, 34, 35, 36, 37, + 38, 39, 30, 30, 42, 51, 51, 34, 35, 36, + 37, 38, 39, 12, 12, 42, 43, 44, 45, 8, + 9, 10, 49, 50, 66, 224, 53, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, + -1, 30, -1, 8, 9, 34, 35, 36, 37, 38, + 39, -1, -1, 42, 43, 44, 45, -1, -1, -1, + -1, 50, -1, -1, 53, 30, -1, 8, 9, 34, + 35, 36, 37, 38, 39, -1, -1, 42, 43, -1, + 45, -1, -1, -1, -1, 50, -1, 52, 53, 30, + -1, 8, 9, 34, 35, 36, 37, 38, 39, -1, + -1, 42, 43, -1, 45, -1, -1, -1, 49, 50, + -1, -1, 53, 30, -1, 8, 9, 34, 35, 36, + 37, 38, 39, -1, -1, 42, 43, -1, 45, 8, + 9, -1, -1, 50, -1, -1, 53, 30, -1, -1, + -1, 34, 35, 36, 37, 38, 39, 8, 9, 42, + -1, 30, 45, -1, 8, 9, -1, 50, -1, -1, + 53, 8, 9, -1, 43, 44, 45, -1, -1, 30, + 49, 50, -1, 52, 53, -1, 30, -1, -1, 40, + 41, 35, 43, 30, 45, 8, 9, -1, 42, 50, + -1, 45, 53, 40, 8, 9, 50, -1, 45, 53, + -1, 8, 9, 50, -1, -1, 53, 30, -1, -1, + 8, 9, -1, -1, -1, -1, 30, -1, -1, -1, + 43, 44, 45, 30, -1, -1, 40, 50, 8, 9, + 53, 45, 30, -1, 8, 9, 50, -1, 45, 53, + -1, -1, -1, 50, -1, 52, 53, 45, -1, -1, + 30, -1, 50, -1, 52, 53, 30, -1, -1, -1, + 40, -1, -1, -1, -1, 45, -1, -1, -1, -1, + 50, 45, -1, 53, -1, -1, 50, -1, -1, 53, + 5, 6, 7, 8, 9, 10, 11, 12, 6, 7, + 8, 9, 10, 11, 12 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -841,24 +845,25 @@ static const yytype_uint8 yystos[] = 86, 87, 88, 91, 52, 64, 78, 80, 84, 62, 80, 63, 78, 10, 43, 44, 49, 69, 79, 81, 82, 86, 87, 91, 67, 88, 49, 61, 65, 70, - 43, 49, 50, 66, 81, 91, 68, 85, 77, 85, - 71, 80, 72, 80, 73, 80, 74, 82, 75, 84, - 76, 84, 46, 48, 46, 48, 47, 91, 91, 6, - 8, 9, 89, 78, 35, 42, 91, 93, 91, 50, - 50, 9, 40, 41, 50, 88, 91, 49, 49, 49, - 82, 86, 89, 89, 79, 50, 11, 89, 81, 50, - 49, 49, 49, 49, 49, 49, 49, 59, 93, 58, - 93, 7, 91, 91, 50, 10, 51, 51, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 51, 35, - 35, 36, 42, 40, 9, 40, 78, 80, 32, 91, - 52, 83, 91, 84, 91, 78, 78, 78, 78, 78, - 57, 57, 89, 31, 33, 42, 90, 91, 50, 93, - 93, 93, 6, 7, 93, 93, 93, 93, 93, 10, - 10, 51, 51, 51, 40, 51, 51, 49, 9, 30, - 92, 49, 49, 46, 46, 49, 49, 50, 51, 51, - 35, 93, 93, 91, 91, 50, 51, 84, 30, 9, - 83, 84, 35, 36, 91, 82, 33, 10, 51, 51, - 35, 9, 30, 51, 91, 10, 30, 51, 91, 51 + 43, 49, 50, 66, 81, 84, 91, 68, 85, 77, + 85, 71, 80, 72, 80, 73, 80, 74, 82, 75, + 84, 76, 84, 46, 48, 46, 48, 47, 91, 91, + 6, 8, 9, 89, 78, 35, 42, 91, 93, 91, + 50, 50, 9, 40, 41, 50, 88, 91, 49, 49, + 49, 82, 86, 89, 89, 79, 50, 11, 89, 81, + 49, 50, 49, 49, 49, 49, 49, 49, 49, 59, + 93, 58, 93, 7, 91, 91, 50, 10, 51, 51, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 51, 35, 35, 36, 42, 40, 9, 40, 78, 80, + 32, 91, 81, 52, 83, 91, 84, 91, 78, 78, + 78, 78, 78, 57, 57, 89, 31, 33, 42, 90, + 91, 50, 93, 93, 93, 6, 7, 93, 93, 93, + 93, 93, 10, 10, 51, 51, 51, 40, 51, 51, + 49, 9, 30, 92, 49, 49, 46, 46, 49, 49, + 50, 51, 51, 35, 93, 93, 91, 91, 50, 51, + 84, 30, 9, 83, 84, 35, 36, 91, 82, 33, + 10, 51, 51, 35, 9, 30, 51, 91, 10, 30, + 51, 91, 51 }; #define yyerrok (yyerrstatus = 0) @@ -1879,7 +1884,15 @@ yyreduce: break; case 41: -#line 182 "a.y" +#line 180 "a.y" + { + (yyval.gen2).from = (yyvsp[(1) - (3)].gen); + (yyval.gen2).to = (yyvsp[(3) - (3)].gen); + } + break; + + case 42: +#line 187 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); @@ -1887,16 +1900,16 @@ yyreduce: } break; - case 42: -#line 190 "a.y" + case 43: +#line 195 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 43: -#line 195 "a.y" + case 44: +#line 200 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); @@ -1904,32 +1917,32 @@ yyreduce: } break; - case 44: -#line 203 "a.y" + case 45: +#line 208 "a.y" { (yyval.gen2).from = nullgen; (yyval.gen2).to = (yyvsp[(2) - (2)].gen); } break; - case 45: -#line 208 "a.y" + case 46: +#line 213 "a.y" { (yyval.gen2).from = nullgen; (yyval.gen2).to = (yyvsp[(1) - (1)].gen); } break; - case 48: -#line 219 "a.y" + case 49: +#line 224 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 49: -#line 224 "a.y" + case 50: +#line 229 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).to = (yyvsp[(3) - (5)].gen); @@ -1939,16 +1952,16 @@ yyreduce: } break; - case 50: -#line 234 "a.y" + case 51: +#line 239 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 51: -#line 239 "a.y" + case 52: +#line 244 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).to = (yyvsp[(3) - (5)].gen); @@ -1958,32 +1971,32 @@ yyreduce: } break; - case 52: -#line 249 "a.y" + case 53: +#line 254 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (2)].gen); (yyval.gen2).to = nullgen; } break; - case 53: -#line 254 "a.y" + case 54: +#line 259 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (1)].gen); (yyval.gen2).to = nullgen; } break; - case 54: -#line 259 "a.y" + case 55: +#line 264 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 55: -#line 266 "a.y" + case 56: +#line 271 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).to = (yyvsp[(3) - (5)].gen); @@ -1991,8 +2004,8 @@ yyreduce: } break; - case 56: -#line 274 "a.y" + case 57: +#line 279 "a.y" { (yyval.gen2).from = (yyvsp[(3) - (5)].gen); (yyval.gen2).to = (yyvsp[(5) - (5)].gen); @@ -2002,32 +2015,32 @@ yyreduce: } break; - case 57: -#line 283 "a.y" + case 58: +#line 288 "a.y" { (yyval.gen2).from = nullgen; (yyval.gen2).to = nullgen; } break; - case 58: -#line 288 "a.y" + case 59: +#line 293 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (1)].gen); (yyval.gen2).to = nullgen; } break; - case 59: -#line 295 "a.y" + case 60: +#line 300 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 60: -#line 300 "a.y" + case 61: +#line 305 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); @@ -2035,22 +2048,22 @@ yyreduce: } break; - case 65: -#line 314 "a.y" + case 66: +#line 319 "a.y" { (yyval.gen) = (yyvsp[(2) - (2)].gen); } break; - case 66: -#line 318 "a.y" + case 67: +#line 323 "a.y" { (yyval.gen) = (yyvsp[(2) - (2)].gen); } break; - case 71: -#line 330 "a.y" + case 72: +#line 335 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_BRANCH; @@ -2058,8 +2071,8 @@ yyreduce: } break; - case 72: -#line 336 "a.y" + case 73: +#line 341 "a.y" { (yyval.gen) = nullgen; if(pass == 2) @@ -2070,8 +2083,8 @@ yyreduce: } break; - case 73: -#line 345 "a.y" + case 74: +#line 350 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_BRANCH; @@ -2080,14 +2093,6 @@ yyreduce: } break; - case 74: -#line 354 "a.y" - { - (yyval.gen) = nullgen; - (yyval.gen).type = (yyvsp[(1) - (1)].lval); - } - break; - case 75: #line 359 "a.y" { @@ -2116,7 +2121,7 @@ yyreduce: #line 374 "a.y" { (yyval.gen) = nullgen; - (yyval.gen).type = D_SP; + (yyval.gen).type = (yyvsp[(1) - (1)].lval); } break; @@ -2124,7 +2129,7 @@ yyreduce: #line 379 "a.y" { (yyval.gen) = nullgen; - (yyval.gen).type = (yyvsp[(1) - (1)].lval); + (yyval.gen).type = D_SP; } break; @@ -2137,16 +2142,15 @@ yyreduce: break; case 81: -#line 390 "a.y" +#line 389 "a.y" { (yyval.gen) = nullgen; - (yyval.gen).type = D_CONST; - (yyval.gen).offset = (yyvsp[(2) - (2)].lval); + (yyval.gen).type = (yyvsp[(1) - (1)].lval); } break; case 82: -#line 398 "a.y" +#line 395 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_CONST; @@ -2155,7 +2159,16 @@ yyreduce: break; case 83: -#line 404 "a.y" +#line 403 "a.y" + { + (yyval.gen) = nullgen; + (yyval.gen).type = D_CONST; + (yyval.gen).offset = (yyvsp[(2) - (2)].lval); + } + break; + + case 84: +#line 409 "a.y" { (yyval.gen) = (yyvsp[(2) - (2)].gen); (yyval.gen).index = (yyvsp[(2) - (2)].gen).type; @@ -2168,8 +2181,8 @@ yyreduce: } break; - case 84: -#line 415 "a.y" + case 85: +#line 420 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_SCONST; @@ -2177,8 +2190,8 @@ yyreduce: } break; - case 85: -#line 421 "a.y" + case 86: +#line 426 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2186,8 +2199,8 @@ yyreduce: } break; - case 86: -#line 427 "a.y" + case 87: +#line 432 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2195,8 +2208,8 @@ yyreduce: } break; - case 87: -#line 433 "a.y" + case 88: +#line 438 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2204,8 +2217,8 @@ yyreduce: } break; - case 88: -#line 439 "a.y" + case 89: +#line 444 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2213,8 +2226,8 @@ yyreduce: } break; - case 91: -#line 451 "a.y" + case 92: +#line 456 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_NONE; @@ -2222,8 +2235,8 @@ yyreduce: } break; - case 92: -#line 457 "a.y" + case 93: +#line 462 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval); @@ -2231,8 +2244,8 @@ yyreduce: } break; - case 93: -#line 463 "a.y" + case 94: +#line 468 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_SP; @@ -2240,8 +2253,8 @@ yyreduce: } break; - case 94: -#line 469 "a.y" + case 95: +#line 474 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval); @@ -2249,8 +2262,8 @@ yyreduce: } break; - case 95: -#line 475 "a.y" + case 96: +#line 480 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_NONE; @@ -2261,8 +2274,8 @@ yyreduce: } break; - case 96: -#line 484 "a.y" + case 97: +#line 489 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval); @@ -2273,24 +2286,24 @@ yyreduce: } break; - case 97: -#line 493 "a.y" + case 98: +#line 498 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(2) - (3)].lval); } break; - case 98: -#line 498 "a.y" + case 99: +#line 503 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_SP; } break; - case 99: -#line 503 "a.y" + case 100: +#line 508 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_NONE; @@ -2300,8 +2313,8 @@ yyreduce: } break; - case 100: -#line 511 "a.y" + case 101: +#line 516 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(2) - (8)].lval); @@ -2311,15 +2324,15 @@ yyreduce: } break; - case 101: -#line 521 "a.y" + case 102: +#line 526 "a.y" { (yyval.gen) = (yyvsp[(1) - (1)].gen); } break; - case 102: -#line 525 "a.y" + case 103: +#line 530 "a.y" { (yyval.gen) = (yyvsp[(1) - (6)].gen); (yyval.gen).index = (yyvsp[(3) - (6)].lval); @@ -2328,8 +2341,8 @@ yyreduce: } break; - case 103: -#line 534 "a.y" + case 104: +#line 539 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = (yyvsp[(4) - (5)].lval); @@ -2338,8 +2351,8 @@ yyreduce: } break; - case 104: -#line 541 "a.y" + case 105: +#line 546 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_STATIC; @@ -2348,164 +2361,164 @@ yyreduce: } break; - case 105: -#line 549 "a.y" + case 106: +#line 554 "a.y" { (yyval.lval) = 0; } break; - case 106: -#line 553 "a.y" + case 107: +#line 558 "a.y" { (yyval.lval) = (yyvsp[(2) - (2)].lval); } break; - case 107: -#line 557 "a.y" + case 108: +#line 562 "a.y" { (yyval.lval) = -(yyvsp[(2) - (2)].lval); } break; - case 109: -#line 564 "a.y" + case 110: +#line 569 "a.y" { (yyval.lval) = D_AUTO; } break; - case 112: -#line 572 "a.y" + case 113: +#line 577 "a.y" { (yyval.lval) = (yyvsp[(1) - (1)].sym)->value; } break; - case 113: -#line 576 "a.y" + case 114: +#line 581 "a.y" { (yyval.lval) = -(yyvsp[(2) - (2)].lval); } break; - case 114: -#line 580 "a.y" + case 115: +#line 585 "a.y" { (yyval.lval) = (yyvsp[(2) - (2)].lval); } break; - case 115: -#line 584 "a.y" + case 116: +#line 589 "a.y" { (yyval.lval) = ~(yyvsp[(2) - (2)].lval); } break; - case 116: -#line 588 "a.y" + case 117: +#line 593 "a.y" { (yyval.lval) = (yyvsp[(2) - (3)].lval); } break; - case 117: -#line 594 "a.y" + case 118: +#line 599 "a.y" { (yyval.lval) = (yyvsp[(1) - (1)].lval) & 0xffffffffLL; } break; - case 118: -#line 598 "a.y" + case 119: +#line 603 "a.y" { (yyval.lval) = -(yyvsp[(2) - (2)].lval) & 0xffffffffLL; } break; - case 119: -#line 602 "a.y" + case 120: +#line 607 "a.y" { (yyval.lval) = ((yyvsp[(1) - (3)].lval) & 0xffffffffLL) + (((yyvsp[(3) - (3)].lval) & 0xffffLL) << 32); } break; - case 120: -#line 607 "a.y" + case 121: +#line 612 "a.y" { (yyval.lval) = (-(yyvsp[(2) - (4)].lval) & 0xffffffffLL) + (((yyvsp[(4) - (4)].lval) & 0xffffLL) << 32); } break; - case 122: -#line 615 "a.y" + case 123: +#line 620 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval); } break; - case 123: -#line 619 "a.y" + case 124: +#line 624 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval); } break; - case 124: -#line 623 "a.y" + case 125: +#line 628 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval); } break; - case 125: -#line 627 "a.y" + case 126: +#line 632 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval); } break; - case 126: -#line 631 "a.y" + case 127: +#line 636 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval); } break; - case 127: -#line 635 "a.y" + case 128: +#line 640 "a.y" { (yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval); } break; - case 128: -#line 639 "a.y" + case 129: +#line 644 "a.y" { (yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval); } break; - case 129: -#line 643 "a.y" + case 130: +#line 648 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval); } break; - case 130: -#line 647 "a.y" + case 131: +#line 652 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval); } break; - case 131: -#line 651 "a.y" + case 132: +#line 656 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval); } @@ -2513,7 +2526,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 2517 "y.tab.c" +#line 2530 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/src/cmd/6g/cgen.c b/src/cmd/6g/cgen.c index 465fc88f23..5d7f9042a4 100644 --- a/src/cmd/6g/cgen.c +++ b/src/cmd/6g/cgen.c @@ -575,6 +575,7 @@ agen(Node *n, Node *res) nodconst(&n2, types[TUINT32], v); gins(optoas(OCMP, types[TUINT32]), &n1, &n2); p1 = gbranch(optoas(OGT, types[TUINT32]), T); + expecttaken(p1, 1); ginscall(panicindex, 0); patch(p1, pc); } @@ -625,6 +626,7 @@ agen(Node *n, Node *res) } gins(optoas(OCMP, t), &n2, &n1); p1 = gbranch(optoas(OLT, t), T); + expecttaken(p1, 1); if(n5.op != OXXX) regfree(&n5); ginscall(panicindex, 0); diff --git a/src/cmd/6g/gg.h b/src/cmd/6g/gg.h index 265230da37..dcda601073 100644 --- a/src/cmd/6g/gg.h +++ b/src/cmd/6g/gg.h @@ -104,6 +104,7 @@ int componentgen(Node*, Node*); void clearp(Prog*); void proglist(void); Prog* gbranch(int, Type*); +void expecttaken(Prog*, int); Prog* prog(int); void gaddoffset(Node*); void gconv(int, int); diff --git a/src/cmd/6g/ggen.c b/src/cmd/6g/ggen.c index b861569456..00a88285ff 100644 --- a/src/cmd/6g/ggen.c +++ b/src/cmd/6g/ggen.c @@ -508,6 +508,7 @@ dodiv(int op, Node *nl, Node *nr, Node *res) nodconst(&n4, t, -1); gins(optoas(OCMP, t), &n3, &n4); p1 = gbranch(optoas(ONE, t), T); + expecttaken(p1, 1); nodconst(&n4, t, -1LL<<(t->width*8-1)); if(t->width == 8) { n5 = n4; @@ -516,6 +517,7 @@ dodiv(int op, Node *nl, Node *nr, Node *res) } gins(optoas(OCMP, t), &ax, &n4); p2 = gbranch(optoas(ONE, t), T); + expecttaken(p2, 1); if(op == ODIV) gmove(&n4, res); if(t->width == 8) @@ -943,6 +945,7 @@ cgen_shift(int op, int bounded, Node *nl, Node *nr, Node *res) nodconst(&n3, tcount, nl->type->width*8); gins(optoas(OCMP, tcount), &n1, &n3); p1 = gbranch(optoas(OLT, tcount), T); + expecttaken(p1, 1); if(op == ORSH && issigned[nl->type->etype]) { nodconst(&n3, types[TUINT32], nl->type->width*8-1); gins(a, &n3, &n2); @@ -1158,12 +1161,14 @@ cmpandthrow(Node *nl, Node *nr) regfree(&n1); if(throwpc == nil) { p1 = gbranch(optoas(op, t), T); + expecttaken(p1, 1); throwpc = pc; ginscall(panicslice, 0); patch(p1, pc); } else { op = brcom(op); p1 = gbranch(optoas(op, t), T); + expecttaken(p1, 0); patch(p1, throwpc); } } diff --git a/src/cmd/6g/gsubr.c b/src/cmd/6g/gsubr.c index 142bbe8671..c2937b5498 100644 --- a/src/cmd/6g/gsubr.c +++ b/src/cmd/6g/gsubr.c @@ -117,6 +117,16 @@ gbranch(int as, Type *t) return p; } +/* + * mark branch as expected taken or not. + */ +void +expecttaken(Prog *p, int taken) +{ + p->from.type = D_CONST; + p->from.offset = taken; +} + /* * patch previous branch to jump to to. */ @@ -2120,6 +2130,7 @@ oindex: } gins(optoas(OCMP, t), reg1, &n2); p1 = gbranch(optoas(OLT, t), T); + expecttaken(p1, 1); if(n4.op != OXXX) regfree(&n4); ginscall(panicindex, 0); @@ -2229,6 +2240,7 @@ oindex_const_sudo: p1 = gins(optoas(OCMP, types[TUINT32]), N, &n2); p1->from = *a; p1 = gbranch(optoas(OGT, types[TUINT32]), T); + expecttaken(p1, 1); ginscall(panicindex, 0); patch(p1, pc); a->offset -= Array_nel; diff --git a/src/cmd/6l/optab.c b/src/cmd/6l/optab.c index 3254c46527..717d083e99 100644 --- a/src/cmd/6l/optab.c +++ b/src/cmd/6l/optab.c @@ -314,7 +314,9 @@ uchar yscond[] = }; uchar yjcond[] = { - Ynone, Ybr, Zbr, 1, + Ynone, Ybr, Zbr, 0, + Yi0, Ybr, Zbr, 0, + Yi1, Ybr, Zbr, 1, 0 }; uchar yloop[] = diff --git a/src/cmd/6l/pass.c b/src/cmd/6l/pass.c index 9bc7d178b8..ecbebbbdc7 100644 --- a/src/cmd/6l/pass.c +++ b/src/cmd/6l/pass.c @@ -192,12 +192,25 @@ loop: * recurse to follow one path. * continue loop on the other. */ - q = brchain(p->link); - if(q != P && q->mark) - if(a != ALOOP) { - p->as = relinv(a); - p->link = p->pcond; - p->pcond = q; + if(p->from.type == D_CONST) { + if(p->from.offset == 1) { + /* + * expect conditional jump to be taken. + * rewrite so that's the fall-through case. + */ + p->as = relinv(a); + q = p->link; + p->link = p->pcond; + p->pcond = q; + } + } else { + q = brchain(p->link); + if(q != P && q->mark) + if(a != ALOOP) { + p->as = relinv(a); + p->link = p->pcond; + p->pcond = q; + } } xfol(p->link, last); q = brchain(p->pcond); @@ -405,7 +418,7 @@ dostkoff(void) for(cursym = textp; cursym != nil; cursym = cursym->next) { if(cursym->text == nil || cursym->text->link == nil) - continue; + continue; p = cursym->text; parsetextconst(p->to.offset); @@ -413,6 +426,14 @@ dostkoff(void) if(autoffset < 0) autoffset = 0; + if(autoffset < StackSmall && !(p->from.scale & NOSPLIT)) { + for(q = p; q != P; q = q->link) + if(q->as == ACALL) + goto noleaf; + p->from.scale |= NOSPLIT; + noleaf:; + } + q = P; if((p->from.scale & NOSPLIT) && autoffset >= StackSmall) diag("nosplit func likely to overflow stack"); diff --git a/src/cmd/8a/a.y b/src/cmd/8a/a.y index f1881808fe..cf2855977d 100644 --- a/src/cmd/8a/a.y +++ b/src/cmd/8a/a.y @@ -177,6 +177,11 @@ nonrel: $$.from = nullgen; $$.to = $1; } +| imm ',' rel + { + $$.from = $1; + $$.to = $3; + } spec1: /* DATA */ nam '/' con ',' imm diff --git a/src/cmd/8a/y.tab.c b/src/cmd/8a/y.tab.c index ccd3a25632..56bb9e8989 100644 --- a/src/cmd/8a/y.tab.c +++ b/src/cmd/8a/y.tab.c @@ -1,23 +1,24 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + 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 - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + 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 part or all of the Bison parser skeleton and distribute that work @@ -28,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -46,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -54,50 +55,11 @@ /* Pure parsers. */ #define YYPURE 0 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 0 -/* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 31 "a.y" - -#include -#include /* if we don't, bison will, and a.h re-#defines getc */ -#include -#include "a.h" - - -/* Line 189 of yacc.c */ -#line 81 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -167,13 +129,37 @@ +/* Copy the first part of user declarations. */ +#line 31 "a.y" + +#include +#include /* if we don't, bison will, and a.h re-#defines getc */ +#include +#include "a.h" + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 214 of yacc.c */ #line 37 "a.y" - +{ Sym *sym; int32 lval; struct { @@ -184,23 +170,22 @@ typedef union YYSTYPE char sval[8]; Gen gen; Gen2 gen2; - - - -/* Line 214 of yacc.c */ -#line 192 "y.tab.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 193 of yacc.c. */ +#line 176 "y.tab.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif + /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 204 "y.tab.c" +/* Line 216 of yacc.c. */ +#line 189 "y.tab.c" #ifdef short # undef short @@ -250,7 +235,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -275,14 +260,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -363,9 +348,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -399,12 +384,12 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -415,16 +400,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 483 +#define YYLAST 514 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 49 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 37 /* YYNRULES -- Number of rules. */ -#define YYNRULES 124 +#define YYNRULES 125 /* YYNRULES -- Number of states. */ -#define YYNSTATES 244 +#define YYNSTATES 247 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -475,16 +460,16 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 4, 5, 9, 10, 15, 16, 21, 23, 26, 29, 33, 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 80, - 82, 86, 90, 93, 95, 98, 100, 103, 105, 111, - 115, 121, 124, 126, 129, 131, 133, 137, 143, 147, - 153, 156, 158, 162, 166, 172, 174, 176, 178, 180, - 183, 186, 188, 190, 192, 194, 196, 201, 204, 207, - 209, 211, 213, 215, 217, 220, 223, 226, 229, 234, - 240, 244, 247, 249, 252, 256, 261, 263, 265, 267, - 272, 277, 284, 294, 298, 302, 307, 313, 322, 324, - 331, 337, 345, 346, 349, 352, 354, 356, 358, 360, - 362, 365, 368, 371, 375, 377, 381, 385, 389, 393, - 397, 402, 407, 411, 415 + 82, 86, 90, 93, 95, 98, 100, 103, 105, 109, + 115, 119, 125, 128, 130, 133, 135, 137, 141, 147, + 151, 157, 160, 162, 166, 170, 176, 178, 180, 182, + 184, 187, 190, 192, 194, 196, 198, 200, 205, 208, + 211, 213, 215, 217, 219, 221, 224, 227, 230, 233, + 238, 244, 248, 251, 253, 256, 260, 265, 267, 269, + 271, 276, 281, 288, 298, 302, 306, 311, 317, 326, + 328, 335, 341, 349, 350, 353, 356, 358, 360, 362, + 364, 366, 369, 372, 375, 379, 381, 385, 389, 393, + 397, 401, 406, 411, 415, 419 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -500,38 +485,39 @@ static const yytype_int8 yyrhs[] = 24, 67, -1, 25, 68, -1, 26, 69, -1, -1, 44, -1, 72, 44, 70, -1, 70, 44, 72, -1, 72, 44, -1, 72, -1, 44, 70, -1, 70, -1, - 44, 73, -1, 73, -1, 81, 11, 84, 44, 75, - -1, 78, 44, 76, -1, 78, 44, 84, 44, 76, - -1, 44, 71, -1, 71, -1, 10, 81, -1, 56, - -1, 60, -1, 72, 44, 70, -1, 72, 44, 70, - 41, 32, -1, 72, 44, 70, -1, 72, 44, 70, - 41, 33, -1, 72, 44, -1, 72, -1, 72, 44, - 70, -1, 78, 44, 75, -1, 78, 44, 84, 44, - 75, -1, 74, -1, 78, -1, 73, -1, 80, -1, - 10, 74, -1, 10, 79, -1, 74, -1, 79, -1, - 75, -1, 70, -1, 75, -1, 84, 45, 29, 46, - -1, 38, 82, -1, 39, 82, -1, 31, -1, 34, - -1, 32, -1, 37, -1, 33, -1, 47, 84, -1, - 47, 81, -1, 47, 36, -1, 47, 35, -1, 47, - 45, 35, 46, -1, 47, 45, 9, 35, 46, -1, - 47, 9, 35, -1, 47, 77, -1, 27, -1, 9, - 27, -1, 27, 9, 27, -1, 9, 27, 9, 27, - -1, 79, -1, 80, -1, 84, -1, 84, 45, 32, - 46, -1, 84, 45, 37, 46, -1, 84, 45, 32, - 10, 84, 46, -1, 84, 45, 32, 46, 45, 32, - 10, 84, 46, -1, 45, 32, 46, -1, 45, 37, - 46, -1, 84, 45, 33, 46, -1, 45, 32, 10, - 84, 46, -1, 45, 32, 46, 45, 32, 10, 84, - 46, -1, 81, -1, 81, 45, 32, 10, 84, 46, - -1, 38, 82, 45, 83, 46, -1, 38, 6, 7, - 82, 45, 30, 46, -1, -1, 8, 84, -1, 9, - 84, -1, 30, -1, 37, -1, 28, -1, 27, -1, - 40, -1, 9, 84, -1, 8, 84, -1, 48, 84, - -1, 45, 85, 46, -1, 84, -1, 85, 8, 85, - -1, 85, 9, 85, -1, 85, 10, 85, -1, 85, - 11, 85, -1, 85, 12, 85, -1, 85, 6, 6, - 85, -1, 85, 7, 7, 85, -1, 85, 5, 85, - -1, 85, 4, 85, -1, 85, 3, 85, -1 + 44, 73, -1, 73, -1, 75, 44, 73, -1, 81, + 11, 84, 44, 75, -1, 78, 44, 76, -1, 78, + 44, 84, 44, 76, -1, 44, 71, -1, 71, -1, + 10, 81, -1, 56, -1, 60, -1, 72, 44, 70, + -1, 72, 44, 70, 41, 32, -1, 72, 44, 70, + -1, 72, 44, 70, 41, 33, -1, 72, 44, -1, + 72, -1, 72, 44, 70, -1, 78, 44, 75, -1, + 78, 44, 84, 44, 75, -1, 74, -1, 78, -1, + 73, -1, 80, -1, 10, 74, -1, 10, 79, -1, + 74, -1, 79, -1, 75, -1, 70, -1, 75, -1, + 84, 45, 29, 46, -1, 38, 82, -1, 39, 82, + -1, 31, -1, 34, -1, 32, -1, 37, -1, 33, + -1, 47, 84, -1, 47, 81, -1, 47, 36, -1, + 47, 35, -1, 47, 45, 35, 46, -1, 47, 45, + 9, 35, 46, -1, 47, 9, 35, -1, 47, 77, + -1, 27, -1, 9, 27, -1, 27, 9, 27, -1, + 9, 27, 9, 27, -1, 79, -1, 80, -1, 84, + -1, 84, 45, 32, 46, -1, 84, 45, 37, 46, + -1, 84, 45, 32, 10, 84, 46, -1, 84, 45, + 32, 46, 45, 32, 10, 84, 46, -1, 45, 32, + 46, -1, 45, 37, 46, -1, 84, 45, 33, 46, + -1, 45, 32, 10, 84, 46, -1, 45, 32, 46, + 45, 32, 10, 84, 46, -1, 81, -1, 81, 45, + 32, 10, 84, 46, -1, 38, 82, 45, 83, 46, + -1, 38, 6, 7, 82, 45, 30, 46, -1, -1, + 8, 84, -1, 9, 84, -1, 30, -1, 37, -1, + 28, -1, 27, -1, 40, -1, 9, 84, -1, 8, + 84, -1, 48, 84, -1, 45, 85, 46, -1, 84, + -1, 85, 8, 85, -1, 85, 9, 85, -1, 85, + 10, 85, -1, 85, 11, 85, -1, 85, 12, 85, + -1, 85, 6, 6, 85, -1, 85, 7, 7, 85, + -1, 85, 5, 85, -1, 85, 4, 85, -1, 85, + 3, 85, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -540,16 +526,16 @@ static const yytype_uint16 yyrline[] = 0, 68, 68, 70, 69, 77, 76, 84, 83, 89, 90, 91, 94, 99, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 121, 125, - 132, 139, 146, 151, 158, 163, 170, 175, 182, 190, - 195, 203, 208, 213, 222, 223, 226, 231, 241, 246, - 256, 261, 266, 273, 278, 286, 287, 290, 291, 292, - 296, 300, 301, 302, 305, 306, 309, 315, 324, 333, - 338, 343, 348, 353, 360, 366, 377, 383, 389, 395, - 401, 409, 418, 423, 428, 433, 440, 441, 444, 450, - 456, 462, 471, 480, 485, 490, 496, 504, 514, 518, - 527, 534, 543, 546, 550, 556, 557, 561, 564, 565, - 569, 573, 577, 581, 587, 588, 592, 596, 600, 604, - 608, 612, 616, 620, 624 + 132, 139, 146, 151, 158, 163, 170, 175, 180, 187, + 195, 200, 208, 213, 218, 227, 228, 231, 236, 246, + 251, 261, 266, 271, 278, 283, 291, 292, 295, 296, + 297, 301, 305, 306, 307, 310, 311, 314, 320, 329, + 338, 343, 348, 353, 358, 365, 371, 382, 388, 394, + 400, 406, 414, 423, 428, 433, 438, 445, 446, 449, + 455, 461, 467, 476, 485, 490, 495, 501, 509, 519, + 523, 532, 539, 548, 551, 555, 561, 562, 566, 569, + 570, 574, 578, 582, 586, 592, 593, 597, 601, 605, + 609, 613, 617, 621, 625, 629 }; #endif @@ -564,11 +550,11 @@ static const char *const yytname[] = "LTYPEM", "LTYPEI", "LTYPEG", "LCONST", "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LFREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB", "LVAR", "':'", "';'", "'='", "','", "'('", "')'", "'$'", "'~'", - "$accept", "prog", "$@1", "line", "$@2", "$@3", "inst", "nonnon", - "rimrem", "remrim", "rimnon", "nonrem", "nonrel", "spec1", "spec2", - "spec3", "spec4", "spec5", "spec6", "spec7", "spec8", "rem", "rom", - "rim", "rel", "reg", "imm", "imm2", "con2", "mem", "omem", "nmem", "nam", - "offset", "pointer", "con", "expr", 0 + "$accept", "prog", "@1", "line", "@2", "@3", "inst", "nonnon", "rimrem", + "remrim", "rimnon", "nonrem", "nonrel", "spec1", "spec2", "spec3", + "spec4", "spec5", "spec6", "spec7", "spec8", "rem", "rom", "rim", "rel", + "reg", "imm", "imm2", "con2", "mem", "omem", "nmem", "nam", "offset", + "pointer", "con", "expr", 0 }; #endif @@ -591,16 +577,16 @@ static const yytype_uint8 yyr1[] = 0, 49, 50, 51, 50, 53, 52, 54, 52, 52, 52, 52, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, - 57, 58, 59, 59, 60, 60, 61, 61, 62, 63, - 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, - 68, 68, 68, 69, 69, 70, 70, 71, 71, 71, - 71, 71, 71, 71, 72, 72, 73, 73, 73, 74, - 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, - 75, 76, 77, 77, 77, 77, 78, 78, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, - 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, - 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85 + 57, 58, 59, 59, 60, 60, 61, 61, 61, 62, + 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, + 67, 68, 68, 68, 69, 69, 70, 70, 71, 71, + 71, 71, 71, 71, 71, 72, 72, 73, 73, 73, + 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, + 75, 75, 76, 77, 77, 77, 77, 78, 78, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, + 80, 81, 81, 82, 82, 82, 83, 83, 83, 84, + 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -609,16 +595,16 @@ static const yytype_uint8 yyr2[] = 0, 2, 0, 0, 3, 0, 4, 0, 4, 1, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, - 3, 3, 2, 1, 2, 1, 2, 1, 5, 3, - 5, 2, 1, 2, 1, 1, 3, 5, 3, 5, - 2, 1, 3, 3, 5, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 4, 2, 2, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 4, 5, - 3, 2, 1, 2, 3, 4, 1, 1, 1, 4, - 4, 6, 9, 3, 3, 4, 5, 8, 1, 6, - 5, 7, 0, 2, 2, 1, 1, 1, 1, 1, - 2, 2, 2, 3, 1, 3, 3, 3, 3, 3, - 4, 4, 3, 3, 3 + 3, 3, 2, 1, 2, 1, 2, 1, 3, 5, + 3, 5, 2, 1, 2, 1, 1, 3, 5, 3, + 5, 2, 1, 3, 3, 5, 1, 1, 1, 1, + 2, 2, 1, 1, 1, 1, 1, 4, 2, 2, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, + 5, 3, 2, 1, 2, 3, 4, 1, 1, 1, + 4, 4, 6, 9, 3, 3, 4, 5, 8, 1, + 6, 5, 7, 0, 2, 2, 1, 1, 1, 1, + 1, 2, 2, 2, 3, 1, 3, 3, 3, 3, + 3, 4, 4, 3, 3, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -629,78 +615,78 @@ static const yytype_uint8 yydefact[] = 2, 3, 1, 0, 0, 28, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 4, 0, 11, 29, 14, 0, 0, - 108, 69, 71, 73, 70, 72, 102, 109, 0, 0, - 0, 15, 35, 55, 56, 86, 87, 98, 88, 0, - 16, 64, 33, 65, 17, 0, 18, 0, 0, 102, - 102, 0, 22, 42, 57, 61, 63, 62, 58, 88, - 20, 0, 29, 44, 45, 23, 102, 0, 0, 19, - 37, 0, 21, 0, 24, 0, 25, 0, 26, 51, - 27, 0, 7, 0, 5, 0, 10, 111, 110, 0, - 0, 0, 0, 34, 0, 0, 114, 0, 112, 0, - 0, 0, 77, 76, 0, 75, 74, 32, 0, 0, - 59, 60, 43, 67, 68, 0, 41, 0, 0, 67, - 36, 0, 0, 0, 0, 50, 0, 0, 12, 0, - 13, 102, 103, 104, 0, 0, 93, 94, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, - 0, 0, 0, 80, 0, 0, 30, 31, 0, 0, - 0, 39, 0, 46, 48, 52, 53, 0, 8, 6, - 0, 107, 105, 106, 0, 0, 0, 124, 123, 122, - 0, 0, 115, 116, 117, 118, 119, 0, 0, 89, - 95, 90, 0, 78, 66, 0, 0, 82, 81, 0, - 0, 0, 0, 0, 100, 96, 0, 120, 121, 0, - 0, 0, 79, 38, 83, 0, 40, 47, 49, 54, - 0, 0, 99, 91, 0, 0, 84, 101, 0, 0, - 85, 97, 0, 92 + 109, 70, 72, 74, 71, 73, 103, 110, 0, 0, + 0, 15, 35, 56, 57, 87, 88, 99, 89, 0, + 16, 65, 33, 66, 17, 0, 18, 0, 0, 103, + 103, 0, 22, 43, 58, 62, 64, 63, 59, 89, + 20, 0, 29, 45, 46, 23, 103, 0, 0, 19, + 37, 0, 0, 21, 0, 24, 0, 25, 0, 26, + 52, 27, 0, 7, 0, 5, 0, 10, 112, 111, + 0, 0, 0, 0, 34, 0, 0, 115, 0, 113, + 0, 0, 0, 78, 77, 0, 76, 75, 32, 0, + 0, 60, 61, 44, 68, 69, 0, 42, 0, 0, + 68, 36, 0, 0, 0, 0, 0, 51, 0, 0, + 12, 0, 13, 103, 104, 105, 0, 0, 94, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 114, 0, 0, 0, 0, 81, 0, 0, 30, 31, + 0, 0, 38, 0, 40, 0, 47, 49, 53, 54, + 0, 8, 6, 0, 108, 106, 107, 0, 0, 0, + 125, 124, 123, 0, 0, 116, 117, 118, 119, 120, + 0, 0, 90, 96, 91, 0, 79, 67, 0, 0, + 83, 82, 0, 0, 0, 0, 0, 101, 97, 0, + 121, 122, 0, 0, 0, 80, 39, 84, 0, 41, + 48, 50, 55, 0, 0, 100, 92, 0, 0, 85, + 102, 0, 0, 86, 98, 0, 93 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 3, 23, 139, 137, 24, 27, 54, 56, - 50, 41, 79, 70, 82, 62, 75, 84, 86, 88, - 90, 51, 63, 52, 64, 43, 53, 171, 208, 44, - 45, 46, 47, 102, 184, 48, 107 + -1, 1, 3, 23, 141, 139, 24, 27, 54, 56, + 50, 41, 79, 70, 83, 62, 75, 85, 87, 89, + 91, 51, 63, 52, 64, 43, 53, 174, 211, 44, + 45, 46, 47, 103, 187, 48, 108 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -107 +#define YYPACT_NINF -63 static const yytype_int16 yypact[] = { - -107, 9, -107, 151, -28, -19, 235, 255, 255, 302, - 175, 6, 282, 34, 363, 255, 255, 255, 363, -3, - -6, 5, -107, -107, 4, -107, -107, -107, 373, 373, - -107, -107, -107, -107, -107, -107, 128, -107, 302, 343, - 373, -107, -107, -107, -107, -107, -107, 17, 19, 115, - -107, -107, 15, -107, -107, 27, -107, 42, 302, 128, - 72, 208, -107, -107, -107, -107, -107, -107, -107, 52, - -107, 44, 302, -107, -107, -107, 72, 359, 373, -107, - -107, 55, -107, 71, -107, 76, -107, 81, -107, 84, - -107, 97, -107, 373, -107, 373, -107, -107, -107, 142, - 373, 373, 114, -107, 1, 116, -107, 102, -107, 129, - 66, 385, -107, -107, 387, -107, -107, -107, 302, 255, - -107, -107, -107, 114, -107, 329, -107, 168, 373, -107, - -107, 149, 18, 302, 302, 302, 397, 151, 447, 151, - 447, 72, -107, -107, 47, 373, 134, -107, 373, 373, - 373, 176, 179, 373, 373, 373, 373, 373, -107, 182, - 3, 148, 152, -107, 401, 153, -107, -107, 158, 166, - 14, -107, 167, 154, 189, -107, -107, 187, -107, -107, - 188, -107, -107, -107, 186, 190, 202, 456, 464, 471, - 373, 373, 146, 146, -107, -107, -107, 373, 373, 192, - -107, -107, 203, -107, -107, 191, 223, 242, -107, 205, - 222, 224, 191, 228, -107, -107, 249, 216, 216, 214, - 215, 233, -107, -107, 261, 244, -107, -107, -107, -107, - 230, 373, -107, -107, 264, 250, -107, -107, 232, 373, - -107, -107, 238, -107 + -63, 15, -63, 154, -17, 9, 238, 258, 258, 305, + 178, 6, 285, 343, 401, 258, 258, 258, 401, 42, + 13, -8, -63, -63, 21, -63, -63, -63, 451, 451, + -63, -63, -63, -63, -63, -63, 34, -63, 305, 366, + 451, -63, -63, -63, -63, -63, -63, 19, 24, 359, + -63, -63, 26, -63, -63, 38, -63, 43, 305, 34, + 41, 211, -63, -63, -63, -63, -63, -63, -63, 53, + -63, 92, 305, -63, -63, -63, 41, 392, 451, -63, + -63, 60, 71, -63, 73, -63, 76, -63, 82, -63, + 83, -63, 89, -63, 451, -63, 451, -63, -63, -63, + 131, 451, 451, 94, -63, 0, 97, -63, 69, -63, + 112, -6, 407, -63, -63, 416, -63, -63, -63, 305, + 258, -63, -63, -63, 94, -63, 332, -63, 121, 451, + -63, -63, 392, 122, 155, 305, 305, 305, 418, 154, + 476, 154, 476, 41, -63, -63, 8, 451, 107, -63, + 451, 451, 451, 151, 152, 451, 451, 451, 451, 451, + -63, 150, 2, 115, 116, -63, 427, 119, -63, -63, + 120, 137, -63, 14, -63, 141, 148, 156, -63, -63, + 157, -63, -63, 153, -63, -63, -63, 158, 161, 176, + 102, 495, 502, 451, 451, 49, 49, -63, -63, -63, + 451, 451, 168, -63, -63, 187, -63, -63, 167, 207, + 226, -63, 189, 205, 206, 167, 210, -63, -63, 231, + 219, 219, 208, 209, 220, -63, -63, 244, 230, -63, + -63, -63, -63, 214, 451, -63, -63, 251, 235, -63, + -63, 217, 451, -63, -63, 218, -63 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -107, -107, -107, -106, -107, -107, -107, 269, -107, -107, - -107, 273, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -2, 236, 0, -1, -8, -9, 85, -107, 10, - -4, -5, 11, -39, -107, -10, -61 + -63, -63, -63, -40, -63, -63, -63, 256, -63, -63, + -63, 261, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -1, 213, 5, -11, -3, -9, 65, -63, 10, + 4, -4, -2, -43, -63, -10, -62 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -710,108 +696,114 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 69, 66, 65, 81, 42, 68, 67, 57, 55, 2, - 42, 145, 80, 198, 25, 85, 87, 89, 97, 98, - 123, 124, 71, 206, 83, 26, 28, 29, 91, 106, - 108, 178, 138, 179, 140, 94, 103, 129, 92, 116, - 93, 207, 28, 29, 36, 30, 96, 146, 95, 199, - 120, 69, 66, 65, 121, 128, 68, 67, 37, 117, - 115, 30, 109, 78, 110, 170, 40, 81, 106, 122, - 103, 118, 76, 60, 37, 181, 130, 182, 77, 78, - 100, 101, 40, 106, 183, 106, 119, 187, 188, 189, - 142, 143, 192, 193, 194, 195, 196, 127, 160, 161, - 131, 98, 180, 162, 106, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 132, 166, 120, 169, 167, - 133, 121, 172, 28, 111, 134, 177, 176, 135, 217, - 218, 173, 174, 175, 99, 185, 100, 101, 106, 106, - 106, 136, 30, 106, 106, 106, 106, 106, 158, 141, - 112, 113, 4, 36, 98, 37, 155, 156, 157, 144, - 114, 159, 147, 40, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 168, 186, - 106, 106, 190, 28, 29, 58, 191, 219, 220, 19, - 20, 21, 197, 22, 200, 210, 223, 168, 201, 203, - 160, 161, 30, 229, 204, 162, 31, 32, 33, 34, - 205, 209, 35, 59, 60, 37, 28, 29, 125, 61, - 39, 238, 49, 40, 153, 154, 155, 156, 157, 242, - 211, 212, 214, 213, 216, 30, 215, 221, 49, 31, - 32, 33, 34, 28, 29, 35, 59, 60, 37, 222, - 224, 225, 170, 39, 227, 49, 40, 228, 230, 231, - 232, 233, 30, 28, 29, 234, 31, 32, 33, 34, - 235, 236, 35, 36, 239, 37, 237, 240, 241, 38, - 39, 73, 30, 40, 243, 74, 31, 32, 33, 34, - 28, 29, 35, 36, 226, 37, 0, 126, 0, 0, - 39, 0, 49, 40, 0, 0, 0, 0, 0, 30, - 28, 29, 0, 31, 32, 33, 34, 0, 0, 35, - 36, 0, 37, 0, 0, 0, 72, 39, 0, 30, - 40, 0, 0, 31, 32, 33, 34, 28, 29, 35, - 36, 0, 37, 0, 0, 0, 0, 39, 0, 0, - 40, 28, 29, 0, 0, 0, 30, 0, 0, 0, - 31, 32, 33, 34, 0, 0, 35, 28, 29, 37, - 30, 28, 29, 0, 39, 104, 0, 40, 0, 0, - 105, 28, 29, 37, 0, 0, 30, 0, 78, 0, - 30, 40, 0, 28, 29, 28, 164, 76, 60, 37, - 30, 36, 0, 37, 78, 28, 29, 40, 39, 28, - 29, 40, 30, 37, 30, 0, 0, 0, 78, 0, - 163, 40, 165, 0, 30, 37, 0, 37, 30, 0, - 78, 0, 78, 40, 0, 40, 202, 37, 0, 0, - 0, 37, 78, 0, 49, 40, 78, 0, 0, 40, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 150, - 151, 152, 153, 154, 155, 156, 157, 151, 152, 153, - 154, 155, 156, 157 + 69, 66, 80, 82, 81, 42, 68, 65, 57, 71, + 147, 42, 201, 55, 67, 2, 124, 125, 98, 99, + 86, 88, 90, 209, 84, 25, 162, 163, 92, 107, + 109, 164, 140, 130, 142, 96, 184, 104, 185, 117, + 100, 210, 101, 102, 36, 186, 148, 116, 202, 101, + 102, 69, 66, 26, 95, 121, 123, 68, 65, 157, + 158, 159, 122, 97, 110, 67, 131, 82, 107, 111, + 118, 104, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 119, 93, 107, 94, 107, 120, 190, 191, + 192, 144, 145, 195, 196, 197, 198, 199, 128, 181, + 183, 182, 99, 129, 132, 107, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 133, 134, 168, 171, + 135, 172, 82, 121, 175, 169, 136, 137, 180, 179, + 122, 220, 221, 138, 176, 177, 178, 188, 143, 146, + 107, 107, 107, 149, 161, 107, 107, 107, 107, 107, + 170, 170, 189, 162, 163, 4, 99, 193, 164, 194, + 200, 203, 204, 28, 29, 206, 207, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 208, 30, 107, 107, 212, 28, 29, 58, 213, + 222, 223, 19, 20, 21, 37, 22, 214, 216, 226, + 78, 215, 173, 40, 217, 30, 232, 218, 219, 31, + 32, 33, 34, 224, 49, 35, 59, 60, 37, 28, + 29, 126, 61, 39, 241, 49, 40, 155, 156, 157, + 158, 159, 245, 225, 227, 228, 173, 230, 30, 231, + 233, 234, 31, 32, 33, 34, 28, 29, 35, 59, + 60, 37, 237, 238, 235, 236, 39, 239, 49, 40, + 240, 242, 243, 244, 246, 30, 28, 29, 73, 31, + 32, 33, 34, 74, 127, 35, 36, 229, 37, 0, + 0, 0, 38, 39, 0, 30, 40, 0, 0, 31, + 32, 33, 34, 28, 29, 35, 36, 0, 37, 0, + 0, 0, 0, 39, 0, 49, 40, 0, 0, 0, + 0, 0, 30, 28, 29, 0, 31, 32, 33, 34, + 0, 0, 35, 36, 0, 37, 0, 0, 0, 72, + 39, 0, 30, 40, 0, 0, 31, 32, 33, 34, + 28, 29, 35, 36, 0, 37, 0, 0, 0, 0, + 39, 28, 29, 40, 0, 0, 0, 0, 0, 30, + 0, 0, 0, 31, 32, 33, 34, 28, 112, 35, + 30, 0, 37, 0, 28, 29, 0, 39, 0, 0, + 40, 76, 60, 37, 0, 0, 30, 77, 78, 0, + 49, 40, 0, 30, 113, 114, 0, 36, 105, 37, + 28, 29, 0, 106, 115, 0, 37, 40, 0, 28, + 29, 78, 0, 0, 40, 28, 29, 0, 0, 30, + 0, 0, 0, 0, 28, 166, 28, 29, 30, 0, + 76, 60, 37, 0, 30, 28, 29, 78, 0, 36, + 40, 37, 165, 30, 0, 30, 39, 37, 0, 40, + 0, 167, 78, 0, 30, 40, 37, 0, 37, 28, + 29, 78, 205, 78, 40, 49, 40, 37, 0, 0, + 0, 0, 78, 0, 0, 40, 0, 0, 30, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, + 0, 37, 0, 0, 0, 0, 78, 0, 0, 40, + 152, 153, 154, 155, 156, 157, 158, 159, 153, 154, + 155, 156, 157, 158, 159 }; static const yytype_int16 yycheck[] = { - 10, 10, 10, 13, 6, 10, 10, 9, 8, 0, - 12, 10, 13, 10, 42, 15, 16, 17, 28, 29, - 59, 60, 11, 9, 14, 44, 8, 9, 18, 39, - 40, 137, 93, 139, 95, 41, 38, 76, 41, 49, - 43, 27, 8, 9, 38, 27, 42, 46, 43, 46, - 58, 61, 61, 61, 58, 11, 61, 61, 40, 44, - 49, 27, 45, 45, 45, 47, 48, 77, 78, 58, - 72, 44, 38, 39, 40, 28, 77, 30, 44, 45, - 8, 9, 48, 93, 37, 95, 44, 148, 149, 150, - 100, 101, 153, 154, 155, 156, 157, 45, 32, 33, - 45, 111, 141, 37, 114, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 44, 118, 125, 128, 119, - 44, 125, 132, 8, 9, 44, 136, 136, 44, 190, - 191, 133, 134, 135, 6, 145, 8, 9, 148, 149, - 150, 44, 27, 153, 154, 155, 156, 157, 46, 7, - 35, 36, 1, 38, 164, 40, 10, 11, 12, 45, - 45, 32, 46, 48, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 29, 45, - 190, 191, 6, 8, 9, 10, 7, 197, 198, 38, - 39, 40, 10, 42, 46, 41, 205, 29, 46, 46, - 32, 33, 27, 212, 46, 37, 31, 32, 33, 34, - 44, 44, 37, 38, 39, 40, 8, 9, 10, 44, - 45, 231, 47, 48, 8, 9, 10, 11, 12, 239, - 41, 44, 46, 45, 32, 27, 46, 45, 47, 31, - 32, 33, 34, 8, 9, 37, 38, 39, 40, 46, - 27, 9, 47, 45, 32, 47, 48, 33, 30, 10, - 46, 46, 27, 8, 9, 32, 31, 32, 33, 34, - 9, 27, 37, 38, 10, 40, 46, 27, 46, 44, - 45, 12, 27, 48, 46, 12, 31, 32, 33, 34, - 8, 9, 37, 38, 209, 40, -1, 61, -1, -1, - 45, -1, 47, 48, -1, -1, -1, -1, -1, 27, - 8, 9, -1, 31, 32, 33, 34, -1, -1, 37, - 38, -1, 40, -1, -1, -1, 44, 45, -1, 27, - 48, -1, -1, 31, 32, 33, 34, 8, 9, 37, - 38, -1, 40, -1, -1, -1, -1, 45, -1, -1, - 48, 8, 9, -1, -1, -1, 27, -1, -1, -1, - 31, 32, 33, 34, -1, -1, 37, 8, 9, 40, - 27, 8, 9, -1, 45, 32, -1, 48, -1, -1, - 37, 8, 9, 40, -1, -1, 27, -1, 45, -1, - 27, 48, -1, 8, 9, 8, 9, 38, 39, 40, - 27, 38, -1, 40, 45, 8, 9, 48, 45, 8, - 9, 48, 27, 40, 27, -1, -1, -1, 45, -1, - 35, 48, 35, -1, 27, 40, -1, 40, 27, -1, - 45, -1, 45, 48, -1, 48, 35, 40, -1, -1, - -1, 40, 45, -1, 47, 48, 45, -1, -1, 48, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, - 6, 7, 8, 9, 10, 11, 12, 6, 7, 8, - 9, 10, 11, 12 + 10, 10, 13, 13, 13, 6, 10, 10, 9, 11, + 10, 12, 10, 8, 10, 0, 59, 60, 28, 29, + 15, 16, 17, 9, 14, 42, 32, 33, 18, 39, + 40, 37, 94, 76, 96, 43, 28, 38, 30, 49, + 6, 27, 8, 9, 38, 37, 46, 49, 46, 8, + 9, 61, 61, 44, 41, 58, 58, 61, 61, 10, + 11, 12, 58, 42, 45, 61, 77, 77, 78, 45, + 44, 72, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 44, 41, 94, 43, 96, 44, 150, 151, + 152, 101, 102, 155, 156, 157, 158, 159, 45, 139, + 143, 141, 112, 11, 44, 115, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 46, 45, 44, 119, 129, + 44, 132, 132, 126, 134, 120, 44, 44, 138, 138, + 126, 193, 194, 44, 135, 136, 137, 147, 7, 45, + 150, 151, 152, 46, 32, 155, 156, 157, 158, 159, + 29, 29, 45, 32, 33, 1, 166, 6, 37, 7, + 10, 46, 46, 8, 9, 46, 46, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 44, 27, 193, 194, 44, 8, 9, 10, 41, + 200, 201, 38, 39, 40, 40, 42, 41, 45, 208, + 45, 44, 47, 48, 46, 27, 215, 46, 32, 31, + 32, 33, 34, 45, 47, 37, 38, 39, 40, 8, + 9, 10, 44, 45, 234, 47, 48, 8, 9, 10, + 11, 12, 242, 46, 27, 9, 47, 32, 27, 33, + 30, 10, 31, 32, 33, 34, 8, 9, 37, 38, + 39, 40, 32, 9, 46, 46, 45, 27, 47, 48, + 46, 10, 27, 46, 46, 27, 8, 9, 12, 31, + 32, 33, 34, 12, 61, 37, 38, 212, 40, -1, + -1, -1, 44, 45, -1, 27, 48, -1, -1, 31, + 32, 33, 34, 8, 9, 37, 38, -1, 40, -1, + -1, -1, -1, 45, -1, 47, 48, -1, -1, -1, + -1, -1, 27, 8, 9, -1, 31, 32, 33, 34, + -1, -1, 37, 38, -1, 40, -1, -1, -1, 44, + 45, -1, 27, 48, -1, -1, 31, 32, 33, 34, + 8, 9, 37, 38, -1, 40, -1, -1, -1, -1, + 45, 8, 9, 48, -1, -1, -1, -1, -1, 27, + -1, -1, -1, 31, 32, 33, 34, 8, 9, 37, + 27, -1, 40, -1, 8, 9, -1, 45, -1, -1, + 48, 38, 39, 40, -1, -1, 27, 44, 45, -1, + 47, 48, -1, 27, 35, 36, -1, 38, 32, 40, + 8, 9, -1, 37, 45, -1, 40, 48, -1, 8, + 9, 45, -1, -1, 48, 8, 9, -1, -1, 27, + -1, -1, -1, -1, 8, 9, 8, 9, 27, -1, + 38, 39, 40, -1, 27, 8, 9, 45, -1, 38, + 48, 40, 35, 27, -1, 27, 45, 40, -1, 48, + -1, 35, 45, -1, 27, 48, 40, -1, 40, 8, + 9, 45, 35, 45, 48, 47, 48, 40, -1, -1, + -1, -1, 45, -1, -1, 48, -1, -1, 27, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, + -1, 40, -1, -1, -1, -1, 45, -1, -1, 48, + 5, 6, 7, 8, 9, 10, 11, 12, 6, 7, + 8, 9, 10, 11, 12 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -826,23 +818,23 @@ static const yytype_uint8 yystos[] = 59, 70, 72, 75, 57, 72, 58, 70, 10, 38, 39, 44, 64, 71, 73, 74, 75, 79, 80, 84, 62, 81, 44, 56, 60, 65, 38, 44, 45, 61, - 73, 84, 63, 78, 66, 72, 67, 72, 68, 72, - 69, 78, 41, 43, 41, 43, 42, 84, 84, 6, - 8, 9, 82, 70, 32, 37, 84, 85, 84, 45, - 45, 9, 35, 36, 45, 81, 84, 44, 44, 44, - 74, 79, 81, 82, 82, 10, 71, 45, 11, 82, - 73, 45, 44, 44, 44, 44, 44, 54, 85, 53, - 85, 7, 84, 84, 45, 10, 46, 46, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 46, 32, - 32, 33, 37, 35, 9, 35, 70, 72, 29, 84, - 47, 76, 84, 70, 70, 70, 75, 84, 52, 52, - 82, 28, 30, 37, 83, 84, 45, 85, 85, 85, - 6, 7, 85, 85, 85, 85, 85, 10, 10, 46, - 46, 46, 35, 46, 46, 44, 9, 27, 77, 44, - 41, 41, 44, 45, 46, 46, 32, 85, 85, 84, - 84, 45, 46, 75, 27, 9, 76, 32, 33, 75, - 30, 10, 46, 46, 32, 9, 27, 46, 84, 10, - 27, 46, 84, 46 + 73, 75, 84, 63, 78, 66, 72, 67, 72, 68, + 72, 69, 78, 41, 43, 41, 43, 42, 84, 84, + 6, 8, 9, 82, 70, 32, 37, 84, 85, 84, + 45, 45, 9, 35, 36, 45, 81, 84, 44, 44, + 44, 74, 79, 81, 82, 82, 10, 71, 45, 11, + 82, 73, 44, 45, 44, 44, 44, 44, 44, 54, + 85, 53, 85, 7, 84, 84, 45, 10, 46, 46, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 46, 32, 32, 33, 37, 35, 9, 35, 70, 72, + 29, 84, 73, 47, 76, 84, 70, 70, 70, 75, + 84, 52, 52, 82, 28, 30, 37, 83, 84, 45, + 85, 85, 85, 6, 7, 85, 85, 85, 85, 85, + 10, 10, 46, 46, 46, 35, 46, 46, 44, 9, + 27, 77, 44, 41, 41, 44, 45, 46, 46, 32, + 85, 85, 84, 84, 45, 46, 75, 27, 9, 76, + 32, 33, 75, 30, 10, 46, 46, 32, 9, 27, + 46, 84, 10, 27, 46, 84, 46 }; #define yyerrok (yyerrstatus = 0) @@ -916,7 +908,7 @@ while (YYID (0)) we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -1027,20 +1019,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1074,11 +1063,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1358,8 +1347,10 @@ yydestruct (yymsg, yytype, yyvaluep) break; } } + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1375,10 +1366,11 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ -/* The lookahead symbol. */ + +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1386,9 +1378,9 @@ int yynerrs; -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1412,68 +1404,66 @@ yyparse () #endif #endif { + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - YYSIZE_T yystacksize; +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; @@ -1503,6 +1493,7 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1510,6 +1501,7 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -1532,8 +1524,9 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1544,6 +1537,7 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1553,9 +1547,6 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -1564,16 +1555,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1605,16 +1596,20 @@ yybackup: goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1654,8 +1649,6 @@ yyreduce: switch (yyn) { case 3: - -/* Line 1455 of yacc.c */ #line 70 "a.y" { stmtline = lineno; @@ -1663,8 +1656,6 @@ yyreduce: break; case 5: - -/* Line 1455 of yacc.c */ #line 77 "a.y" { if((yyvsp[(1) - (2)].sym)->value != pc) @@ -1674,8 +1665,6 @@ yyreduce: break; case 7: - -/* Line 1455 of yacc.c */ #line 84 "a.y" { (yyvsp[(1) - (2)].sym)->type = LLAB; @@ -1684,8 +1673,6 @@ yyreduce: break; case 12: - -/* Line 1455 of yacc.c */ #line 95 "a.y" { (yyvsp[(1) - (3)].sym)->type = LVAR; @@ -1694,8 +1681,6 @@ yyreduce: break; case 13: - -/* Line 1455 of yacc.c */ #line 100 "a.y" { if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval)) @@ -1705,106 +1690,76 @@ yyreduce: break; case 14: - -/* Line 1455 of yacc.c */ #line 105 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 15: - -/* Line 1455 of yacc.c */ #line 106 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 16: - -/* Line 1455 of yacc.c */ #line 107 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 17: - -/* Line 1455 of yacc.c */ #line 108 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 18: - -/* Line 1455 of yacc.c */ #line 109 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 19: - -/* Line 1455 of yacc.c */ #line 110 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 20: - -/* Line 1455 of yacc.c */ #line 111 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 21: - -/* Line 1455 of yacc.c */ #line 112 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 22: - -/* Line 1455 of yacc.c */ #line 113 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 23: - -/* Line 1455 of yacc.c */ #line 114 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 24: - -/* Line 1455 of yacc.c */ #line 115 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 25: - -/* Line 1455 of yacc.c */ #line 116 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 26: - -/* Line 1455 of yacc.c */ #line 117 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 27: - -/* Line 1455 of yacc.c */ #line 118 "a.y" { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } break; case 28: - -/* Line 1455 of yacc.c */ #line 121 "a.y" { (yyval.gen2).from = nullgen; @@ -1813,8 +1768,6 @@ yyreduce: break; case 29: - -/* Line 1455 of yacc.c */ #line 126 "a.y" { (yyval.gen2).from = nullgen; @@ -1823,8 +1776,6 @@ yyreduce: break; case 30: - -/* Line 1455 of yacc.c */ #line 133 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); @@ -1833,8 +1784,6 @@ yyreduce: break; case 31: - -/* Line 1455 of yacc.c */ #line 140 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); @@ -1843,8 +1792,6 @@ yyreduce: break; case 32: - -/* Line 1455 of yacc.c */ #line 147 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (2)].gen); @@ -1853,8 +1800,6 @@ yyreduce: break; case 33: - -/* Line 1455 of yacc.c */ #line 152 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (1)].gen); @@ -1863,8 +1808,6 @@ yyreduce: break; case 34: - -/* Line 1455 of yacc.c */ #line 159 "a.y" { (yyval.gen2).from = nullgen; @@ -1873,8 +1816,6 @@ yyreduce: break; case 35: - -/* Line 1455 of yacc.c */ #line 164 "a.y" { (yyval.gen2).from = nullgen; @@ -1883,8 +1824,6 @@ yyreduce: break; case 36: - -/* Line 1455 of yacc.c */ #line 171 "a.y" { (yyval.gen2).from = nullgen; @@ -1893,8 +1832,6 @@ yyreduce: break; case 37: - -/* Line 1455 of yacc.c */ #line 176 "a.y" { (yyval.gen2).from = nullgen; @@ -1903,9 +1840,15 @@ yyreduce: break; case 38: +#line 181 "a.y" + { + (yyval.gen2).from = (yyvsp[(1) - (3)].gen); + (yyval.gen2).to = (yyvsp[(3) - (3)].gen); + } + break; -/* Line 1455 of yacc.c */ -#line 183 "a.y" + case 39: +#line 188 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); @@ -1913,20 +1856,16 @@ yyreduce: } break; - case 39: - -/* Line 1455 of yacc.c */ -#line 191 "a.y" + case 40: +#line 196 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 40: - -/* Line 1455 of yacc.c */ -#line 196 "a.y" + case 41: +#line 201 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); @@ -1934,30 +1873,24 @@ yyreduce: } break; - case 41: - -/* Line 1455 of yacc.c */ -#line 204 "a.y" + case 42: +#line 209 "a.y" { (yyval.gen2).from = nullgen; (yyval.gen2).to = (yyvsp[(2) - (2)].gen); } break; - case 42: - -/* Line 1455 of yacc.c */ -#line 209 "a.y" + case 43: +#line 214 "a.y" { (yyval.gen2).from = nullgen; (yyval.gen2).to = (yyvsp[(1) - (1)].gen); } break; - case 43: - -/* Line 1455 of yacc.c */ -#line 214 "a.y" + case 44: +#line 219 "a.y" { (yyval.gen2).from = nullgen; (yyval.gen2).to = (yyvsp[(2) - (2)].gen); @@ -1966,20 +1899,16 @@ yyreduce: } break; - case 46: - -/* Line 1455 of yacc.c */ -#line 227 "a.y" + case 47: +#line 232 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 47: - -/* Line 1455 of yacc.c */ -#line 232 "a.y" + case 48: +#line 237 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).to = (yyvsp[(3) - (5)].gen); @@ -1989,20 +1918,16 @@ yyreduce: } break; - case 48: - -/* Line 1455 of yacc.c */ -#line 242 "a.y" + case 49: +#line 247 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 49: - -/* Line 1455 of yacc.c */ -#line 247 "a.y" + case 50: +#line 252 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).to = (yyvsp[(3) - (5)].gen); @@ -2012,50 +1937,40 @@ yyreduce: } break; - case 50: - -/* Line 1455 of yacc.c */ -#line 257 "a.y" + case 51: +#line 262 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (2)].gen); (yyval.gen2).to = nullgen; } break; - case 51: - -/* Line 1455 of yacc.c */ -#line 262 "a.y" + case 52: +#line 267 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (1)].gen); (yyval.gen2).to = nullgen; } break; - case 52: - -/* Line 1455 of yacc.c */ -#line 267 "a.y" + case 53: +#line 272 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 53: - -/* Line 1455 of yacc.c */ -#line 274 "a.y" + case 54: +#line 279 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (3)].gen); (yyval.gen2).to = (yyvsp[(3) - (3)].gen); } break; - case 54: - -/* Line 1455 of yacc.c */ -#line 279 "a.y" + case 55: +#line 284 "a.y" { (yyval.gen2).from = (yyvsp[(1) - (5)].gen); (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); @@ -2063,28 +1978,22 @@ yyreduce: } break; - case 59: - -/* Line 1455 of yacc.c */ -#line 293 "a.y" + case 60: +#line 298 "a.y" { (yyval.gen) = (yyvsp[(2) - (2)].gen); } break; - case 60: - -/* Line 1455 of yacc.c */ -#line 297 "a.y" + case 61: +#line 302 "a.y" { (yyval.gen) = (yyvsp[(2) - (2)].gen); } break; - case 66: - -/* Line 1455 of yacc.c */ -#line 310 "a.y" + case 67: +#line 315 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_BRANCH; @@ -2092,10 +2001,8 @@ yyreduce: } break; - case 67: - -/* Line 1455 of yacc.c */ -#line 316 "a.y" + case 68: +#line 321 "a.y" { (yyval.gen) = nullgen; if(pass == 2) @@ -2106,10 +2013,8 @@ yyreduce: } break; - case 68: - -/* Line 1455 of yacc.c */ -#line 325 "a.y" + case 69: +#line 330 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_BRANCH; @@ -2118,19 +2023,7 @@ yyreduce: } break; - case 69: - -/* Line 1455 of yacc.c */ -#line 334 "a.y" - { - (yyval.gen) = nullgen; - (yyval.gen).type = (yyvsp[(1) - (1)].lval); - } - break; - case 70: - -/* Line 1455 of yacc.c */ #line 339 "a.y" { (yyval.gen) = nullgen; @@ -2139,8 +2032,6 @@ yyreduce: break; case 71: - -/* Line 1455 of yacc.c */ #line 344 "a.y" { (yyval.gen) = nullgen; @@ -2149,29 +2040,31 @@ yyreduce: break; case 72: - -/* Line 1455 of yacc.c */ #line 349 "a.y" { (yyval.gen) = nullgen; - (yyval.gen).type = D_SP; + (yyval.gen).type = (yyvsp[(1) - (1)].lval); } break; case 73: - -/* Line 1455 of yacc.c */ #line 354 "a.y" { (yyval.gen) = nullgen; - (yyval.gen).type = (yyvsp[(1) - (1)].lval); + (yyval.gen).type = D_SP; } break; case 74: +#line 359 "a.y" + { + (yyval.gen) = nullgen; + (yyval.gen).type = (yyvsp[(1) - (1)].lval); + } + break; -/* Line 1455 of yacc.c */ -#line 361 "a.y" + case 75: +#line 366 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_CONST; @@ -2179,10 +2072,8 @@ yyreduce: } break; - case 75: - -/* Line 1455 of yacc.c */ -#line 367 "a.y" + case 76: +#line 372 "a.y" { (yyval.gen) = (yyvsp[(2) - (2)].gen); (yyval.gen).index = (yyvsp[(2) - (2)].gen).type; @@ -2195,10 +2086,8 @@ yyreduce: } break; - case 76: - -/* Line 1455 of yacc.c */ -#line 378 "a.y" + case 77: +#line 383 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_SCONST; @@ -2206,10 +2095,8 @@ yyreduce: } break; - case 77: - -/* Line 1455 of yacc.c */ -#line 384 "a.y" + case 78: +#line 389 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2217,10 +2104,8 @@ yyreduce: } break; - case 78: - -/* Line 1455 of yacc.c */ -#line 390 "a.y" + case 79: +#line 395 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2228,10 +2113,8 @@ yyreduce: } break; - case 79: - -/* Line 1455 of yacc.c */ -#line 396 "a.y" + case 80: +#line 401 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2239,10 +2122,8 @@ yyreduce: } break; - case 80: - -/* Line 1455 of yacc.c */ -#line 402 "a.y" + case 81: +#line 407 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_FCONST; @@ -2250,10 +2131,8 @@ yyreduce: } break; - case 81: - -/* Line 1455 of yacc.c */ -#line 410 "a.y" + case 82: +#line 415 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_CONST2; @@ -2262,50 +2141,40 @@ yyreduce: } break; - case 82: - -/* Line 1455 of yacc.c */ -#line 419 "a.y" + case 83: +#line 424 "a.y" { (yyval.con2).v1 = (yyvsp[(1) - (1)].lval); (yyval.con2).v2 = 0; } break; - case 83: - -/* Line 1455 of yacc.c */ -#line 424 "a.y" + case 84: +#line 429 "a.y" { (yyval.con2).v1 = -(yyvsp[(2) - (2)].lval); (yyval.con2).v2 = 0; } break; - case 84: - -/* Line 1455 of yacc.c */ -#line 429 "a.y" + case 85: +#line 434 "a.y" { (yyval.con2).v1 = (yyvsp[(1) - (3)].lval); (yyval.con2).v2 = (yyvsp[(3) - (3)].lval); } break; - case 85: - -/* Line 1455 of yacc.c */ -#line 434 "a.y" + case 86: +#line 439 "a.y" { (yyval.con2).v1 = -(yyvsp[(2) - (4)].lval); (yyval.con2).v2 = (yyvsp[(4) - (4)].lval); } break; - case 88: - -/* Line 1455 of yacc.c */ -#line 445 "a.y" + case 89: +#line 450 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_NONE; @@ -2313,10 +2182,8 @@ yyreduce: } break; - case 89: - -/* Line 1455 of yacc.c */ -#line 451 "a.y" + case 90: +#line 456 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval); @@ -2324,10 +2191,8 @@ yyreduce: } break; - case 90: - -/* Line 1455 of yacc.c */ -#line 457 "a.y" + case 91: +#line 462 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_SP; @@ -2335,10 +2200,8 @@ yyreduce: } break; - case 91: - -/* Line 1455 of yacc.c */ -#line 463 "a.y" + case 92: +#line 468 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_NONE; @@ -2349,10 +2212,8 @@ yyreduce: } break; - case 92: - -/* Line 1455 of yacc.c */ -#line 472 "a.y" + case 93: +#line 477 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval); @@ -2363,30 +2224,24 @@ yyreduce: } break; - case 93: - -/* Line 1455 of yacc.c */ -#line 481 "a.y" + case 94: +#line 486 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(2) - (3)].lval); } break; - case 94: - -/* Line 1455 of yacc.c */ -#line 486 "a.y" + case 95: +#line 491 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_SP; } break; - case 95: - -/* Line 1455 of yacc.c */ -#line 491 "a.y" + case 96: +#line 496 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval); @@ -2394,10 +2249,8 @@ yyreduce: } break; - case 96: - -/* Line 1455 of yacc.c */ -#line 497 "a.y" + case 97: +#line 502 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+D_NONE; @@ -2407,10 +2260,8 @@ yyreduce: } break; - case 97: - -/* Line 1455 of yacc.c */ -#line 505 "a.y" + case 98: +#line 510 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_INDIR+(yyvsp[(2) - (8)].lval); @@ -2420,19 +2271,15 @@ yyreduce: } break; - case 98: - -/* Line 1455 of yacc.c */ -#line 515 "a.y" + case 99: +#line 520 "a.y" { (yyval.gen) = (yyvsp[(1) - (1)].gen); } break; - case 99: - -/* Line 1455 of yacc.c */ -#line 519 "a.y" + case 100: +#line 524 "a.y" { (yyval.gen) = (yyvsp[(1) - (6)].gen); (yyval.gen).index = (yyvsp[(3) - (6)].lval); @@ -2441,10 +2288,8 @@ yyreduce: } break; - case 100: - -/* Line 1455 of yacc.c */ -#line 528 "a.y" + case 101: +#line 533 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = (yyvsp[(4) - (5)].lval); @@ -2453,10 +2298,8 @@ yyreduce: } break; - case 101: - -/* Line 1455 of yacc.c */ -#line 535 "a.y" + case 102: +#line 540 "a.y" { (yyval.gen) = nullgen; (yyval.gen).type = D_STATIC; @@ -2465,181 +2308,142 @@ yyreduce: } break; - case 102: - -/* Line 1455 of yacc.c */ -#line 543 "a.y" + case 103: +#line 548 "a.y" { (yyval.lval) = 0; } break; - case 103: - -/* Line 1455 of yacc.c */ -#line 547 "a.y" + case 104: +#line 552 "a.y" { (yyval.lval) = (yyvsp[(2) - (2)].lval); } break; - case 104: - -/* Line 1455 of yacc.c */ -#line 551 "a.y" + case 105: +#line 556 "a.y" { (yyval.lval) = -(yyvsp[(2) - (2)].lval); } break; - case 106: - -/* Line 1455 of yacc.c */ -#line 558 "a.y" + case 107: +#line 563 "a.y" { (yyval.lval) = D_AUTO; } break; - case 109: - -/* Line 1455 of yacc.c */ -#line 566 "a.y" + case 110: +#line 571 "a.y" { (yyval.lval) = (yyvsp[(1) - (1)].sym)->value; } break; - case 110: - -/* Line 1455 of yacc.c */ -#line 570 "a.y" + case 111: +#line 575 "a.y" { (yyval.lval) = -(yyvsp[(2) - (2)].lval); } break; - case 111: - -/* Line 1455 of yacc.c */ -#line 574 "a.y" + case 112: +#line 579 "a.y" { (yyval.lval) = (yyvsp[(2) - (2)].lval); } break; - case 112: - -/* Line 1455 of yacc.c */ -#line 578 "a.y" + case 113: +#line 583 "a.y" { (yyval.lval) = ~(yyvsp[(2) - (2)].lval); } break; - case 113: - -/* Line 1455 of yacc.c */ -#line 582 "a.y" + case 114: +#line 587 "a.y" { (yyval.lval) = (yyvsp[(2) - (3)].lval); } break; - case 115: - -/* Line 1455 of yacc.c */ -#line 589 "a.y" + case 116: +#line 594 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval); } break; - case 116: - -/* Line 1455 of yacc.c */ -#line 593 "a.y" + case 117: +#line 598 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval); } break; - case 117: - -/* Line 1455 of yacc.c */ -#line 597 "a.y" + case 118: +#line 602 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval); } break; - case 118: - -/* Line 1455 of yacc.c */ -#line 601 "a.y" + case 119: +#line 606 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval); } break; - case 119: - -/* Line 1455 of yacc.c */ -#line 605 "a.y" + case 120: +#line 610 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval); } break; - case 120: - -/* Line 1455 of yacc.c */ -#line 609 "a.y" + case 121: +#line 614 "a.y" { (yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval); } break; - case 121: - -/* Line 1455 of yacc.c */ -#line 613 "a.y" + case 122: +#line 618 "a.y" { (yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval); } break; - case 122: - -/* Line 1455 of yacc.c */ -#line 617 "a.y" + case 123: +#line 622 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval); } break; - case 123: - -/* Line 1455 of yacc.c */ -#line 621 "a.y" + case 124: +#line 626 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval); } break; - case 124: - -/* Line 1455 of yacc.c */ -#line 625 "a.y" + case 125: +#line 630 "a.y" { (yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval); } break; - -/* Line 1455 of yacc.c */ -#line 2643 "y.tab.c" +/* Line 1267 of yacc.c. */ +#line 2447 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2650,6 +2454,7 @@ yyreduce: *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2714,7 +2519,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -2731,7 +2536,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -2788,6 +2593,9 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; @@ -2812,7 +2620,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2823,7 +2631,7 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) + if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered diff --git a/src/cmd/8a/y.tab.h b/src/cmd/8a/y.tab.h index 69a966a4bc..baded0b6e0 100644 --- a/src/cmd/8a/y.tab.h +++ b/src/cmd/8a/y.tab.h @@ -1,23 +1,24 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + 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 - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + 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 part or all of the Bison parser skeleton and distribute that work @@ -28,11 +29,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -104,11 +104,8 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 1676 of yacc.c */ #line 37 "a.y" - +{ Sym *sym; int32 lval; struct { @@ -119,17 +116,14 @@ typedef union YYSTYPE char sval[8]; Gen gen; Gen2 gen2; - - - -/* Line 1676 of yacc.c */ -#line 127 "y.tab.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 1529 of yacc.c. */ +#line 122 "y.tab.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; - diff --git a/src/cmd/8g/cgen.c b/src/cmd/8g/cgen.c index 541a9bfacf..784fa1de4e 100644 --- a/src/cmd/8g/cgen.c +++ b/src/cmd/8g/cgen.c @@ -596,6 +596,7 @@ agen(Node *n, Node *res) nodconst(&n2, types[TUINT32], v); gins(optoas(OCMP, types[TUINT32]), &n1, &n2); p1 = gbranch(optoas(OGT, types[TUINT32]), T); + expecttaken(p1, 1); ginscall(panicindex, 0); patch(p1, pc); } @@ -633,6 +634,7 @@ agen(Node *n, Node *res) nodconst(&n1, types[TUINT32], nl->type->bound); gins(optoas(OCMP, types[TUINT32]), &n2, &n1); p1 = gbranch(optoas(OLT, types[TUINT32]), T); + expecttaken(p1, 1); if(p2) patch(p2, pc); ginscall(panicindex, 0); diff --git a/src/cmd/8g/gg.h b/src/cmd/8g/gg.h index 27963f35cc..c8a4cdebb5 100644 --- a/src/cmd/8g/gg.h +++ b/src/cmd/8g/gg.h @@ -122,6 +122,7 @@ void cgen64(Node*, Node*); void clearp(Prog*); void proglist(void); Prog* gbranch(int, Type*); +void expecttaken(Prog*, int); Prog* prog(int); void gaddoffset(Node*); void gconv(int, int); diff --git a/src/cmd/8g/ggen.c b/src/cmd/8g/ggen.c index 4ccf6a0ab8..5fb66f57f0 100644 --- a/src/cmd/8g/ggen.c +++ b/src/cmd/8g/ggen.c @@ -896,12 +896,14 @@ cmpandthrow(Node *nl, Node *nr) regfree(&n1); if(throwpc == nil) { p1 = gbranch(optoas(op, t), T); + expecttaken(p1, 1); throwpc = pc; ginscall(panicslice, 0); patch(p1, pc); } else { op = brcom(op); p1 = gbranch(optoas(op, t), T); + expecttaken(p1, 0); patch(p1, throwpc); } } diff --git a/src/cmd/8g/gsubr.c b/src/cmd/8g/gsubr.c index 47bd897a9b..86ed30522a 100644 --- a/src/cmd/8g/gsubr.c +++ b/src/cmd/8g/gsubr.c @@ -118,6 +118,13 @@ gbranch(int as, Type *t) return p; } +void +expecttaken(Prog *p, int taken) +{ + p->from.type = D_CONST; + p->from.offset = taken; +} + /* * patch previous branch to jump to to. */ diff --git a/src/cmd/8l/optab.c b/src/cmd/8l/optab.c index 4d5751aeaf..81fe25d042 100644 --- a/src/cmd/8l/optab.c +++ b/src/cmd/8l/optab.c @@ -254,7 +254,9 @@ uchar yscond[] = }; uchar yjcond[] = { - Ynone, Ybr, Zbr, 1, + Ynone, Ybr, Zbr, 0, + Yi0, Ybr, Zbr, 0, + Yi1, Ybr, Zbr, 1, 0 }; uchar yloop[] = diff --git a/src/cmd/8l/pass.c b/src/cmd/8l/pass.c index c34a556828..d92c2f55a0 100644 --- a/src/cmd/8l/pass.c +++ b/src/cmd/8l/pass.c @@ -184,12 +184,25 @@ loop: * recurse to follow one path. * continue loop on the other. */ - q = brchain(p->link); - if(q != P && q->mark) - if(a != ALOOP) { - p->as = relinv(a); - p->link = p->pcond; - p->pcond = q; + if(p->from.type == D_CONST) { + if(p->from.offset == 1) { + /* + * expect conditional jump to be taken. + * rewrite so that's the fall-through case. + */ + p->as = relinv(a); + q = p->link; + p->link = p->pcond; + p->pcond = q; + } + } else { + q = brchain(p->link); + if(q != P && q->mark) + if(a != ALOOP) { + p->as = relinv(a); + p->link = p->pcond; + p->pcond = q; + } } xfol(p->link, last); q = brchain(p->pcond);