static void init_src_reg(struct asm_src_register *r);
+static void asm_instruction_set_operands(struct asm_instruction *inst,
+ const struct prog_dst_register *dst, const struct asm_src_register *src0,
+ const struct asm_src_register *src1, const struct asm_src_register *src2);
+
static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op,
const struct prog_dst_register *dst, const struct asm_src_register *src0,
const struct asm_src_register *src1, const struct asm_src_register *src2);
+static struct asm_instruction *asm_instruction_copy_ctor(
+ const struct prog_instruction *base, const struct prog_dst_register *dst,
+ const struct asm_src_register *src0, const struct asm_src_register *src1,
+ const struct asm_src_register *src2);
+
#ifndef FALSE
#define FALSE 0
#define TRUE (!FALSE)
/* Line 189 of yacc.c */
-#line 174 "program_parse.tab.c"
+#line 183 "program_parse.tab.c"
/* Enabling traces. */
#ifndef YYDEBUG
{
/* Line 214 of yacc.c */
-#line 107 "program_parse.y"
+#line 116 "program_parse.y"
struct asm_instruction *inst;
struct asm_symbol *sym;
/* Line 214 of yacc.c */
-#line 344 "program_parse.tab.c"
+#line 353 "program_parse.tab.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
/* Copy the second part of user declarations. */
/* Line 264 of yacc.c */
-#line 249 "program_parse.y"
+#line 258 "program_parse.y"
extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
void *yyscanner);
/* Line 264 of yacc.c */
-#line 375 "program_parse.tab.c"
+#line 384 "program_parse.tab.c"
#ifdef short
# undef short
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 256, 256, 259, 267, 279, 280, 283, 305, 306,
- 309, 324, 327, 332, 339, 340, 341, 342, 343, 344,
- 345, 348, 349, 350, 353, 359, 366, 373, 381, 388,
- 396, 441, 448, 493, 499, 500, 501, 502, 503, 504,
- 505, 506, 507, 508, 509, 510, 513, 526, 534, 551,
- 558, 577, 588, 608, 630, 639, 672, 679, 694, 744,
- 786, 797, 818, 828, 834, 865, 882, 882, 884, 891,
- 903, 904, 905, 908, 920, 932, 950, 961, 973, 975,
- 976, 977, 978, 981, 981, 981, 981, 982, 985, 986,
- 987, 988, 989, 990, 993, 1011, 1015, 1021, 1025, 1029,
- 1033, 1042, 1051, 1055, 1060, 1066, 1077, 1077, 1078, 1080,
- 1084, 1088, 1092, 1098, 1098, 1100, 1116, 1139, 1142, 1153,
- 1159, 1165, 1166, 1173, 1179, 1185, 1193, 1199, 1205, 1213,
- 1219, 1225, 1233, 1234, 1237, 1238, 1239, 1240, 1241, 1242,
- 1243, 1244, 1245, 1246, 1247, 1250, 1259, 1263, 1267, 1273,
- 1282, 1286, 1290, 1299, 1303, 1309, 1315, 1322, 1327, 1335,
- 1345, 1347, 1355, 1361, 1365, 1369, 1375, 1386, 1395, 1399,
- 1404, 1408, 1412, 1416, 1422, 1429, 1433, 1439, 1447, 1458,
- 1465, 1469, 1475, 1485, 1496, 1500, 1518, 1527, 1530, 1536,
- 1540, 1544, 1550, 1561, 1566, 1571, 1576, 1581, 1586, 1594,
- 1597, 1602, 1615, 1623, 1634, 1642, 1642, 1644, 1644, 1646,
- 1656, 1661, 1668, 1678, 1687, 1692, 1699, 1709, 1719, 1731,
- 1731, 1732, 1732, 1734, 1744, 1752, 1762, 1770, 1778, 1787,
- 1798, 1802, 1808, 1809, 1810, 1813, 1813, 1816, 1816, 1819,
- 1825, 1833, 1846, 1855, 1864, 1868, 1877, 1886, 1897, 1904,
- 1909, 1918, 1930, 1933, 1942, 1953, 1954, 1955, 1958, 1959,
- 1960, 1963, 1964, 1967, 1968, 1971, 1972, 1975, 1986, 1997,
- 2008
+ 0, 265, 265, 268, 276, 288, 289, 292, 314, 315,
+ 318, 333, 336, 341, 348, 349, 350, 351, 352, 353,
+ 354, 357, 358, 359, 362, 368, 374, 380, 387, 393,
+ 400, 444, 451, 495, 501, 502, 503, 504, 505, 506,
+ 507, 508, 509, 510, 511, 512, 515, 527, 535, 552,
+ 559, 578, 589, 609, 631, 640, 673, 680, 695, 745,
+ 787, 798, 819, 829, 835, 866, 883, 883, 885, 892,
+ 904, 905, 906, 909, 921, 933, 951, 962, 974, 976,
+ 977, 978, 979, 982, 982, 982, 982, 983, 986, 987,
+ 988, 989, 990, 991, 994, 1012, 1016, 1022, 1026, 1030,
+ 1034, 1043, 1052, 1056, 1061, 1067, 1078, 1078, 1079, 1081,
+ 1085, 1089, 1093, 1099, 1099, 1101, 1117, 1140, 1143, 1154,
+ 1160, 1166, 1167, 1174, 1180, 1186, 1194, 1200, 1206, 1214,
+ 1220, 1226, 1234, 1235, 1238, 1239, 1240, 1241, 1242, 1243,
+ 1244, 1245, 1246, 1247, 1248, 1251, 1260, 1264, 1268, 1274,
+ 1283, 1287, 1291, 1300, 1304, 1310, 1316, 1323, 1328, 1336,
+ 1346, 1348, 1356, 1362, 1366, 1370, 1376, 1387, 1396, 1400,
+ 1405, 1409, 1413, 1417, 1423, 1430, 1434, 1440, 1448, 1459,
+ 1466, 1470, 1476, 1486, 1497, 1501, 1519, 1528, 1531, 1537,
+ 1541, 1545, 1551, 1562, 1567, 1572, 1577, 1582, 1587, 1595,
+ 1598, 1603, 1616, 1624, 1635, 1643, 1643, 1645, 1645, 1647,
+ 1657, 1662, 1669, 1679, 1688, 1693, 1700, 1710, 1720, 1732,
+ 1732, 1733, 1733, 1735, 1745, 1753, 1763, 1771, 1779, 1788,
+ 1799, 1803, 1809, 1810, 1811, 1814, 1814, 1817, 1817, 1820,
+ 1826, 1834, 1847, 1856, 1865, 1869, 1878, 1887, 1898, 1905,
+ 1910, 1919, 1931, 1934, 1943, 1954, 1955, 1956, 1959, 1960,
+ 1961, 1964, 1965, 1968, 1969, 1972, 1973, 1976, 1987, 1998,
+ 2009
};
#endif
case 3:
/* Line 1455 of yacc.c */
-#line 260 "program_parse.y"
+#line 269 "program_parse.y"
{
if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header");
case 4:
/* Line 1455 of yacc.c */
-#line 268 "program_parse.y"
+#line 277 "program_parse.y"
{
if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header");
case 7:
/* Line 1455 of yacc.c */
-#line 284 "program_parse.y"
+#line 293 "program_parse.y"
{
int valid = 0;
case 10:
/* Line 1455 of yacc.c */
-#line 310 "program_parse.y"
+#line 319 "program_parse.y"
{
if ((yyvsp[(1) - (2)].inst) != NULL) {
if (state->inst_tail == NULL) {
case 12:
/* Line 1455 of yacc.c */
-#line 328 "program_parse.y"
+#line 337 "program_parse.y"
{
(yyval.inst) = (yyvsp[(1) - (1)].inst);
state->prog->NumAluInstructions++;
case 13:
/* Line 1455 of yacc.c */
-#line 333 "program_parse.y"
+#line 342 "program_parse.y"
{
(yyval.inst) = (yyvsp[(1) - (1)].inst);
state->prog->NumTexInstructions++;
case 24:
/* Line 1455 of yacc.c */
-#line 354 "program_parse.y"
+#line 363 "program_parse.y"
{
(yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL);
;}
case 25:
/* Line 1455 of yacc.c */
-#line 360 "program_parse.y"
+#line 369 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL);
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode;
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL);
;}
break;
case 26:
/* Line 1455 of yacc.c */
-#line 367 "program_parse.y"
+#line 375 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL);
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode;
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL);
;}
break;
case 27:
/* Line 1455 of yacc.c */
-#line 374 "program_parse.y"
+#line 381 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL);
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode;
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL);
;}
break;
case 28:
/* Line 1455 of yacc.c */
-#line 382 "program_parse.y"
+#line 388 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL);
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode;
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL);
;}
break;
case 29:
/* Line 1455 of yacc.c */
-#line 390 "program_parse.y"
+#line 395 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg));
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode;
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg));
;}
break;
case 30:
/* Line 1455 of yacc.c */
-#line 397 "program_parse.y"
+#line 401 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL);
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL);
if ((yyval.inst) != NULL) {
const GLbitfield tex_mask = (1U << (yyvsp[(6) - (8)].integer));
GLbitfield shadow_tex = 0;
GLbitfield target_mask = 0;
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode;
(yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer);
if ((yyvsp[(8) - (8)].integer) < 0) {
case 31:
/* Line 1455 of yacc.c */
-#line 442 "program_parse.y"
+#line 445 "program_parse.y"
{
(yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL);
state->fragment.UsesKill = 1;
case 32:
/* Line 1455 of yacc.c */
-#line 449 "program_parse.y"
+#line 452 "program_parse.y"
{
- (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (12)].temp_inst).Opcode, & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg));
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg));
if ((yyval.inst) != NULL) {
const GLbitfield tex_mask = (1U << (yyvsp[(10) - (12)].integer));
GLbitfield shadow_tex = 0;
GLbitfield target_mask = 0;
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (12)].temp_inst).SaturateMode;
(yyval.inst)->Base.TexSrcUnit = (yyvsp[(10) - (12)].integer);
if ((yyvsp[(12) - (12)].integer) < 0) {
case 33:
/* Line 1455 of yacc.c */
-#line 494 "program_parse.y"
+#line 496 "program_parse.y"
{
(yyval.integer) = (yyvsp[(2) - (2)].integer);
;}
case 34:
/* Line 1455 of yacc.c */
-#line 499 "program_parse.y"
+#line 501 "program_parse.y"
{ (yyval.integer) = TEXTURE_1D_INDEX; ;}
break;
case 35:
/* Line 1455 of yacc.c */
-#line 500 "program_parse.y"
+#line 502 "program_parse.y"
{ (yyval.integer) = TEXTURE_2D_INDEX; ;}
break;
case 36:
/* Line 1455 of yacc.c */
-#line 501 "program_parse.y"
+#line 503 "program_parse.y"
{ (yyval.integer) = TEXTURE_3D_INDEX; ;}
break;
case 37:
/* Line 1455 of yacc.c */
-#line 502 "program_parse.y"
+#line 504 "program_parse.y"
{ (yyval.integer) = TEXTURE_CUBE_INDEX; ;}
break;
case 38:
/* Line 1455 of yacc.c */
-#line 503 "program_parse.y"
+#line 505 "program_parse.y"
{ (yyval.integer) = TEXTURE_RECT_INDEX; ;}
break;
case 39:
/* Line 1455 of yacc.c */
-#line 504 "program_parse.y"
+#line 506 "program_parse.y"
{ (yyval.integer) = -TEXTURE_1D_INDEX; ;}
break;
case 40:
/* Line 1455 of yacc.c */
-#line 505 "program_parse.y"
+#line 507 "program_parse.y"
{ (yyval.integer) = -TEXTURE_2D_INDEX; ;}
break;
case 41:
/* Line 1455 of yacc.c */
-#line 506 "program_parse.y"
+#line 508 "program_parse.y"
{ (yyval.integer) = -TEXTURE_RECT_INDEX; ;}
break;
case 42:
/* Line 1455 of yacc.c */
-#line 507 "program_parse.y"
+#line 509 "program_parse.y"
{ (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;}
break;
case 43:
/* Line 1455 of yacc.c */
-#line 508 "program_parse.y"
+#line 510 "program_parse.y"
{ (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;}
break;
case 44:
/* Line 1455 of yacc.c */
-#line 509 "program_parse.y"
+#line 511 "program_parse.y"
{ (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;}
break;
case 45:
/* Line 1455 of yacc.c */
-#line 510 "program_parse.y"
+#line 512 "program_parse.y"
{ (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;}
break;
case 46:
/* Line 1455 of yacc.c */
-#line 514 "program_parse.y"
+#line 516 "program_parse.y"
{
/* FIXME: Is this correct? Should the extenedSwizzle be applied
* FIXME: to the existing swizzle?
(yyvsp[(4) - (6)].src_reg).Base.Swizzle = (yyvsp[(6) - (6)].swiz_mask).swizzle;
(yyvsp[(4) - (6)].src_reg).Base.Negate = (yyvsp[(6) - (6)].swiz_mask).mask;
- (yyval.inst) = asm_instruction_ctor(OPCODE_SWZ, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL);
- (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode;
+ (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL);
;}
break;
case 47:
/* Line 1455 of yacc.c */
-#line 527 "program_parse.y"
+#line 528 "program_parse.y"
{
(yyval.src_reg) = (yyvsp[(2) - (2)].src_reg);
case 48:
/* Line 1455 of yacc.c */
-#line 535 "program_parse.y"
+#line 536 "program_parse.y"
{
(yyval.src_reg) = (yyvsp[(3) - (4)].src_reg);
case 49:
/* Line 1455 of yacc.c */
-#line 552 "program_parse.y"
+#line 553 "program_parse.y"
{
(yyval.src_reg) = (yyvsp[(1) - (2)].src_reg);
case 50:
/* Line 1455 of yacc.c */
-#line 559 "program_parse.y"
+#line 560 "program_parse.y"
{
struct asm_symbol temp_sym;
case 51:
/* Line 1455 of yacc.c */
-#line 578 "program_parse.y"
+#line 579 "program_parse.y"
{
(yyval.src_reg) = (yyvsp[(2) - (3)].src_reg);
case 52:
/* Line 1455 of yacc.c */
-#line 589 "program_parse.y"
+#line 590 "program_parse.y"
{
(yyval.src_reg) = (yyvsp[(3) - (5)].src_reg);
case 53:
/* Line 1455 of yacc.c */
-#line 609 "program_parse.y"
+#line 610 "program_parse.y"
{
(yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg);
(yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask;
case 54:
/* Line 1455 of yacc.c */
-#line 631 "program_parse.y"
+#line 632 "program_parse.y"
{
init_dst_reg(& (yyval.dst_reg));
(yyval.dst_reg).File = PROGRAM_ADDRESS;
case 55:
/* Line 1455 of yacc.c */
-#line 640 "program_parse.y"
+#line 641 "program_parse.y"
{
const unsigned xyzw_valid =
((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0)
case 56:
/* Line 1455 of yacc.c */
-#line 673 "program_parse.y"
+#line 674 "program_parse.y"
{
(yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle);
(yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0;
case 57:
/* Line 1455 of yacc.c */
-#line 680 "program_parse.y"
+#line 681 "program_parse.y"
{
if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector");
case 58:
/* Line 1455 of yacc.c */
-#line 695 "program_parse.y"
+#line 696 "program_parse.y"
{
if (strlen((yyvsp[(1) - (1)].string)) > 1) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector");
case 59:
/* Line 1455 of yacc.c */
-#line 745 "program_parse.y"
+#line 746 "program_parse.y"
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string));
case 60:
/* Line 1455 of yacc.c */
-#line 787 "program_parse.y"
+#line 788 "program_parse.y"
{
init_src_reg(& (yyval.src_reg));
(yyval.src_reg).Base.File = PROGRAM_INPUT;
case 61:
/* Line 1455 of yacc.c */
-#line 798 "program_parse.y"
+#line 799 "program_parse.y"
{
if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr
&& ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) {
case 62:
/* Line 1455 of yacc.c */
-#line 819 "program_parse.y"
+#line 820 "program_parse.y"
{
init_src_reg(& (yyval.src_reg));
(yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL)
case 63:
/* Line 1455 of yacc.c */
-#line 829 "program_parse.y"
+#line 830 "program_parse.y"
{
init_dst_reg(& (yyval.dst_reg));
(yyval.dst_reg).File = PROGRAM_OUTPUT;
case 64:
/* Line 1455 of yacc.c */
-#line 835 "program_parse.y"
+#line 836 "program_parse.y"
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string));
case 65:
/* Line 1455 of yacc.c */
-#line 866 "program_parse.y"
+#line 867 "program_parse.y"
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string));
case 68:
/* Line 1455 of yacc.c */
-#line 885 "program_parse.y"
+#line 886 "program_parse.y"
{
init_src_reg(& (yyval.src_reg));
(yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer);
case 69:
/* Line 1455 of yacc.c */
-#line 892 "program_parse.y"
+#line 893 "program_parse.y"
{
/* FINISHME: Add support for multiple address registers.
*/
case 70:
/* Line 1455 of yacc.c */
-#line 903 "program_parse.y"
+#line 904 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 71:
/* Line 1455 of yacc.c */
-#line 904 "program_parse.y"
+#line 905 "program_parse.y"
{ (yyval.integer) = (yyvsp[(2) - (2)].integer); ;}
break;
case 72:
/* Line 1455 of yacc.c */
-#line 905 "program_parse.y"
+#line 906 "program_parse.y"
{ (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;}
break;
case 73:
/* Line 1455 of yacc.c */
-#line 909 "program_parse.y"
+#line 910 "program_parse.y"
{
if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) {
yyerror(& (yylsp[(1) - (1)]), state,
case 74:
/* Line 1455 of yacc.c */
-#line 921 "program_parse.y"
+#line 922 "program_parse.y"
{
if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) {
yyerror(& (yylsp[(1) - (1)]), state,
case 75:
/* Line 1455 of yacc.c */
-#line 933 "program_parse.y"
+#line 934 "program_parse.y"
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string));
case 76:
/* Line 1455 of yacc.c */
-#line 951 "program_parse.y"
+#line 952 "program_parse.y"
{
if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector");
case 77:
/* Line 1455 of yacc.c */
-#line 962 "program_parse.y"
+#line 963 "program_parse.y"
{
if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) {
yyerror(& (yylsp[(1) - (1)]), state,
case 82:
/* Line 1455 of yacc.c */
-#line 978 "program_parse.y"
+#line 979 "program_parse.y"
{ (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;}
break;
case 87:
/* Line 1455 of yacc.c */
-#line 982 "program_parse.y"
+#line 983 "program_parse.y"
{ (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;}
break;
case 94:
/* Line 1455 of yacc.c */
-#line 994 "program_parse.y"
+#line 995 "program_parse.y"
{
struct asm_symbol *const s =
declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)]));
case 95:
/* Line 1455 of yacc.c */
-#line 1012 "program_parse.y"
+#line 1013 "program_parse.y"
{
(yyval.attrib) = (yyvsp[(2) - (2)].attrib);
;}
case 96:
/* Line 1455 of yacc.c */
-#line 1016 "program_parse.y"
+#line 1017 "program_parse.y"
{
(yyval.attrib) = (yyvsp[(2) - (2)].attrib);
;}
case 97:
/* Line 1455 of yacc.c */
-#line 1022 "program_parse.y"
+#line 1023 "program_parse.y"
{
(yyval.attrib) = VERT_ATTRIB_POS;
;}
case 98:
/* Line 1455 of yacc.c */
-#line 1026 "program_parse.y"
+#line 1027 "program_parse.y"
{
(yyval.attrib) = VERT_ATTRIB_WEIGHT;
;}
case 99:
/* Line 1455 of yacc.c */
-#line 1030 "program_parse.y"
+#line 1031 "program_parse.y"
{
(yyval.attrib) = VERT_ATTRIB_NORMAL;
;}
case 100:
/* Line 1455 of yacc.c */
-#line 1034 "program_parse.y"
+#line 1035 "program_parse.y"
{
if (!state->ctx->Extensions.EXT_secondary_color) {
yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported");
case 101:
/* Line 1455 of yacc.c */
-#line 1043 "program_parse.y"
+#line 1044 "program_parse.y"
{
if (!state->ctx->Extensions.EXT_fog_coord) {
yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported");
case 102:
/* Line 1455 of yacc.c */
-#line 1052 "program_parse.y"
+#line 1053 "program_parse.y"
{
(yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer);
;}
case 103:
/* Line 1455 of yacc.c */
-#line 1056 "program_parse.y"
+#line 1057 "program_parse.y"
{
yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported");
YYERROR;
case 104:
/* Line 1455 of yacc.c */
-#line 1061 "program_parse.y"
+#line 1062 "program_parse.y"
{
(yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer);
;}
case 105:
/* Line 1455 of yacc.c */
-#line 1067 "program_parse.y"
+#line 1068 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference");
case 109:
/* Line 1455 of yacc.c */
-#line 1081 "program_parse.y"
+#line 1082 "program_parse.y"
{
(yyval.attrib) = FRAG_ATTRIB_WPOS;
;}
case 110:
/* Line 1455 of yacc.c */
-#line 1085 "program_parse.y"
+#line 1086 "program_parse.y"
{
(yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer);
;}
case 111:
/* Line 1455 of yacc.c */
-#line 1089 "program_parse.y"
+#line 1090 "program_parse.y"
{
(yyval.attrib) = FRAG_ATTRIB_FOGC;
;}
case 112:
/* Line 1455 of yacc.c */
-#line 1093 "program_parse.y"
+#line 1094 "program_parse.y"
{
(yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer);
;}
case 115:
/* Line 1455 of yacc.c */
-#line 1101 "program_parse.y"
+#line 1102 "program_parse.y"
{
struct asm_symbol *const s =
declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)]));
case 116:
/* Line 1455 of yacc.c */
-#line 1117 "program_parse.y"
+#line 1118 "program_parse.y"
{
if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) {
yyerror(& (yylsp[(4) - (6)]), state,
case 117:
/* Line 1455 of yacc.c */
-#line 1139 "program_parse.y"
+#line 1140 "program_parse.y"
{
(yyval.integer) = 0;
;}
case 118:
/* Line 1455 of yacc.c */
-#line 1143 "program_parse.y"
+#line 1144 "program_parse.y"
{
if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size");
case 119:
/* Line 1455 of yacc.c */
-#line 1154 "program_parse.y"
+#line 1155 "program_parse.y"
{
(yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym);
;}
case 120:
/* Line 1455 of yacc.c */
-#line 1160 "program_parse.y"
+#line 1161 "program_parse.y"
{
(yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym);
;}
case 122:
/* Line 1455 of yacc.c */
-#line 1167 "program_parse.y"
+#line 1168 "program_parse.y"
{
(yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length;
(yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym);
case 123:
/* Line 1455 of yacc.c */
-#line 1174 "program_parse.y"
+#line 1175 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 124:
/* Line 1455 of yacc.c */
-#line 1180 "program_parse.y"
+#line 1181 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 125:
/* Line 1455 of yacc.c */
-#line 1186 "program_parse.y"
+#line 1187 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 126:
/* Line 1455 of yacc.c */
-#line 1194 "program_parse.y"
+#line 1195 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 127:
/* Line 1455 of yacc.c */
-#line 1200 "program_parse.y"
+#line 1201 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 128:
/* Line 1455 of yacc.c */
-#line 1206 "program_parse.y"
+#line 1207 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 129:
/* Line 1455 of yacc.c */
-#line 1214 "program_parse.y"
+#line 1215 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 130:
/* Line 1455 of yacc.c */
-#line 1220 "program_parse.y"
+#line 1221 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 131:
/* Line 1455 of yacc.c */
-#line 1226 "program_parse.y"
+#line 1227 "program_parse.y"
{
memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
(yyval.temp_sym).param_binding_begin = ~0;
case 132:
/* Line 1455 of yacc.c */
-#line 1233 "program_parse.y"
+#line 1234 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;}
break;
case 133:
/* Line 1455 of yacc.c */
-#line 1234 "program_parse.y"
+#line 1235 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 134:
/* Line 1455 of yacc.c */
-#line 1237 "program_parse.y"
+#line 1238 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 135:
/* Line 1455 of yacc.c */
-#line 1238 "program_parse.y"
+#line 1239 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 136:
/* Line 1455 of yacc.c */
-#line 1239 "program_parse.y"
+#line 1240 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 137:
/* Line 1455 of yacc.c */
-#line 1240 "program_parse.y"
+#line 1241 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 138:
/* Line 1455 of yacc.c */
-#line 1241 "program_parse.y"
+#line 1242 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 139:
/* Line 1455 of yacc.c */
-#line 1242 "program_parse.y"
+#line 1243 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 140:
/* Line 1455 of yacc.c */
-#line 1243 "program_parse.y"
+#line 1244 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 141:
/* Line 1455 of yacc.c */
-#line 1244 "program_parse.y"
+#line 1245 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 142:
/* Line 1455 of yacc.c */
-#line 1245 "program_parse.y"
+#line 1246 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 143:
/* Line 1455 of yacc.c */
-#line 1246 "program_parse.y"
+#line 1247 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 144:
/* Line 1455 of yacc.c */
-#line 1247 "program_parse.y"
+#line 1248 "program_parse.y"
{ memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;}
break;
case 145:
/* Line 1455 of yacc.c */
-#line 1251 "program_parse.y"
+#line 1252 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_MATERIAL;
case 146:
/* Line 1455 of yacc.c */
-#line 1260 "program_parse.y"
+#line 1261 "program_parse.y"
{
(yyval.integer) = (yyvsp[(1) - (1)].integer);
;}
case 147:
/* Line 1455 of yacc.c */
-#line 1264 "program_parse.y"
+#line 1265 "program_parse.y"
{
(yyval.integer) = STATE_EMISSION;
;}
case 148:
/* Line 1455 of yacc.c */
-#line 1268 "program_parse.y"
+#line 1269 "program_parse.y"
{
(yyval.integer) = STATE_SHININESS;
;}
case 149:
/* Line 1455 of yacc.c */
-#line 1274 "program_parse.y"
+#line 1275 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_LIGHT;
case 150:
/* Line 1455 of yacc.c */
-#line 1283 "program_parse.y"
+#line 1284 "program_parse.y"
{
(yyval.integer) = (yyvsp[(1) - (1)].integer);
;}
case 151:
/* Line 1455 of yacc.c */
-#line 1287 "program_parse.y"
+#line 1288 "program_parse.y"
{
(yyval.integer) = STATE_POSITION;
;}
case 152:
/* Line 1455 of yacc.c */
-#line 1291 "program_parse.y"
+#line 1292 "program_parse.y"
{
if (!state->ctx->Extensions.EXT_point_parameters) {
yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported");
case 153:
/* Line 1455 of yacc.c */
-#line 1300 "program_parse.y"
+#line 1301 "program_parse.y"
{
(yyval.integer) = (yyvsp[(2) - (2)].integer);
;}
case 154:
/* Line 1455 of yacc.c */
-#line 1304 "program_parse.y"
+#line 1305 "program_parse.y"
{
(yyval.integer) = STATE_HALF_VECTOR;
;}
case 155:
/* Line 1455 of yacc.c */
-#line 1310 "program_parse.y"
+#line 1311 "program_parse.y"
{
(yyval.integer) = STATE_SPOT_DIRECTION;
;}
case 156:
/* Line 1455 of yacc.c */
-#line 1316 "program_parse.y"
+#line 1317 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(2) - (2)].state)[0];
(yyval.state)[1] = (yyvsp[(2) - (2)].state)[1];
case 157:
/* Line 1455 of yacc.c */
-#line 1323 "program_parse.y"
+#line 1324 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT;
case 158:
/* Line 1455 of yacc.c */
-#line 1328 "program_parse.y"
+#line 1329 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR;
case 159:
/* Line 1455 of yacc.c */
-#line 1336 "program_parse.y"
+#line 1337 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_LIGHTPROD;
case 161:
/* Line 1455 of yacc.c */
-#line 1348 "program_parse.y"
+#line 1349 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = (yyvsp[(3) - (3)].integer);
case 162:
/* Line 1455 of yacc.c */
-#line 1356 "program_parse.y"
+#line 1357 "program_parse.y"
{
(yyval.integer) = STATE_TEXENV_COLOR;
;}
case 163:
/* Line 1455 of yacc.c */
-#line 1362 "program_parse.y"
+#line 1363 "program_parse.y"
{
(yyval.integer) = STATE_AMBIENT;
;}
case 164:
/* Line 1455 of yacc.c */
-#line 1366 "program_parse.y"
+#line 1367 "program_parse.y"
{
(yyval.integer) = STATE_DIFFUSE;
;}
case 165:
/* Line 1455 of yacc.c */
-#line 1370 "program_parse.y"
+#line 1371 "program_parse.y"
{
(yyval.integer) = STATE_SPECULAR;
;}
case 166:
/* Line 1455 of yacc.c */
-#line 1376 "program_parse.y"
+#line 1377 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector");
case 167:
/* Line 1455 of yacc.c */
-#line 1387 "program_parse.y"
+#line 1388 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_TEXGEN;
case 168:
/* Line 1455 of yacc.c */
-#line 1396 "program_parse.y"
+#line 1397 "program_parse.y"
{
(yyval.integer) = STATE_TEXGEN_EYE_S;
;}
case 169:
/* Line 1455 of yacc.c */
-#line 1400 "program_parse.y"
+#line 1401 "program_parse.y"
{
(yyval.integer) = STATE_TEXGEN_OBJECT_S;
;}
case 170:
/* Line 1455 of yacc.c */
-#line 1405 "program_parse.y"
+#line 1406 "program_parse.y"
{
(yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S;
;}
case 171:
/* Line 1455 of yacc.c */
-#line 1409 "program_parse.y"
+#line 1410 "program_parse.y"
{
(yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S;
;}
case 172:
/* Line 1455 of yacc.c */
-#line 1413 "program_parse.y"
+#line 1414 "program_parse.y"
{
(yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S;
;}
case 173:
/* Line 1455 of yacc.c */
-#line 1417 "program_parse.y"
+#line 1418 "program_parse.y"
{
(yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S;
;}
case 174:
/* Line 1455 of yacc.c */
-#line 1423 "program_parse.y"
+#line 1424 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = (yyvsp[(2) - (2)].integer);
case 175:
/* Line 1455 of yacc.c */
-#line 1430 "program_parse.y"
+#line 1431 "program_parse.y"
{
(yyval.integer) = STATE_FOG_COLOR;
;}
case 176:
/* Line 1455 of yacc.c */
-#line 1434 "program_parse.y"
+#line 1435 "program_parse.y"
{
(yyval.integer) = STATE_FOG_PARAMS;
;}
case 177:
/* Line 1455 of yacc.c */
-#line 1440 "program_parse.y"
+#line 1441 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_CLIPPLANE;
case 178:
/* Line 1455 of yacc.c */
-#line 1448 "program_parse.y"
+#line 1449 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector");
case 179:
/* Line 1455 of yacc.c */
-#line 1459 "program_parse.y"
+#line 1460 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = (yyvsp[(2) - (2)].integer);
case 180:
/* Line 1455 of yacc.c */
-#line 1466 "program_parse.y"
+#line 1467 "program_parse.y"
{
(yyval.integer) = STATE_POINT_SIZE;
;}
case 181:
/* Line 1455 of yacc.c */
-#line 1470 "program_parse.y"
+#line 1471 "program_parse.y"
{
(yyval.integer) = STATE_POINT_ATTENUATION;
;}
case 182:
/* Line 1455 of yacc.c */
-#line 1476 "program_parse.y"
+#line 1477 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(1) - (5)].state)[0];
(yyval.state)[1] = (yyvsp[(1) - (5)].state)[1];
case 183:
/* Line 1455 of yacc.c */
-#line 1486 "program_parse.y"
+#line 1487 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(1) - (2)].state)[0];
(yyval.state)[1] = (yyvsp[(1) - (2)].state)[1];
case 184:
/* Line 1455 of yacc.c */
-#line 1496 "program_parse.y"
+#line 1497 "program_parse.y"
{
(yyval.state)[2] = 0;
(yyval.state)[3] = 3;
case 185:
/* Line 1455 of yacc.c */
-#line 1501 "program_parse.y"
+#line 1502 "program_parse.y"
{
/* It seems logical that the matrix row range specifier would have
* to specify a range or more than one row (i.e., $5 > $3).
case 186:
/* Line 1455 of yacc.c */
-#line 1519 "program_parse.y"
+#line 1520 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(2) - (3)].state)[0];
(yyval.state)[1] = (yyvsp[(2) - (3)].state)[1];
case 187:
/* Line 1455 of yacc.c */
-#line 1527 "program_parse.y"
+#line 1528 "program_parse.y"
{
(yyval.integer) = 0;
;}
case 188:
/* Line 1455 of yacc.c */
-#line 1531 "program_parse.y"
+#line 1532 "program_parse.y"
{
(yyval.integer) = (yyvsp[(1) - (1)].integer);
;}
case 189:
/* Line 1455 of yacc.c */
-#line 1537 "program_parse.y"
+#line 1538 "program_parse.y"
{
(yyval.integer) = STATE_MATRIX_INVERSE;
;}
case 190:
/* Line 1455 of yacc.c */
-#line 1541 "program_parse.y"
+#line 1542 "program_parse.y"
{
(yyval.integer) = STATE_MATRIX_TRANSPOSE;
;}
case 191:
/* Line 1455 of yacc.c */
-#line 1545 "program_parse.y"
+#line 1546 "program_parse.y"
{
(yyval.integer) = STATE_MATRIX_INVTRANS;
;}
case 192:
/* Line 1455 of yacc.c */
-#line 1551 "program_parse.y"
+#line 1552 "program_parse.y"
{
if ((yyvsp[(1) - (1)].integer) > 3) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference");
case 193:
/* Line 1455 of yacc.c */
-#line 1562 "program_parse.y"
+#line 1563 "program_parse.y"
{
(yyval.state)[0] = STATE_MODELVIEW_MATRIX;
(yyval.state)[1] = (yyvsp[(2) - (2)].integer);
case 194:
/* Line 1455 of yacc.c */
-#line 1567 "program_parse.y"
+#line 1568 "program_parse.y"
{
(yyval.state)[0] = STATE_PROJECTION_MATRIX;
(yyval.state)[1] = 0;
case 195:
/* Line 1455 of yacc.c */
-#line 1572 "program_parse.y"
+#line 1573 "program_parse.y"
{
(yyval.state)[0] = STATE_MVP_MATRIX;
(yyval.state)[1] = 0;
case 196:
/* Line 1455 of yacc.c */
-#line 1577 "program_parse.y"
+#line 1578 "program_parse.y"
{
(yyval.state)[0] = STATE_TEXTURE_MATRIX;
(yyval.state)[1] = (yyvsp[(2) - (2)].integer);
case 197:
/* Line 1455 of yacc.c */
-#line 1582 "program_parse.y"
+#line 1583 "program_parse.y"
{
yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported");
YYERROR;
case 198:
/* Line 1455 of yacc.c */
-#line 1587 "program_parse.y"
+#line 1588 "program_parse.y"
{
(yyval.state)[0] = STATE_PROGRAM_MATRIX;
(yyval.state)[1] = (yyvsp[(3) - (4)].integer);
case 199:
/* Line 1455 of yacc.c */
-#line 1594 "program_parse.y"
+#line 1595 "program_parse.y"
{
(yyval.integer) = 0;
;}
case 200:
/* Line 1455 of yacc.c */
-#line 1598 "program_parse.y"
+#line 1599 "program_parse.y"
{
(yyval.integer) = (yyvsp[(1) - (1)].integer);
;}
case 201:
/* Line 1455 of yacc.c */
-#line 1603 "program_parse.y"
+#line 1604 "program_parse.y"
{
/* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
* zero is valid.
case 202:
/* Line 1455 of yacc.c */
-#line 1616 "program_parse.y"
+#line 1617 "program_parse.y"
{
/* Since GL_ARB_matrix_palette isn't supported, just let any value
* through here. The error will be generated later.
case 203:
/* Line 1455 of yacc.c */
-#line 1624 "program_parse.y"
+#line 1625 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector");
case 204:
/* Line 1455 of yacc.c */
-#line 1635 "program_parse.y"
+#line 1636 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = STATE_DEPTH_RANGE;
case 209:
/* Line 1455 of yacc.c */
-#line 1647 "program_parse.y"
+#line 1648 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = state->state_param_enum;
case 210:
/* Line 1455 of yacc.c */
-#line 1657 "program_parse.y"
+#line 1658 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(1) - (1)].integer);
(yyval.state)[1] = (yyvsp[(1) - (1)].integer);
case 211:
/* Line 1455 of yacc.c */
-#line 1662 "program_parse.y"
+#line 1663 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(1) - (3)].integer);
(yyval.state)[1] = (yyvsp[(3) - (3)].integer);
case 212:
/* Line 1455 of yacc.c */
-#line 1669 "program_parse.y"
+#line 1670 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = state->state_param_enum;
case 213:
/* Line 1455 of yacc.c */
-#line 1679 "program_parse.y"
+#line 1680 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = state->state_param_enum;
case 214:
/* Line 1455 of yacc.c */
-#line 1688 "program_parse.y"
+#line 1689 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(1) - (1)].integer);
(yyval.state)[1] = (yyvsp[(1) - (1)].integer);
case 215:
/* Line 1455 of yacc.c */
-#line 1693 "program_parse.y"
+#line 1694 "program_parse.y"
{
(yyval.state)[0] = (yyvsp[(1) - (3)].integer);
(yyval.state)[1] = (yyvsp[(3) - (3)].integer);
case 216:
/* Line 1455 of yacc.c */
-#line 1700 "program_parse.y"
+#line 1701 "program_parse.y"
{
memset((yyval.state), 0, sizeof((yyval.state)));
(yyval.state)[0] = state->state_param_enum;
case 217:
/* Line 1455 of yacc.c */
-#line 1710 "program_parse.y"
+#line 1711 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference");
case 218:
/* Line 1455 of yacc.c */
-#line 1720 "program_parse.y"
+#line 1721 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference");
case 223:
/* Line 1455 of yacc.c */
-#line 1735 "program_parse.y"
+#line 1736 "program_parse.y"
{
(yyval.vector).count = 4;
(yyval.vector).data[0] = (yyvsp[(1) - (1)].real);
case 224:
/* Line 1455 of yacc.c */
-#line 1745 "program_parse.y"
+#line 1746 "program_parse.y"
{
(yyval.vector).count = 1;
(yyval.vector).data[0] = (yyvsp[(1) - (1)].real);
case 225:
/* Line 1455 of yacc.c */
-#line 1753 "program_parse.y"
+#line 1754 "program_parse.y"
{
(yyval.vector).count = 1;
(yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer);
case 226:
/* Line 1455 of yacc.c */
-#line 1763 "program_parse.y"
+#line 1764 "program_parse.y"
{
(yyval.vector).count = 4;
(yyval.vector).data[0] = (yyvsp[(2) - (3)].real);
case 227:
/* Line 1455 of yacc.c */
-#line 1771 "program_parse.y"
+#line 1772 "program_parse.y"
{
(yyval.vector).count = 4;
(yyval.vector).data[0] = (yyvsp[(2) - (5)].real);
case 228:
/* Line 1455 of yacc.c */
-#line 1780 "program_parse.y"
+#line 1781 "program_parse.y"
{
(yyval.vector).count = 4;
(yyval.vector).data[0] = (yyvsp[(2) - (7)].real);
case 229:
/* Line 1455 of yacc.c */
-#line 1789 "program_parse.y"
+#line 1790 "program_parse.y"
{
(yyval.vector).count = 4;
(yyval.vector).data[0] = (yyvsp[(2) - (9)].real);
case 230:
/* Line 1455 of yacc.c */
-#line 1799 "program_parse.y"
+#line 1800 "program_parse.y"
{
(yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real);
;}
case 231:
/* Line 1455 of yacc.c */
-#line 1803 "program_parse.y"
+#line 1804 "program_parse.y"
{
(yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer));
;}
case 232:
/* Line 1455 of yacc.c */
-#line 1808 "program_parse.y"
+#line 1809 "program_parse.y"
{ (yyval.negate) = FALSE; ;}
break;
case 233:
/* Line 1455 of yacc.c */
-#line 1809 "program_parse.y"
+#line 1810 "program_parse.y"
{ (yyval.negate) = TRUE; ;}
break;
case 234:
/* Line 1455 of yacc.c */
-#line 1810 "program_parse.y"
+#line 1811 "program_parse.y"
{ (yyval.negate) = FALSE; ;}
break;
case 235:
/* Line 1455 of yacc.c */
-#line 1813 "program_parse.y"
+#line 1814 "program_parse.y"
{ (yyval.integer) = (yyvsp[(1) - (1)].integer); ;}
break;
case 237:
/* Line 1455 of yacc.c */
-#line 1816 "program_parse.y"
+#line 1817 "program_parse.y"
{ (yyval.integer) = (yyvsp[(1) - (1)].integer); ;}
break;
case 239:
/* Line 1455 of yacc.c */
-#line 1820 "program_parse.y"
+#line 1821 "program_parse.y"
{
if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) {
YYERROR;
case 240:
/* Line 1455 of yacc.c */
-#line 1826 "program_parse.y"
+#line 1827 "program_parse.y"
{
if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) {
YYERROR;
case 241:
/* Line 1455 of yacc.c */
-#line 1834 "program_parse.y"
+#line 1835 "program_parse.y"
{
struct asm_symbol *const s =
declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)]));
case 242:
/* Line 1455 of yacc.c */
-#line 1847 "program_parse.y"
+#line 1848 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.result) = VERT_RESULT_HPOS;
case 243:
/* Line 1455 of yacc.c */
-#line 1856 "program_parse.y"
+#line 1857 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.result) = VERT_RESULT_FOGC;
case 244:
/* Line 1455 of yacc.c */
-#line 1865 "program_parse.y"
+#line 1866 "program_parse.y"
{
(yyval.result) = (yyvsp[(2) - (2)].result);
;}
case 245:
/* Line 1455 of yacc.c */
-#line 1869 "program_parse.y"
+#line 1870 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.result) = VERT_RESULT_PSIZ;
case 246:
/* Line 1455 of yacc.c */
-#line 1878 "program_parse.y"
+#line 1879 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer);
case 247:
/* Line 1455 of yacc.c */
-#line 1887 "program_parse.y"
+#line 1888 "program_parse.y"
{
if (state->mode == ARB_fragment) {
(yyval.result) = FRAG_RESULT_DEPTH;
case 248:
/* Line 1455 of yacc.c */
-#line 1898 "program_parse.y"
+#line 1899 "program_parse.y"
{
(yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer);
;}
case 249:
/* Line 1455 of yacc.c */
-#line 1904 "program_parse.y"
+#line 1905 "program_parse.y"
{
(yyval.integer) = (state->mode == ARB_vertex)
? VERT_RESULT_COL0
case 250:
/* Line 1455 of yacc.c */
-#line 1910 "program_parse.y"
+#line 1911 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.integer) = VERT_RESULT_COL0;
case 251:
/* Line 1455 of yacc.c */
-#line 1919 "program_parse.y"
+#line 1920 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.integer) = VERT_RESULT_BFC0;
case 252:
/* Line 1455 of yacc.c */
-#line 1930 "program_parse.y"
+#line 1931 "program_parse.y"
{
(yyval.integer) = 0;
;}
case 253:
/* Line 1455 of yacc.c */
-#line 1934 "program_parse.y"
+#line 1935 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.integer) = 0;
case 254:
/* Line 1455 of yacc.c */
-#line 1943 "program_parse.y"
+#line 1944 "program_parse.y"
{
if (state->mode == ARB_vertex) {
(yyval.integer) = 1;
case 255:
/* Line 1455 of yacc.c */
-#line 1953 "program_parse.y"
+#line 1954 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 256:
/* Line 1455 of yacc.c */
-#line 1954 "program_parse.y"
+#line 1955 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 257:
/* Line 1455 of yacc.c */
-#line 1955 "program_parse.y"
+#line 1956 "program_parse.y"
{ (yyval.integer) = 1; ;}
break;
case 258:
/* Line 1455 of yacc.c */
-#line 1958 "program_parse.y"
+#line 1959 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 259:
/* Line 1455 of yacc.c */
-#line 1959 "program_parse.y"
+#line 1960 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 260:
/* Line 1455 of yacc.c */
-#line 1960 "program_parse.y"
+#line 1961 "program_parse.y"
{ (yyval.integer) = 1; ;}
break;
case 261:
/* Line 1455 of yacc.c */
-#line 1963 "program_parse.y"
+#line 1964 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 262:
/* Line 1455 of yacc.c */
-#line 1964 "program_parse.y"
+#line 1965 "program_parse.y"
{ (yyval.integer) = (yyvsp[(2) - (3)].integer); ;}
break;
case 263:
/* Line 1455 of yacc.c */
-#line 1967 "program_parse.y"
+#line 1968 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 264:
/* Line 1455 of yacc.c */
-#line 1968 "program_parse.y"
+#line 1969 "program_parse.y"
{ (yyval.integer) = (yyvsp[(2) - (3)].integer); ;}
break;
case 265:
/* Line 1455 of yacc.c */
-#line 1971 "program_parse.y"
+#line 1972 "program_parse.y"
{ (yyval.integer) = 0; ;}
break;
case 266:
/* Line 1455 of yacc.c */
-#line 1972 "program_parse.y"
+#line 1973 "program_parse.y"
{ (yyval.integer) = (yyvsp[(2) - (3)].integer); ;}
break;
case 267:
/* Line 1455 of yacc.c */
-#line 1976 "program_parse.y"
+#line 1977 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector");
case 268:
/* Line 1455 of yacc.c */
-#line 1987 "program_parse.y"
+#line 1988 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector");
case 269:
/* Line 1455 of yacc.c */
-#line 1998 "program_parse.y"
+#line 1999 "program_parse.y"
{
if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector");
case 270:
/* Line 1455 of yacc.c */
-#line 2009 "program_parse.y"
+#line 2010 "program_parse.y"
{
struct asm_symbol *exist = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string));
/* Line 1455 of yacc.c */
-#line 4718 "program_parse.tab.c"
+#line 4719 "program_parse.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
/* Line 1675 of yacc.c */
-#line 2029 "program_parse.y"
+#line 2030 "program_parse.y"
+
+
+void
+asm_instruction_set_operands(struct asm_instruction *inst,
+ const struct prog_dst_register *dst,
+ const struct asm_src_register *src0,
+ const struct asm_src_register *src1,
+ const struct asm_src_register *src2)
+{
+ /* In the core ARB extensions only the KIL instruction doesn't have a
+ * destination register.
+ */
+ if (dst == NULL) {
+ init_dst_reg(& inst->Base.DstReg);
+ } else {
+ inst->Base.DstReg = *dst;
+ }
+
+ inst->Base.SrcReg[0] = src0->Base;
+ inst->SrcReg[0] = *src0;
+
+ if (src1 != NULL) {
+ inst->Base.SrcReg[1] = src1->Base;
+ inst->SrcReg[1] = *src1;
+ } else {
+ init_src_reg(& inst->SrcReg[1]);
+ }
+
+ if (src2 != NULL) {
+ inst->Base.SrcReg[2] = src2->Base;
+ inst->SrcReg[2] = *src2;
+ } else {
+ init_src_reg(& inst->SrcReg[2]);
+ }
+}
struct asm_instruction *
const struct asm_src_register *src1,
const struct asm_src_register *src2)
{
- struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction));
+ struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
if (inst) {
_mesa_init_instructions(& inst->Base, 1);
inst->Base.Opcode = op;
- /* In the core ARB extensions only the KIL instruction doesn't have a
- * destination register.
- */
- if (dst == NULL) {
- init_dst_reg(& inst->Base.DstReg);
- } else {
- inst->Base.DstReg = *dst;
- }
+ asm_instruction_set_operands(inst, dst, src0, src1, src2);
+ }
- inst->Base.SrcReg[0] = src0->Base;
- inst->SrcReg[0] = *src0;
+ return inst;
+}
- if (src1 != NULL) {
- inst->Base.SrcReg[1] = src1->Base;
- inst->SrcReg[1] = *src1;
- } else {
- init_src_reg(& inst->SrcReg[1]);
- }
- if (src2 != NULL) {
- inst->Base.SrcReg[2] = src2->Base;
- inst->SrcReg[2] = *src2;
- } else {
- init_src_reg(& inst->SrcReg[2]);
- }
+struct asm_instruction *
+asm_instruction_copy_ctor(const struct prog_instruction *base,
+ const struct prog_dst_register *dst,
+ const struct asm_src_register *src0,
+ const struct asm_src_register *src1,
+ const struct asm_src_register *src2)
+{
+ struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
+
+ if (inst) {
+ _mesa_init_instructions(& inst->Base, 1);
+ inst->Base.Opcode = base->Opcode;
+ inst->Base.SaturateMode = base->SaturateMode;
+
+ asm_instruction_set_operands(inst, dst, src0, src1, src2);
}
return inst;