From 14b1cb8d5a27ec9716d3f790fce95f0469e35605 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 7 Mar 2010 13:28:57 +0000 Subject: Updated to Mesa 7.7 --- mesalib/src/mesa/shader/grammar/grammar.syn | 567 ----- mesalib/src/mesa/shader/lex.yy.c | 1822 +++++++------- mesalib/src/mesa/shader/nvfragparse.c | 8 +- mesalib/src/mesa/shader/prog_instruction.h | 1 - mesalib/src/mesa/shader/prog_optimize.c | 256 +- mesalib/src/mesa/shader/prog_parameter.c | 2 +- mesalib/src/mesa/shader/prog_print.c | 13 +- mesalib/src/mesa/shader/program.c | 21 +- mesalib/src/mesa/shader/program_lexer.l | 187 +- mesalib/src/mesa/shader/program_parse.tab.c | 2578 +++++++++++--------- mesalib/src/mesa/shader/program_parse.tab.h | 174 +- mesalib/src/mesa/shader/program_parse.y | 486 +++- mesalib/src/mesa/shader/program_parse_extra.c | 126 + mesalib/src/mesa/shader/program_parser.h | 30 +- mesalib/src/mesa/shader/programopt.c | 109 +- mesalib/src/mesa/shader/programopt.h | 7 + mesalib/src/mesa/shader/shader_api.c | 63 +- mesalib/src/mesa/shader/slang/slang_codegen.c | 2 +- mesalib/src/mesa/shader/slang/slang_compile.c | 34 +- .../mesa/shader/slang/slang_compile_operation.c | 1 + .../mesa/shader/slang/slang_compile_operation.h | 1 - mesalib/src/mesa/shader/slang/slang_emit.c | 124 +- mesalib/src/mesa/shader/slang/slang_link.c | 25 +- mesalib/src/mesa/shader/slang/slang_simplify.c | 9 +- mesalib/src/mesa/shader/slang/slang_vartable.c | 4 +- 25 files changed, 3737 insertions(+), 2913 deletions(-) delete mode 100644 mesalib/src/mesa/shader/grammar/grammar.syn (limited to 'mesalib/src/mesa/shader') diff --git a/mesalib/src/mesa/shader/grammar/grammar.syn b/mesalib/src/mesa/shader/grammar/grammar.syn deleted file mode 100644 index 5d99f65bf..000000000 --- a/mesalib/src/mesa/shader/grammar/grammar.syn +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - /** - * \file grammar.syn - * syntax of .syn script - used to validate other syntax files - * \author Michal Krol - */ - -.syntax grammar; - -/* declaration */ -.emtcode DECLARATION_END 0 -.emtcode DECLARATION_EMITCODE 1 -.emtcode DECLARATION_ERRORTEXT 2 -.emtcode DECLARATION_REGBYTE 3 -.emtcode DECLARATION_LEXER 4 -.emtcode DECLARATION_RULE 5 - -/* specifier */ -.emtcode SPECIFIER_END 0 -.emtcode SPECIFIER_AND_TAG 1 -.emtcode SPECIFIER_OR_TAG 2 -.emtcode SPECIFIER_CHARACTER_RANGE 3 -.emtcode SPECIFIER_CHARACTER 4 -.emtcode SPECIFIER_STRING 5 -.emtcode SPECIFIER_IDENTIFIER 6 -.emtcode SPECIFIER_TRUE 7 -.emtcode SPECIFIER_FALSE 8 -.emtcode SPECIFIER_DEBUG 9 - -/* identifier */ -.emtcode IDENTIFIER_SIMPLE 0 -.emtcode IDENTIFIER_LOOP 1 - -/* error */ -.emtcode ERROR_NOT_PRESENT 0 -.emtcode ERROR_PRESENT 1 - -/* emit */ -.emtcode EMIT_NULL 0 -.emtcode EMIT_INTEGER 1 -.emtcode EMIT_IDENTIFIER 2 -.emtcode EMIT_CHARACTER 3 -.emtcode EMIT_LAST_CHARACTER 4 -.emtcode EMIT_CURRENT_POSITION 5 - -.errtext INVALID_GRAMMAR "internal error 2001: invalid grammar script" -.errtext SYNTAX_EXPECTED "internal error 2002: '.syntax' keyword expected" -.errtext IDENTIFIER_EXPECTED "internal error 2003: identifier expected" -.errtext MISSING_SEMICOLON "internal error 2004: missing ';'" -.errtext INTEGER_EXPECTED "internal error 2005: integer value expected" -.errtext STRING_EXPECTED "internal error 2006: string expected" - -/* - ::= ".syntax" ";" -*/ -grammar - grammar_1 .error INVALID_GRAMMAR; -grammar_1 - optional_space .and ".syntax" .error SYNTAX_EXPECTED .and space .and identifier .and - semicolon .and declaration_list .and optional_space .and '\0' .emit DECLARATION_END; - -/* - ::= - | "" -*/ -optional_space - space .or .true; - -/* - ::= * -*/ -space - single_space .and .loop single_space; - -/* - ::= - | -*/ -single_space - white_char .or comment_block; - -/* - ::= " " - | "\t" - | "\n" - | "\r" -*/ -white_char - ' ' .or '\t' .or '\n' .or '\r'; - -/* - ::= "/" "*" -*/ -comment_block - '/' .and '*' .and comment_rest; - -/* - ::= * - | * "*" -*/ -comment_rest - .loop comment_char_no_star .and comment_rest_1; -comment_rest_1 - comment_end .or comment_rest_2; -comment_rest_2 - '*' .and comment_rest; - -/* - ::= All ASCII characters except "*" and "\0" -*/ -comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -/* - ::= "*" "/" -*/ -comment_end - '*' .and '/'; - -/* - ::= -*/ -identifier - identifier_ne .error IDENTIFIER_EXPECTED; - -/* - ::= * -*/ -identifier_ne - first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit '\0'; - -/* - ::= "a"-"z" - | "A"-"Z" - | "_" -*/ -first_idchar - 'a'-'z' .or 'A'-'Z' .or '_'; - -/* - ::= - | -*/ -follow_idchar - first_idchar .or digit_dec; - -/* - ::= "0"-"9" -*/ -digit_dec - '0'-'9'; - -/* - ::= ";" -*/ -semicolon - optional_space .and ';' .error MISSING_SEMICOLON .and optional_space; - -/* - ::= - | -*/ -declaration_list - declaration .and .loop declaration; - -/* - ::= - | - | - | -*/ -declaration - emitcode_definition .emit DECLARATION_EMITCODE .or - errortext_definition .emit DECLARATION_ERRORTEXT .or - regbyte_definition .emit DECLARATION_REGBYTE .or - lexer_definition .emit DECLARATION_LEXER .or - rule_definition .emit DECLARATION_RULE; - -/* - ::= ".emtcode" -*/ -emitcode_definition - ".emtcode" .and space .and identifier .and space .and integer .and space_or_null; - -/* - ::= -*/ -integer - integer_ne .error INTEGER_EXPECTED; - -/* - ::= - | -*/ -integer_ne - hex_integer .emit 0x10 .or dec_integer .emit 10; - -/* - :: * -*/ -hex_integer - hex_prefix .and digit_hex .emit * .and .loop digit_hex .emit * .and .true .emit '\0'; - -/* - ::= "0x" - | "0X" -*/ -hex_prefix - '0' .and hex_prefix_1; -hex_prefix_1 - 'x' .or 'X'; - -/* - ::= "0"-"9" - | "a"-"f" - | "A"-"F" -*/ -digit_hex - '0'-'9' .or 'a'-'f' .or 'A'-'F'; - -/* - :: * -*/ -dec_integer - digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -/* - ::= - | "\0" -*/ -space_or_null - space .or '\0'; - -/* - ::= ".errtext" -*/ -errortext_definition - ".errtext" .and space .and identifier .and space .and string .and space_or_null; - -/* - ::= -*/ -string - string_ne .error STRING_EXPECTED; - -/* - ::= "\"" "\"" -*/ -string_ne - '"' .and .loop string_char_double_quotes .and '"' .emit '\0'; - -/* - ::= - | - | "\'" -*/ -string_char_double_quotes - escape_sequence .or string_char .emit * .or '\'' .emit *; - -/* - ::= All ASCII characters except "\'", "\"", "\n", "\r", - "\0" and "\\" -*/ -string_char - '\x5D'-'\xFF' .or '\x28'-'\x5B' .or '\x23'-'\x26' .or '\x0E'-'\x21' .or '\x0B'-'\x0C' .or - '\x01'-'\x09'; - -/* - ::= "\\" -*/ -escape_sequence - '\\' .emit * .and escape_code; - -/* - ::= - | - | -*/ -escape_code - simple_escape_code .emit * .or hex_escape_code .or oct_escape_code; - -/* - ::= "\'" - | "\"" - | "?" - | "\\" - | "a" - | "b" - | "f" - | "n" - | "r" - | "t" - | "v" -*/ -simple_escape_code - '\'' .or '"' .or '?' .or '\\' .or 'a' .or 'b' .or 'f' .or 'n' .or 'r' .or 't' .or 'v'; - -/* - ::= "x" * -*/ -hex_escape_code - 'x' .emit * .and digit_hex .emit * .and .loop digit_hex .emit *; - -/* - ::= -*/ -oct_escape_code - digit_oct .emit * .and optional_digit_oct .and optional_digit_oct; - -/* - ::= "0"-"7" -*/ -digit_oct - '0'-'7'; - -/* - ::= - | "" -*/ -optional_digit_oct - digit_oct .emit * .or .true; - -/* - ::= ".regbyte" -*/ -regbyte_definition - ".regbyte" .and space .and identifier .and space .and integer .and space_or_null; - -/* - ::= ".string" ";" -*/ -lexer_definition - ".string" .and space .and identifier .and semicolon; - -/* - ::= -*/ -rule_definition - identifier_ne .and space .and definition; - -/* - ::= ";" -*/ -definition - specifier .and optional_specifiers_and_or .and semicolon .emit SPECIFIER_END; - -/* - ::= - | - | "" -*/ -optional_specifiers_and_or - and_specifiers .emit SPECIFIER_AND_TAG .or or_specifiers .emit SPECIFIER_OR_TAG .or .true; - -/* - ::= -*/ -specifier - specifier_condition .and optional_space .and specifier_rule; - -/* - ::= ".if" "(" ")" -*/ -specifier_condition - specifier_condition_1 .or .true; -specifier_condition_1 - ".if" .and optional_space .and '(' .and optional_space .and left_operand .and operator .and - right_operand .and optional_space .and ')'; - -/* - ::= -*/ -left_operand - identifier; - -/* - ::= "!=" - | "==" -*/ -operator - operator_1 .or operator_2; -operator_1 - optional_space .and '!' .and '=' .and optional_space; -operator_2 - optional_space .and '=' .and '=' .and optional_space; - -/* - ::= -*/ -right_operand - integer; - -/* - ::= * - | * - | * - | ".true" * - | ".false" * - | ".debug" * - | * -*/ -specifier_rule - specifier_rule_1 .and optional_error .and .loop emit .and .true .emit EMIT_NULL; -specifier_rule_1 - character_range .emit SPECIFIER_CHARACTER_RANGE .or - character .emit SPECIFIER_CHARACTER .or - string_ne .emit SPECIFIER_STRING .or - ".true" .emit SPECIFIER_TRUE .or - ".false" .emit SPECIFIER_FALSE .or - ".debug" .emit SPECIFIER_DEBUG .or - advanced_identifier .emit SPECIFIER_IDENTIFIER; - -/* - ::= "\'" ::= - | - | "\"" -*/ -string_char_single_quotes - escape_sequence .or string_char .emit * .or '"' .emit *; - -/* - ::= "-" -*/ -character_range - character .and optional_space .and '-' .and optional_space .and character; - -/* - ::= -*/ -advanced_identifier - optional_loop .and identifier; - -/* - ::= ".loop" - | "" -*/ -optional_loop - optional_loop_1 .emit IDENTIFIER_LOOP .or .true .emit IDENTIFIER_SIMPLE; -optional_loop_1 - ".loop" .and space; - -/* - ::= - | "" -*/ -optional_error - error .emit ERROR_PRESENT .or .true .emit ERROR_NOT_PRESENT; - -/* - :: ".error" -*/ -error - space .and ".error" .and space .and identifier; - -/* - ::= - | -*/ -emit - emit_output .or emit_regbyte; - -/* - ::= ".emit" -*/ -emit_output - space .and ".emit" .and space .and emit_param; - -/* - ::= - | - | - | "*" - | "$" -*/ -emit_param - integer_ne .emit EMIT_INTEGER .or - identifier_ne .emit EMIT_IDENTIFIER .or - character .emit EMIT_CHARACTER .or - '*' .emit EMIT_LAST_CHARACTER .or - '$' .emit EMIT_CURRENT_POSITION; - -/* - ::= ".load" -*/ -emit_regbyte - space .and ".load" .and space .and identifier .and space .and emit_param; - -/* - ::= * -*/ -and_specifiers - and_specifier .and .loop and_specifier; - -/* - ::= * -*/ -or_specifiers - or_specifier .and .loop or_specifier; - -/* - ::= ".and" -*/ -and_specifier - space .and ".and" .and space .and specifier; - -/* - ::= ".or" -*/ -or_specifier - space .and ".or" .and space .and specifier; - - -.string __string_filter; - -/* - <__string_filter> ::= <__first_identifier_char> <__next_identifier_char>* -*/ -__string_filter - __first_identifier_char .and .loop __next_identifier_char; - -/* - <__first_identifier_char> ::= "a"-"z" - | "A"-"Z" - | "_" - | "." -*/ -__first_identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '.'; - -/* - <__next_identifier_char> ::= "a"-"z" - | "A"-"Z" - | "_" - | "0"-"9" -*/ -__next_identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/mesalib/src/mesa/shader/lex.yy.c b/mesalib/src/mesa/shader/lex.yy.c index fefef573e..68543ae2e 100644 --- a/mesalib/src/mesa/shader/lex.yy.c +++ b/mesalib/src/mesa/shader/lex.yy.c @@ -53,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -157,7 +158,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -348,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 183 -#define YY_END_OF_BUFFER 184 +#define YY_NUM_RULES 170 +#define YY_END_OF_BUFFER 171 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -357,82 +366,101 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[675] = +static yyconst flex_int16_t yy_accept[850] = { 0, - 0, 0, 184, 182, 180, 179, 182, 182, 152, 178, - 154, 154, 154, 154, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 180, 0, 0, 181, 152, 0, - 153, 155, 175, 175, 0, 0, 0, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 132, 176, 133, 134, - 166, 166, 166, 166, 0, 154, 0, 140, 141, 142, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 173, 0, 0, 0, + 0, 0, 171, 169, 167, 166, 169, 169, 139, 165, + 141, 141, 141, 141, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 167, 0, 0, 168, 139, + 0, 140, 142, 162, 162, 0, 0, 0, 0, 162, + 0, 0, 0, 0, 0, 0, 0, 119, 163, 120, + 121, 153, 153, 153, 153, 0, 141, 0, 127, 128, + 129, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 163, 163, 163, 164, 164, 165, 156, - 155, 156, 0, 157, 11, 13, 152, 15, 152, 152, - 16, 18, 152, 20, 22, 24, 26, 6, 28, 30, - 31, 33, 35, 38, 36, 40, 41, 43, 45, 47, - - 49, 51, 152, 152, 152, 53, 55, 152, 57, 59, - 61, 152, 63, 65, 67, 69, 152, 71, 73, 75, - 77, 152, 152, 152, 152, 152, 152, 0, 0, 0, - 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 93, 94, 96, 0, 171, 0, 0, 0, - 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 170, 169, 169, 122, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 160, 160, - 161, 162, 0, 158, 152, 152, 152, 152, 152, 152, - 152, 152, 143, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 144, 152, 152, 152, 152, 152, 152, - 152, 152, 10, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 0, 177, 0, 0, 0, 86, 87, - 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, + 159, 159, 159, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 150, 150, 151, 151, 152, 143, + 142, 143, 0, 144, 11, 12, 139, 13, 139, 139, + 14, 15, 139, 16, 17, 18, 19, 20, 21, 6, + + 22, 23, 24, 25, 26, 28, 27, 29, 30, 31, + 32, 33, 34, 35, 139, 139, 139, 139, 139, 40, + 41, 139, 42, 43, 44, 45, 46, 47, 48, 139, + 49, 50, 51, 52, 53, 54, 55, 139, 56, 57, + 58, 59, 139, 139, 64, 65, 139, 139, 139, 139, + 139, 139, 0, 0, 0, 0, 142, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 80, 81, 83, + 0, 158, 0, 0, 0, 0, 0, 0, 97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 156, 156, 109, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 147, 147, 148, 149, 0, 145, 11, + 11, 139, 12, 12, 12, 139, 139, 139, 139, 139, + 15, 15, 139, 130, 16, 16, 139, 17, 17, 139, + 18, 18, 139, 19, 19, 139, 20, 20, 139, 21, + 21, 139, 22, 22, 139, 24, 24, 139, 25, 25, + 139, 28, 28, 139, 27, 27, 139, 30, 30, 139, + 31, 31, 139, 32, 32, 139, 33, 33, 139, 34, + 34, 139, 35, 35, 139, 139, 139, 139, 36, 139, + 38, 139, 40, 40, 139, 41, 41, 139, 131, 42, + 42, 139, 43, 43, 139, 139, 45, 45, 139, 46, + + 46, 139, 47, 47, 139, 48, 48, 139, 139, 49, + 49, 139, 50, 50, 139, 51, 51, 139, 52, 52, + 139, 53, 53, 139, 54, 54, 139, 139, 10, 56, + 139, 57, 139, 58, 139, 59, 139, 60, 139, 62, + 139, 64, 64, 139, 139, 139, 139, 139, 139, 139, + 139, 0, 164, 0, 0, 0, 73, 74, 0, 0, + 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, - 126, 0, 128, 0, 0, 0, 0, 0, 0, 167, - 159, 152, 152, 152, 4, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 9, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 82, 152, 152, 0, 0, 0, - 0, 0, 88, 89, 0, 0, 0, 0, 97, 0, - 0, 101, 104, 0, 0, 0, 0, 0, 0, 0, - 115, 116, 0, 0, 0, 0, 121, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 152, 152, 152, - 152, 152, 152, 5, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 7, 8, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 83, - 152, 79, 0, 0, 0, 0, 137, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 107, 0, 111, 112, - 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 130, 131, 0, 0, 138, 12, 3, 14, - 148, 149, 152, 17, 19, 21, 23, 25, 27, 29, - 32, 34, 39, 37, 42, 44, 46, 48, 50, 52, - 54, 56, 58, 60, 62, 152, 152, 152, 64, 66, - 68, 70, 72, 74, 76, 78, 152, 81, 139, 0, - 0, 84, 0, 90, 0, 0, 0, 99, 0, 0, - - 0, 0, 0, 0, 113, 0, 0, 119, 106, 0, - 0, 0, 0, 0, 0, 135, 0, 152, 145, 146, - 152, 80, 0, 0, 0, 0, 92, 95, 100, 0, - 0, 105, 0, 0, 0, 118, 0, 0, 0, 0, - 127, 129, 0, 152, 152, 2, 1, 0, 91, 0, - 103, 0, 109, 117, 0, 0, 124, 125, 136, 152, - 147, 0, 102, 0, 120, 123, 152, 85, 108, 152, - 152, 150, 151, 0 + 0, 0, 0, 0, 155, 0, 0, 0, 113, 0, + 115, 0, 0, 0, 0, 0, 0, 154, 146, 139, + + 139, 139, 4, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 9, 37, 39, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 60, 139, 61, 62, 139, 63, 139, 139, 139, 139, + 139, 69, 139, 139, 0, 0, 0, 0, 0, 75, + 76, 0, 0, 0, 0, 84, 0, 0, 88, 91, + 0, 0, 0, 0, 0, 0, 0, 102, 103, 0, + 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 139, 139, 139, 139, 139, 139, + 5, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 7, 8, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 61, 139, 139, 63, 139, 139, + 139, 139, 139, 70, 139, 66, 0, 0, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 94, 0, 98, 99, 0, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 117, 118, 0, 0, + + 125, 11, 3, 12, 135, 136, 139, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 24, 25, 28, 27, + 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 139, 139, 139, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 139, + 139, 139, 139, 64, 65, 139, 68, 126, 0, 0, + 71, 0, 77, 0, 0, 0, 86, 0, 0, 0, + 0, 0, 0, 100, 0, 0, 106, 93, 0, 0, + 0, 0, 0, 0, 122, 0, 139, 132, 133, 139, + 60, 139, 62, 139, 67, 0, 0, 0, 0, 79, + + 82, 87, 0, 0, 92, 0, 0, 0, 105, 0, + 0, 0, 0, 114, 116, 0, 139, 139, 61, 63, + 2, 1, 0, 78, 0, 90, 0, 96, 104, 0, + 0, 111, 112, 123, 139, 134, 0, 89, 0, 107, + 110, 139, 72, 95, 139, 139, 137, 138, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -478,280 +506,357 @@ static yyconst flex_int32_t yy_meta[68] = 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[678] = +static yyconst flex_int16_t yy_base[853] = { 0, - 0, 0, 954, 955, 66, 955, 948, 949, 0, 69, - 85, 128, 140, 152, 151, 58, 39, 48, 75, 927, - 158, 160, 73, 59, 71, 170, 54, 920, 890, 889, - 901, 885, 899, 898, 142, 927, 939, 955, 0, 206, - 955, 189, 168, 171, 53, 27, 66, 119, 175, 899, - 885, 123, 170, 883, 895, 183, 955, 198, 225, 99, - 212, 219, 223, 227, 285, 297, 308, 955, 955, 955, - 904, 917, 911, 165, 900, 903, 899, 914, 224, 896, - 910, 194, 896, 909, 900, 913, 890, 901, 892, 294, - 893, 884, 893, 884, 883, 884, 878, 884, 895, 881, - - 878, 890, 893, 880, 873, 889, 865, 193, 139, 885, - 861, 846, 841, 858, 834, 839, 865, 167, 854, 259, - 849, 325, 282, 851, 832, 302, 842, 838, 833, 43, - 839, 825, 841, 838, 829, 305, 309, 831, 820, 834, - 837, 819, 834, 821, 818, 825, 275, 833, 254, 299, - 317, 327, 331, 810, 827, 828, 821, 803, 310, 804, - 826, 817, 316, 327, 331, 335, 339, 343, 347, 955, - 405, 416, 422, 428, 825, 240, 849, 0, 848, 831, - 821, 820, 840, 818, 817, 816, 815, 0, 814, 0, - 813, 812, 0, 811, 810, 0, 809, 808, 807, 806, - - 805, 804, 820, 813, 826, 800, 799, 805, 797, 796, - 795, 816, 793, 792, 791, 790, 800, 788, 787, 786, - 785, 777, 776, 761, 761, 760, 759, 802, 774, 762, - 434, 442, 416, 766, 186, 763, 757, 757, 751, 764, - 764, 749, 955, 955, 764, 752, 418, 759, 281, 756, - 762, 308, 757, 955, 748, 755, 754, 757, 743, 742, - 746, 741, 278, 746, 420, 428, 430, 955, 738, 736, - 736, 744, 745, 727, 421, 732, 738, 419, 426, 430, - 434, 438, 496, 502, 752, 764, 750, 749, 742, 756, - 746, 745, 0, 744, 743, 742, 741, 740, 739, 738, - - 737, 736, 735, 734, 733, 732, 731, 730, 733, 726, - 733, 726, 725, 0, 724, 723, 722, 725, 720, 719, - 718, 717, 0, 716, 715, 714, 713, 691, 685, 690, - 696, 679, 694, 315, 955, 693, 683, 687, 955, 955, - 677, 686, 672, 689, 672, 675, 669, 955, 670, 669, - 666, 673, 666, 674, 670, 680, 677, 659, 665, 672, - 656, 655, 673, 655, 667, 666, 955, 665, 655, 659, - 955, 646, 955, 651, 651, 659, 642, 643, 653, 955, - 955, 685, 667, 683, 0, 507, 681, 681, 680, 679, - 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, - - 668, 667, 666, 665, 652, 645, 0, 662, 661, 660, - 659, 658, 636, 656, 655, 654, 653, 652, 651, 650, - 649, 618, 621, 601, 0, 602, 595, 602, 601, 602, - 594, 612, 955, 955, 594, 592, 602, 595, 955, 590, - 607, 330, 955, 598, 582, 583, 592, 583, 582, 582, - 955, 581, 590, 580, 596, 593, 955, 592, 590, 579, - 580, 576, 568, 575, 570, 571, 566, 592, 592, 590, - 604, 603, 598, 0, 586, 585, 584, 583, 582, 581, - 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, - 570, 0, 0, 569, 568, 567, 566, 565, 509, 564, - - 563, 562, 561, 560, 559, 558, 557, 535, 535, 0, - 542, 0, 576, 575, 524, 542, 955, 537, 532, 525, - 521, 533, 523, 521, 517, 533, 524, 523, 955, 955, - 526, 955, 521, 514, 503, 514, 506, 510, 523, 518, - 521, 503, 955, 955, 515, 504, 955, 0, 0, 0, - 0, 0, 543, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1299, 1300, 66, 1300, 1293, 1294, 0, 69, + 85, 128, 140, 152, 151, 58, 56, 63, 76, 1272, + 158, 160, 39, 163, 173, 189, 52, 1265, 76, 1235, + 1234, 1246, 1230, 1244, 1243, 105, 1272, 1284, 1300, 0, + 225, 1300, 218, 160, 157, 20, 123, 66, 119, 192, + 1244, 1230, 54, 162, 1228, 1240, 194, 1300, 200, 195, + 98, 227, 196, 231, 235, 293, 305, 316, 1300, 1300, + 1300, 1249, 1262, 1256, 223, 1245, 1248, 1244, 1259, 107, + 298, 1241, 1255, 246, 1241, 1254, 1245, 1258, 1235, 1246, + 1237, 182, 1238, 1229, 1238, 1229, 1228, 1229, 144, 1223, + + 1229, 1240, 1231, 1225, 1222, 1223, 1227, 289, 1236, 1223, + 302, 1230, 1217, 1231, 1207, 65, 315, 276, 1227, 1226, + 1202, 1187, 1182, 1199, 1175, 1180, 1206, 279, 1195, 293, + 1190, 342, 299, 1192, 1173, 317, 1183, 1179, 1174, 207, + 1180, 1166, 1182, 1179, 1170, 320, 324, 1172, 1161, 1175, + 1178, 1160, 1175, 1162, 1159, 1166, 284, 1174, 227, 288, + 327, 342, 345, 1151, 1168, 1169, 1162, 1144, 318, 1145, + 1167, 1158, 330, 341, 345, 349, 353, 357, 361, 1300, + 419, 430, 436, 442, 440, 441, 1191, 0, 1190, 1173, + 1163, 443, 1183, 444, 451, 468, 470, 472, 471, 0, + + 496, 0, 497, 498, 0, 499, 500, 0, 524, 525, + 526, 536, 537, 553, 1178, 1171, 1184, 354, 356, 561, + 563, 1165, 564, 565, 1157, 580, 590, 591, 592, 1178, + 593, 617, 618, 619, 629, 630, 1155, 1165, 330, 362, + 419, 483, 445, 364, 646, 1153, 1145, 1144, 1129, 1129, + 1128, 1127, 1170, 1142, 1130, 662, 669, 643, 1134, 487, + 1131, 1125, 1125, 1119, 1132, 1132, 1117, 1300, 1300, 1132, + 1120, 646, 1127, 135, 1124, 1130, 561, 1125, 1300, 1116, + 1123, 1122, 1125, 1111, 1110, 1114, 1109, 448, 1114, 650, + 653, 665, 1300, 1106, 1104, 1104, 1112, 1113, 1095, 670, + + 1100, 1106, 486, 579, 655, 661, 668, 726, 732, 1112, + 682, 1119, 1110, 688, 730, 1117, 1116, 1109, 1123, 1113, + 1104, 712, 1111, 0, 1102, 731, 1109, 1100, 733, 1107, + 1098, 734, 1105, 1096, 736, 1103, 1094, 737, 1101, 1092, + 738, 1099, 1090, 739, 1097, 1088, 740, 1095, 1086, 741, + 1093, 1084, 742, 1091, 1082, 743, 1089, 1080, 744, 1087, + 1078, 745, 1085, 1076, 746, 1083, 1074, 747, 1081, 1072, + 748, 1079, 1070, 749, 1077, 1080, 1073, 1080, 0, 1073, + 0, 1088, 1063, 750, 1070, 1061, 751, 1068, 0, 1059, + 752, 1066, 1057, 755, 1064, 1063, 1054, 758, 1061, 1052, + + 776, 1059, 1050, 777, 1057, 1048, 779, 1055, 1058, 1045, + 780, 1052, 1043, 782, 1050, 1041, 783, 1048, 1039, 784, + 1046, 1037, 785, 1044, 1035, 786, 1042, 1041, 0, 1032, + 1039, 1030, 1037, 1028, 1035, 1026, 1033, 787, 1032, 788, + 1047, 1022, 789, 1029, 1028, 1006, 1000, 1005, 1011, 994, + 1009, 424, 1300, 1008, 998, 1002, 1300, 1300, 992, 1001, + 987, 1004, 987, 990, 984, 1300, 985, 984, 981, 988, + 981, 989, 985, 995, 992, 974, 980, 987, 971, 970, + 988, 970, 982, 981, 1300, 980, 970, 974, 1300, 961, + 1300, 966, 966, 974, 957, 958, 968, 1300, 1300, 1000, + + 982, 998, 0, 798, 996, 996, 995, 994, 993, 992, + 991, 990, 989, 988, 987, 986, 985, 984, 983, 982, + 981, 980, 979, 978, 965, 958, 0, 0, 0, 975, + 974, 973, 972, 971, 970, 969, 968, 967, 945, 965, + 964, 963, 962, 961, 960, 959, 958, 957, 956, 955, + 929, 936, 793, 927, 934, 794, 950, 949, 918, 921, + 901, 0, 902, 895, 902, 901, 902, 894, 912, 1300, + 1300, 894, 892, 902, 895, 1300, 890, 907, 516, 1300, + 898, 882, 883, 892, 883, 882, 882, 1300, 881, 890, + 880, 896, 893, 1300, 892, 890, 879, 880, 876, 868, + + 875, 870, 871, 866, 892, 892, 890, 904, 903, 898, + 0, 886, 885, 884, 883, 882, 881, 880, 879, 878, + 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, + 0, 0, 867, 866, 865, 864, 863, 862, 861, 860, + 859, 804, 858, 857, 856, 855, 854, 853, 852, 851, + 850, 849, 848, 865, 839, 846, 862, 836, 843, 841, + 840, 818, 818, 0, 825, 0, 859, 858, 807, 825, + 1300, 820, 815, 808, 804, 816, 806, 804, 800, 816, + 807, 806, 1300, 1300, 809, 1300, 804, 797, 786, 797, + 789, 793, 806, 801, 804, 786, 1300, 1300, 798, 787, + + 1300, 0, 0, 0, 0, 0, 826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 539, 538, 536, 0, 0, - 0, 0, 0, 0, 0, 0, 494, 0, 0, 545, - 544, 955, 491, 955, 495, 495, 504, 955, 488, 502, - - 483, 485, 482, 490, 955, 468, 479, 955, 955, 483, - 479, 472, 470, 470, 483, 955, 467, 507, 0, 0, - 507, 0, 514, 513, 472, 433, 955, 955, 955, 435, - 435, 955, 429, 386, 377, 955, 366, 365, 323, 328, - 955, 955, 339, 348, 337, 955, 955, 307, 955, 305, - 955, 257, 955, 955, 247, 221, 955, 955, 955, 236, - 0, 213, 955, 150, 955, 955, 232, 955, 955, 162, - 138, 0, 0, 955, 541, 108, 544 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 814, 813, 802, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, + 798, 779, 792, 0, 0, 656, 0, 0, 706, 702, + 1300, 649, 1300, 648, 648, 654, 1300, 637, 645, 610, + 612, 608, 608, 1300, 572, 583, 1300, 1300, 577, 573, + 560, 557, 542, 555, 1300, 539, 573, 0, 0, 572, + 0, 555, 0, 546, 0, 562, 551, 495, 479, 1300, + + 1300, 1300, 481, 481, 1300, 480, 443, 31, 1300, 141, + 166, 171, 186, 1300, 1300, 211, 236, 276, 0, 0, + 1300, 1300, 290, 1300, 325, 1300, 346, 1300, 1300, 343, + 341, 1300, 1300, 1300, 365, 0, 380, 1300, 371, 1300, + 1300, 486, 1300, 1300, 451, 458, 0, 0, 1300, 836, + 503, 839 } ; -static yyconst flex_int16_t yy_def[678] = +static yyconst flex_int16_t yy_def[853] = { 0, - 674, 1, 674, 674, 674, 674, 674, 675, 676, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 674, 674, 675, 674, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 677, 674, 674, 674, 674, 674, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 676, 676, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 676, - 676, 674, 674, 674, 674, 674, 676, 674, 674, 676, - 676, 676, 676, 0, 674, 674, 674 + 849, 1, 849, 849, 849, 849, 849, 850, 851, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 850, 849, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 852, 849, 849, 849, 849, + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 849, 849, 849, 849, + 849, 851, 849, 849, 851, 851, 851, 851, 0, 849, + 849, 849 } ; -static yyconst flex_int16_t yy_nxt[1023] = +static yyconst flex_int16_t yy_nxt[1368] = { 0, 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, 9, 9, 9, 20, 21, 22, 9, 23, 24, - 9, 25, 26, 27, 9, 9, 9, 28, 9, 9, - 9, 9, 9, 9, 9, 9, 29, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 30, 9, 31, 32, - 33, 9, 34, 9, 9, 9, 9, 35, 79, 35, - 40, 80, 129, 108, 96, 81, 130, 41, 42, 42, - 42, 42, 42, 42, 76, 82, 77, 97, 98, 240, - 99, 109, 78, 65, 66, 66, 66, 66, 66, 66, - - 83, 241, 94, 100, 67, 127, 84, 95, 128, 39, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 131, - 132, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 67, 133, 61, 62, 63, 64, 65, 66, 66, 66, - 66, 66, 66, 35, 160, 35, 68, 67, 65, 66, - 66, 66, 66, 66, 66, 219, 673, 161, 69, 67, - 65, 66, 66, 66, 66, 66, 66, 71, 220, 72, - 70, 67, 140, 67, 134, 90, 73, 135, 141, 86, - 672, 87, 74, 91, 75, 67, 88, 101, 92, 89, - 178, 102, 103, 104, 93, 105, 179, 67, 42, 42, - - 42, 42, 42, 42, 106, 189, 107, 40, 122, 123, - 123, 142, 126, 123, 669, 123, 136, 137, 123, 217, - 124, 124, 123, 190, 147, 143, 123, 125, 125, 123, - 218, 337, 144, 123, 122, 148, 184, 185, 149, 151, - 152, 150, 670, 671, 338, 153, 186, 118, 119, 45, - 46, 47, 48, 154, 50, 51, 123, 162, 52, 53, - 54, 55, 56, 57, 120, 59, 60, 668, 155, 121, - 156, 286, 667, 157, 158, 163, 163, 163, 163, 666, - 287, 159, 164, 163, 165, 166, 167, 163, 163, 168, - 169, 163, 163, 163, 171, 171, 171, 171, 171, 171, - - 230, 665, 664, 260, 172, 65, 66, 66, 66, 66, - 66, 66, 198, 261, 154, 173, 67, 174, 174, 174, - 174, 174, 174, 233, 233, 364, 349, 257, 365, 233, - 172, 199, 231, 258, 232, 232, 232, 232, 232, 232, - 233, 350, 67, 233, 233, 236, 233, 233, 262, 233, - 247, 233, 233, 353, 263, 273, 233, 663, 233, 233, - 233, 428, 662, 233, 233, 274, 354, 233, 265, 233, - 661, 264, 266, 267, 233, 233, 660, 429, 233, 278, - 278, 278, 278, 524, 659, 233, 525, 658, 657, 233, - 278, 278, 278, 278, 279, 278, 278, 280, 281, 278, - - 278, 278, 278, 278, 278, 278, 282, 278, 278, 278, - 278, 278, 278, 278, 42, 42, 42, 42, 42, 42, - 656, 655, 654, 283, 122, 284, 284, 284, 284, 284, - 284, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 232, 232, 232, 232, 232, 232, 653, - 122, 232, 232, 232, 232, 232, 232, 335, 335, 335, - 335, 335, 335, 335, 374, 335, 375, 335, 376, 335, - 335, 367, 335, 652, 335, 335, 335, 335, 335, 651, - 650, 377, 380, 380, 380, 380, 335, 649, 335, 380, - 380, 380, 380, 381, 380, 380, 380, 380, 380, 380, - - 380, 380, 380, 380, 380, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 471, 472, 576, - 577, 648, 647, 646, 645, 644, 643, 642, 641, 640, - 639, 638, 637, 636, 635, 634, 633, 632, 631, 473, - 578, 37, 37, 37, 170, 170, 630, 629, 628, 627, - 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, - 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, - 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, - 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 575, 574, - - 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, - 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, - 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, - 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 532, 531, 530, 529, 528, 527, 526, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, - 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, - 481, 480, 479, 478, 477, 476, 475, 474, 470, 469, - - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - 386, 385, 384, 383, 382, 379, 378, 373, 372, 371, - 370, 369, 368, 366, 363, 362, 361, 360, 359, 358, - - 357, 356, 355, 352, 351, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 336, 264, 236, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 285, 277, 276, 275, 272, - 271, 270, 269, 268, 259, 256, 255, 254, 253, 252, - 251, 250, 249, 248, 246, 245, 244, 243, 242, 239, - 238, 237, 235, 234, 162, 229, 228, 227, 226, 225, - - 224, 223, 222, 221, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, - 200, 197, 196, 195, 194, 193, 192, 191, 188, 187, - 183, 182, 181, 180, 177, 176, 175, 146, 145, 139, - 138, 38, 117, 116, 115, 114, 113, 112, 111, 110, - 85, 38, 36, 674, 3, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 9, 25, 26, 27, 28, 9, 9, 29, 9, 9, + 9, 9, 9, 9, 9, 9, 30, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 31, 9, 32, 33, + 34, 9, 35, 9, 9, 9, 9, 36, 96, 36, + 41, 116, 137, 97, 80, 138, 829, 42, 43, 43, + 43, 43, 43, 43, 77, 81, 78, 119, 82, 117, + 83, 238, 79, 66, 67, 67, 67, 67, 67, 67, + + 84, 85, 239, 150, 68, 120, 36, 86, 36, 151, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 141, + 142, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 68, 143, 62, 63, 64, 65, 66, 67, 67, 67, + 67, 67, 67, 170, 194, 195, 69, 68, 66, 67, + 67, 67, 67, 67, 67, 218, 171, 219, 70, 68, + 66, 67, 67, 67, 67, 67, 67, 72, 139, 73, + 71, 68, 140, 68, 144, 92, 74, 145, 98, 88, + 467, 89, 75, 93, 76, 68, 90, 99, 94, 91, + 101, 100, 102, 103, 95, 468, 830, 68, 136, 133, + + 210, 133, 133, 152, 133, 104, 105, 133, 106, 107, + 108, 109, 110, 134, 111, 133, 112, 153, 133, 211, + 135, 831, 113, 114, 154, 115, 41, 43, 43, 43, + 43, 43, 43, 146, 147, 157, 832, 132, 165, 133, + 166, 161, 162, 167, 168, 833, 158, 163, 188, 159, + 133, 169, 160, 265, 189, 164, 834, 201, 133, 174, + 173, 175, 176, 132, 835, 266, 128, 129, 46, 47, + 48, 49, 172, 51, 52, 202, 285, 53, 54, 55, + 56, 57, 58, 130, 60, 61, 286, 243, 131, 244, + 173, 173, 173, 173, 177, 173, 173, 178, 179, 173, + + 173, 173, 181, 181, 181, 181, 181, 181, 228, 836, + 196, 197, 182, 66, 67, 67, 67, 67, 67, 67, + 198, 232, 229, 183, 68, 184, 184, 184, 184, 184, + 184, 240, 134, 241, 255, 233, 282, 287, 182, 135, + 258, 258, 283, 288, 242, 837, 258, 430, 164, 256, + 68, 257, 257, 257, 257, 257, 257, 258, 258, 258, + 261, 258, 258, 298, 258, 272, 258, 258, 258, 258, + 431, 258, 381, 299, 258, 258, 379, 838, 258, 432, + 440, 289, 258, 290, 258, 258, 291, 292, 380, 258, + 382, 839, 258, 303, 303, 303, 303, 840, 441, 841, + + 258, 842, 433, 258, 303, 303, 303, 303, 304, 303, + 303, 305, 306, 303, 303, 303, 303, 303, 303, 303, + 307, 303, 303, 303, 303, 303, 303, 303, 43, 43, + 43, 43, 43, 43, 843, 844, 434, 308, 132, 309, + 309, 309, 309, 309, 309, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 310, 313, 435, + 321, 325, 311, 314, 132, 322, 326, 438, 328, 847, + 565, 311, 315, 329, 322, 326, 848, 311, 314, 439, + 312, 316, 329, 323, 327, 331, 566, 334, 340, 337, + 332, 330, 335, 341, 338, 482, 845, 846, 483, 332, + + 436, 335, 341, 338, 40, 332, 828, 335, 333, 338, + 336, 342, 339, 343, 346, 349, 352, 355, 344, 347, + 350, 353, 356, 437, 827, 826, 825, 344, 347, 350, + 353, 356, 455, 824, 347, 350, 345, 348, 351, 354, + 357, 358, 361, 364, 823, 456, 359, 362, 365, 498, + 498, 498, 498, 367, 370, 359, 362, 365, 368, 371, + 822, 359, 362, 365, 360, 363, 366, 368, 371, 678, + 373, 821, 679, 368, 371, 374, 369, 372, 383, 820, + 386, 390, 393, 384, 374, 387, 391, 394, 819, 818, + 374, 817, 384, 375, 387, 391, 394, 397, 816, 815, + + 814, 385, 398, 388, 392, 395, 471, 400, 403, 406, + 410, 398, 401, 404, 407, 411, 813, 398, 812, 472, + 399, 401, 404, 407, 411, 811, 810, 401, 404, 407, + 402, 405, 408, 412, 413, 416, 419, 809, 808, 414, + 417, 420, 498, 498, 498, 498, 422, 425, 414, 417, + 420, 423, 426, 807, 414, 417, 420, 415, 418, 421, + 423, 426, 806, 442, 805, 804, 423, 426, 443, 424, + 427, 257, 257, 257, 257, 257, 257, 443, 257, 257, + 257, 257, 257, 257, 453, 453, 444, 453, 453, 803, + 453, 453, 453, 453, 453, 453, 802, 453, 801, 310, + + 453, 453, 800, 799, 453, 313, 485, 453, 453, 798, + 797, 453, 453, 492, 796, 493, 795, 494, 499, 498, + 498, 498, 312, 453, 498, 498, 498, 498, 316, 321, + 495, 498, 498, 498, 498, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 313, 325, 501, + 328, 331, 323, 334, 337, 340, 343, 346, 349, 352, + 355, 358, 361, 364, 367, 370, 373, 383, 386, 390, + 316, 327, 393, 330, 333, 397, 336, 339, 342, 345, + 348, 351, 354, 357, 360, 363, 366, 369, 372, 375, + 385, 388, 392, 400, 403, 395, 406, 410, 399, 413, + + 416, 419, 422, 425, 551, 554, 442, 794, 608, 609, + 655, 658, 793, 792, 736, 737, 402, 405, 791, 408, + 412, 790, 415, 418, 421, 424, 427, 552, 555, 444, + 610, 789, 788, 656, 659, 738, 38, 38, 38, 180, + 180, 787, 786, 785, 784, 783, 782, 781, 780, 779, + 778, 777, 776, 775, 774, 773, 772, 771, 770, 769, + 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, + 758, 757, 756, 755, 754, 753, 659, 752, 751, 656, + 750, 749, 748, 747, 746, 745, 744, 743, 742, 741, + 740, 739, 735, 734, 733, 732, 731, 730, 729, 728, + + 727, 726, 725, 724, 723, 722, 721, 720, 719, 718, + 717, 716, 715, 714, 713, 712, 711, 710, 709, 708, + 707, 706, 705, 704, 703, 702, 701, 700, 699, 698, + 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, + 687, 686, 685, 684, 683, 682, 681, 680, 677, 676, + 675, 674, 673, 672, 671, 670, 669, 668, 667, 666, + 665, 664, 663, 662, 661, 660, 657, 555, 654, 552, + 653, 652, 651, 650, 649, 648, 647, 646, 645, 644, + 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, + 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, + 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, + 570, 569, 568, 567, 564, 563, 562, 561, 560, 559, + 558, 557, 444, 556, 553, 550, 437, 549, 435, 548, + 433, 547, 431, 546, 545, 427, 544, 424, 543, 421, + 542, 418, 541, 415, 540, 412, 539, 538, 408, 537, + 405, 536, 402, 535, 399, 534, 533, 395, 532, 392, + + 531, 388, 530, 385, 529, 528, 527, 526, 525, 524, + 375, 523, 372, 522, 369, 521, 366, 520, 363, 519, + 360, 518, 357, 517, 354, 516, 351, 515, 348, 514, + 345, 513, 342, 512, 339, 511, 336, 510, 333, 509, + 330, 508, 327, 507, 323, 506, 505, 504, 503, 502, + 316, 500, 312, 497, 496, 491, 490, 489, 488, 487, + 486, 484, 481, 480, 479, 478, 477, 476, 475, 474, + 473, 470, 469, 466, 465, 464, 463, 462, 461, 460, + 459, 458, 457, 454, 289, 261, 452, 451, 450, 449, + 448, 447, 446, 445, 429, 428, 409, 396, 389, 378, + + 377, 376, 324, 320, 319, 318, 317, 302, 301, 300, + 297, 296, 295, 294, 293, 284, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 271, 270, 269, 268, 267, + 264, 263, 262, 260, 259, 172, 254, 253, 252, 251, + 250, 249, 248, 247, 246, 245, 237, 236, 235, 234, + 231, 230, 227, 226, 225, 224, 223, 222, 221, 220, + 217, 216, 215, 214, 213, 212, 209, 208, 207, 206, + 205, 204, 203, 200, 199, 193, 192, 191, 190, 187, + 186, 185, 156, 155, 149, 148, 39, 127, 126, 125, + 124, 123, 122, 121, 118, 87, 39, 37, 849, 3, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; -static yyconst flex_int16_t yy_chk[1023] = +static yyconst flex_int16_t yy_chk[1368] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -759,113 +864,150 @@ static yyconst flex_int16_t yy_chk[1023] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 17, 5, - 10, 17, 46, 27, 24, 18, 46, 10, 10, 10, - 10, 10, 10, 10, 16, 18, 16, 24, 25, 130, - 25, 27, 16, 11, 11, 11, 11, 11, 11, 11, - - 19, 130, 23, 25, 11, 45, 19, 23, 45, 676, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 47, - 47, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 47, 10, 10, 10, 10, 12, 12, 12, 12, - 12, 12, 12, 35, 60, 35, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 109, 671, 60, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 15, 109, 15, - 14, 14, 52, 12, 48, 22, 15, 48, 52, 21, - 670, 21, 15, 22, 15, 13, 21, 26, 22, 21, - 74, 26, 26, 26, 22, 26, 74, 14, 42, 42, - - 42, 42, 42, 42, 26, 82, 26, 40, 42, 43, - 43, 53, 44, 44, 664, 43, 49, 49, 44, 108, - 118, 43, 49, 82, 56, 53, 43, 118, 43, 44, - 108, 235, 53, 49, 42, 56, 79, 79, 56, 58, - 58, 56, 667, 667, 235, 58, 79, 40, 40, 40, - 40, 40, 40, 58, 40, 40, 58, 61, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 662, 59, 40, - 59, 176, 660, 59, 59, 61, 61, 61, 61, 656, - 176, 59, 62, 62, 62, 62, 63, 63, 63, 63, - 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, - - 120, 655, 652, 149, 65, 66, 66, 66, 66, 66, - 66, 66, 90, 149, 120, 67, 66, 67, 67, 67, - 67, 67, 67, 123, 123, 263, 249, 147, 263, 123, - 65, 90, 122, 147, 122, 122, 122, 122, 122, 122, - 123, 249, 66, 126, 126, 126, 136, 136, 150, 126, - 137, 137, 136, 252, 150, 159, 137, 650, 151, 151, - 126, 334, 648, 136, 151, 159, 252, 137, 152, 152, - 645, 151, 153, 153, 152, 151, 644, 334, 153, 163, - 163, 163, 163, 442, 643, 152, 442, 640, 639, 153, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 166, - - 166, 166, 167, 167, 167, 167, 168, 168, 168, 168, - 169, 169, 169, 169, 171, 171, 171, 171, 171, 171, - 638, 637, 635, 172, 171, 172, 172, 172, 172, 172, - 172, 173, 173, 173, 173, 173, 173, 174, 174, 174, - 174, 174, 174, 231, 231, 231, 231, 231, 231, 634, - 171, 232, 232, 232, 232, 232, 232, 233, 233, 247, - 247, 265, 265, 233, 275, 247, 275, 265, 275, 266, - 266, 267, 267, 633, 233, 266, 247, 267, 265, 631, - 630, 275, 278, 278, 278, 278, 266, 626, 267, 279, - 279, 279, 279, 280, 280, 280, 280, 281, 281, 281, - - 281, 282, 282, 282, 282, 283, 283, 283, 283, 283, - 283, 284, 284, 284, 284, 284, 284, 386, 386, 499, - 499, 625, 624, 623, 621, 618, 617, 615, 614, 613, - 612, 611, 610, 607, 606, 604, 603, 602, 601, 386, - 499, 675, 675, 675, 677, 677, 600, 599, 597, 596, - 595, 593, 591, 590, 587, 578, 577, 576, 553, 546, - 545, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 531, 528, 527, 526, 525, 524, 523, 522, 521, - 520, 519, 518, 516, 515, 514, 513, 511, 509, 508, - 507, 506, 505, 504, 503, 502, 501, 500, 498, 497, - - 496, 495, 494, 491, 490, 489, 488, 487, 486, 485, - 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, - 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 456, 455, 454, 453, - 452, 450, 449, 448, 447, 446, 445, 444, 441, 440, - 438, 437, 436, 435, 432, 431, 430, 429, 428, 427, - 426, 424, 423, 422, 421, 420, 419, 418, 417, 416, - 415, 414, 413, 412, 411, 410, 409, 408, 406, 405, - 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, - 394, 393, 392, 391, 390, 389, 388, 387, 384, 383, - - 382, 379, 378, 377, 376, 375, 374, 372, 370, 369, - 368, 366, 365, 364, 363, 362, 361, 360, 359, 358, - 357, 356, 355, 354, 353, 352, 351, 350, 349, 347, - 346, 345, 344, 343, 342, 341, 338, 337, 336, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 322, - 321, 320, 319, 318, 317, 316, 315, 313, 312, 311, - 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, - 300, 299, 298, 297, 296, 295, 294, 292, 291, 290, - 289, 288, 287, 286, 285, 277, 276, 274, 273, 272, - 271, 270, 269, 264, 262, 261, 260, 259, 258, 257, - - 256, 255, 253, 251, 250, 248, 246, 245, 242, 241, - 240, 239, 238, 237, 236, 234, 230, 229, 228, 227, - 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, - 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, - 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 195, 194, 192, 191, 189, 187, 186, 185, 184, 183, - 182, 181, 180, 179, 177, 175, 162, 161, 160, 158, - 157, 156, 155, 154, 148, 146, 145, 144, 143, 142, - 141, 140, 139, 138, 135, 134, 133, 132, 131, 129, - 128, 127, 125, 124, 121, 119, 117, 116, 115, 114, - - 113, 112, 111, 110, 107, 106, 105, 104, 103, 102, - 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, - 91, 89, 88, 87, 86, 85, 84, 83, 81, 80, - 78, 77, 76, 75, 73, 72, 71, 55, 54, 51, - 50, 37, 36, 34, 33, 32, 31, 30, 29, 28, - 20, 8, 7, 3, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 1, 1, 1, 1, 1, 1, 1, 5, 23, 5, + 10, 27, 46, 23, 17, 46, 808, 10, 10, 10, + 10, 10, 10, 10, 16, 17, 16, 29, 17, 27, + 18, 116, 16, 11, 11, 11, 11, 11, 11, 11, + + 18, 19, 116, 53, 11, 29, 36, 19, 36, 53, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 48, + 48, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 48, 10, 10, 10, 10, 12, 12, 12, 12, + 12, 12, 12, 61, 80, 80, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 99, 61, 99, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 15, 47, 15, + 14, 14, 47, 12, 49, 22, 15, 49, 24, 21, + 274, 21, 15, 22, 15, 13, 21, 24, 22, 21, + 25, 24, 25, 25, 22, 274, 810, 14, 45, 45, + + 92, 44, 44, 54, 45, 25, 26, 44, 26, 26, + 26, 26, 26, 44, 26, 45, 26, 54, 44, 92, + 44, 811, 26, 26, 54, 26, 41, 43, 43, 43, + 43, 43, 43, 50, 50, 57, 812, 43, 60, 50, + 60, 59, 59, 60, 60, 813, 57, 59, 75, 57, + 50, 60, 57, 140, 75, 59, 816, 84, 59, 63, + 63, 63, 63, 43, 817, 140, 41, 41, 41, 41, + 41, 41, 62, 41, 41, 84, 159, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 159, 118, 41, 118, + 62, 62, 62, 62, 64, 64, 64, 64, 65, 65, + + 65, 65, 66, 66, 66, 66, 66, 66, 108, 818, + 81, 81, 66, 67, 67, 67, 67, 67, 67, 67, + 81, 111, 108, 68, 67, 68, 68, 68, 68, 68, + 68, 117, 128, 117, 130, 111, 157, 160, 66, 128, + 133, 133, 157, 160, 117, 823, 133, 239, 130, 132, + 67, 132, 132, 132, 132, 132, 132, 133, 136, 136, + 136, 146, 146, 169, 136, 147, 147, 146, 161, 161, + 239, 147, 219, 169, 161, 136, 218, 825, 146, 240, + 244, 161, 147, 162, 162, 161, 163, 163, 218, 162, + 219, 827, 163, 173, 173, 173, 173, 830, 244, 831, + + 162, 835, 240, 163, 174, 174, 174, 174, 175, 175, + 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, + 178, 178, 178, 178, 179, 179, 179, 179, 181, 181, + 181, 181, 181, 181, 837, 839, 241, 182, 181, 182, + 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, + 183, 184, 184, 184, 184, 184, 184, 185, 186, 241, + 192, 194, 185, 186, 181, 192, 194, 243, 195, 845, + 452, 185, 186, 195, 192, 194, 846, 185, 186, 243, + 185, 186, 195, 192, 194, 196, 452, 197, 199, 198, + 196, 195, 197, 199, 198, 288, 842, 842, 288, 196, + + 242, 197, 199, 198, 851, 196, 807, 197, 196, 198, + 197, 199, 198, 201, 203, 204, 206, 207, 201, 203, + 204, 206, 207, 242, 806, 804, 803, 201, 203, 204, + 206, 207, 260, 799, 203, 204, 201, 203, 204, 206, + 207, 209, 210, 211, 798, 260, 209, 210, 211, 303, + 303, 303, 303, 212, 213, 209, 210, 211, 212, 213, + 797, 209, 210, 211, 209, 210, 211, 212, 213, 579, + 214, 796, 579, 212, 213, 214, 212, 213, 220, 794, + 221, 223, 224, 220, 214, 221, 223, 224, 792, 790, + 214, 787, 220, 214, 221, 223, 224, 226, 786, 784, + + 783, 220, 226, 221, 223, 224, 277, 227, 228, 229, + 231, 226, 227, 228, 229, 231, 782, 226, 781, 277, + 226, 227, 228, 229, 231, 780, 779, 227, 228, 229, + 227, 228, 229, 231, 232, 233, 234, 776, 775, 232, + 233, 234, 304, 304, 304, 304, 235, 236, 232, 233, + 234, 235, 236, 773, 232, 233, 234, 232, 233, 234, + 235, 236, 772, 245, 771, 770, 235, 236, 245, 235, + 236, 256, 256, 256, 256, 256, 256, 245, 257, 257, + 257, 257, 257, 257, 258, 258, 245, 272, 272, 769, + 258, 290, 290, 272, 291, 291, 768, 290, 766, 311, + + 291, 258, 765, 764, 272, 314, 292, 292, 290, 762, + 760, 291, 292, 300, 759, 300, 756, 300, 305, 305, + 305, 305, 311, 292, 306, 306, 306, 306, 314, 322, + 300, 307, 307, 307, 307, 308, 308, 308, 308, 308, + 308, 309, 309, 309, 309, 309, 309, 315, 326, 315, + 329, 332, 322, 335, 338, 341, 344, 347, 350, 353, + 356, 359, 362, 365, 368, 371, 374, 384, 387, 391, + 315, 326, 394, 329, 332, 398, 335, 338, 341, 344, + 347, 350, 353, 356, 359, 362, 365, 368, 371, 374, + 384, 387, 391, 401, 404, 394, 407, 411, 398, 414, + + 417, 420, 423, 426, 438, 440, 443, 753, 504, 504, + 553, 556, 752, 751, 642, 642, 401, 404, 750, 407, + 411, 738, 414, 417, 420, 423, 426, 438, 440, 443, + 504, 737, 736, 553, 556, 642, 850, 850, 850, 852, + 852, 707, 700, 699, 696, 695, 694, 693, 692, 691, + 690, 689, 688, 687, 685, 682, 681, 680, 679, 678, + 677, 676, 675, 674, 673, 672, 670, 669, 668, 667, + 665, 663, 662, 661, 660, 659, 658, 657, 656, 655, + 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, + 644, 643, 641, 640, 639, 638, 637, 636, 635, 634, + + 633, 630, 629, 628, 627, 626, 625, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 593, 592, 591, 590, + 589, 587, 586, 585, 584, 583, 582, 581, 578, 577, + 575, 574, 573, 572, 569, 568, 567, 566, 565, 564, + 563, 561, 560, 559, 558, 557, 555, 554, 552, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, + 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, + 530, 526, 525, 524, 523, 522, 521, 520, 519, 518, + + 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, + 507, 506, 505, 502, 501, 500, 497, 496, 495, 494, + 493, 492, 490, 488, 487, 486, 484, 483, 482, 481, + 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, + 470, 469, 468, 467, 465, 464, 463, 462, 461, 460, + 459, 456, 455, 454, 451, 450, 449, 448, 447, 446, + 445, 444, 442, 441, 439, 437, 436, 435, 434, 433, + 432, 431, 430, 428, 427, 425, 424, 422, 421, 419, + 418, 416, 415, 413, 412, 410, 409, 408, 406, 405, + 403, 402, 400, 399, 397, 396, 395, 393, 392, 390, + + 388, 386, 385, 383, 382, 380, 378, 377, 376, 375, + 373, 372, 370, 369, 367, 366, 364, 363, 361, 360, + 358, 357, 355, 354, 352, 351, 349, 348, 346, 345, + 343, 342, 340, 339, 337, 336, 334, 333, 331, 330, + 328, 327, 325, 323, 321, 320, 319, 318, 317, 316, + 313, 312, 310, 302, 301, 299, 298, 297, 296, 295, + 294, 289, 287, 286, 285, 284, 283, 282, 281, 280, + 278, 276, 275, 273, 271, 270, 267, 266, 265, 264, + 263, 262, 261, 259, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 238, 237, 230, 225, 222, 217, + + 216, 215, 193, 191, 190, 189, 187, 172, 171, 170, + 168, 167, 166, 165, 164, 158, 156, 155, 154, 153, + 152, 151, 150, 149, 148, 145, 144, 143, 142, 141, + 139, 138, 137, 135, 134, 131, 129, 127, 126, 125, + 124, 123, 122, 121, 120, 119, 115, 114, 113, 112, + 110, 109, 107, 106, 105, 104, 103, 102, 101, 100, + 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, + 87, 86, 85, 83, 82, 79, 78, 77, 76, 74, + 73, 72, 56, 55, 52, 51, 38, 37, 35, 34, + 33, 32, 31, 30, 28, 20, 8, 7, 3, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; /* The intent behind this definition is that it'll catch @@ -904,22 +1046,27 @@ static yyconst flex_int16_t yy_chk[1023] = #include "prog_instruction.h" #include "prog_statevars.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) +#ifndef HAVE_UNISTD_H +#define YY_NO_UNISTD_H +#endif + #define return_token_or_IDENTIFIER(condition, token) \ do { \ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -934,15 +1081,16 @@ static yyconst flex_int16_t yy_chk[1023] = } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -991,6 +1139,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -1004,7 +1161,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1008 "lex.yy.c" +#line 1165 "lex.yy.c" #define INITIAL 0 @@ -1141,7 +1298,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1149,7 +1311,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1160,7 +1322,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1245,10 +1407,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 137 "program_lexer.l" +#line 157 "program_lexer.l" -#line 1252 "lex.yy.c" +#line 1414 "lex.yy.c" yylval = yylval_param; @@ -1305,13 +1467,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 955 ); + while ( yy_base[yy_current_state] != 1300 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1337,17 +1499,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 159 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 160 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 141 "program_lexer.l" +#line 161 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1355,813 +1517,745 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 165 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 166 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 167 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 168 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 169 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 170 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 171 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 153 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, ABS, OFF); } +#line 173 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 154 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } +#line 174 "program_lexer.l" +{ return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 155 "program_lexer.l" -{ return_opcode( 1, BIN_OP, ADD, OFF); } +#line 175 "program_lexer.l" +{ return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 156 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } +#line 177 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 157 "program_lexer.l" -{ return_opcode(require_ARB_vp, ARL, ARL, OFF); } +#line 178 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 159 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } +#line 180 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 160 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } +#line 181 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 161 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } +#line 182 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 162 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } +#line 183 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 164 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP3, OFF); } +#line 184 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 165 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } +#line 185 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 166 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP4, OFF); } +#line 187 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 167 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } +#line 188 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 168 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DPH, OFF); } +#line 190 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 169 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } +#line 191 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 170 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DST, OFF); } +#line 193 "program_lexer.l" +{ return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 171 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } +#line 195 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 173 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, EX2, OFF); } +#line 196 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 174 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } +#line 197 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 175 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } +#line 198 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 177 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FLR, OFF); } +#line 200 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 178 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } +#line 201 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 179 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FRC, OFF); } +#line 202 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 180 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } +#line 203 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 182 "program_lexer.l" -{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } +#line 204 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 184 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, LIT, OFF); } +#line 206 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 185 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } +#line 207 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 186 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, LG2, OFF); } +#line 208 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 187 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } +#line 209 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 188 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } +#line 210 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 189 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } +#line 212 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 190 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } +#line 213 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 192 "program_lexer.l" -{ return_opcode( 1, TRI_OP, MAD, OFF); } +#line 214 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 193 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } +#line 216 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 194 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MAX, OFF); } +#line 217 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 195 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } +#line 218 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 196 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MIN, OFF); } +#line 219 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 197 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } +#line 220 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 198 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, MOV, OFF); } +#line 221 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 199 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } +#line 222 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 200 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MUL, OFF); } +#line 223 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 201 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } +#line 224 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 203 "program_lexer.l" -{ return_opcode( 1, BINSC_OP, POW, OFF); } +#line 225 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 204 "program_lexer.l" -{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } +#line 226 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 206 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RCP, OFF); } +#line 227 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 207 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +#line 229 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 208 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } +#line 230 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 209 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } +#line 231 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 211 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } +#line 232 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 212 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +#line 234 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 213 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SGE, OFF); } +#line 235 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 214 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +#line 236 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } YY_BREAK case 63: YY_RULE_SETUP -#line 215 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } +#line 237 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } YY_BREAK case 64: YY_RULE_SETUP -#line 216 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +#line 239 "program_lexer.l" +{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 65: YY_RULE_SETUP -#line 217 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SLT, OFF); } +#line 240 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 66: YY_RULE_SETUP -#line 218 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +#line 242 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 67: YY_RULE_SETUP -#line 219 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SUB, OFF); } +#line 243 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 68: YY_RULE_SETUP -#line 220 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } +#line 244 "program_lexer.l" +{ return PROGRAM; } YY_BREAK case 69: YY_RULE_SETUP -#line 221 "program_lexer.l" -{ return_opcode( 1, SWZ, SWZ, OFF); } +#line 245 "program_lexer.l" +{ return STATE; } YY_BREAK case 70: YY_RULE_SETUP -#line 222 "program_lexer.l" -{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } +#line 246 "program_lexer.l" +{ return RESULT; } YY_BREAK case 71: YY_RULE_SETUP -#line 224 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } +#line 248 "program_lexer.l" +{ return AMBIENT; } YY_BREAK case 72: YY_RULE_SETUP -#line 225 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } +#line 249 "program_lexer.l" +{ return ATTENUATION; } YY_BREAK case 73: YY_RULE_SETUP -#line 226 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } +#line 250 "program_lexer.l" +{ return BACK; } YY_BREAK case 74: YY_RULE_SETUP -#line 227 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +#line 251 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 75: YY_RULE_SETUP -#line 228 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } +#line 252 "program_lexer.l" +{ return COLOR; } YY_BREAK case 76: YY_RULE_SETUP -#line 229 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } +#line 253 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 77: YY_RULE_SETUP -#line 231 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, OFF); } +#line 254 "program_lexer.l" +{ return DIFFUSE; } YY_BREAK case 78: YY_RULE_SETUP -#line 232 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +#line 255 "program_lexer.l" +{ return DIRECTION; } YY_BREAK case 79: YY_RULE_SETUP -#line 234 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +#line 256 "program_lexer.l" +{ return EMISSION; } YY_BREAK case 80: YY_RULE_SETUP -#line 235 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +#line 257 "program_lexer.l" +{ return ENV; } YY_BREAK case 81: YY_RULE_SETUP -#line 236 "program_lexer.l" -{ return PROGRAM; } +#line 258 "program_lexer.l" +{ return EYE; } YY_BREAK case 82: YY_RULE_SETUP -#line 237 "program_lexer.l" -{ return STATE; } +#line 259 "program_lexer.l" +{ return FOGCOORD; } YY_BREAK case 83: YY_RULE_SETUP -#line 238 "program_lexer.l" -{ return RESULT; } +#line 260 "program_lexer.l" +{ return FOG; } YY_BREAK case 84: YY_RULE_SETUP -#line 240 "program_lexer.l" -{ return AMBIENT; } +#line 261 "program_lexer.l" +{ return FRONT; } YY_BREAK case 85: YY_RULE_SETUP -#line 241 "program_lexer.l" -{ return ATTENUATION; } +#line 262 "program_lexer.l" +{ return HALF; } YY_BREAK case 86: YY_RULE_SETUP -#line 242 "program_lexer.l" -{ return BACK; } +#line 263 "program_lexer.l" +{ return INVERSE; } YY_BREAK case 87: YY_RULE_SETUP -#line 243 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } +#line 264 "program_lexer.l" +{ return INVTRANS; } YY_BREAK case 88: YY_RULE_SETUP -#line 244 "program_lexer.l" -{ return COLOR; } +#line 265 "program_lexer.l" +{ return LIGHT; } YY_BREAK case 89: YY_RULE_SETUP -#line 245 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } +#line 266 "program_lexer.l" +{ return LIGHTMODEL; } YY_BREAK case 90: YY_RULE_SETUP -#line 246 "program_lexer.l" -{ return DIFFUSE; } +#line 267 "program_lexer.l" +{ return LIGHTPROD; } YY_BREAK case 91: YY_RULE_SETUP -#line 247 "program_lexer.l" -{ return DIRECTION; } +#line 268 "program_lexer.l" +{ return LOCAL; } YY_BREAK case 92: YY_RULE_SETUP -#line 248 "program_lexer.l" -{ return EMISSION; } +#line 269 "program_lexer.l" +{ return MATERIAL; } YY_BREAK case 93: YY_RULE_SETUP -#line 249 "program_lexer.l" -{ return ENV; } +#line 270 "program_lexer.l" +{ return MAT_PROGRAM; } YY_BREAK case 94: YY_RULE_SETUP -#line 250 "program_lexer.l" -{ return EYE; } +#line 271 "program_lexer.l" +{ return MATRIX; } YY_BREAK case 95: YY_RULE_SETUP -#line 251 "program_lexer.l" -{ return FOGCOORD; } +#line 272 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 96: YY_RULE_SETUP -#line 252 "program_lexer.l" -{ return FOG; } +#line 273 "program_lexer.l" +{ return MODELVIEW; } YY_BREAK case 97: YY_RULE_SETUP -#line 253 "program_lexer.l" -{ return FRONT; } +#line 274 "program_lexer.l" +{ return MVP; } YY_BREAK case 98: YY_RULE_SETUP -#line 254 "program_lexer.l" -{ return HALF; } +#line 275 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 99: YY_RULE_SETUP -#line 255 "program_lexer.l" -{ return INVERSE; } +#line 276 "program_lexer.l" +{ return OBJECT; } YY_BREAK case 100: YY_RULE_SETUP -#line 256 "program_lexer.l" -{ return INVTRANS; } +#line 277 "program_lexer.l" +{ return PALETTE; } YY_BREAK case 101: YY_RULE_SETUP -#line 257 "program_lexer.l" -{ return LIGHT; } +#line 278 "program_lexer.l" +{ return PARAMS; } YY_BREAK case 102: YY_RULE_SETUP -#line 258 "program_lexer.l" -{ return LIGHTMODEL; } +#line 279 "program_lexer.l" +{ return PLANE; } YY_BREAK case 103: YY_RULE_SETUP -#line 259 "program_lexer.l" -{ return LIGHTPROD; } +#line 280 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 104: YY_RULE_SETUP -#line 260 "program_lexer.l" -{ return LOCAL; } +#line 281 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 105: YY_RULE_SETUP -#line 261 "program_lexer.l" -{ return MATERIAL; } +#line 282 "program_lexer.l" +{ return POSITION; } YY_BREAK case 106: YY_RULE_SETUP -#line 262 "program_lexer.l" -{ return MAT_PROGRAM; } +#line 283 "program_lexer.l" +{ return PRIMARY; } YY_BREAK case 107: YY_RULE_SETUP -#line 263 "program_lexer.l" -{ return MATRIX; } +#line 284 "program_lexer.l" +{ return PROJECTION; } YY_BREAK case 108: YY_RULE_SETUP -#line 264 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } +#line 285 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 109: YY_RULE_SETUP -#line 265 "program_lexer.l" -{ return MODELVIEW; } +#line 286 "program_lexer.l" +{ return ROW; } YY_BREAK case 110: YY_RULE_SETUP -#line 266 "program_lexer.l" -{ return MVP; } +#line 287 "program_lexer.l" +{ return SCENECOLOR; } YY_BREAK case 111: YY_RULE_SETUP -#line 267 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } +#line 288 "program_lexer.l" +{ return SECONDARY; } YY_BREAK case 112: YY_RULE_SETUP -#line 268 "program_lexer.l" -{ return OBJECT; } +#line 289 "program_lexer.l" +{ return SHININESS; } YY_BREAK case 113: YY_RULE_SETUP -#line 269 "program_lexer.l" -{ return PALETTE; } +#line 290 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 114: YY_RULE_SETUP -#line 270 "program_lexer.l" -{ return PARAMS; } +#line 291 "program_lexer.l" +{ return SPECULAR; } YY_BREAK case 115: YY_RULE_SETUP -#line 271 "program_lexer.l" -{ return PLANE; } +#line 292 "program_lexer.l" +{ return SPOT; } YY_BREAK case 116: YY_RULE_SETUP -#line 272 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } +#line 293 "program_lexer.l" +{ return TEXCOORD; } YY_BREAK case 117: YY_RULE_SETUP -#line 273 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } +#line 294 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 118: YY_RULE_SETUP -#line 274 "program_lexer.l" -{ return POSITION; } +#line 295 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 119: YY_RULE_SETUP -#line 275 "program_lexer.l" -{ return PRIMARY; } +#line 296 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 120: YY_RULE_SETUP -#line 276 "program_lexer.l" -{ return PROJECTION; } +#line 297 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 121: YY_RULE_SETUP -#line 277 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } +#line 298 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 122: YY_RULE_SETUP -#line 278 "program_lexer.l" -{ return ROW; } +#line 299 "program_lexer.l" +{ return TEXTURE; } YY_BREAK case 123: YY_RULE_SETUP -#line 279 "program_lexer.l" -{ return SCENECOLOR; } +#line 300 "program_lexer.l" +{ return TRANSPOSE; } YY_BREAK case 124: YY_RULE_SETUP -#line 280 "program_lexer.l" -{ return SECONDARY; } +#line 301 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 125: YY_RULE_SETUP -#line 281 "program_lexer.l" -{ return SHININESS; } +#line 302 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 126: YY_RULE_SETUP -#line 282 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } +#line 304 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 127: YY_RULE_SETUP -#line 283 "program_lexer.l" -{ return SPECULAR; } +#line 305 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 128: YY_RULE_SETUP -#line 284 "program_lexer.l" -{ return SPOT; } +#line 306 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 129: YY_RULE_SETUP -#line 285 "program_lexer.l" -{ return TEXCOORD; } +#line 307 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 130: YY_RULE_SETUP -#line 286 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, TEXENV); } +#line 308 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 131: YY_RULE_SETUP -#line 287 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN); } +#line 309 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 132: YY_RULE_SETUP -#line 288 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } +#line 310 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 133: YY_RULE_SETUP -#line 289 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } +#line 311 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 134: YY_RULE_SETUP -#line 290 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } +#line 312 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 135: YY_RULE_SETUP -#line 291 "program_lexer.l" -{ return TEXTURE; } +#line 313 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 136: YY_RULE_SETUP -#line 292 "program_lexer.l" -{ return TRANSPOSE; } +#line 314 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 293 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } +#line 315 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 138: YY_RULE_SETUP -#line 294 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, WEIGHT); } +#line 316 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 139: YY_RULE_SETUP -#line 296 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } +#line 318 "program_lexer.l" +{ return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 140: YY_RULE_SETUP -#line 297 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 298 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 299 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 300 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 301 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 302 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 303 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 304 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 305 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 306 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 307 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 308 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 310 "program_lexer.l" -{ - yylval->string = strdup(yytext); - return IDENTIFIER; -} - YY_BREAK -case 153: -YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 320 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 154: +case 141: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 322 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 155: +case 142: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 326 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 156: -/* rule 156 can match eol */ +case 143: +/* rule 143 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 330 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 157: +case 144: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 334 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 158: +case 145: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 338 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 159: +case 146: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 343 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 160: +case 147: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 349 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2169,27 +2263,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 161: +case 148: YY_RULE_SETUP -#line 350 "program_lexer.l" +#line 355 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 162: +case 149: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 360 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 163: +case 150: YY_RULE_SETUP -#line 361 "program_lexer.l" +#line 366 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2197,9 +2291,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 164: +case 151: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 372 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2207,18 +2301,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 165: +case 152: YY_RULE_SETUP -#line 373 "program_lexer.l" +#line 378 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 166: +case 153: YY_RULE_SETUP -#line 379 "program_lexer.l" +#line 384 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2226,9 +2320,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 167: +case 154: YY_RULE_SETUP -#line 386 "program_lexer.l" +#line 391 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2238,18 +2332,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 168: +case 155: YY_RULE_SETUP -#line 395 "program_lexer.l" +#line 400 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 169: +case 156: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 406 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2257,27 +2351,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 170: +case 157: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 412 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 171: +case 158: YY_RULE_SETUP -#line 412 "program_lexer.l" +#line 417 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 172: +case 159: YY_RULE_SETUP -#line 418 "program_lexer.l" +#line 423 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2285,9 +2379,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 173: +case 160: YY_RULE_SETUP -#line 424 "program_lexer.l" +#line 429 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2295,18 +2389,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 174: +case 161: YY_RULE_SETUP -#line 430 "program_lexer.l" +#line 435 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 175: +case 162: YY_RULE_SETUP -#line 436 "program_lexer.l" +#line 441 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2314,9 +2408,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 176: +case 163: YY_RULE_SETUP -#line 444 "program_lexer.l" +#line 449 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2328,9 +2422,9 @@ YY_RULE_SETUP } } YY_BREAK -case 177: +case 164: YY_RULE_SETUP -#line 455 "program_lexer.l" +#line 460 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2340,15 +2434,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 178: +case 165: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 469 "program_lexer.l" { return DOT; } YY_BREAK -case 179: -/* rule 179 can match eol */ +case 166: +/* rule 166 can match eol */ YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 471 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2357,30 +2451,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 180: +case 167: YY_RULE_SETUP -#line 473 "program_lexer.l" +#line 478 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 181: +case 168: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 474 "program_lexer.l" +#line 479 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 182: +case 169: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 480 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 183: +case 170: YY_RULE_SETUP -#line 476 "program_lexer.l" +#line 481 "program_lexer.l" ECHO; YY_BREAK -#line 2384 "lex.yy.c" +#line 2478 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2674,7 +2768,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2703,11 +2797,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 674); + yy_is_jam = (yy_current_state == 849); return yy_is_jam ? 0 : yy_current_state; } @@ -3148,8 +3242,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -3555,7 +3649,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 476 "program_lexer.l" +#line 481 "program_lexer.l" diff --git a/mesalib/src/mesa/shader/nvfragparse.c b/mesalib/src/mesa/shader/nvfragparse.c index 0fd55524a..b739a6aa0 100644 --- a/mesalib/src/mesa/shader/nvfragparse.c +++ b/mesalib/src/mesa/shader/nvfragparse.c @@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token) const struct instruction_pattern *inst; struct instruction_pattern result; + result.name = NULL; + result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + result.inputs = 0; + result.outputs = 0; + result.suffixes = 0; + for (inst = Instructions; inst->name; inst++) { if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ @@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token) return result; } } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + return result; } diff --git a/mesalib/src/mesa/shader/prog_instruction.h b/mesalib/src/mesa/shader/prog_instruction.h index 39a221eea..1c687bc16 100644 --- a/mesalib/src/mesa/shader/prog_instruction.h +++ b/mesalib/src/mesa/shader/prog_instruction.h @@ -121,7 +121,6 @@ /*@{*/ #define SATURATE_OFF 0 #define SATURATE_ZERO_ONE 1 -#define SATURATE_PLUS_MINUS_ONE 2 /*@}*/ diff --git a/mesalib/src/mesa/shader/prog_optimize.c b/mesalib/src/mesa/shader/prog_optimize.c index 9d937488e..4fe351251 100644 --- a/mesalib/src/mesa/shader/prog_optimize.c +++ b/mesalib/src/mesa/shader/prog_optimize.c @@ -38,6 +38,39 @@ static GLboolean dbg = GL_FALSE; +/* Returns the mask of channels read from the given srcreg in this instruction. + */ +static GLuint +get_src_arg_mask(const struct prog_instruction *inst, int arg) +{ + int writemask = inst->DstReg.WriteMask; + + if (inst->CondUpdate) + writemask = WRITEMASK_XYZW; + + switch (inst->Opcode) { + case OPCODE_MOV: + case OPCODE_ABS: + case OPCODE_ADD: + case OPCODE_MUL: + case OPCODE_SUB: + return writemask; + case OPCODE_RCP: + case OPCODE_SIN: + case OPCODE_COS: + case OPCODE_RSQ: + case OPCODE_POW: + case OPCODE_EX2: + return WRITEMASK_X; + case OPCODE_DP2: + return WRITEMASK_XY; + case OPCODE_DP3: + case OPCODE_XPD: + return WRITEMASK_XYZ; + default: + return WRITEMASK_XYZW; + } +} /** * In 'prog' remove instruction[i] if removeFlags[i] == TRUE. @@ -74,6 +107,12 @@ remove_instructions(struct gl_program *prog, const GLboolean *removeFlags) } } } + /* Finish removing if the first instruction was to be removed. */ + if (removeCount > 0) { + GLint removeStart = removeEnd - removeCount + 1; + _mesa_delete_instructions(prog, removeStart, removeCount); + removeStart = removeCount = 0; /* reset removal info */ + } return totalRemoved; } @@ -187,11 +226,10 @@ _mesa_consolidate_registers(struct gl_program *prog) static void _mesa_remove_dead_code(struct gl_program *prog) { - GLboolean tempWritten[MAX_PROGRAM_TEMPS], tempRead[MAX_PROGRAM_TEMPS]; + GLboolean tempRead[MAX_PROGRAM_TEMPS][4]; GLboolean *removeInst; /* per-instruction removal flag */ - GLuint i, rem; + GLuint i, rem = 0, comp; - memset(tempWritten, 0, sizeof(tempWritten)); memset(tempRead, 0, sizeof(tempRead)); if (dbg) { @@ -212,16 +250,37 @@ _mesa_remove_dead_code(struct gl_program *prog) for (j = 0; j < numSrc; j++) { if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { const GLuint index = inst->SrcReg[j].Index; + GLuint read_mask; ASSERT(index < MAX_PROGRAM_TEMPS); + read_mask = get_src_arg_mask(inst, j); if (inst->SrcReg[j].RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); - _mesa_free(removeInst); - return; + goto done; } - tempRead[index] = GL_TRUE; + for (comp = 0; comp < 4; comp++) { + GLuint swz = (inst->SrcReg[j].Swizzle >> (3 * comp)) & 0x7; + + if ((read_mask & (1 << comp)) == 0) + continue; + + switch (swz) { + case SWIZZLE_X: + tempRead[index][0] = GL_TRUE; + break; + case SWIZZLE_Y: + tempRead[index][1] = GL_TRUE; + break; + case SWIZZLE_Z: + tempRead[index][2] = GL_TRUE; + break; + case SWIZZLE_W: + tempRead[index][3] = GL_TRUE; + break; + } + } } } @@ -233,50 +292,63 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); - _mesa_free(removeInst); - return; + goto done; } - tempWritten[index] = GL_TRUE; if (inst->CondUpdate) { /* If we're writing to this register and setting condition * codes we cannot remove the instruction. Prevent removal * by setting the 'read' flag. */ - tempRead[index] = GL_TRUE; + tempRead[index][0] = GL_TRUE; + tempRead[index][1] = GL_TRUE; + tempRead[index][2] = GL_TRUE; + tempRead[index][3] = GL_TRUE; } } } - if (dbg) { - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { - if (tempWritten[i] && !tempRead[i]) - _mesa_printf("Remove writes to tmp %u\n", i); - } - } - /* find instructions that write to dead registers, flag for removal */ for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - if (inst->DstReg.File == PROGRAM_TEMPORARY) { - GLint index = inst->DstReg.Index; - removeInst[i] = (tempWritten[index] && !tempRead[index]); - if (dbg && removeInst[i]) { - _mesa_printf("Remove inst %u: ", i); - _mesa_print_instruction(inst); - } + struct prog_instruction *inst = prog->Instructions + i; + const GLuint numDst = _mesa_num_inst_dst_regs(inst->Opcode); + + if (numDst != 0 && inst->DstReg.File == PROGRAM_TEMPORARY) { + GLint chan, index = inst->DstReg.Index; + + for (chan = 0; chan < 4; chan++) { + if (!tempRead[index][chan] && + inst->DstReg.WriteMask & (1 << chan)) { + if (dbg) { + _mesa_printf("Remove writemask on %u.%c\n", i, + chan == 3 ? 'w' : 'x' + chan); + } + inst->DstReg.WriteMask &= ~(1 << chan); + rem++; + } + } + + if (inst->DstReg.WriteMask == 0) { + /* If we cleared all writes, the instruction can be removed. */ + if (dbg) + _mesa_printf("Remove instruction %u: \n", i); + removeInst[i] = GL_TRUE; + } } } /* now remove the instructions which aren't needed */ rem = remove_instructions(prog, removeInst); - _mesa_free(removeInst); - if (dbg) { - _mesa_printf("Optimize: End dead code removal. %u instructions removed\n", rem); + _mesa_printf("Optimize: End dead code removal.\n"); + _mesa_printf(" %u channel writes removed\n", rem); + _mesa_printf(" %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } + +done: + _mesa_free(removeInst); } @@ -325,6 +397,132 @@ find_next_temp_use(const struct gl_program *prog, GLuint start, GLuint index) return END; } +static GLboolean _mesa_is_flow_control_opcode(enum prog_opcode opcode) +{ + switch (opcode) { + case OPCODE_BGNLOOP: + case OPCODE_BGNSUB: + case OPCODE_BRA: + case OPCODE_CAL: + case OPCODE_CONT: + case OPCODE_IF: + case OPCODE_ELSE: + case OPCODE_END: + case OPCODE_ENDIF: + case OPCODE_ENDLOOP: + case OPCODE_ENDSUB: + case OPCODE_RET: + return GL_TRUE; + default: + return GL_FALSE; + } +} + +/** + * Try to remove use of extraneous MOV instructions, to free them up for dead + * code removal. + */ +static void +_mesa_remove_extra_move_use(struct gl_program *prog) +{ + GLuint i, j; + + if (dbg) { + _mesa_printf("Optimize: Begin remove extra move use\n"); + _mesa_print_program(prog); + } + + /* + * Look for sequences such as this: + * MOV tmpX, arg0; + * ... + * FOO tmpY, tmpX, arg1; + * and convert into: + * MOV tmpX, arg0; + * ... + * FOO tmpY, arg0, arg1; + */ + + for (i = 0; i + 1 < prog->NumInstructions; i++) { + const struct prog_instruction *mov = prog->Instructions + i; + + if (mov->Opcode != OPCODE_MOV || + mov->DstReg.File != PROGRAM_TEMPORARY || + mov->DstReg.RelAddr || + mov->DstReg.CondMask != COND_TR || + mov->SaturateMode != SATURATE_OFF || + mov->SrcReg[0].RelAddr) + continue; + + /* Walk through remaining instructions until the or src reg gets + * rewritten or we get into some flow-control, eliminating the use of + * this MOV. + */ + for (j = i + 1; j < prog->NumInstructions; j++) { + struct prog_instruction *inst2 = prog->Instructions + j; + int arg; + + if (_mesa_is_flow_control_opcode(inst2->Opcode)) + break; + + /* First rewrite this instruction's args if appropriate. */ + for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) { + int comp; + int read_mask = get_src_arg_mask(inst2, arg); + + if (inst2->SrcReg[arg].File != mov->DstReg.File || + inst2->SrcReg[arg].Index != mov->DstReg.Index || + inst2->SrcReg[arg].RelAddr || + inst2->SrcReg[arg].Abs) + continue; + + /* Check that all the sources for this arg of inst2 come from inst1 + * or constants. + */ + for (comp = 0; comp < 4; comp++) { + int src_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + /* If the MOV didn't write that channel, can't use it. */ + if ((read_mask & (1 << comp)) && + src_swz <= SWIZZLE_W && + (mov->DstReg.WriteMask & (1 << src_swz)) == 0) + break; + } + if (comp != 4) + continue; + + /* Adjust the swizzles of inst2 to point at MOV's source */ + for (comp = 0; comp < 4; comp++) { + int inst2_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + if (inst2_swz <= SWIZZLE_W) { + GLuint s = GET_SWZ(mov->SrcReg[0].Swizzle, inst2_swz); + inst2->SrcReg[arg].Swizzle &= ~(7 << (3 * comp)); + inst2->SrcReg[arg].Swizzle |= s << (3 * comp); + inst2->SrcReg[arg].Negate ^= (((mov->SrcReg[0].Negate >> + inst2_swz) & 0x1) << comp); + } + } + inst2->SrcReg[arg].File = mov->SrcReg[0].File; + inst2->SrcReg[arg].Index = mov->SrcReg[0].Index; + } + + /* If this instruction overwrote part of the move, our time is up. */ + if ((inst2->DstReg.File == mov->DstReg.File && + (inst2->DstReg.RelAddr || + inst2->DstReg.Index == mov->DstReg.Index)) || + (inst2->DstReg.File == mov->SrcReg[0].File && + (inst2->DstReg.RelAddr || + inst2->DstReg.Index == mov->SrcReg[0].Index))) + break; + } + } + + if (dbg) { + _mesa_printf("Optimize: End remove extra move use.\n"); + /*_mesa_print_program(prog);*/ + } +} /** * Try to remove extraneous MOV instructions from the given program. @@ -823,6 +1021,8 @@ _mesa_reallocate_registers(struct gl_program *prog) void _mesa_optimize_program(GLcontext *ctx, struct gl_program *program) { + _mesa_remove_extra_move_use(program); + if (1) _mesa_remove_dead_code(program); diff --git a/mesalib/src/mesa/shader/prog_parameter.c b/mesalib/src/mesa/shader/prog_parameter.c index 2f029b02e..f22492e02 100644 --- a/mesalib/src/mesa/shader/prog_parameter.c +++ b/mesalib/src/mesa/shader/prog_parameter.c @@ -500,7 +500,7 @@ GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); + GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name); if (i < 0) return NULL; else diff --git a/mesalib/src/mesa/shader/prog_print.c b/mesalib/src/mesa/shader/prog_print.c index b71735aa8..52c102cba 100644 --- a/mesalib/src/mesa/shader/prog_print.c +++ b/mesalib/src/mesa/shader/prog_print.c @@ -788,7 +788,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!VP1.0\n"); else - _mesa_fprintf(f, "# Vertex Program/Shader\n"); + _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: @@ -797,7 +797,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!FP1.0\n"); else - _mesa_fprintf(f, "# Fragment Program/Shader\n"); + _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); break; } @@ -826,11 +826,11 @@ _mesa_print_program(const struct gl_program *prog) * XXX move to imports.[ch] if useful elsewhere. */ static const char * -binary(GLbitfield val) +binary(GLbitfield64 val) { - static char buf[50]; + static char buf[80]; GLint i, len = 0; - for (i = 31; i >= 0; --i) { + for (i = 63; i >= 0; --i) { if (val & (1 << i)) buf[len++] = '1'; else if (len > 0 || i == 0) @@ -906,7 +906,8 @@ _mesa_fprint_parameter_list(FILE *f, if (!list) return; - _mesa_fprintf(f, "param list %p\n", (void *) list); + if (0) + _mesa_fprintf(f, "param list %p\n", (void *) list); _mesa_fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); for (i = 0; i < list->NumParameters; i++){ struct gl_program_parameter *param = list->Parameters + i; diff --git a/mesalib/src/mesa/shader/program.c b/mesalib/src/mesa/shader/program.c index 2cd6eb8a3..6b8d94e66 100644 --- a/mesalib/src/mesa/shader/program.c +++ b/mesalib/src/mesa/shader/program.c @@ -351,13 +351,6 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Attributes); } - /* XXX this is a little ugly */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; - if (vprog->TnlData) - _mesa_free(vprog->TnlData); - } - _mesa_free(prog); } @@ -813,9 +806,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile) const struct prog_instruction *inst = prog->Instructions + i; const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; + /* check dst reg first */ + if (inst->DstReg.File == regFile) { + used[inst->DstReg.Index] = GL_TRUE; + } + else { + /* check src regs otherwise */ + for (k = 0; k < n; k++) { + if (inst->SrcReg[k].File == regFile) { + used[inst->SrcReg[k].Index] = GL_TRUE; + break; + } } } } diff --git a/mesalib/src/mesa/shader/program_lexer.l b/mesalib/src/mesa/shader/program_lexer.l index c2803ff70..e2acb3c0c 100644 --- a/mesalib/src/mesa/shader/program_lexer.l +++ b/mesalib/src/mesa/shader/program_lexer.l @@ -26,22 +26,27 @@ #include "prog_instruction.h" #include "prog_statevars.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) +#ifndef HAVE_UNISTD_H +#define YY_NO_UNISTD_H +#endif + #define return_token_or_IDENTIFIER(condition, token) \ do { \ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -56,15 +61,16 @@ } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -113,6 +119,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -133,6 +148,11 @@ exp [Ee][-+]?[0-9]+ frac "."[0-9]+ dot "."[ \t]* +sz [HRX]? +szf [HR]? +cc C? +sat (_SAT)? + %option bison-bridge bison-locations reentrant noyywrap %% @@ -150,86 +170,74 @@ OUTPUT { return OUTPUT; } PARAM { return PARAM; } TEMP { yylval->integer = at_temp; return TEMP; } -ABS { return_opcode( 1, VECTOR_OP, ABS, OFF); } -ABS_SAT { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } -ADD { return_opcode( 1, BIN_OP, ADD, OFF); } -ADD_SAT { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } -ARL { return_opcode(require_ARB_vp, ARL, ARL, OFF); } - -CMP { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } -CMP_SAT { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } -COS { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } -COS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } - -DP3 { return_opcode( 1, BIN_OP, DP3, OFF); } -DP3_SAT { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } -DP4 { return_opcode( 1, BIN_OP, DP4, OFF); } -DP4_SAT { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } -DPH { return_opcode( 1, BIN_OP, DPH, OFF); } -DPH_SAT { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } -DST { return_opcode( 1, BIN_OP, DST, OFF); } -DST_SAT { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } - -EX2 { return_opcode( 1, SCALAR_OP, EX2, OFF); } -EX2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } -EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } - -FLR { return_opcode( 1, VECTOR_OP, FLR, OFF); } -FLR_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } -FRC { return_opcode( 1, VECTOR_OP, FRC, OFF); } -FRC_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } - -KIL { return_opcode(require_ARB_fp, KIL, KIL, OFF); } - -LIT { return_opcode( 1, VECTOR_OP, LIT, OFF); } -LIT_SAT { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } -LG2 { return_opcode( 1, SCALAR_OP, LG2, OFF); } -LG2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } -LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } -LRP { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } -LRP_SAT { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } - -MAD { return_opcode( 1, TRI_OP, MAD, OFF); } -MAD_SAT { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } -MAX { return_opcode( 1, BIN_OP, MAX, OFF); } -MAX_SAT { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } -MIN { return_opcode( 1, BIN_OP, MIN, OFF); } -MIN_SAT { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } -MOV { return_opcode( 1, VECTOR_OP, MOV, OFF); } -MOV_SAT { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } -MUL { return_opcode( 1, BIN_OP, MUL, OFF); } -MUL_SAT { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } - -POW { return_opcode( 1, BINSC_OP, POW, OFF); } -POW_SAT { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } - -RCP { return_opcode( 1, SCALAR_OP, RCP, OFF); } -RCP_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } -RSQ { return_opcode( 1, SCALAR_OP, RSQ, OFF); } -RSQ_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } - -SCS { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } -SCS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } -SGE { return_opcode( 1, BIN_OP, SGE, OFF); } -SGE_SAT { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } -SIN { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } -SIN_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } -SLT { return_opcode( 1, BIN_OP, SLT, OFF); } -SLT_SAT { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } -SUB { return_opcode( 1, BIN_OP, SUB, OFF); } -SUB_SAT { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } -SWZ { return_opcode( 1, SWZ, SWZ, OFF); } -SWZ_SAT { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } - -TEX { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } -TEX_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } -TXB { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } -TXB_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } -TXP { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } -TXP_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } - -XPD { return_opcode( 1, BIN_OP, XPD, OFF); } -XPD_SAT { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +ABS{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, ABS, 3); } +ADD{sz}{cc}{sat} { return_opcode( 1, BIN_OP, ADD, 3); } +ARL { return_opcode(require_ARB_vp, ARL, ARL, 3); } + +CMP{sat} { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } +COS{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } + +DDX{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } +DDY{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } +DP3{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP3, 3); } +DP4{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP4, 3); } +DPH{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DPH, 3); } +DST{szf}{cc}{sat} { return_opcode( 1, BIN_OP, DST, 3); } + +EX2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, EX2, 3); } +EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } + +FLR{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FLR, 3); } +FRC{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FRC, 3); } + +KIL { return_opcode(require_ARB_fp, KIL, KIL, 3); } + +LIT{szf}{cc}{sat} { return_opcode( 1, VECTOR_OP, LIT, 3); } +LG2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, LG2, 3); } +LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } +LRP{sz}{cc}{sat} { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } + +MAD{sz}{cc}{sat} { return_opcode( 1, TRI_OP, MAD, 3); } +MAX{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MAX, 3); } +MIN{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MIN, 3); } +MOV{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, MOV, 3); } +MUL{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MUL, 3); } + +PK2H { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } +PK2US { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } +PK4B { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } +PK4UB { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } +POW{szf}{cc}{sat} { return_opcode( 1, BINSC_OP, POW, 3); } + +RCP{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RCP, 3); } +RFL{szf}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } +RSQ{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RSQ, 3); } + +SCS{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } +SEQ{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } +SFL{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } +SGE{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SGE, 3); } +SGT{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } +SIN{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } +SLE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } +SLT{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SLT, 3); } +SNE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } +STR{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, STR, 3); } +SUB{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SUB, 3); } +SWZ{sat} { return_opcode( 1, SWZ, SWZ, 3); } + +TEX{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } +TXB{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } +TXD{cc}{sat} { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } +TXP{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } + +UP2H{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } +UP2US{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } +UP4B{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } +UP4UB{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } + +X2D{szf}{cc}{sat} { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } +XPD{sat} { return_opcode( 1, BIN_OP, XPD, 3); } vertex { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } fragment { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } @@ -307,10 +315,7 @@ ARRAY2D { return_token_or_IDENTIFIER(require_ARB_fp && require ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } -[_a-zA-Z$][_a-zA-Z0-9$]* { - yylval->string = strdup(yytext); - return IDENTIFIER; -} +[_a-zA-Z$][_a-zA-Z0-9$]* { return handle_ident(yyextra, yytext, yylval); } ".." { return DOT_DOT; } diff --git a/mesalib/src/mesa/shader/program_parse.tab.c b/mesalib/src/mesa/shader/program_parse.tab.c index b7bac7e5a..d4f842948 100644 --- a/mesalib/src/mesa/shader/program_parse.tab.c +++ b/mesalib/src/mesa/shader/program_parse.tab.c @@ -137,12 +137,27 @@ static int validate_inputs(struct YYLTYPE *locp, static void init_dst_reg(struct prog_dst_register *r); +static void set_dst_reg(struct prog_dst_register *r, + gl_register_file file, GLint index); + static void init_src_reg(struct asm_src_register *r); +static void set_src_reg(struct asm_src_register *r, + gl_register_file file, GLint index); + +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) @@ -170,7 +185,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Line 189 of yacc.c */ -#line 174 "program_parse.tab.c" +#line 189 "program_parse.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -216,90 +231,92 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -310,7 +327,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 107 "program_parse.y" +#line 122 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -339,7 +356,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 343 "program_parse.tab.c" +#line 360 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -363,14 +380,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 249 "program_parse.y" +#line 267 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 374 "program_parse.tab.c" +#line 391 "program_parse.tab.c" #ifdef short # undef short @@ -587,20 +604,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 342 +#define YYLAST 396 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 115 +#define YYNTOKENS 120 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 134 +#define YYNNTS 143 /* YYNRULES -- Number of rules. */ -#define YYNRULES 264 +#define YYNRULES 282 /* YYNRULES -- Number of states. */ -#define YYNSTATES 436 +#define YYNSTATES 475 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 360 +#define YYMAXUTOK 362 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -612,15 +629,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 110, 107, 111, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, - 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, + 115, 116, 2, 113, 109, 114, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 108, + 2, 117, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 108, 2, 109, 2, 2, 2, 2, 2, 2, + 2, 111, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 113, 2, 114, 2, 2, 2, 2, + 2, 2, 2, 118, 110, 119, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -644,7 +661,7 @@ static const yytype_uint8 yytranslate[] = 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105 + 105, 106, 107 }; #if YYDEBUG @@ -654,142 +671,152 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, - 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, - 99, 102, 105, 107, 109, 111, 113, 115, 117, 119, - 121, 123, 125, 127, 129, 136, 140, 144, 147, 150, - 158, 161, 163, 165, 167, 169, 174, 176, 178, 180, - 182, 184, 186, 188, 192, 193, 196, 199, 201, 203, - 205, 207, 209, 211, 213, 215, 217, 218, 220, 222, - 224, 226, 227, 229, 231, 233, 235, 237, 239, 244, - 247, 250, 252, 255, 257, 260, 262, 265, 270, 275, - 277, 278, 282, 284, 286, 289, 291, 294, 296, 298, - 302, 309, 310, 312, 315, 320, 322, 326, 328, 330, - 332, 334, 336, 338, 340, 342, 344, 346, 349, 352, - 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, - 386, 388, 390, 392, 398, 400, 402, 404, 407, 409, - 411, 414, 416, 419, 426, 428, 432, 434, 436, 438, - 440, 442, 447, 449, 451, 453, 455, 457, 459, 462, - 464, 466, 472, 474, 477, 479, 481, 487, 490, 491, - 498, 502, 503, 505, 507, 509, 511, 513, 516, 518, - 520, 523, 528, 533, 534, 538, 540, 542, 544, 547, - 549, 551, 553, 555, 561, 563, 567, 573, 579, 581, - 585, 591, 593, 595, 597, 599, 601, 603, 605, 607, - 609, 613, 619, 627, 637, 640, 643, 645, 647, 648, - 649, 653, 654, 658, 662, 664, 669, 672, 675, 678, - 681, 685, 688, 692, 693, 695, 697, 698, 700, 702, - 703, 705, 707, 708, 710, 712, 713, 717, 718, 722, - 723, 727, 729, 731, 733 + 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, + 92, 101, 104, 107, 120, 123, 125, 127, 129, 131, + 133, 135, 137, 139, 141, 143, 145, 147, 154, 157, + 162, 165, 167, 171, 177, 181, 184, 192, 195, 197, + 199, 201, 203, 208, 210, 212, 214, 216, 218, 220, + 222, 226, 227, 230, 233, 235, 237, 239, 241, 243, + 245, 247, 249, 251, 252, 254, 256, 258, 260, 261, + 265, 269, 270, 273, 276, 278, 280, 282, 284, 286, + 288, 290, 292, 297, 300, 303, 305, 308, 310, 313, + 315, 318, 323, 328, 330, 331, 335, 337, 339, 342, + 344, 347, 349, 351, 355, 362, 363, 365, 368, 373, + 375, 379, 381, 383, 385, 387, 389, 391, 393, 395, + 397, 399, 402, 405, 408, 411, 414, 417, 420, 423, + 426, 429, 432, 435, 439, 441, 443, 445, 451, 453, + 455, 457, 460, 462, 464, 467, 469, 472, 479, 481, + 485, 487, 489, 491, 493, 495, 500, 502, 504, 506, + 508, 510, 512, 515, 517, 519, 525, 527, 530, 532, + 534, 540, 543, 544, 551, 555, 556, 558, 560, 562, + 564, 566, 569, 571, 573, 576, 581, 586, 587, 591, + 593, 595, 597, 600, 602, 604, 606, 608, 614, 616, + 620, 626, 632, 634, 638, 644, 646, 648, 650, 652, + 654, 656, 658, 660, 662, 666, 672, 680, 690, 693, + 696, 698, 700, 701, 702, 707, 709, 710, 711, 715, + 719, 721, 727, 730, 733, 736, 739, 743, 746, 750, + 751, 753, 755, 756, 758, 760, 761, 763, 765, 766, + 768, 770, 771, 775, 776, 780, 781, 785, 787, 789, + 791, 796, 798 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 116, 0, -1, 117, 118, 120, 12, -1, 3, -1, - 4, -1, 118, 119, -1, -1, 8, 98, 106, -1, - 120, 121, -1, -1, 122, 106, -1, 158, 106, -1, - 123, -1, 124, -1, 125, -1, 126, -1, 127, -1, - 128, -1, 129, -1, 130, -1, 135, -1, 131, -1, - 132, -1, 19, 139, 107, 136, -1, 18, 138, 107, - 137, -1, 16, 138, 107, 136, -1, 14, 138, 107, - 136, 107, 136, -1, 13, 138, 107, 137, 107, 137, - -1, 17, 138, 107, 137, 107, 137, 107, 137, -1, - 15, 138, 107, 137, 107, 133, 107, 134, -1, 20, - 137, -1, 82, 243, -1, 83, -1, 84, -1, 85, - -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, - -1, 91, -1, 92, -1, 93, -1, 94, -1, 21, - 138, 107, 143, 107, 140, -1, 229, 143, 155, -1, - 229, 143, 156, -1, 144, 157, -1, 152, 154, -1, - 141, 107, 141, 107, 141, 107, 141, -1, 229, 142, - -1, 22, -1, 98, -1, 98, -1, 160, -1, 145, - 108, 146, 109, -1, 174, -1, 236, -1, 98, -1, - 98, -1, 147, -1, 148, -1, 22, -1, 152, 153, - 149, -1, -1, 110, 150, -1, 111, 151, -1, 22, - -1, 22, -1, 98, -1, 102, -1, 102, -1, 102, - -1, 102, -1, 99, -1, 103, -1, -1, 99, -1, - 100, -1, 101, -1, 102, -1, -1, 159, -1, 166, - -1, 230, -1, 232, -1, 235, -1, 248, -1, 7, - 98, 112, 160, -1, 95, 161, -1, 37, 165, -1, - 59, -1, 97, 163, -1, 52, -1, 28, 241, -1, - 36, -1, 73, 242, -1, 49, 108, 164, 109, -1, - 96, 108, 162, 109, -1, 22, -1, -1, 108, 164, - 109, -1, 22, -1, 59, -1, 28, 241, -1, 36, - -1, 73, 242, -1, 167, -1, 168, -1, 10, 98, - 170, -1, 10, 98, 108, 169, 109, 171, -1, -1, - 22, -1, 112, 173, -1, 112, 113, 172, 114, -1, - 175, -1, 172, 107, 175, -1, 177, -1, 213, -1, - 223, -1, 177, -1, 213, -1, 224, -1, 176, -1, - 214, -1, 223, -1, 177, -1, 72, 201, -1, 72, - 178, -1, 72, 180, -1, 72, 183, -1, 72, 185, - -1, 72, 191, -1, 72, 187, -1, 72, 194, -1, - 72, 196, -1, 72, 198, -1, 72, 200, -1, 72, - 212, -1, 46, 240, 179, -1, 189, -1, 32, -1, - 68, -1, 42, 108, 190, 109, 181, -1, 189, -1, - 59, -1, 25, -1, 71, 182, -1, 39, -1, 31, - -1, 43, 184, -1, 24, -1, 240, 66, -1, 44, - 108, 190, 109, 240, 186, -1, 189, -1, 74, 244, - 188, -1, 28, -1, 24, -1, 30, -1, 70, -1, - 22, -1, 75, 242, 192, 193, -1, 34, -1, 53, - -1, 78, -1, 79, -1, 77, -1, 76, -1, 35, - 195, -1, 28, -1, 55, -1, 27, 108, 197, 109, - 56, -1, 22, -1, 57, 199, -1, 69, -1, 25, - -1, 203, 65, 108, 206, 109, -1, 203, 202, -1, - -1, 65, 108, 206, 104, 206, 109, -1, 48, 207, - 204, -1, -1, 205, -1, 40, -1, 81, -1, 41, - -1, 22, -1, 50, 208, -1, 62, -1, 51, -1, - 80, 242, -1, 54, 108, 210, 109, -1, 47, 108, - 211, 109, -1, -1, 108, 209, 109, -1, 22, -1, - 22, -1, 22, -1, 29, 63, -1, 217, -1, 220, - -1, 215, -1, 218, -1, 61, 33, 108, 216, 109, - -1, 221, -1, 221, 104, 221, -1, 61, 33, 108, - 221, 109, -1, 61, 45, 108, 219, 109, -1, 222, - -1, 222, 104, 222, -1, 61, 45, 108, 222, 109, - -1, 22, -1, 22, -1, 225, -1, 227, -1, 226, - -1, 227, -1, 228, -1, 23, -1, 22, -1, 113, - 228, 114, -1, 113, 228, 107, 228, 114, -1, 113, - 228, 107, 228, 107, 228, 114, -1, 113, 228, 107, - 228, 107, 228, 107, 228, 114, -1, 229, 23, -1, - 229, 22, -1, 110, -1, 111, -1, -1, -1, 11, - 231, 234, -1, -1, 5, 233, 234, -1, 234, 107, - 98, -1, 98, -1, 9, 98, 112, 236, -1, 64, - 59, -1, 64, 36, -1, 64, 237, -1, 64, 58, - -1, 64, 73, 242, -1, 64, 29, -1, 28, 238, - 239, -1, -1, 38, -1, 26, -1, -1, 60, -1, - 67, -1, -1, 38, -1, 26, -1, -1, 60, -1, - 67, -1, -1, 108, 245, 109, -1, -1, 108, 246, - 109, -1, -1, 108, 247, 109, -1, 22, -1, 22, - -1, 22, -1, 6, 98, 112, 98, -1 + 121, 0, -1, 122, 123, 125, 12, -1, 3, -1, + 4, -1, 123, 124, -1, -1, 8, 262, 108, -1, + 125, 126, -1, -1, 127, 108, -1, 170, 108, -1, + 128, -1, 129, -1, 130, -1, 131, -1, 132, -1, + 133, -1, 134, -1, 135, -1, 141, -1, 136, -1, + 137, -1, 138, -1, 19, 146, 109, 142, -1, 18, + 145, 109, 144, -1, 16, 145, 109, 142, -1, 14, + 145, 109, 142, 109, 142, -1, 13, 145, 109, 144, + 109, 144, -1, 17, 145, 109, 144, 109, 144, 109, + 144, -1, 15, 145, 109, 144, 109, 139, 109, 140, + -1, 20, 144, -1, 20, 166, -1, 22, 145, 109, + 144, 109, 144, 109, 144, 109, 139, 109, 140, -1, + 83, 256, -1, 84, -1, 85, -1, 86, -1, 87, + -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, + -1, 93, -1, 94, -1, 95, -1, 21, 145, 109, + 150, 109, 147, -1, 241, 143, -1, 241, 110, 143, + 110, -1, 150, 162, -1, 238, -1, 241, 150, 163, + -1, 241, 110, 150, 163, 110, -1, 151, 164, 165, + -1, 159, 161, -1, 148, 109, 148, 109, 148, 109, + 148, -1, 241, 149, -1, 23, -1, 262, -1, 100, + -1, 172, -1, 152, 111, 153, 112, -1, 186, -1, + 249, -1, 100, -1, 100, -1, 154, -1, 155, -1, + 23, -1, 159, 160, 156, -1, -1, 113, 157, -1, + 114, 158, -1, 23, -1, 23, -1, 100, -1, 104, + -1, 104, -1, 104, -1, 104, -1, 101, -1, 105, + -1, -1, 101, -1, 102, -1, 103, -1, 104, -1, + -1, 115, 166, 116, -1, 115, 167, 116, -1, -1, + 168, 163, -1, 169, 163, -1, 99, -1, 100, -1, + 171, -1, 178, -1, 242, -1, 245, -1, 248, -1, + 261, -1, 7, 99, 117, 172, -1, 96, 173, -1, + 38, 177, -1, 60, -1, 98, 175, -1, 53, -1, + 29, 254, -1, 37, -1, 74, 255, -1, 50, 111, + 176, 112, -1, 97, 111, 174, 112, -1, 23, -1, + -1, 111, 176, 112, -1, 23, -1, 60, -1, 29, + 254, -1, 37, -1, 74, 255, -1, 179, -1, 180, + -1, 10, 99, 182, -1, 10, 99, 111, 181, 112, + 183, -1, -1, 23, -1, 117, 185, -1, 117, 118, + 184, 119, -1, 187, -1, 184, 109, 187, -1, 189, + -1, 225, -1, 235, -1, 189, -1, 225, -1, 236, + -1, 188, -1, 226, -1, 235, -1, 189, -1, 73, + 213, -1, 73, 190, -1, 73, 192, -1, 73, 195, + -1, 73, 197, -1, 73, 203, -1, 73, 199, -1, + 73, 206, -1, 73, 208, -1, 73, 210, -1, 73, + 212, -1, 73, 224, -1, 47, 253, 191, -1, 201, + -1, 33, -1, 69, -1, 43, 111, 202, 112, 193, + -1, 201, -1, 60, -1, 26, -1, 72, 194, -1, + 40, -1, 32, -1, 44, 196, -1, 25, -1, 253, + 67, -1, 45, 111, 202, 112, 253, 198, -1, 201, + -1, 75, 257, 200, -1, 29, -1, 25, -1, 31, + -1, 71, -1, 23, -1, 76, 255, 204, 205, -1, + 35, -1, 54, -1, 79, -1, 80, -1, 78, -1, + 77, -1, 36, 207, -1, 29, -1, 56, -1, 28, + 111, 209, 112, 57, -1, 23, -1, 58, 211, -1, + 70, -1, 26, -1, 215, 66, 111, 218, 112, -1, + 215, 214, -1, -1, 66, 111, 218, 106, 218, 112, + -1, 49, 219, 216, -1, -1, 217, -1, 41, -1, + 82, -1, 42, -1, 23, -1, 51, 220, -1, 63, + -1, 52, -1, 81, 255, -1, 55, 111, 222, 112, + -1, 48, 111, 223, 112, -1, -1, 111, 221, 112, + -1, 23, -1, 23, -1, 23, -1, 30, 64, -1, + 229, -1, 232, -1, 227, -1, 230, -1, 62, 34, + 111, 228, 112, -1, 233, -1, 233, 106, 233, -1, + 62, 34, 111, 233, 112, -1, 62, 46, 111, 231, + 112, -1, 234, -1, 234, 106, 234, -1, 62, 46, + 111, 234, 112, -1, 23, -1, 23, -1, 237, -1, + 239, -1, 238, -1, 239, -1, 240, -1, 24, -1, + 23, -1, 118, 240, 119, -1, 118, 240, 109, 240, + 119, -1, 118, 240, 109, 240, 109, 240, 119, -1, + 118, 240, 109, 240, 109, 240, 109, 240, 119, -1, + 241, 24, -1, 241, 23, -1, 113, -1, 114, -1, + -1, -1, 244, 11, 243, 247, -1, 262, -1, -1, + -1, 5, 246, 247, -1, 247, 109, 99, -1, 99, + -1, 244, 9, 99, 117, 249, -1, 65, 60, -1, + 65, 37, -1, 65, 250, -1, 65, 59, -1, 65, + 74, 255, -1, 65, 30, -1, 29, 251, 252, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 111, 258, 112, -1, -1, 111, 259, 112, -1, + -1, 111, 260, 112, -1, 23, -1, 23, -1, 23, + -1, 6, 99, 117, 100, -1, 99, -1, 100, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 256, 256, 259, 267, 279, 280, 283, 307, 308, - 311, 326, 329, 334, 341, 342, 343, 344, 345, 346, - 347, 350, 351, 354, 360, 367, 374, 382, 389, 397, - 442, 449, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 469, 482, 495, 508, 530, 539, - 572, 579, 594, 649, 693, 704, 725, 735, 741, 774, - 793, 793, 795, 802, 814, 815, 816, 819, 831, 843, - 863, 874, 886, 888, 889, 890, 891, 894, 894, 894, - 894, 895, 898, 899, 900, 901, 902, 903, 906, 925, - 929, 935, 939, 943, 947, 956, 965, 969, 974, 980, - 991, 991, 992, 994, 998, 1002, 1006, 1012, 1012, 1014, - 1031, 1056, 1059, 1070, 1076, 1082, 1083, 1090, 1096, 1102, - 1110, 1116, 1122, 1130, 1136, 1142, 1150, 1151, 1154, 1155, - 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1167, - 1176, 1180, 1184, 1190, 1199, 1203, 1207, 1216, 1220, 1226, - 1232, 1239, 1244, 1252, 1262, 1264, 1272, 1278, 1282, 1286, - 1292, 1303, 1312, 1316, 1321, 1325, 1329, 1333, 1339, 1346, - 1350, 1356, 1364, 1375, 1382, 1386, 1392, 1402, 1413, 1417, - 1435, 1444, 1447, 1453, 1457, 1461, 1467, 1478, 1483, 1488, - 1493, 1498, 1503, 1511, 1514, 1519, 1532, 1540, 1551, 1559, - 1559, 1561, 1561, 1563, 1573, 1578, 1585, 1595, 1604, 1609, - 1616, 1626, 1636, 1648, 1648, 1649, 1649, 1651, 1661, 1669, - 1679, 1687, 1695, 1704, 1715, 1719, 1725, 1726, 1727, 1730, - 1730, 1733, 1733, 1736, 1743, 1752, 1766, 1775, 1784, 1788, - 1797, 1806, 1817, 1824, 1829, 1838, 1850, 1853, 1862, 1873, - 1874, 1875, 1878, 1879, 1880, 1883, 1884, 1887, 1888, 1891, - 1892, 1895, 1906, 1917, 1928 + 0, 274, 274, 277, 285, 297, 298, 301, 325, 326, + 329, 344, 347, 352, 359, 360, 361, 362, 363, 364, + 365, 368, 369, 370, 373, 379, 385, 391, 398, 404, + 411, 455, 460, 470, 514, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 534, 546, 554, + 571, 578, 595, 606, 626, 651, 658, 691, 698, 713, + 768, 809, 818, 839, 848, 852, 881, 900, 900, 902, + 909, 921, 922, 923, 926, 940, 954, 974, 985, 997, + 999, 1000, 1001, 1002, 1005, 1005, 1005, 1005, 1006, 1009, + 1013, 1018, 1025, 1032, 1039, 1062, 1085, 1086, 1087, 1088, + 1089, 1090, 1093, 1112, 1116, 1122, 1126, 1130, 1134, 1143, + 1152, 1156, 1161, 1167, 1178, 1178, 1179, 1181, 1185, 1189, + 1193, 1199, 1199, 1201, 1218, 1243, 1246, 1257, 1263, 1269, + 1270, 1277, 1283, 1289, 1297, 1303, 1309, 1317, 1323, 1329, + 1337, 1338, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, + 1349, 1350, 1351, 1354, 1363, 1367, 1371, 1377, 1386, 1390, + 1394, 1403, 1407, 1413, 1419, 1426, 1431, 1439, 1449, 1451, + 1459, 1465, 1469, 1473, 1479, 1490, 1499, 1503, 1508, 1512, + 1516, 1520, 1526, 1533, 1537, 1543, 1551, 1562, 1569, 1573, + 1579, 1589, 1600, 1604, 1622, 1631, 1634, 1640, 1644, 1648, + 1654, 1665, 1670, 1675, 1680, 1685, 1690, 1698, 1701, 1706, + 1719, 1727, 1738, 1746, 1746, 1748, 1748, 1750, 1760, 1765, + 1772, 1782, 1791, 1796, 1803, 1813, 1823, 1835, 1835, 1836, + 1836, 1838, 1848, 1856, 1866, 1874, 1882, 1891, 1902, 1906, + 1912, 1913, 1914, 1917, 1917, 1920, 1955, 1959, 1959, 1962, + 1969, 1978, 1992, 2001, 2010, 2014, 2023, 2032, 2043, 2050, + 2055, 2064, 2076, 2079, 2088, 2099, 2100, 2101, 2104, 2105, + 2106, 2109, 2110, 2113, 2114, 2117, 2118, 2121, 2132, 2143, + 2154, 2180, 2181 }; #endif @@ -801,9 +828,9 @@ static const char *const yytname[] = "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS", "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP", "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL", - "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK", - "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV", - "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", + "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", + "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", + "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL", "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL", "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE", @@ -814,49 +841,51 @@ static const char *const yytname[] = "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", - "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", - "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", - "'}'", "$accept", "program", "language", "optionSequence", "option", - "statementSequence", "statement", "instruction", "ALU_instruction", - "TexInstruction", "ARL_instruction", "VECTORop_instruction", - "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", - "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", - "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg", - "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle", - "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray", - "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel", - "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg", - "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix", - "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding", - "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", - "fragAttribItem", "PARAM_statement", "PARAM_singleStmt", - "PARAM_multipleStmt", "optArraySize", "paramSingleInit", - "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl", - "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem", - "stateSingleItem", "stateMaterialItem", "stateMatProperty", - "stateLightItem", "stateLightProperty", "stateSpotProperty", - "stateLightModelItem", "stateLModProperty", "stateLightProdItem", - "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty", - "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem", - "stateTexGenType", "stateTexGenCoord", "stateFogItem", - "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", - "statePointItem", "statePointProperty", "stateMatrixRow", - "stateMatrixRows", "optMatrixRows", "stateMatrixItem", - "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", - "stateMatrixName", "stateOptModMatNum", "stateModMatNum", - "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem", - "programSingleItem", "programMultipleItem", "progEnvParams", - "progEnvParamNums", "progEnvParam", "progLocalParams", - "progLocalParamNums", "progLocalParam", "progEnvParamNum", - "progLocalParamNum", "paramConstDecl", "paramConstUse", - "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", - "signedFloatConstant", "optionalSign", "TEMP_statement", "@1", + "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2", + "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", + "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program", + "language", "optionSequence", "option", "statementSequence", "statement", + "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", + "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", + "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", + "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget", + "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg", + "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp", + "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem", + "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset", + "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent", + "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask", + "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2", + "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem", + "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", + "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt", + "optArraySize", "paramSingleInit", "paramMultipleInit", + "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse", + "paramMultipleItem", "stateMultipleItem", "stateSingleItem", + "stateMaterialItem", "stateMatProperty", "stateLightItem", + "stateLightProperty", "stateSpotProperty", "stateLightModelItem", + "stateLModProperty", "stateLightProdItem", "stateLProdProperty", + "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty", + "stateLightNumber", "stateTexGenItem", "stateTexGenType", + "stateTexGenCoord", "stateFogItem", "stateFogProperty", + "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem", + "statePointProperty", "stateMatrixRow", "stateMatrixRows", + "optMatrixRows", "stateMatrixItem", "stateOptMatModifier", + "stateMatModifier", "stateMatrixRowNum", "stateMatrixName", + "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum", + "stateProgramMatNum", "stateDepthItem", "programSingleItem", + "programMultipleItem", "progEnvParams", "progEnvParamNums", + "progEnvParam", "progLocalParams", "progLocalParamNums", + "progLocalParam", "progEnvParamNum", "progLocalParamNum", + "paramConstDecl", "paramConstUse", "paramConstScalarDecl", + "paramConstScalarUse", "paramConstVector", "signedFloatConstant", + "optionalSign", "TEMP_statement", "@1", "optVarSize", "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", - "ALIAS_statement", 0 + "ALIAS_statement", "string", 0 }; #endif @@ -875,41 +904,43 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 59, 44, 91, 93, - 43, 45, 61, 123, 125 + 355, 356, 357, 358, 359, 360, 361, 362, 59, 44, + 124, 91, 93, 43, 45, 40, 41, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_uint16 yyr1[] = { - 0, 115, 116, 117, 117, 118, 118, 119, 120, 120, - 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, - 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 134, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 142, 143, 143, 143, 143, 144, 144, 145, - 146, 146, 147, 148, 149, 149, 149, 150, 151, 152, - 153, 154, 155, 156, 156, 156, 156, 157, 157, 157, - 157, 157, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 161, 161, 161, 161, 161, 161, 161, 161, 162, - 163, 163, 164, 165, 165, 165, 165, 166, 166, 167, - 168, 169, 169, 170, 171, 172, 172, 173, 173, 173, - 174, 174, 174, 175, 175, 175, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, - 179, 179, 179, 180, 181, 181, 181, 181, 181, 182, - 183, 184, 184, 185, 186, 187, 188, 189, 189, 189, - 190, 191, 192, 192, 193, 193, 193, 193, 194, 195, - 195, 196, 197, 198, 199, 199, 200, 201, 202, 202, - 203, 204, 204, 205, 205, 205, 206, 207, 207, 207, - 207, 207, 207, 208, 208, 209, 210, 211, 212, 213, - 213, 214, 214, 215, 216, 216, 217, 218, 219, 219, - 220, 221, 222, 223, 223, 224, 224, 225, 226, 226, - 227, 227, 227, 227, 228, 228, 229, 229, 229, 231, - 230, 233, 232, 234, 234, 235, 236, 236, 236, 236, - 236, 236, 237, 238, 238, 238, 239, 239, 239, 240, - 240, 240, 241, 241, 241, 242, 242, 243, 243, 244, - 244, 245, 246, 247, 248 + 0, 120, 121, 122, 122, 123, 123, 124, 125, 125, + 126, 126, 127, 127, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 137, 138, 139, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 141, 142, 142, + 143, 143, 144, 144, 145, 146, 147, 148, 149, 149, + 150, 150, 150, 150, 151, 151, 152, 153, 153, 154, + 155, 156, 156, 156, 157, 158, 159, 160, 161, 162, + 163, 163, 163, 163, 164, 164, 164, 164, 164, 165, + 165, 165, 166, 167, 168, 169, 170, 170, 170, 170, + 170, 170, 171, 172, 172, 173, 173, 173, 173, 173, + 173, 173, 173, 174, 175, 175, 176, 177, 177, 177, + 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, + 184, 185, 185, 185, 186, 186, 186, 187, 187, 187, + 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, + 189, 189, 189, 190, 191, 191, 191, 192, 193, 193, + 193, 193, 193, 194, 195, 196, 196, 197, 198, 199, + 200, 201, 201, 201, 202, 203, 204, 204, 205, 205, + 205, 205, 206, 207, 207, 208, 209, 210, 211, 211, + 212, 213, 214, 214, 215, 216, 216, 217, 217, 217, + 218, 219, 219, 219, 219, 219, 219, 220, 220, 221, + 222, 223, 224, 225, 225, 226, 226, 227, 228, 228, + 229, 230, 231, 231, 232, 233, 234, 235, 235, 236, + 236, 237, 238, 238, 239, 239, 239, 239, 240, 240, + 241, 241, 241, 243, 242, 244, 244, 246, 245, 247, + 247, 248, 249, 249, 249, 249, 249, 249, 250, 251, + 251, 251, 252, 252, 252, 253, 253, 253, 254, 254, + 254, 255, 255, 256, 256, 257, 257, 258, 259, 260, + 261, 262, 262 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -917,31 +948,33 @@ static const yytype_uint8 yyr2[] = { 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 6, 3, 3, 2, 2, 7, - 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, - 1, 1, 1, 3, 0, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 4, 2, - 2, 1, 2, 1, 2, 1, 2, 4, 4, 1, - 0, 3, 1, 1, 2, 1, 2, 1, 1, 3, - 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, - 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, - 2, 1, 2, 6, 1, 3, 1, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 5, 1, 2, 1, 1, 5, 2, 0, 6, - 3, 0, 1, 1, 1, 1, 1, 2, 1, 1, - 2, 4, 4, 0, 3, 1, 1, 1, 2, 1, - 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 5, 7, 9, 2, 2, 1, 1, 0, 0, - 3, 0, 3, 3, 1, 4, 2, 2, 2, 2, - 3, 2, 3, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 3, 0, 3, 0, - 3, 1, 1, 1, 4 + 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, + 8, 2, 2, 12, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 2, 4, + 2, 1, 3, 5, 3, 2, 7, 2, 1, 1, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 3, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 2, 2, 1, 2, 1, 2, 1, + 2, 4, 4, 1, 0, 3, 1, 1, 2, 1, + 2, 1, 1, 3, 6, 0, 1, 2, 4, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 1, 1, 1, 5, 1, 1, + 1, 2, 1, 1, 2, 1, 2, 6, 1, 3, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 5, 1, 2, 1, 1, + 5, 2, 0, 6, 3, 0, 1, 1, 1, 1, + 1, 2, 1, 1, 2, 4, 4, 0, 3, 1, + 1, 1, 2, 1, 1, 1, 1, 5, 1, 3, + 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 7, 9, 2, 2, + 1, 1, 0, 0, 4, 1, 0, 0, 3, 3, + 1, 5, 2, 2, 2, 2, 3, 2, 3, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 3, 0, 3, 0, 3, 1, 1, 1, + 4, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -949,272 +982,296 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 231, 0, 0, 0, 0, 229, 2, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 8, 0, 12, - 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, - 0, 82, 83, 107, 108, 84, 85, 86, 87, 7, - 0, 0, 0, 0, 0, 0, 0, 58, 0, 81, - 57, 0, 0, 0, 0, 0, 69, 0, 0, 226, - 227, 30, 0, 0, 10, 11, 234, 232, 0, 0, - 0, 111, 228, 109, 230, 243, 241, 237, 239, 236, - 255, 238, 228, 77, 78, 79, 80, 47, 228, 228, - 228, 228, 228, 228, 71, 48, 219, 218, 0, 0, - 0, 0, 53, 228, 76, 0, 54, 56, 120, 121, - 199, 200, 122, 215, 216, 0, 0, 264, 88, 235, - 112, 0, 113, 117, 118, 119, 213, 214, 217, 0, - 245, 244, 246, 0, 240, 0, 0, 0, 0, 25, - 0, 24, 23, 252, 105, 103, 255, 90, 0, 0, - 0, 0, 0, 0, 249, 0, 249, 0, 0, 259, - 255, 128, 129, 130, 131, 133, 132, 134, 135, 136, - 137, 0, 138, 252, 95, 0, 93, 91, 255, 0, - 100, 89, 0, 74, 73, 75, 46, 0, 0, 233, - 0, 225, 224, 247, 248, 242, 261, 0, 228, 228, - 0, 0, 228, 253, 254, 104, 106, 0, 0, 0, - 198, 169, 170, 168, 0, 151, 251, 250, 150, 0, - 0, 0, 0, 193, 189, 0, 188, 255, 181, 175, - 174, 173, 0, 0, 0, 0, 94, 0, 96, 0, - 0, 92, 228, 220, 62, 0, 60, 61, 0, 228, - 0, 110, 256, 27, 26, 72, 45, 257, 0, 0, - 211, 0, 212, 0, 172, 0, 160, 0, 152, 0, - 157, 158, 141, 142, 159, 139, 140, 0, 0, 187, - 0, 190, 183, 185, 184, 180, 182, 263, 0, 156, - 155, 162, 163, 0, 0, 102, 0, 99, 0, 0, - 0, 55, 70, 64, 44, 0, 0, 228, 0, 31, - 0, 228, 206, 210, 0, 0, 249, 197, 0, 195, - 0, 196, 0, 260, 167, 166, 164, 165, 161, 186, - 0, 97, 98, 101, 228, 221, 0, 0, 63, 228, - 51, 52, 50, 0, 0, 0, 115, 123, 126, 124, - 201, 202, 125, 262, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 29, 28, 171, - 146, 148, 145, 0, 143, 144, 0, 192, 194, 191, - 176, 0, 67, 65, 68, 66, 0, 0, 0, 127, - 178, 228, 114, 258, 149, 147, 153, 154, 228, 222, - 228, 0, 0, 0, 177, 116, 0, 0, 0, 204, - 0, 208, 0, 223, 228, 203, 0, 207, 0, 0, - 49, 205, 209, 0, 0, 179 + 0, 3, 4, 0, 6, 1, 9, 0, 5, 246, + 281, 282, 0, 247, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 242, 0, 0, 8, 0, + 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, + 23, 20, 0, 96, 97, 121, 122, 98, 0, 99, + 100, 101, 245, 7, 0, 0, 0, 0, 0, 65, + 0, 88, 64, 0, 0, 0, 0, 0, 76, 0, + 0, 94, 240, 241, 31, 32, 83, 0, 0, 0, + 10, 11, 0, 243, 250, 248, 0, 0, 125, 242, + 123, 259, 257, 253, 255, 252, 271, 254, 242, 84, + 85, 86, 87, 91, 242, 242, 242, 242, 242, 242, + 78, 55, 81, 80, 82, 92, 233, 232, 0, 0, + 0, 0, 60, 0, 242, 83, 0, 61, 63, 134, + 135, 213, 214, 136, 229, 230, 0, 242, 0, 0, + 0, 280, 102, 126, 0, 127, 131, 132, 133, 227, + 228, 231, 0, 261, 260, 262, 0, 256, 0, 0, + 54, 0, 0, 0, 26, 0, 25, 24, 268, 119, + 117, 271, 104, 0, 0, 0, 0, 0, 0, 265, + 0, 265, 0, 0, 275, 271, 142, 143, 144, 145, + 147, 146, 148, 149, 150, 151, 0, 152, 268, 109, + 0, 107, 105, 271, 0, 114, 103, 83, 0, 52, + 0, 0, 0, 0, 244, 249, 0, 239, 238, 263, + 264, 258, 277, 0, 242, 95, 0, 0, 83, 242, + 0, 48, 0, 51, 0, 242, 269, 270, 118, 120, + 0, 0, 0, 212, 183, 184, 182, 0, 165, 267, + 266, 164, 0, 0, 0, 0, 207, 203, 0, 202, + 271, 195, 189, 188, 187, 0, 0, 0, 0, 108, + 0, 110, 0, 0, 106, 0, 242, 234, 69, 0, + 67, 68, 0, 242, 242, 251, 0, 124, 272, 28, + 89, 90, 93, 27, 0, 79, 50, 273, 0, 0, + 225, 0, 226, 0, 186, 0, 174, 0, 166, 0, + 171, 172, 155, 156, 173, 153, 154, 0, 0, 201, + 0, 204, 197, 199, 198, 194, 196, 279, 0, 170, + 169, 176, 177, 0, 0, 116, 0, 113, 0, 0, + 53, 0, 62, 77, 71, 47, 0, 0, 0, 242, + 49, 0, 34, 0, 242, 220, 224, 0, 0, 265, + 211, 0, 209, 0, 210, 0, 276, 181, 180, 178, + 179, 175, 200, 0, 111, 112, 115, 242, 235, 0, + 0, 70, 242, 58, 57, 59, 242, 0, 0, 0, + 129, 137, 140, 138, 215, 216, 139, 278, 0, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 30, 29, 185, 160, 162, 159, 0, 157, 158, + 0, 206, 208, 205, 190, 0, 74, 72, 75, 73, + 0, 0, 0, 0, 141, 192, 242, 128, 274, 163, + 161, 167, 168, 242, 236, 242, 0, 0, 0, 0, + 191, 130, 0, 0, 0, 0, 218, 0, 222, 0, + 237, 242, 0, 217, 0, 221, 0, 0, 56, 33, + 219, 223, 0, 0, 193 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 268, 377, - 39, 146, 71, 58, 67, 314, 315, 352, 114, 59, - 115, 255, 256, 257, 348, 393, 395, 68, 313, 105, - 266, 196, 97, 40, 41, 116, 191, 308, 251, 306, - 157, 42, 43, 44, 131, 83, 261, 355, 132, 117, - 356, 357, 118, 171, 285, 172, 384, 405, 173, 228, - 174, 406, 175, 300, 286, 277, 176, 303, 338, 177, - 223, 178, 275, 179, 241, 180, 399, 414, 181, 295, - 296, 340, 238, 289, 330, 332, 328, 182, 119, 359, - 360, 418, 120, 361, 420, 121, 271, 273, 362, 122, - 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, - 47, 60, 91, 142, 205, 229, 215, 144, 319, 243, - 207, 364, 298, 48 + -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 298, + 411, 41, 161, 231, 74, 60, 69, 345, 346, 384, + 232, 61, 126, 279, 280, 281, 381, 427, 429, 70, + 344, 111, 296, 115, 103, 160, 75, 227, 76, 228, + 42, 43, 127, 206, 338, 274, 336, 172, 44, 45, + 46, 144, 90, 287, 389, 145, 128, 390, 391, 129, + 186, 315, 187, 418, 440, 188, 251, 189, 441, 190, + 330, 316, 307, 191, 333, 371, 192, 246, 193, 305, + 194, 264, 195, 434, 450, 196, 325, 326, 373, 261, + 319, 363, 365, 361, 197, 130, 393, 394, 455, 131, + 395, 457, 132, 301, 303, 396, 133, 149, 134, 135, + 151, 77, 47, 139, 48, 49, 54, 85, 50, 62, + 97, 155, 221, 252, 238, 157, 352, 266, 223, 398, + 328, 51, 12 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -369 +#define YYPACT_NINF -401 static const yytype_int16 yypact[] = { - 143, -369, -369, 36, -369, -369, 45, -39, -369, 169, - -33, -369, -19, -6, -4, 12, -369, -369, -34, -34, - -34, -34, -34, -34, 15, 62, -34, -369, 26, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - 60, -369, -369, -369, -369, -369, -369, -369, -369, -369, - 20, 56, 107, 110, 37, 20, -3, -369, 111, 109, - -369, 113, 114, 116, 117, 118, -369, 119, 125, -369, - -369, -369, -15, 121, -369, -369, -369, 122, 132, -18, - 167, 210, -11, -369, 122, 63, -369, -369, -369, -369, - 130, -369, 62, -369, -369, -369, -369, -369, 62, 62, - 62, 62, 62, 62, -369, -369, -369, -369, 9, 72, - 87, -1, 131, 62, 104, 134, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -15, 142, -369, -369, -369, - -369, 135, -369, -369, -369, -369, -369, -369, -369, 182, - -369, -369, 52, 219, -369, 138, 139, -15, 140, -369, - 141, -369, -369, 61, -369, -369, 130, -369, 144, 145, - 146, 180, 11, 147, 85, 148, 99, 89, -2, 149, - 130, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, 184, -369, 61, -369, 150, -369, -369, 130, 151, - 152, -369, 27, -369, -369, -369, -369, -10, 154, -369, - 153, -369, -369, -369, -369, -369, -369, 155, 62, 62, - 161, 168, 62, -369, -369, -369, -369, 229, 244, 246, - -369, -369, -369, -369, 247, -369, -369, -369, -369, 204, - 247, 17, 163, 164, -369, 165, -369, 130, 67, -369, - -369, -369, 252, 248, 18, 170, -369, 253, -369, 255, - 253, -369, 62, -369, -369, 171, -369, -369, 177, 62, - 172, -369, -369, -369, -369, -369, -369, 173, 175, 176, - -369, 178, -369, 179, -369, 181, -369, 183, -369, 185, - -369, -369, -369, -369, -369, -369, -369, 262, 264, -369, - 267, -369, -369, -369, -369, -369, -369, -369, 186, -369, - -369, -369, -369, 136, 269, -369, 187, -369, 188, 190, - 43, -369, -369, 106, -369, 193, -5, -7, 271, -369, - 108, 62, -369, -369, 245, 4, 99, -369, 194, -369, - 195, -369, 196, -369, -369, -369, -369, -369, -369, -369, - 197, -369, -369, -369, 62, -369, 280, 285, -369, 62, - -369, -369, -369, 93, 87, 53, -369, -369, -369, -369, - -369, -369, -369, -369, 199, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, 278, -369, -369, 8, -369, -369, -369, - -369, 57, -369, -369, -369, -369, 203, 205, 206, -369, - 250, -7, -369, -369, -369, -369, -369, -369, 62, -369, - 62, 229, 244, 208, -369, -369, 198, 211, 202, 213, - 214, 218, 269, -369, 62, -369, 229, -369, 244, 54, - -369, -369, -369, 269, 215, -369 + 193, -401, -401, 27, -401, -401, 62, 143, -401, 24, + -401, -401, -30, -401, -18, 12, 83, -401, 15, 15, + 15, 15, 15, 15, 67, 61, 15, 15, -401, 127, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, 144, -401, -401, -401, -401, -401, 204, -401, + -401, -401, -401, -401, 155, 136, 138, 34, 140, -401, + 147, 108, -401, 150, 156, 157, 158, 160, -401, 162, + 159, -401, -401, -401, -401, -401, 102, -13, 163, 164, + -401, -401, 165, -401, -401, 166, 170, 10, 235, 0, + -401, 141, -401, -401, -401, -401, 167, -401, 131, -401, + -401, -401, -401, 168, 131, 131, 131, 131, 131, 131, + -401, -401, -401, -401, -401, -401, -401, -401, 104, 97, + 114, 38, 169, 30, 131, 102, 171, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 30, 131, 172, 155, + 175, -401, -401, -401, 173, -401, -401, -401, -401, -401, + -401, -401, 223, -401, -401, 123, 253, -401, 177, 149, + -401, 178, -10, 181, -401, 182, -401, -401, 134, -401, + -401, 167, -401, 183, 184, 185, 213, 99, 186, 154, + 187, 146, 153, 7, 188, 167, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 215, -401, 134, -401, + 190, -401, -401, 167, 191, 192, -401, 102, -48, -401, + 1, 195, 196, 214, 166, -401, 189, -401, -401, -401, + -401, -401, -401, 180, 131, -401, 194, 197, 102, 131, + 30, -401, 203, 205, 201, 131, -401, -401, -401, -401, + 285, 288, 289, -401, -401, -401, -401, 291, -401, -401, + -401, -401, 248, 291, 33, 206, 207, -401, 208, -401, + 167, 14, -401, -401, -401, 293, 292, 92, 209, -401, + 299, -401, 301, 299, -401, 216, 131, -401, -401, 217, + -401, -401, 221, 131, 131, -401, 212, -401, -401, -401, + -401, -401, -401, -401, 218, -401, -401, 220, 224, 225, + -401, 226, -401, 227, -401, 228, -401, 230, -401, 231, + -401, -401, -401, -401, -401, -401, -401, 304, 309, -401, + 312, -401, -401, -401, -401, -401, -401, -401, 232, -401, + -401, -401, -401, 161, 313, -401, 233, -401, 234, 238, + -401, 13, -401, -401, 137, -401, 242, -15, 243, 3, + -401, 314, -401, 133, 131, -401, -401, 296, 94, 146, + -401, 245, -401, 246, -401, 247, -401, -401, -401, -401, + -401, -401, -401, 249, -401, -401, -401, 131, -401, 332, + 337, -401, 131, -401, -401, -401, 131, 142, 114, 28, + -401, -401, -401, -401, -401, -401, -401, -401, 250, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, 331, -401, -401, + 68, -401, -401, -401, -401, 43, -401, -401, -401, -401, + 255, 256, 257, 258, -401, 300, 3, -401, -401, -401, + -401, -401, -401, 131, -401, 131, 201, 285, 288, 259, + -401, -401, 252, 264, 265, 263, 261, 266, 270, 313, + -401, 131, 133, -401, 285, -401, 288, 80, -401, -401, + -401, -401, 313, 267, -401 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -94, -88, 133, -369, -369, -334, -369, -85, -369, - -369, -369, -369, -369, -369, -369, -369, 128, -369, -369, - -369, -369, -369, -369, -369, 251, -369, -369, -369, 77, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -72, -369, -81, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -305, 101, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -22, -369, - -369, -336, -369, -369, -369, -369, -369, -369, 254, -369, - -369, -369, -369, -369, -369, -369, -342, -368, 256, -369, - -369, -369, -80, -110, -82, -369, -369, -369, -369, 279, - -369, 257, -369, -369, -369, -161, 156, -146, -369, -369, - -369, -369, -369, -369 + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -69, + -82, -401, -100, 151, -86, 210, -401, -401, -366, -401, + -54, -401, -401, -401, -401, -401, -401, -401, -401, 174, + -401, -401, -401, -118, -401, -401, 229, -401, -401, -401, + -401, -401, 295, -401, -401, -401, 110, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -51, -401, -88, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -311, 139, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -2, -401, -401, -400, -401, + -401, -401, -401, -401, -401, 298, -401, -401, -401, -401, + -401, -401, -401, -390, -295, 302, -401, -401, -136, -87, + -120, -89, -401, -401, -401, -401, -401, 251, -401, 176, + -401, -401, -401, -176, 198, -153, -401, -401, -401, -401, + -401, -401, -6 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -60 +#define YYTABLE_NINF -230 static const yytype_int16 yytable[] = { - 139, 133, 137, 192, 145, 231, 149, 106, 107, 152, - 216, 148, 254, 150, 151, 396, 147, 350, 147, 108, - 385, 147, 108, 239, 244, 85, 86, 183, 280, 380, - 56, 139, 280, 87, 281, 184, 5, 153, 281, 221, - 198, 280, 248, 381, 421, 154, 109, 281, 185, 282, - 109, 186, 301, 7, 353, 88, 89, 110, 187, 10, - 432, 110, 210, 382, 57, 354, 222, 240, 155, 419, - 90, 302, 188, 49, 284, 383, 417, 111, 284, 51, - 111, 407, 156, 112, 431, 283, 429, 284, 66, 140, - 430, 291, 52, 351, 53, 189, 190, 434, 113, 69, - 70, 141, 113, 69, 70, 158, 113, 292, 293, 225, - 54, 226, 203, 66, 160, 264, 161, 159, 76, 204, - 263, 213, 162, 227, 269, 226, 397, 147, 214, 163, - 164, 165, 74, 166, 252, 167, 232, 227, 398, 233, - 234, 253, 310, 235, 168, 81, 1, 2, 294, 82, - 344, 236, 61, 62, 63, 64, 65, 345, 433, 73, - 401, 169, 170, 390, 408, 386, 75, 402, 78, 237, - 139, 409, 69, 70, 11, 12, 13, 316, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 193, 201, 202, 194, 195, 93, 94, - 95, 96, 334, 335, 336, 337, 346, 347, 92, 79, - 98, 99, 80, 100, 101, 102, 103, 104, 125, 126, - 127, 56, 130, 378, 391, 139, 358, 137, 143, -59, - 199, 206, 197, 220, 200, 208, 209, 211, 212, 245, - 267, 270, 217, 218, 219, 224, 230, 242, 247, 249, - 250, 259, 139, 265, 262, 260, 272, 316, 274, 276, - 278, 287, 288, 290, 297, 305, 299, 307, 304, 312, - 311, 318, 320, 321, 327, 317, 329, 322, 323, 331, - 324, 339, 325, 363, 326, 333, 341, 342, 416, 343, - 349, 379, 392, 387, 388, 389, 390, 394, 403, 404, - 410, 425, 423, 411, 412, 413, 422, 426, 424, 139, - 358, 137, 428, 427, 435, 258, 139, 309, 316, 415, - 128, 279, 400, 0, 84, 0, 134, 129, 135, 246, - 0, 0, 316 + 152, 146, 150, 52, 208, 254, 164, 209, 383, 167, + 116, 117, 158, 116, 117, 162, 430, 162, 239, 163, + 162, 165, 166, 125, 278, 118, 233, 5, 118, 13, + 14, 15, 267, 262, 16, 152, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 419, 118, 119, + 271, 212, 119, 116, 117, 322, 323, 456, 310, 467, + 120, 276, 119, 120, 311, 387, 312, 198, 118, 207, + 7, 277, 473, 120, 470, 199, 388, 263, 53, 453, + 58, 55, 211, 121, 10, 11, 121, 122, 200, 275, + 122, 201, 119, 310, 233, 468, 324, 123, 202, 311, + 230, 68, 313, 120, 314, 124, 121, 321, 124, 442, + 292, 56, 203, 72, 73, 59, 72, 73, 124, 310, + 414, 124, 377, 10, 11, 311, 121, 331, 244, 293, + 122, 173, 378, 168, 415, 204, 205, 436, 289, 314, + 162, 169, 175, 174, 176, 88, 332, 437, 124, 299, + 177, 89, 443, 458, 416, 245, 341, 178, 179, 180, + 71, 181, 444, 182, 170, 314, 417, 68, 153, 91, + 92, 471, 183, 249, 72, 73, 432, 93, 171, 248, + 154, 249, 57, 420, 219, 250, 472, 152, 433, 184, + 185, 220, 424, 250, 347, 236, 1, 2, 348, 94, + 95, 255, 237, 112, 256, 257, 113, 114, 258, 99, + 100, 101, 102, 82, 96, 83, 259, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 63, + 64, 65, 66, 67, 260, 80, 78, 79, 367, 368, + 369, 370, 10, 11, 72, 73, 217, 218, 71, 225, + 379, 380, 81, 86, 84, 87, 98, 425, 143, 104, + 152, 392, 150, 110, 138, 105, 106, 107, 412, 108, + 141, 109, 136, 137, 215, 140, 222, 243, 156, 58, + -66, 268, 210, 159, 297, 216, 224, 229, 152, 213, + 234, 235, 288, 347, 240, 241, 242, 247, 253, 265, + 431, 270, 272, 273, 283, 284, 286, 295, 300, -229, + 290, 302, 304, 291, 306, 308, 327, 317, 318, 320, + 334, 329, 335, 452, 337, 343, 340, 360, 350, 342, + 349, 351, 362, 353, 354, 364, 372, 397, 355, 356, + 357, 385, 358, 359, 366, 374, 375, 152, 392, 150, + 376, 382, 386, 413, 152, 426, 347, 421, 422, 423, + 428, 424, 438, 439, 445, 446, 449, 464, 447, 448, + 459, 460, 347, 461, 462, 463, 466, 454, 465, 474, + 469, 294, 142, 339, 282, 451, 435, 147, 226, 285, + 214, 148, 309, 0, 0, 0, 269 }; static const yytype_int16 yycheck[] = { - 82, 82, 82, 113, 92, 166, 100, 22, 23, 103, - 156, 99, 22, 101, 102, 349, 98, 22, 100, 37, - 325, 103, 37, 25, 170, 28, 29, 28, 24, 25, - 64, 113, 24, 36, 30, 36, 0, 28, 30, 28, - 125, 24, 188, 39, 412, 36, 61, 30, 49, 32, - 61, 52, 34, 8, 61, 58, 59, 72, 59, 98, - 428, 72, 147, 59, 98, 72, 55, 69, 59, 411, - 73, 53, 73, 106, 70, 71, 410, 95, 70, 98, - 95, 386, 73, 98, 426, 68, 422, 70, 98, 26, - 424, 237, 98, 98, 98, 96, 97, 433, 113, 110, - 111, 38, 113, 110, 111, 33, 113, 40, 41, 24, - 98, 26, 60, 98, 27, 209, 29, 45, 98, 67, - 208, 60, 35, 38, 212, 26, 33, 209, 67, 42, - 43, 44, 106, 46, 107, 48, 47, 38, 45, 50, - 51, 114, 252, 54, 57, 108, 3, 4, 81, 112, - 107, 62, 19, 20, 21, 22, 23, 114, 104, 26, - 107, 74, 75, 109, 107, 326, 106, 114, 112, 80, - 252, 114, 110, 111, 5, 6, 7, 259, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 99, 22, 23, 102, 103, 99, 100, - 101, 102, 76, 77, 78, 79, 110, 111, 107, 112, - 107, 107, 112, 107, 107, 107, 107, 102, 107, 107, - 98, 64, 22, 321, 344, 317, 317, 317, 108, 108, - 98, 22, 108, 63, 109, 107, 107, 107, 107, 65, - 82, 22, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 107, 344, 102, 109, 112, 22, 349, 22, 22, - 66, 108, 108, 108, 22, 22, 28, 22, 108, 102, - 109, 108, 107, 107, 22, 113, 22, 109, 109, 22, - 109, 22, 109, 22, 109, 109, 109, 109, 408, 109, - 107, 56, 22, 109, 109, 109, 109, 22, 109, 31, - 107, 109, 114, 108, 108, 65, 108, 104, 107, 401, - 401, 401, 104, 109, 109, 197, 408, 250, 410, 401, - 79, 230, 354, -1, 55, -1, 82, 80, 82, 183, - -1, -1, 424 + 89, 89, 89, 9, 124, 181, 106, 125, 23, 109, + 23, 24, 98, 23, 24, 104, 382, 106, 171, 105, + 109, 107, 108, 77, 23, 38, 162, 0, 38, 5, + 6, 7, 185, 26, 10, 124, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 358, 38, 62, + 203, 137, 62, 23, 24, 41, 42, 447, 25, 459, + 73, 109, 62, 73, 31, 62, 33, 29, 38, 123, + 8, 119, 472, 73, 464, 37, 73, 70, 108, 445, + 65, 99, 136, 96, 99, 100, 96, 100, 50, 207, + 100, 53, 62, 25, 230, 461, 82, 110, 60, 31, + 110, 100, 69, 73, 71, 118, 96, 260, 118, 420, + 228, 99, 74, 113, 114, 100, 113, 114, 118, 25, + 26, 118, 109, 99, 100, 31, 96, 35, 29, 229, + 100, 34, 119, 29, 40, 97, 98, 109, 224, 71, + 229, 37, 28, 46, 30, 111, 54, 119, 118, 235, + 36, 117, 109, 448, 60, 56, 276, 43, 44, 45, + 99, 47, 119, 49, 60, 71, 72, 100, 27, 29, + 30, 466, 58, 27, 113, 114, 34, 37, 74, 25, + 39, 27, 99, 359, 61, 39, 106, 276, 46, 75, + 76, 68, 112, 39, 283, 61, 3, 4, 284, 59, + 60, 48, 68, 101, 51, 52, 104, 105, 55, 101, + 102, 103, 104, 9, 74, 11, 63, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 19, + 20, 21, 22, 23, 81, 108, 26, 27, 77, 78, + 79, 80, 99, 100, 113, 114, 23, 24, 99, 100, + 113, 114, 108, 117, 99, 117, 109, 377, 23, 109, + 349, 349, 349, 104, 99, 109, 109, 109, 354, 109, + 100, 109, 109, 109, 99, 109, 23, 64, 111, 65, + 111, 66, 111, 115, 83, 112, 109, 109, 377, 117, + 109, 109, 112, 382, 111, 111, 111, 111, 111, 111, + 386, 111, 111, 111, 109, 109, 117, 104, 23, 104, + 116, 23, 23, 116, 23, 67, 23, 111, 111, 111, + 111, 29, 23, 443, 23, 104, 110, 23, 110, 112, + 118, 111, 23, 109, 109, 23, 23, 23, 112, 112, + 112, 347, 112, 112, 112, 112, 112, 436, 436, 436, + 112, 109, 109, 57, 443, 23, 445, 112, 112, 112, + 23, 112, 112, 32, 109, 109, 66, 106, 111, 111, + 111, 119, 461, 109, 109, 112, 106, 446, 112, 112, + 462, 230, 87, 273, 210, 436, 388, 89, 159, 213, + 139, 89, 253, -1, -1, -1, 198 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_uint16 yystos[] = { - 0, 3, 4, 116, 117, 0, 118, 8, 119, 120, - 98, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 135, - 158, 159, 166, 167, 168, 230, 232, 235, 248, 106, - 233, 98, 98, 98, 98, 231, 64, 98, 138, 144, - 236, 138, 138, 138, 138, 138, 98, 139, 152, 110, - 111, 137, 229, 138, 106, 106, 98, 234, 112, 112, - 112, 108, 112, 170, 234, 28, 29, 36, 58, 59, - 73, 237, 107, 99, 100, 101, 102, 157, 107, 107, - 107, 107, 107, 107, 102, 154, 22, 23, 37, 61, - 72, 95, 98, 113, 143, 145, 160, 174, 177, 213, - 217, 220, 224, 226, 227, 107, 107, 98, 160, 236, - 22, 169, 173, 177, 213, 223, 225, 227, 228, 229, - 26, 38, 238, 108, 242, 137, 136, 229, 137, 136, - 137, 137, 136, 28, 36, 59, 73, 165, 33, 45, - 27, 29, 35, 42, 43, 44, 46, 48, 57, 74, - 75, 178, 180, 183, 185, 187, 191, 194, 196, 198, - 200, 203, 212, 28, 36, 49, 52, 59, 73, 96, - 97, 161, 228, 99, 102, 103, 156, 108, 143, 98, - 109, 22, 23, 60, 67, 239, 22, 245, 107, 107, - 143, 107, 107, 60, 67, 241, 242, 108, 108, 108, - 63, 28, 55, 195, 108, 24, 26, 38, 184, 240, - 108, 240, 47, 50, 51, 54, 62, 80, 207, 25, - 69, 199, 108, 244, 242, 65, 241, 108, 242, 108, - 108, 163, 107, 114, 22, 146, 147, 148, 152, 107, - 112, 171, 109, 137, 136, 102, 155, 82, 133, 137, - 22, 221, 22, 222, 22, 197, 22, 190, 66, 190, - 24, 30, 32, 68, 70, 179, 189, 108, 108, 208, - 108, 242, 40, 41, 81, 204, 205, 22, 247, 28, - 188, 34, 53, 192, 108, 22, 164, 22, 162, 164, - 228, 109, 102, 153, 140, 141, 229, 113, 108, 243, - 107, 107, 109, 109, 109, 109, 109, 22, 211, 22, - 209, 22, 210, 109, 76, 77, 78, 79, 193, 22, - 206, 109, 109, 109, 107, 114, 110, 111, 149, 107, - 22, 98, 142, 61, 72, 172, 175, 176, 177, 214, - 215, 218, 223, 22, 246, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 134, 137, 56, - 25, 39, 59, 71, 181, 189, 240, 109, 109, 109, - 109, 228, 22, 150, 22, 151, 141, 33, 45, 201, - 203, 107, 114, 109, 31, 182, 186, 189, 107, 114, - 107, 108, 108, 65, 202, 175, 228, 141, 216, 221, - 219, 222, 108, 114, 107, 109, 104, 109, 104, 206, - 141, 221, 222, 104, 206, 109 + 0, 3, 4, 121, 122, 0, 123, 8, 124, 125, + 99, 100, 262, 5, 6, 7, 10, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 141, 170, 171, 178, 179, 180, 242, 244, 245, + 248, 261, 262, 108, 246, 99, 99, 99, 65, 100, + 145, 151, 249, 145, 145, 145, 145, 145, 100, 146, + 159, 99, 113, 114, 144, 166, 168, 241, 145, 145, + 108, 108, 9, 11, 99, 247, 117, 117, 111, 117, + 182, 29, 30, 37, 59, 60, 74, 250, 109, 101, + 102, 103, 104, 164, 109, 109, 109, 109, 109, 109, + 104, 161, 101, 104, 105, 163, 23, 24, 38, 62, + 73, 96, 100, 110, 118, 150, 152, 172, 186, 189, + 225, 229, 232, 236, 238, 239, 109, 109, 99, 243, + 109, 100, 172, 23, 181, 185, 189, 225, 235, 237, + 239, 240, 241, 27, 39, 251, 111, 255, 144, 115, + 165, 142, 241, 144, 142, 144, 144, 142, 29, 37, + 60, 74, 177, 34, 46, 28, 30, 36, 43, 44, + 45, 47, 49, 58, 75, 76, 190, 192, 195, 197, + 199, 203, 206, 208, 210, 212, 215, 224, 29, 37, + 50, 53, 60, 74, 97, 98, 173, 150, 240, 163, + 111, 150, 144, 117, 247, 99, 112, 23, 24, 61, + 68, 252, 23, 258, 109, 100, 166, 167, 169, 109, + 110, 143, 150, 238, 109, 109, 61, 68, 254, 255, + 111, 111, 111, 64, 29, 56, 207, 111, 25, 27, + 39, 196, 253, 111, 253, 48, 51, 52, 55, 63, + 81, 219, 26, 70, 211, 111, 257, 255, 66, 254, + 111, 255, 111, 111, 175, 163, 109, 119, 23, 153, + 154, 155, 159, 109, 109, 249, 117, 183, 112, 144, + 116, 116, 163, 142, 143, 104, 162, 83, 139, 144, + 23, 233, 23, 234, 23, 209, 23, 202, 67, 202, + 25, 31, 33, 69, 71, 191, 201, 111, 111, 220, + 111, 255, 41, 42, 82, 216, 217, 23, 260, 29, + 200, 35, 54, 204, 111, 23, 176, 23, 174, 176, + 110, 240, 112, 104, 160, 147, 148, 241, 144, 118, + 110, 111, 256, 109, 109, 112, 112, 112, 112, 112, + 23, 223, 23, 221, 23, 222, 112, 77, 78, 79, + 80, 205, 23, 218, 112, 112, 112, 109, 119, 113, + 114, 156, 109, 23, 149, 262, 109, 62, 73, 184, + 187, 188, 189, 226, 227, 230, 235, 23, 259, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 140, 144, 57, 26, 40, 60, 72, 193, 201, + 253, 112, 112, 112, 112, 240, 23, 157, 23, 158, + 148, 144, 34, 46, 213, 215, 109, 119, 112, 32, + 194, 198, 201, 109, 119, 109, 109, 111, 111, 66, + 214, 187, 240, 148, 139, 228, 233, 231, 234, 111, + 119, 109, 109, 112, 106, 112, 106, 218, 148, 140, + 233, 234, 106, 218, 112 }; #define yyerrok (yyerrstatus = 0) @@ -2068,7 +2125,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 260 "program_parse.y" +#line 278 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2081,7 +2138,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 268 "program_parse.y" +#line 286 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2096,7 +2153,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 284 "program_parse.y" +#line 302 "program_parse.y" { int valid = 0; @@ -2123,7 +2180,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 312 "program_parse.y" +#line 330 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2143,7 +2200,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 330 "program_parse.y" +#line 348 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2153,85 +2210,79 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 335 "program_parse.y" +#line 353 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; ;} break; - case 23: + case 24: /* Line 1455 of yacc.c */ -#line 355 "program_parse.y" +#line 374 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 24: + case 25: /* Line 1455 of yacc.c */ -#line 361 "program_parse.y" +#line 380 "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 25: + case 26: /* Line 1455 of yacc.c */ -#line 368 "program_parse.y" +#line 386 "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: + case 27: /* Line 1455 of yacc.c */ -#line 375 "program_parse.y" +#line 392 "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 27: + case 28: /* Line 1455 of yacc.c */ -#line 383 "program_parse.y" +#line 399 "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: + case 29: /* Line 1455 of yacc.c */ -#line 391 "program_parse.y" +#line 406 "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 29: + case 30: /* Line 1455 of yacc.c */ -#line 398 "program_parse.y" +#line 412 "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) { @@ -2267,113 +2318,173 @@ yyreduce: ;} break; - case 30: + case 31: /* Line 1455 of yacc.c */ -#line 443 "program_parse.y" +#line 456 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; ;} break; - case 31: + case 32: + +/* Line 1455 of yacc.c */ +#line 461 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; + (yyval.inst)->Base.DstReg.CondSwizzle = (yyvsp[(2) - (2)].dst_reg).CondSwizzle; + (yyval.inst)->Base.DstReg.CondSrc = (yyvsp[(2) - (2)].dst_reg).CondSrc; + state->fragment.UsesKill = 1; + ;} + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 471 "program_parse.y" + { + (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.TexSrcUnit = (yyvsp[(10) - (12)].integer); + + if ((yyvsp[(12) - (12)].integer) < 0) { + shadow_tex = tex_mask; + + (yyval.inst)->Base.TexSrcTarget = -(yyvsp[(12) - (12)].integer); + (yyval.inst)->Base.TexShadow = 1; + } else { + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(12) - (12)].integer); + } + + target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != 0) + && ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& (yylsp[(12) - (12)]), state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + ;} + break; + + case 34: /* Line 1455 of yacc.c */ -#line 450 "program_parse.y" +#line 515 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 32: + case 35: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 520 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; - case 33: + case 36: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 521 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; - case 34: + case 37: /* Line 1455 of yacc.c */ -#line 457 "program_parse.y" +#line 522 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; - case 35: + case 38: /* Line 1455 of yacc.c */ -#line 458 "program_parse.y" +#line 523 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; - case 36: + case 39: /* Line 1455 of yacc.c */ -#line 459 "program_parse.y" +#line 524 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; - case 37: + case 40: /* Line 1455 of yacc.c */ -#line 460 "program_parse.y" +#line 525 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; - case 38: + case 41: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 526 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; - case 39: + case 42: /* Line 1455 of yacc.c */ -#line 462 "program_parse.y" +#line 527 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; - case 40: + case 43: /* Line 1455 of yacc.c */ -#line 463 "program_parse.y" +#line 528 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; - case 41: + case 44: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 529 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; - case 42: + case 45: /* Line 1455 of yacc.c */ -#line 465 "program_parse.y" +#line 530 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; - case 43: + case 46: /* Line 1455 of yacc.c */ -#line 466 "program_parse.y" +#line 531 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; - case 44: + case 47: /* Line 1455 of yacc.c */ -#line 470 "program_parse.y" +#line 535 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2381,31 +2492,79 @@ yyreduce: (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 45: + case 48: /* Line 1455 of yacc.c */ -#line 483 "program_parse.y" +#line 547 "program_parse.y" { - (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); - if ((yyvsp[(1) - (3)].negate)) { + if ((yyvsp[(1) - (2)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + ;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 555 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (4)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (4)].negate)) { (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; } + (yyval.src_reg).Base.Abs = 1; + ;} + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 572 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, - (yyvsp[(3) - (3)].swiz_mask).swizzle); + (yyvsp[(2) - (2)].swiz_mask).swizzle); ;} break; - case 46: + case 51: + +/* Line 1455 of yacc.c */ +#line 579 "program_parse.y" + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(1) - (1)].vector)); + + set_src_reg(& (yyval.src_reg), PROGRAM_CONSTANT, temp_sym.param_binding_begin); + ;} + break; + + case 52: /* Line 1455 of yacc.c */ -#line 496 "program_parse.y" +#line 596 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2418,13 +2577,38 @@ yyreduce: ;} break; - case 47: + case 53: /* Line 1455 of yacc.c */ -#line 509 "program_parse.y" +#line 607 "program_parse.y" { - (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); - (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (5)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (5)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Abs = 1; + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(4) - (5)].swiz_mask).swizzle); + ;} + break; + + case 54: + +/* Line 1455 of yacc.c */ +#line 627 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; + (yyval.dst_reg).CondMask = (yyvsp[(3) - (3)].dst_reg).CondMask; + (yyval.dst_reg).CondSwizzle = (yyvsp[(3) - (3)].dst_reg).CondSwizzle; + (yyval.dst_reg).CondSrc = (yyvsp[(3) - (3)].dst_reg).CondSrc; if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -2433,32 +2617,30 @@ yyreduce: */ if (state->option.PositionInvariant && ((yyval.dst_reg).Index == VERT_RESULT_HPOS)) { - yyerror(& (yylsp[(1) - (2)]), state, "position-invariant programs cannot " + yyerror(& (yylsp[(1) - (3)]), state, "position-invariant programs cannot " "write position"); YYERROR; } - state->prog->OutputsWritten |= (1U << (yyval.dst_reg).Index); + state->prog->OutputsWritten |= BITFIELD64_BIT((yyval.dst_reg).Index); } ;} break; - case 48: + case 55: /* Line 1455 of yacc.c */ -#line 531 "program_parse.y" +#line 652 "program_parse.y" { - init_dst_reg(& (yyval.dst_reg)); - (yyval.dst_reg).File = PROGRAM_ADDRESS; - (yyval.dst_reg).Index = 0; + set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; ;} break; - case 49: + case 56: /* Line 1455 of yacc.c */ -#line 540 "program_parse.y" +#line 659 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2491,20 +2673,20 @@ yyreduce: ;} break; - case 50: + case 57: /* Line 1455 of yacc.c */ -#line 573 "program_parse.y" +#line 692 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 51: + case 58: /* Line 1455 of yacc.c */ -#line 580 "program_parse.y" +#line 699 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2521,10 +2703,10 @@ yyreduce: ;} break; - case 52: + case 59: /* Line 1455 of yacc.c */ -#line 595 "program_parse.y" +#line 714 "program_parse.y" { char s; @@ -2579,10 +2761,10 @@ yyreduce: ;} break; - case 53: + case 60: /* Line 1455 of yacc.c */ -#line 650 "program_parse.y" +#line 769 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2604,16 +2786,13 @@ yyreduce: init_src_reg(& (yyval.src_reg)); switch (s->type) { case at_temp: - (yyval.src_reg).Base.File = PROGRAM_TEMPORARY; - (yyval.src_reg).Base.Index = s->temp_binding; + set_src_reg(& (yyval.src_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - (yyval.src_reg).Base.File = s->param_binding_type; - (yyval.src_reg).Base.Index = s->param_binding_begin; + set_src_reg(& (yyval.src_reg), s->param_binding_type, s->param_binding_begin); break; case at_attrib: - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = s->attrib_binding; + set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, s->attrib_binding); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { @@ -2628,14 +2807,12 @@ yyreduce: ;} break; - case 54: + case 61: /* Line 1455 of yacc.c */ -#line 694 "program_parse.y" +#line 810 "program_parse.y" { - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].attrib); + set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[(1) - (1)].attrib)); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { @@ -2644,10 +2821,10 @@ yyreduce: ;} break; - case 55: + case 62: /* Line 1455 of yacc.c */ -#line 705 "program_parse.y" +#line 819 "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)) { @@ -2670,34 +2847,31 @@ yyreduce: ;} break; - case 56: + case 63: /* Line 1455 of yacc.c */ -#line 726 "program_parse.y" +#line 840 "program_parse.y" { - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) + gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) ? (yyvsp[(1) - (1)].temp_sym).param_binding_type : PROGRAM_CONSTANT; - (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].temp_sym).param_binding_begin; + set_src_reg(& (yyval.src_reg), file, (yyvsp[(1) - (1)].temp_sym).param_binding_begin); ;} break; - case 57: + case 64: /* Line 1455 of yacc.c */ -#line 736 "program_parse.y" +#line 849 "program_parse.y" { - init_dst_reg(& (yyval.dst_reg)); - (yyval.dst_reg).File = PROGRAM_OUTPUT; - (yyval.dst_reg).Index = (yyvsp[(1) - (1)].result); + set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[(1) - (1)].result)); ;} break; - case 58: + case 65: /* Line 1455 of yacc.c */ -#line 742 "program_parse.y" +#line 853 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2712,28 +2886,24 @@ yyreduce: YYERROR; } - init_dst_reg(& (yyval.dst_reg)); switch (s->type) { case at_temp: - (yyval.dst_reg).File = PROGRAM_TEMPORARY; - (yyval.dst_reg).Index = s->temp_binding; + set_dst_reg(& (yyval.dst_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_output: - (yyval.dst_reg).File = PROGRAM_OUTPUT; - (yyval.dst_reg).Index = s->output_binding; + set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, s->output_binding); break; default: - (yyval.dst_reg).File = s->param_binding_type; - (yyval.dst_reg).Index = s->param_binding_begin; + set_dst_reg(& (yyval.dst_reg), s->param_binding_type, s->param_binding_begin); break; } ;} break; - case 59: + case 66: /* Line 1455 of yacc.c */ -#line 775 "program_parse.y" +#line 882 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2752,20 +2922,20 @@ yyreduce: ;} break; - case 62: + case 69: /* Line 1455 of yacc.c */ -#line 796 "program_parse.y" +#line 903 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 63: + case 70: /* Line 1455 of yacc.c */ -#line 803 "program_parse.y" +#line 910 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2777,35 +2947,37 @@ yyreduce: ;} break; - case 64: + case 71: /* Line 1455 of yacc.c */ -#line 814 "program_parse.y" +#line 921 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 65: + case 72: /* Line 1455 of yacc.c */ -#line 815 "program_parse.y" +#line 922 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 66: + case 73: /* Line 1455 of yacc.c */ -#line 816 "program_parse.y" +#line 923 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 67: + case 74: /* Line 1455 of yacc.c */ -#line 820 "program_parse.y" +#line 927 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -2813,14 +2985,16 @@ yyreduce: ;} break; - case 68: + case 75: /* Line 1455 of yacc.c */ -#line 832 "program_parse.y" +#line 941 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -2828,10 +3002,10 @@ yyreduce: ;} break; - case 69: + case 76: /* Line 1455 of yacc.c */ -#line 844 "program_parse.y" +#line 955 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2851,10 +3025,10 @@ yyreduce: ;} break; - case 70: + case 77: /* Line 1455 of yacc.c */ -#line 864 "program_parse.y" +#line 975 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2865,10 +3039,10 @@ yyreduce: ;} break; - case 71: + case 78: /* Line 1455 of yacc.c */ -#line 875 "program_parse.y" +#line 986 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2880,147 +3054,248 @@ yyreduce: ;} break; - case 76: - -/* Line 1455 of yacc.c */ -#line 891 "program_parse.y" - { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} - break; - - case 81: + case 83: /* Line 1455 of yacc.c */ -#line 895 "program_parse.y" +#line 1002 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 907 "program_parse.y" - { - struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); - - if (s == NULL) { - free((yyvsp[(2) - (4)].string)); - YYERROR; - } else { - s->attrib_binding = (yyvsp[(4) - (4)].attrib); - state->InputsBound |= (1U << s->attrib_binding); - - if (!validate_inputs(& (yylsp[(4) - (4)]), state)) { - YYERROR; - } - } - ;} +#line 1006 "program_parse.y" + { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 89: /* Line 1455 of yacc.c */ -#line 926 "program_parse.y" +#line 1010 "program_parse.y" { - (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} break; case 90: /* Line 1455 of yacc.c */ -#line 930 "program_parse.y" +#line 1014 "program_parse.y" { - (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} break; case 91: /* Line 1455 of yacc.c */ -#line 936 "program_parse.y" +#line 1018 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_POS; + (yyval.dst_reg).CondMask = COND_TR; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; ;} break; case 92: /* Line 1455 of yacc.c */ -#line 940 "program_parse.y" +#line 1026 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_WEIGHT; + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; ;} break; case 93: /* Line 1455 of yacc.c */ -#line 944 "program_parse.y" +#line 1033 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_NORMAL; + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; ;} break; case 94: /* Line 1455 of yacc.c */ -#line 948 "program_parse.y" +#line 1040 "program_parse.y" { - if (!state->ctx->Extensions.EXT_secondary_color) { - yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + YYERROR; } - (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; ;} break; case 95: /* Line 1455 of yacc.c */ -#line 957 "program_parse.y" +#line 1063 "program_parse.y" { - if (!state->ctx->Extensions.EXT_fog_coord) { - yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + YYERROR; } - (yyval.attrib) = VERT_ATTRIB_FOG; + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; ;} break; - case 96: + case 102: /* Line 1455 of yacc.c */ -#line 966 "program_parse.y" +#line 1094 "program_parse.y" { - (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); - ;} - break; + struct asm_symbol *const s = + declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); - case 97: + if (s == NULL) { + free((yyvsp[(2) - (4)].string)); + YYERROR; + } else { + s->attrib_binding = (yyvsp[(4) - (4)].attrib); + state->InputsBound |= (1U << s->attrib_binding); + + if (!validate_inputs(& (yylsp[(4) - (4)]), state)) { + YYERROR; + } + } + ;} + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 1113 "program_parse.y" + { + (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + ;} + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 1117 "program_parse.y" + { + (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + ;} + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 1123 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_POS; + ;} + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 1127 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_WEIGHT; + ;} + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 1131 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_NORMAL; + ;} + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 1135 "program_parse.y" + { + if (!state->ctx->Extensions.EXT_secondary_color) { + yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); + YYERROR; + } + + (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 1144 "program_parse.y" + { + if (!state->ctx->Extensions.EXT_fog_coord) { + yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); + YYERROR; + } + + (yyval.attrib) = VERT_ATTRIB_FOG; + ;} + break; + + case 110: /* Line 1455 of yacc.c */ -#line 970 "program_parse.y" +#line 1153 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 1157 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 98: + case 112: /* Line 1455 of yacc.c */ -#line 975 "program_parse.y" +#line 1162 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 99: + case 113: /* Line 1455 of yacc.c */ -#line 981 "program_parse.y" +#line 1168 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3031,46 +3306,46 @@ yyreduce: ;} break; - case 103: + case 117: /* Line 1455 of yacc.c */ -#line 995 "program_parse.y" +#line 1182 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 104: + case 118: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1186 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 105: + case 119: /* Line 1455 of yacc.c */ -#line 1003 "program_parse.y" +#line 1190 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 106: + case 120: /* Line 1455 of yacc.c */ -#line 1007 "program_parse.y" +#line 1194 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 109: + case 123: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1202 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3087,10 +3362,10 @@ yyreduce: ;} break; - case 110: + case 124: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1219 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { free((yyvsp[(2) - (6)].string)); @@ -3114,19 +3389,19 @@ yyreduce: ;} break; - case 111: + case 125: /* Line 1455 of yacc.c */ -#line 1056 "program_parse.y" +#line 1243 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 112: + case 126: /* Line 1455 of yacc.c */ -#line 1060 "program_parse.y" +#line 1247 "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"); @@ -3137,38 +3412,38 @@ yyreduce: ;} break; - case 113: + case 127: /* Line 1455 of yacc.c */ -#line 1071 "program_parse.y" +#line 1258 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 114: + case 128: /* Line 1455 of yacc.c */ -#line 1077 "program_parse.y" +#line 1264 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 116: + case 130: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1271 "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); ;} break; - case 117: + case 131: /* Line 1455 of yacc.c */ -#line 1091 "program_parse.y" +#line 1278 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3176,10 +3451,10 @@ yyreduce: ;} break; - case 118: + case 132: /* Line 1455 of yacc.c */ -#line 1097 "program_parse.y" +#line 1284 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3187,10 +3462,10 @@ yyreduce: ;} break; - case 119: + case 133: /* Line 1455 of yacc.c */ -#line 1103 "program_parse.y" +#line 1290 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3198,10 +3473,10 @@ yyreduce: ;} break; - case 120: + case 134: /* Line 1455 of yacc.c */ -#line 1111 "program_parse.y" +#line 1298 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3209,10 +3484,10 @@ yyreduce: ;} break; - case 121: + case 135: /* Line 1455 of yacc.c */ -#line 1117 "program_parse.y" +#line 1304 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3220,10 +3495,10 @@ yyreduce: ;} break; - case 122: + case 136: /* Line 1455 of yacc.c */ -#line 1123 "program_parse.y" +#line 1310 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3231,10 +3506,10 @@ yyreduce: ;} break; - case 123: + case 137: /* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" +#line 1318 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3242,10 +3517,10 @@ yyreduce: ;} break; - case 124: + case 138: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1324 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3253,10 +3528,10 @@ yyreduce: ;} break; - case 125: + case 139: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1330 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3264,101 +3539,101 @@ yyreduce: ;} break; - case 126: + case 140: /* Line 1455 of yacc.c */ -#line 1150 "program_parse.y" +#line 1337 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 127: + case 141: /* Line 1455 of yacc.c */ -#line 1151 "program_parse.y" +#line 1338 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 128: + case 142: /* Line 1455 of yacc.c */ -#line 1154 "program_parse.y" +#line 1341 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 129: + case 143: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1342 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 130: + case 144: /* Line 1455 of yacc.c */ -#line 1156 "program_parse.y" +#line 1343 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: + case 145: /* Line 1455 of yacc.c */ -#line 1157 "program_parse.y" +#line 1344 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 132: + case 146: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1345 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 133: + case 147: /* Line 1455 of yacc.c */ -#line 1159 "program_parse.y" +#line 1346 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: + case 148: /* Line 1455 of yacc.c */ -#line 1160 "program_parse.y" +#line 1347 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 135: + case 149: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1348 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 136: + case 150: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1349 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 137: + case 151: /* Line 1455 of yacc.c */ -#line 1163 "program_parse.y" +#line 1350 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 138: + case 152: /* Line 1455 of yacc.c */ -#line 1164 "program_parse.y" +#line 1351 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 139: + case 153: /* Line 1455 of yacc.c */ -#line 1168 "program_parse.y" +#line 1355 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3367,37 +3642,37 @@ yyreduce: ;} break; - case 140: + case 154: /* Line 1455 of yacc.c */ -#line 1177 "program_parse.y" +#line 1364 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 141: + case 155: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1368 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 142: + case 156: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1372 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 143: + case 157: /* Line 1455 of yacc.c */ -#line 1191 "program_parse.y" +#line 1378 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3406,28 +3681,28 @@ yyreduce: ;} break; - case 144: + case 158: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1387 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 145: + case 159: /* Line 1455 of yacc.c */ -#line 1204 "program_parse.y" +#line 1391 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 146: + case 160: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1395 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3438,57 +3713,57 @@ yyreduce: ;} break; - case 147: + case 161: /* Line 1455 of yacc.c */ -#line 1217 "program_parse.y" +#line 1404 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 148: + case 162: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1408 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 149: + case 163: /* Line 1455 of yacc.c */ -#line 1227 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 150: + case 164: /* Line 1455 of yacc.c */ -#line 1233 "program_parse.y" +#line 1420 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 151: + case 165: /* Line 1455 of yacc.c */ -#line 1240 "program_parse.y" +#line 1427 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 152: + case 166: /* Line 1455 of yacc.c */ -#line 1245 "program_parse.y" +#line 1432 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3496,10 +3771,10 @@ yyreduce: ;} break; - case 153: + case 167: /* Line 1455 of yacc.c */ -#line 1253 "program_parse.y" +#line 1440 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3509,10 +3784,10 @@ yyreduce: ;} break; - case 155: + case 169: /* Line 1455 of yacc.c */ -#line 1265 "program_parse.y" +#line 1452 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3520,46 +3795,46 @@ yyreduce: ;} break; - case 156: + case 170: /* Line 1455 of yacc.c */ -#line 1273 "program_parse.y" +#line 1460 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 157: + case 171: /* Line 1455 of yacc.c */ -#line 1279 "program_parse.y" +#line 1466 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 158: + case 172: /* Line 1455 of yacc.c */ -#line 1283 "program_parse.y" +#line 1470 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 159: + case 173: /* Line 1455 of yacc.c */ -#line 1287 "program_parse.y" +#line 1474 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 160: + case 174: /* Line 1455 of yacc.c */ -#line 1293 "program_parse.y" +#line 1480 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3570,10 +3845,10 @@ yyreduce: ;} break; - case 161: + case 175: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1491 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3582,92 +3857,92 @@ yyreduce: ;} break; - case 162: + case 176: /* Line 1455 of yacc.c */ -#line 1313 "program_parse.y" +#line 1500 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 163: + case 177: /* Line 1455 of yacc.c */ -#line 1317 "program_parse.y" +#line 1504 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 164: + case 178: /* Line 1455 of yacc.c */ -#line 1322 "program_parse.y" +#line 1509 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 165: + case 179: /* Line 1455 of yacc.c */ -#line 1326 "program_parse.y" +#line 1513 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 166: + case 180: /* Line 1455 of yacc.c */ -#line 1330 "program_parse.y" +#line 1517 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 167: + case 181: /* Line 1455 of yacc.c */ -#line 1334 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 168: + case 182: /* Line 1455 of yacc.c */ -#line 1340 "program_parse.y" +#line 1527 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 169: + case 183: /* Line 1455 of yacc.c */ -#line 1347 "program_parse.y" +#line 1534 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 170: + case 184: /* Line 1455 of yacc.c */ -#line 1351 "program_parse.y" +#line 1538 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 171: + case 185: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1544 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3675,10 +3950,10 @@ yyreduce: ;} break; - case 172: + case 186: /* Line 1455 of yacc.c */ -#line 1365 "program_parse.y" +#line 1552 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3689,38 +3964,38 @@ yyreduce: ;} break; - case 173: + case 187: /* Line 1455 of yacc.c */ -#line 1376 "program_parse.y" +#line 1563 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 174: + case 188: /* Line 1455 of yacc.c */ -#line 1383 "program_parse.y" +#line 1570 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 175: + case 189: /* Line 1455 of yacc.c */ -#line 1387 "program_parse.y" +#line 1574 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 176: + case 190: /* Line 1455 of yacc.c */ -#line 1393 "program_parse.y" +#line 1580 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3730,10 +4005,10 @@ yyreduce: ;} break; - case 177: + case 191: /* Line 1455 of yacc.c */ -#line 1403 "program_parse.y" +#line 1590 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3743,20 +4018,20 @@ yyreduce: ;} break; - case 178: + case 192: /* Line 1455 of yacc.c */ -#line 1413 "program_parse.y" +#line 1600 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 179: + case 193: /* Line 1455 of yacc.c */ -#line 1418 "program_parse.y" +#line 1605 "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). @@ -3774,10 +4049,10 @@ yyreduce: ;} break; - case 180: + case 194: /* Line 1455 of yacc.c */ -#line 1436 "program_parse.y" +#line 1623 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3785,55 +4060,55 @@ yyreduce: ;} break; - case 181: + case 195: /* Line 1455 of yacc.c */ -#line 1444 "program_parse.y" +#line 1631 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 182: + case 196: /* Line 1455 of yacc.c */ -#line 1448 "program_parse.y" +#line 1635 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 183: + case 197: /* Line 1455 of yacc.c */ -#line 1454 "program_parse.y" +#line 1641 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 184: + case 198: /* Line 1455 of yacc.c */ -#line 1458 "program_parse.y" +#line 1645 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 185: + case 199: /* Line 1455 of yacc.c */ -#line 1462 "program_parse.y" +#line 1649 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 186: + case 200: /* Line 1455 of yacc.c */ -#line 1468 "program_parse.y" +#line 1655 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3844,88 +4119,88 @@ yyreduce: ;} break; - case 187: + case 201: /* Line 1455 of yacc.c */ -#line 1479 "program_parse.y" +#line 1666 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 188: + case 202: /* Line 1455 of yacc.c */ -#line 1484 "program_parse.y" +#line 1671 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 189: + case 203: /* Line 1455 of yacc.c */ -#line 1489 "program_parse.y" +#line 1676 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 190: + case 204: /* Line 1455 of yacc.c */ -#line 1494 "program_parse.y" +#line 1681 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 191: + case 205: /* Line 1455 of yacc.c */ -#line 1499 "program_parse.y" +#line 1686 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 192: + case 206: /* Line 1455 of yacc.c */ -#line 1504 "program_parse.y" +#line 1691 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 193: + case 207: /* Line 1455 of yacc.c */ -#line 1511 "program_parse.y" +#line 1698 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 194: + case 208: /* Line 1455 of yacc.c */ -#line 1515 "program_parse.y" +#line 1702 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 195: + case 209: /* Line 1455 of yacc.c */ -#line 1520 "program_parse.y" +#line 1707 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3939,10 +4214,10 @@ yyreduce: ;} break; - case 196: + case 210: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1720 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3951,10 +4226,10 @@ yyreduce: ;} break; - case 197: + case 211: /* Line 1455 of yacc.c */ -#line 1541 "program_parse.y" +#line 1728 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3965,20 +4240,20 @@ yyreduce: ;} break; - case 198: + case 212: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1739 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 203: + case 217: /* Line 1455 of yacc.c */ -#line 1564 "program_parse.y" +#line 1751 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3988,30 +4263,30 @@ yyreduce: ;} break; - case 204: + case 218: /* Line 1455 of yacc.c */ -#line 1574 "program_parse.y" +#line 1761 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 205: + case 219: /* Line 1455 of yacc.c */ -#line 1579 "program_parse.y" +#line 1766 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 206: + case 220: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1773 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4021,10 +4296,10 @@ yyreduce: ;} break; - case 207: + case 221: /* Line 1455 of yacc.c */ -#line 1596 "program_parse.y" +#line 1783 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4034,30 +4309,30 @@ yyreduce: ;} break; - case 208: + case 222: /* Line 1455 of yacc.c */ -#line 1605 "program_parse.y" +#line 1792 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 209: + case 223: /* Line 1455 of yacc.c */ -#line 1610 "program_parse.y" +#line 1797 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 210: + case 224: /* Line 1455 of yacc.c */ -#line 1617 "program_parse.y" +#line 1804 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4067,10 +4342,10 @@ yyreduce: ;} break; - case 211: + case 225: /* Line 1455 of yacc.c */ -#line 1627 "program_parse.y" +#line 1814 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4080,10 +4355,10 @@ yyreduce: ;} break; - case 212: + case 226: /* Line 1455 of yacc.c */ -#line 1637 "program_parse.y" +#line 1824 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4093,10 +4368,10 @@ yyreduce: ;} break; - case 217: + case 231: /* Line 1455 of yacc.c */ -#line 1652 "program_parse.y" +#line 1839 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4106,10 +4381,10 @@ yyreduce: ;} break; - case 218: + case 232: /* Line 1455 of yacc.c */ -#line 1662 "program_parse.y" +#line 1849 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4119,10 +4394,10 @@ yyreduce: ;} break; - case 219: + case 233: /* Line 1455 of yacc.c */ -#line 1670 "program_parse.y" +#line 1857 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4132,10 +4407,10 @@ yyreduce: ;} break; - case 220: + case 234: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1867 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4145,10 +4420,10 @@ yyreduce: ;} break; - case 221: + case 235: /* Line 1455 of yacc.c */ -#line 1688 "program_parse.y" +#line 1875 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4158,10 +4433,10 @@ yyreduce: ;} break; - case 222: + case 236: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1884 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4171,10 +4446,10 @@ yyreduce: ;} break; - case 223: + case 237: /* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" +#line 1893 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4184,63 +4459,110 @@ yyreduce: ;} break; - case 224: + case 238: /* Line 1455 of yacc.c */ -#line 1716 "program_parse.y" +#line 1903 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 225: + case 239: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1907 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 226: + case 240: /* Line 1455 of yacc.c */ -#line 1725 "program_parse.y" +#line 1912 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 227: + case 241: /* Line 1455 of yacc.c */ -#line 1726 "program_parse.y" +#line 1913 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 228: + case 242: /* Line 1455 of yacc.c */ -#line 1727 "program_parse.y" +#line 1914 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 229: + case 243: /* Line 1455 of yacc.c */ -#line 1730 "program_parse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} +#line 1917 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 231: + case 245: /* Line 1455 of yacc.c */ -#line 1733 "program_parse.y" +#line 1921 "program_parse.y" + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", (yyvsp[(1) - (1)].string)) == 0) { + } else if (strcmp("LONG", (yyvsp[(1) - (1)].string)) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + ;} + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1955 "program_parse.y" + { + ;} + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 1959 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 233: + case 249: /* Line 1455 of yacc.c */ -#line 1737 "program_parse.y" +#line 1963 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { free((yyvsp[(3) - (3)].string)); @@ -4249,10 +4571,10 @@ yyreduce: ;} break; - case 234: + case 250: /* Line 1455 of yacc.c */ -#line 1744 "program_parse.y" +#line 1970 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { free((yyvsp[(1) - (1)].string)); @@ -4261,27 +4583,27 @@ yyreduce: ;} break; - case 235: + case 251: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1979 "program_parse.y" { struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); + declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); if (s == NULL) { - free((yyvsp[(2) - (4)].string)); + free((yyvsp[(3) - (5)].string)); YYERROR; } else { - s->output_binding = (yyvsp[(4) - (4)].result); + s->output_binding = (yyvsp[(5) - (5)].result); } ;} break; - case 236: + case 252: /* Line 1455 of yacc.c */ -#line 1767 "program_parse.y" +#line 1993 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4292,10 +4614,10 @@ yyreduce: ;} break; - case 237: + case 253: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 2002 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4306,19 +4628,19 @@ yyreduce: ;} break; - case 238: + case 254: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 2011 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 239: + case 255: /* Line 1455 of yacc.c */ -#line 1789 "program_parse.y" +#line 2015 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4329,10 +4651,10 @@ yyreduce: ;} break; - case 240: + case 256: /* Line 1455 of yacc.c */ -#line 1798 "program_parse.y" +#line 2024 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4343,10 +4665,10 @@ yyreduce: ;} break; - case 241: + case 257: /* Line 1455 of yacc.c */ -#line 1807 "program_parse.y" +#line 2033 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4357,19 +4679,19 @@ yyreduce: ;} break; - case 242: + case 258: /* Line 1455 of yacc.c */ -#line 1818 "program_parse.y" +#line 2044 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 243: + case 259: /* Line 1455 of yacc.c */ -#line 1824 "program_parse.y" +#line 2050 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4377,10 +4699,10 @@ yyreduce: ;} break; - case 244: + case 260: /* Line 1455 of yacc.c */ -#line 1830 "program_parse.y" +#line 2056 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4391,10 +4713,10 @@ yyreduce: ;} break; - case 245: + case 261: /* Line 1455 of yacc.c */ -#line 1839 "program_parse.y" +#line 2065 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4405,19 +4727,19 @@ yyreduce: ;} break; - case 246: + case 262: /* Line 1455 of yacc.c */ -#line 1850 "program_parse.y" +#line 2076 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: + case 263: /* Line 1455 of yacc.c */ -#line 1854 "program_parse.y" +#line 2080 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4428,10 +4750,10 @@ yyreduce: ;} break; - case 248: + case 264: /* Line 1455 of yacc.c */ -#line 1863 "program_parse.y" +#line 2089 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4442,94 +4764,94 @@ yyreduce: ;} break; - case 249: + case 265: /* Line 1455 of yacc.c */ -#line 1873 "program_parse.y" +#line 2099 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: + case 266: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 2100 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: + case 267: /* Line 1455 of yacc.c */ -#line 1875 "program_parse.y" +#line 2101 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 252: + case 268: /* Line 1455 of yacc.c */ -#line 1878 "program_parse.y" +#line 2104 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 269: /* Line 1455 of yacc.c */ -#line 1879 "program_parse.y" +#line 2105 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 270: /* Line 1455 of yacc.c */ -#line 1880 "program_parse.y" +#line 2106 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 255: + case 271: /* Line 1455 of yacc.c */ -#line 1883 "program_parse.y" +#line 2109 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 272: /* Line 1455 of yacc.c */ -#line 1884 "program_parse.y" +#line 2110 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 257: + case 273: /* Line 1455 of yacc.c */ -#line 1887 "program_parse.y" +#line 2113 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 274: /* Line 1455 of yacc.c */ -#line 1888 "program_parse.y" +#line 2114 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: + case 275: /* Line 1455 of yacc.c */ -#line 1891 "program_parse.y" +#line 2117 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: + case 276: /* Line 1455 of yacc.c */ -#line 1892 "program_parse.y" +#line 2118 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 261: + case 277: /* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" +#line 2122 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4540,10 +4862,10 @@ yyreduce: ;} break; - case 262: + case 278: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 2133 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4554,10 +4876,10 @@ yyreduce: ;} break; - case 263: + case 279: /* Line 1455 of yacc.c */ -#line 1918 "program_parse.y" +#line 2144 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4568,22 +4890,23 @@ yyreduce: ;} break; - case 264: + case 280: /* Line 1455 of yacc.c */ -#line 1929 "program_parse.y" +#line 2155 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); struct asm_symbol *target = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(4) - (4)].string)); - free((yyvsp[(4) - (4)].string)); if (exist != NULL) { + char m[1000]; + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); free((yyvsp[(2) - (4)].string)); - yyerror(& (yylsp[(2) - (4)]), state, "redeclared identifier"); + yyerror(& (yylsp[(2) - (4)]), state, m); YYERROR; } else if (target == NULL) { free((yyvsp[(2) - (4)].string)); @@ -4599,7 +4922,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4603 "program_parse.tab.c" +#line 4926 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4818,7 +5141,49 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1953 "program_parse.y" +#line 2184 "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; + } + + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } + + 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 * @@ -4828,37 +5193,37 @@ asm_instruction_ctor(gl_inst_opcode op, 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.CondUpdate = base->CondUpdate; + inst->Base.CondDst = base->CondDst; + inst->Base.SaturateMode = base->SaturateMode; + inst->Base.Precision = base->Precision; + + asm_instruction_set_operands(inst, dst, src0, src1, src2); } return inst; @@ -4876,6 +5241,26 @@ init_dst_reg(struct prog_dst_register *r) } +/** Like init_dst_reg() but set the File and Index fields. */ +void +set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = 1 << INST_INDEX_BITS; + const GLint minIndex = 0; + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file == PROGRAM_TEMPORARY || + file == PROGRAM_ADDRESS || + file == PROGRAM_OUTPUT); + memset(r, 0, sizeof(*r)); + r->File = file; + r->Index = index; + r->WriteMask = WRITEMASK_XYZW; + r->CondMask = COND_TR; + r->CondSwizzle = SWIZZLE_NOOP; +} + + void init_src_reg(struct asm_src_register *r) { @@ -4886,6 +5271,23 @@ init_src_reg(struct asm_src_register *r) } +/** Like init_src_reg() but set the File and Index fields. */ +void +set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; + const GLint minIndex = -(1 << INST_INDEX_BITS); + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file < PROGRAM_FILE_MAX); + memset(r, 0, sizeof(*r)); + r->Base.File = file; + r->Base.Index = index; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + /** * Validate the set of inputs used by a program * diff --git a/mesalib/src/mesa/shader/program_parse.tab.h b/mesalib/src/mesa/shader/program_parse.tab.h index dabb3bf1a..406100c85 100644 --- a/mesalib/src/mesa/shader/program_parse.tab.h +++ b/mesalib/src/mesa/shader/program_parse.tab.h @@ -58,90 +58,92 @@ ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -152,7 +154,7 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 107 "program_parse.y" +#line 122 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -181,7 +183,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 185 "program_parse.tab.h" +#line 187 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/mesalib/src/mesa/shader/program_parse.y b/mesalib/src/mesa/shader/program_parse.y index aad5eeb7d..8ca6f9805 100644 --- a/mesalib/src/mesa/shader/program_parse.y +++ b/mesalib/src/mesa/shader/program_parse.y @@ -66,12 +66,27 @@ static int validate_inputs(struct YYLTYPE *locp, static void init_dst_reg(struct prog_dst_register *r); +static void set_dst_reg(struct prog_dst_register *r, + gl_register_file file, GLint index); + static void init_src_reg(struct asm_src_register *r); +static void set_src_reg(struct asm_src_register *r, + gl_register_file file, GLint index); + +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) @@ -142,7 +157,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Tokens for instructions */ %token BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP -%token ARL KIL SWZ +%token ARL KIL SWZ TXD_OP %token INTEGER %token REAL @@ -169,7 +184,8 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %token VERTEX VTXATTRIB %token WEIGHT -%token IDENTIFIER +%token IDENTIFIER USED_IDENTIFIER +%type string %token MASK4 MASK3 MASK2 MASK1 SWIZZLE %token DOT_DOT %token DOT @@ -177,11 +193,11 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type instruction ALU_instruction TexInstruction %type ARL_instruction VECTORop_instruction %type SCALARop_instruction BINSCop_instruction BINop_instruction -%type TRIop_instruction SWZ_instruction SAMPLE_instruction +%type TRIop_instruction TXD_instruction SWZ_instruction SAMPLE_instruction %type KIL_instruction %type dstReg maskedDstReg maskedAddrReg -%type srcReg scalarSrcReg swizzleSrcReg +%type srcReg scalarUse scalarSrcReg swizzleSrcReg %type scalarSuffix swizzleSuffix extendedSwizzle %type extSwizComp extSwizSel %type optionalMask @@ -192,6 +208,8 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type addrReg %type addrComponent addrWriteMask +%type ccMaskRule ccTest ccMaskRule2 ccTest2 optionalCcMask + %type resultBinding resultColBinding %type optFaceType optColorType %type optResultFaceType optResultColorType @@ -280,7 +298,7 @@ optionSequence: optionSequence option | ; -option: OPTION IDENTIFIER ';' +option: OPTION string ';' { int valid = 0; @@ -349,6 +367,7 @@ ALU_instruction: ARL_instruction TexInstruction: SAMPLE_instruction | KIL_instruction + | TXD_instruction ; ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg @@ -359,51 +378,45 @@ ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; TRIop_instruction: TRI_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); } ; SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); if ($$ != NULL) { const GLbitfield tex_mask = (1U << $6); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - $$->Base.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $6; if ($8 < 0) { @@ -444,6 +457,58 @@ KIL_instruction: KIL swizzleSrcReg $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL); state->fragment.UsesKill = 1; } + | KIL ccTest + { + $$ = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + $$->Base.DstReg.CondMask = $2.CondMask; + $$->Base.DstReg.CondSwizzle = $2.CondSwizzle; + $$->Base.DstReg.CondSrc = $2.CondSrc; + state->fragment.UsesKill = 1; + } + ; + +TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget + { + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); + if ($$ != NULL) { + const GLbitfield tex_mask = (1U << $10); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + $$->Base.TexSrcUnit = $10; + + if ($12 < 0) { + shadow_tex = tex_mask; + + $$->Base.TexSrcTarget = -$12; + $$->Base.TexShadow = 1; + } else { + $$->Base.TexSrcTarget = $12; + } + + target_mask = (1U << $$->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[$10] != 0) + && ((state->prog->TexturesUsed[$10] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& @12, state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[$10] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + } ; texImageUnit: TEXTURE_UNIT optTexImageUnitNum @@ -474,21 +539,56 @@ SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle $4.Base.Swizzle = $6.swizzle; $4.Base.Negate = $6.mask; - $$ = asm_instruction_ctor(OPCODE_SWZ, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; -scalarSrcReg: optionalSign srcReg scalarSuffix +scalarSrcReg: optionalSign scalarUse { $$ = $2; if ($1) { $$.Base.Negate = ~$$.Base.Negate; } + } + | optionalSign '|' scalarUse '|' + { + $$ = $3; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "unexpected character '|'"); + YYERROR; + } + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Abs = 1; + } + ; + +scalarUse: srcReg scalarSuffix + { + $$ = $1; $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, - $3.swizzle); + $2.swizzle); + } + | paramConstScalarUse + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& @1, state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & $1); + + set_src_reg(& $$, PROGRAM_CONSTANT, temp_sym.param_binding_begin); } ; @@ -503,12 +603,33 @@ swizzleSrcReg: optionalSign srcReg swizzleSuffix $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, $3.swizzle); } + | optionalSign '|' srcReg swizzleSuffix '|' + { + $$ = $3; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "unexpected character '|'"); + YYERROR; + } + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Abs = 1; + $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, + $4.swizzle); + } + ; -maskedDstReg: dstReg optionalMask +maskedDstReg: dstReg optionalMask optionalCcMask { $$ = $1; $$.WriteMask = $2.mask; + $$.CondMask = $3.CondMask; + $$.CondSwizzle = $3.CondSwizzle; + $$.CondSrc = $3.CondSrc; if ($$.File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -522,16 +643,14 @@ maskedDstReg: dstReg optionalMask YYERROR; } - state->prog->OutputsWritten |= (1U << $$.Index); + state->prog->OutputsWritten |= BITFIELD64_BIT($$.Index); } } ; maskedAddrReg: addrReg addrWriteMask { - init_dst_reg(& $$); - $$.File = PROGRAM_ADDRESS; - $$.Index = 0; + set_dst_reg(& $$, PROGRAM_ADDRESS, 0); $$.WriteMask = $2.mask; } ; @@ -591,7 +710,7 @@ extSwizSel: INTEGER $$.xyzw_valid = 1; $$.rgba_valid = 1; } - | IDENTIFIER + | string { char s; @@ -646,7 +765,7 @@ extSwizSel: INTEGER } ; -srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ +srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -668,16 +787,13 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ init_src_reg(& $$); switch (s->type) { case at_temp: - $$.Base.File = PROGRAM_TEMPORARY; - $$.Base.Index = s->temp_binding; + set_src_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - $$.Base.File = s->param_binding_type; - $$.Base.Index = s->param_binding_begin; + set_src_reg(& $$, s->param_binding_type, s->param_binding_begin); break; case at_attrib: - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = s->attrib_binding; + set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding); state->prog->InputsRead |= (1U << $$.Base.Index); if (!validate_inputs(& @1, state)) { @@ -692,9 +808,7 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ } | attribBinding { - init_src_reg(& $$); - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = $1; + set_src_reg(& $$, PROGRAM_INPUT, $1); state->prog->InputsRead |= (1U << $$.Base.Index); if (!validate_inputs(& @1, state)) { @@ -724,21 +838,18 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ } | paramSingleItemUse { - init_src_reg(& $$); - $$.Base.File = ($1.name != NULL) + gl_register_file file = ($1.name != NULL) ? $1.param_binding_type : PROGRAM_CONSTANT; - $$.Base.Index = $1.param_binding_begin; + set_src_reg(& $$, file, $1.param_binding_begin); } ; dstReg: resultBinding { - init_dst_reg(& $$); - $$.File = PROGRAM_OUTPUT; - $$.Index = $1; + set_dst_reg(& $$, PROGRAM_OUTPUT, $1); } - | IDENTIFIER /* temporaryReg | vertexResultReg */ + | USED_IDENTIFIER /* temporaryReg | vertexResultReg */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -753,25 +864,21 @@ dstReg: resultBinding YYERROR; } - init_dst_reg(& $$); switch (s->type) { case at_temp: - $$.File = PROGRAM_TEMPORARY; - $$.Index = s->temp_binding; + set_dst_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding); break; case at_output: - $$.File = PROGRAM_OUTPUT; - $$.Index = s->output_binding; + set_dst_reg(& $$, PROGRAM_OUTPUT, s->output_binding); break; default: - $$.File = s->param_binding_type; - $$.Index = s->param_binding_begin; + set_dst_reg(& $$, s->param_binding_type, s->param_binding_begin); break; } } ; -progParamArray: IDENTIFIER +progParamArray: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -819,8 +926,10 @@ addrRegRelOffset: { $$ = 0; } addrRegPosOffset: INTEGER { if (($1 < 0) || ($1 > 63)) { - yyerror(& @1, state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", $1); + yyerror(& @1, state, s); YYERROR; } else { $$ = $1; @@ -831,8 +940,10 @@ addrRegPosOffset: INTEGER addrRegNegOffset: INTEGER { if (($1 < 0) || ($1 > 64)) { - yyerror(& @1, state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", $1); + yyerror(& @1, state, s); YYERROR; } else { $$ = $1; @@ -840,7 +951,7 @@ addrRegNegOffset: INTEGER } ; -addrReg: IDENTIFIER +addrReg: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -895,6 +1006,82 @@ optionalMask: MASK4 | MASK3 | MASK2 | MASK1 | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } ; +optionalCcMask: '(' ccTest ')' + { + $$ = $2; + } + | '(' ccTest2 ')' + { + $$ = $2; + } + | + { + $$.CondMask = COND_TR; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + +ccTest: ccMaskRule swizzleSuffix + { + $$ = $1; + $$.CondSwizzle = $2.swizzle; + } + ; + +ccTest2: ccMaskRule2 swizzleSuffix + { + $$ = $1; + $$.CondSwizzle = $2.swizzle; + } + ; + +ccMaskRule: IDENTIFIER + { + const int cond = _mesa_parse_cc($1); + if ((cond == 0) || ($1[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + +ccMaskRule2: USED_IDENTIFIER + { + const int cond = _mesa_parse_cc($1); + if ((cond == 0) || ($1[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + namingStatement: ATTRIB_statement | PARAM_statement | TEMP_statement @@ -1727,7 +1914,46 @@ optionalSign: '+' { $$ = FALSE; } | { $$ = FALSE; } ; -TEMP_statement: TEMP { $$ = $1; } varNameList +TEMP_statement: optVarSize TEMP { $$ = $2; } varNameList + ; + +optVarSize: string + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& @1, state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", $1) == 0) { + } else if (strcmp("LONG", $1) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + } + | + { + } ; ADDRESS_statement: ADDRESS { $$ = $1; } varNameList @@ -1749,16 +1975,16 @@ varNameList: varNameList ',' IDENTIFIER } ; -OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding +OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding { struct asm_symbol *const s = - declare_variable(state, $2, at_output, & @2); + declare_variable(state, $3, at_output, & @3); if (s == NULL) { - free($2); + free($3); YYERROR; } else { - s->output_binding = $4; + s->output_binding = $5; } } ; @@ -1925,19 +2151,20 @@ legacyTexUnitNum: INTEGER } ; -ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER +ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $2); struct asm_symbol *target = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $4); - free($4); if (exist != NULL) { + char m[1000]; + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2); free($2); - yyerror(& @2, state, "redeclared identifier"); + yyerror(& @2, state, m); YYERROR; } else if (target == NULL) { free($2); @@ -1950,8 +2177,54 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER } ; +string: IDENTIFIER + | USED_IDENTIFIER + ; + %% +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; + } + + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } + + 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_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, @@ -1959,37 +2232,37 @@ asm_instruction_ctor(gl_inst_opcode op, 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.CondUpdate = base->CondUpdate; + inst->Base.CondDst = base->CondDst; + inst->Base.SaturateMode = base->SaturateMode; + inst->Base.Precision = base->Precision; + + asm_instruction_set_operands(inst, dst, src0, src1, src2); } return inst; @@ -2007,6 +2280,26 @@ init_dst_reg(struct prog_dst_register *r) } +/** Like init_dst_reg() but set the File and Index fields. */ +void +set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = 1 << INST_INDEX_BITS; + const GLint minIndex = 0; + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file == PROGRAM_TEMPORARY || + file == PROGRAM_ADDRESS || + file == PROGRAM_OUTPUT); + memset(r, 0, sizeof(*r)); + r->File = file; + r->Index = index; + r->WriteMask = WRITEMASK_XYZW; + r->CondMask = COND_TR; + r->CondSwizzle = SWIZZLE_NOOP; +} + + void init_src_reg(struct asm_src_register *r) { @@ -2017,6 +2310,23 @@ init_src_reg(struct asm_src_register *r) } +/** Like init_src_reg() but set the File and Index fields. */ +void +set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; + const GLint minIndex = -(1 << INST_INDEX_BITS); + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file < PROGRAM_FILE_MAX); + memset(r, 0, sizeof(*r)); + r->Base.File = file; + r->Base.Index = index; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + /** * Validate the set of inputs used by a program * diff --git a/mesalib/src/mesa/shader/program_parse_extra.c b/mesalib/src/mesa/shader/program_parse_extra.c index 8e4be606f..0656c5eaa 100644 --- a/mesalib/src/mesa/shader/program_parse_extra.c +++ b/mesalib/src/mesa/shader/program_parse_extra.c @@ -33,6 +33,121 @@ * \author Ian Romanick */ +int +_mesa_parse_instruction_suffix(const struct asm_parser_state *state, + const char *suffix, + struct prog_instruction *inst) +{ + inst->CondUpdate = 0; + inst->CondDst = 0; + inst->SaturateMode = SATURATE_OFF; + inst->Precision = FLOAT32; + + + /* The first possible suffix element is the precision specifier from + * NV_fragment_program_option. + */ + if (state->option.NV_fragment) { + switch (suffix[0]) { + case 'H': + inst->Precision = FLOAT16; + suffix++; + break; + case 'R': + inst->Precision = FLOAT32; + suffix++; + break; + case 'X': + inst->Precision = FIXED12; + suffix++; + break; + default: + break; + } + } + + /* The next possible suffix element is the condition code modifier selection + * from NV_fragment_program_option. + */ + if (state->option.NV_fragment) { + if (suffix[0] == 'C') { + inst->CondUpdate = 1; + suffix++; + } + } + + + /* The final possible suffix element is the saturation selector from + * ARB_fragment_program. + */ + if (state->mode == ARB_fragment) { + if (strcmp(suffix, "_SAT") == 0) { + inst->SaturateMode = SATURATE_ZERO_ONE; + suffix += 4; + } + } + + + /* It is an error for all of the suffix string not to be consumed. + */ + return suffix[0] == '\0'; +} + + +int +_mesa_parse_cc(const char *s) +{ + int cond = 0; + + switch (s[0]) { + case 'E': + if (s[1] == 'Q') { + cond = COND_EQ; + } + break; + + case 'F': + if (s[1] == 'L') { + cond = COND_FL; + } + break; + + case 'G': + if (s[1] == 'E') { + cond = COND_GE; + } else if (s[1] == 'T') { + cond = COND_GT; + } + break; + + case 'L': + if (s[1] == 'E') { + cond = COND_LE; + } else if (s[1] == 'T') { + cond = COND_LT; + } + break; + + case 'N': + if (s[1] == 'E') { + cond = COND_NE; + } + break; + + case 'T': + if (s[1] == 'R') { + cond = COND_TR; + } + break; + + default: + break; + } + + return ((cond == 0) || (s[2] != '\0')) ? 0 : cond; +} + + int _mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) { @@ -102,6 +217,17 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) return 1; } } + } else if (strncmp(option, "NV_fragment_program", 19) == 0) { + option += 19; + + /* Other NV_fragment_program strings may be supported later. + */ + if (option[0] == '\0') { + if (state->ctx->Extensions.NV_fragment_program_option) { + state->option.NV_fragment = 1; + return 1; + } + } } else if (strncmp(option, "MESA_", 5) == 0) { option += 5; diff --git a/mesalib/src/mesa/shader/program_parser.h b/mesalib/src/mesa/shader/program_parser.h index fa47d8456..c170948f7 100644 --- a/mesalib/src/mesa/shader/program_parser.h +++ b/mesalib/src/mesa/shader/program_parser.h @@ -35,7 +35,7 @@ enum asm_type { at_attrib, at_param, at_temp, - at_output, + at_output }; struct asm_symbol { @@ -202,6 +202,7 @@ struct asm_parser_state { unsigned Shadow:1; unsigned TexRect:1; unsigned TexArray:1; + unsigned NV_fragment:1; } option; struct { @@ -263,4 +264,31 @@ extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state, extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option); +/** + * Parses and processes instruction suffixes + * + * Instruction suffixes, such as \c _SAT, are processed. The relevant bits + * are set in \c inst. If suffixes are encountered that are either not known + * or not supported by the modes and options set in \c state, zero will be + * returned. + * + * \return + * Non-zero on success, zero on failure. + */ +extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state, + const char *suffix, struct prog_instruction *inst); + +/** + * Parses a condition code name + * + * The condition code names (e.g., \c LT, \c GT, \c NE) were added to assembly + * shaders with the \c GL_NV_fragment_program_option extension. This function + * converts a string representation into one of the \c COND_ macros. + * + * \return + * One of the \c COND_ macros defined in prog_instruction.h on success or zero + * on failure. + */ +extern int _mesa_parse_cc(const char *s); + /*@}*/ diff --git a/mesalib/src/mesa/shader/programopt.c b/mesalib/src/mesa/shader/programopt.c index f70c75cec..951454570 100644 --- a/mesalib/src/mesa/shader/programopt.c +++ b/mesalib/src/mesa/shader/programopt.c @@ -109,7 +109,7 @@ _mesa_insert_mvp_dp4_code(GLcontext *ctx, struct gl_vertex_program *vprog) vprog->Base.Instructions = newInst; vprog->Base.NumInstructions = newLen; vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); + vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS); } @@ -211,7 +211,7 @@ _mesa_insert_mvp_mad_code(GLcontext *ctx, struct gl_vertex_program *vprog) vprog->Base.Instructions = newInst; vprog->Base.NumInstructions = newLen; vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); + vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS); } @@ -528,15 +528,11 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) /* look for instructions which write to the varying vars identified above */ for (i = 0; i < prog->NumInstructions; i++) { struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - if (inst->DstReg.File == type && - outputMap[inst->DstReg.Index] >= 0) { - /* change inst to write to the temp reg, instead of the varying */ - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = outputMap[inst->DstReg.Index]; - } + if (inst->DstReg.File == type && + outputMap[inst->DstReg.Index] >= 0) { + /* change inst to write to the temp reg, instead of the varying */ + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = outputMap[inst->DstReg.Index]; } } @@ -573,3 +569,94 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) } } } + + +/** + * Make the given fragment program into a "no-op" shader. + * Actually, just copy the incoming fragment color (or texcoord) + * to the output color. + * This is for debug/test purposes. + */ +void +_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog) +{ + struct prog_instruction *inst; + GLuint inputAttr; + + inst = _mesa_alloc_instructions(2); + if (!inst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_fragment_program"); + return; + } + + _mesa_init_instructions(inst, 2); + + inst[0].Opcode = OPCODE_MOV; + inst[0].DstReg.File = PROGRAM_OUTPUT; + inst[0].DstReg.Index = FRAG_RESULT_COLOR; + inst[0].SrcReg[0].File = PROGRAM_INPUT; + if (prog->Base.InputsRead & FRAG_BIT_COL0) + inputAttr = FRAG_ATTRIB_COL0; + else + inputAttr = FRAG_ATTRIB_TEX0; + inst[0].SrcReg[0].Index = inputAttr; + + inst[1].Opcode = OPCODE_END; + + _mesa_free_instructions(prog->Base.Instructions, + prog->Base.NumInstructions); + + prog->Base.Instructions = inst; + prog->Base.NumInstructions = 2; + prog->Base.InputsRead = 1 << inputAttr; + prog->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR); +} + + +/** + * \sa _mesa_nop_fragment_program + * Replace the given vertex program with a "no-op" program that just + * transforms vertex position and emits color. + */ +void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog) +{ + struct prog_instruction *inst; + GLuint inputAttr; + + /* + * Start with a simple vertex program that emits color. + */ + inst = _mesa_alloc_instructions(2); + if (!inst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_vertex_program"); + return; + } + + _mesa_init_instructions(inst, 2); + + inst[0].Opcode = OPCODE_MOV; + inst[0].DstReg.File = PROGRAM_OUTPUT; + inst[0].DstReg.Index = VERT_RESULT_COL0; + inst[0].SrcReg[0].File = PROGRAM_INPUT; + if (prog->Base.InputsRead & VERT_BIT_COLOR0) + inputAttr = VERT_ATTRIB_COLOR0; + else + inputAttr = VERT_ATTRIB_TEX0; + inst[0].SrcReg[0].Index = inputAttr; + + inst[1].Opcode = OPCODE_END; + + _mesa_free_instructions(prog->Base.Instructions, + prog->Base.NumInstructions); + + prog->Base.Instructions = inst; + prog->Base.NumInstructions = 2; + prog->Base.InputsRead = 1 << inputAttr; + prog->Base.OutputsWritten = BITFIELD64_BIT(VERT_RESULT_COL0); + + /* + * Now insert code to do standard modelview/projection transformation. + */ + _mesa_insert_mvp_code(ctx, prog); +} diff --git a/mesalib/src/mesa/shader/programopt.h b/mesalib/src/mesa/shader/programopt.h index 96acaf956..21fac0784 100644 --- a/mesalib/src/mesa/shader/programopt.h +++ b/mesalib/src/mesa/shader/programopt.h @@ -42,4 +42,11 @@ _mesa_count_texture_instructions(struct gl_program *prog); extern void _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type); +extern void +_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog); + +extern void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog); + + #endif /* PROGRAMOPT_H */ diff --git a/mesalib/src/mesa/shader/shader_api.c b/mesalib/src/mesa/shader/shader_api.c index b282d7af6..453cd3964 100644 --- a/mesalib/src/mesa/shader/shader_api.c +++ b/mesalib/src/mesa/shader/shader_api.c @@ -380,12 +380,18 @@ get_shader_flags(void) flags |= GLSL_DUMP; if (_mesa_strstr(env, "log")) flags |= GLSL_LOG; + if (_mesa_strstr(env, "nopvert")) + flags |= GLSL_NOP_VERT; + if (_mesa_strstr(env, "nopfrag")) + flags |= GLSL_NOP_FRAG; if (_mesa_strstr(env, "nopt")) flags |= GLSL_NO_OPT; else if (_mesa_strstr(env, "opt")) flags |= GLSL_OPT; if (_mesa_strstr(env, "uniform")) flags |= GLSL_UNIFORMS; + if (_mesa_strstr(env, "useprog")) + flags |= GLSL_USE_PROG; } return flags; @@ -1492,6 +1498,41 @@ _mesa_link_program(GLcontext *ctx, GLuint program) } +/** + * Print basic shader info (for debug). + */ +static void +print_shader_info(const struct gl_shader_program *shProg) +{ + GLuint i; + + _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); + for (i = 0; i < shProg->NumShaders; i++) { + const char *s; + switch (shProg->Shaders[i]->Type) { + case GL_VERTEX_SHADER: + s = "vertex"; + break; + case GL_FRAGMENT_SHADER: + s = "fragment"; + break; + case GL_GEOMETRY_SHADER: + s = "geometry"; + break; + default: + s = ""; + } + _mesa_printf(" %s shader %u, checksum %u\n", s, + shProg->Shaders[i]->Name, + shProg->Shaders[i]->SourceChecksum); + } + if (shProg->VertexProgram) + _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + if (shProg->FragmentProgram) + _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); +} + + /** * Called via ctx->Driver.UseProgram() */ @@ -1506,8 +1547,6 @@ _mesa_use_program(GLcontext *ctx, GLuint program) return; } - FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); - if (program) { shProg = _mesa_lookup_shader_program_err(ctx, program, "glUseProgram"); if (!shProg) { @@ -1520,26 +1559,18 @@ _mesa_use_program(GLcontext *ctx, GLuint program) } /* debug code */ - if (0) { - GLuint i; - _mesa_printf("Use Shader %u\n", shProg->Name); - for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x, checksum %u\n", - shProg->Shaders[i]->Name, - shProg->Shaders[i]->Type, - shProg->Shaders[i]->SourceChecksum); - } - if (shProg->VertexProgram) - printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); - if (shProg->FragmentProgram) - printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + if (ctx->Shader.Flags & GLSL_USE_PROG) { + print_shader_info(shProg); } } else { shProg = NULL; } - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); + if (ctx->Shader.CurrentProgram != shProg) { + FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); + } } diff --git a/mesalib/src/mesa/shader/slang/slang_codegen.c b/mesalib/src/mesa/shader/slang/slang_codegen.c index 344dfdc68..ee5a50ca8 100644 --- a/mesalib/src/mesa/shader/slang/slang_codegen.c +++ b/mesalib/src/mesa/shader/slang/slang_codegen.c @@ -925,7 +925,7 @@ gen_return_with_expression(slang_assemble_ctx *A, slang_operation *oper) slang_operation_copy(rhs, &oper->children[0]); } - ///blockOper->locals->outer_scope = oper->locals->outer_scope; + /*blockOper->locals->outer_scope = oper->locals->outer_scope;*/ /*slang_print_tree(blockOper, 0);*/ diff --git a/mesalib/src/mesa/shader/slang/slang_compile.c b/mesalib/src/mesa/shader/slang/slang_compile.c index c1b97c7cb..499e16e2d 100644 --- a/mesalib/src/mesa/shader/slang/slang_compile.c +++ b/mesalib/src/mesa/shader/slang/slang_compile.c @@ -2738,6 +2738,7 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) slang_info_log info_log; slang_code_object obj; slang_unit_type type; + GLenum progTarget; if (shader->Type == GL_VERTEX_SHADER) { type = SLANG_UNIT_VERTEX_SHADER; @@ -2754,17 +2755,18 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->Main = GL_FALSE; - if (!shader->Program) { - GLenum progTarget; - if (shader->Type == GL_VERTEX_SHADER) - progTarget = GL_VERTEX_PROGRAM_ARB; - else - progTarget = GL_FRAGMENT_PROGRAM_ARB; - shader->Program = ctx->Driver.NewProgram(ctx, progTarget, 1); - shader->Program->Parameters = _mesa_new_parameter_list(); - shader->Program->Varying = _mesa_new_parameter_list(); - shader->Program->Attributes = _mesa_new_parameter_list(); - } + /* free the shader's old instructions, etc */ + _mesa_reference_program(ctx, &shader->Program, NULL); + + /* allocate new GPU program, parameter lists, etc. */ + if (shader->Type == GL_VERTEX_SHADER) + progTarget = GL_VERTEX_PROGRAM_ARB; + else + progTarget = GL_FRAGMENT_PROGRAM_ARB; + shader->Program = ctx->Driver.NewProgram(ctx, progTarget, 1); + shader->Program->Parameters = _mesa_new_parameter_list(); + shader->Program->Varying = _mesa_new_parameter_list(); + shader->Program->Attributes = _mesa_new_parameter_list(); slang_info_log_construct(&info_log); _slang_code_object_ctr(&obj); @@ -2814,6 +2816,16 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) (ctx->Shader.Flags & GLSL_NO_OPT) == 0) { _mesa_optimize_program(ctx, shader->Program); } + if ((ctx->Shader.Flags & GLSL_NOP_VERT) && + shader->Program->Target == GL_VERTEX_PROGRAM_ARB) { + _mesa_nop_vertex_program(ctx, + (struct gl_vertex_program *) shader->Program); + } + if ((ctx->Shader.Flags & GLSL_NOP_FRAG) && + shader->Program->Target == GL_FRAGMENT_PROGRAM_ARB) { + _mesa_nop_fragment_program(ctx, + (struct gl_fragment_program *) shader->Program); + } } if (ctx->Shader.Flags & GLSL_LOG) { diff --git a/mesalib/src/mesa/shader/slang/slang_compile_operation.c b/mesalib/src/mesa/shader/slang/slang_compile_operation.c index 3e2bdbc91..be73094ca 100644 --- a/mesalib/src/mesa/shader/slang/slang_compile_operation.c +++ b/mesalib/src/mesa/shader/slang/slang_compile_operation.c @@ -52,6 +52,7 @@ slang_operation_construct(slang_operation * oper) _slang_variable_scope_ctr(oper->locals); oper->fun = NULL; oper->var = NULL; + oper->label = NULL; return GL_TRUE; } diff --git a/mesalib/src/mesa/shader/slang/slang_compile_operation.h b/mesalib/src/mesa/shader/slang/slang_compile_operation.h index 58f1edeed..1f15c1989 100644 --- a/mesalib/src/mesa/shader/slang/slang_compile_operation.h +++ b/mesalib/src/mesa/shader/slang/slang_compile_operation.h @@ -127,7 +127,6 @@ typedef struct slang_operation_ * indicate such. num_children indicates number of elements. */ GLboolean array_constructor; - double x; } slang_operation; diff --git a/mesalib/src/mesa/shader/slang/slang_emit.c b/mesalib/src/mesa/shader/slang/slang_emit.c index 3af301eac..c0e4b27aa 100644 --- a/mesalib/src/mesa/shader/slang/slang_emit.c +++ b/mesalib/src/mesa/shader/slang/slang_emit.c @@ -195,6 +195,9 @@ alloc_node_storage(slang_emit_info *emitInfo, slang_ir_node *n, if (!n->Store) { assert(defaultSize > 0); n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, defaultSize); + if (!n->Store) { + return GL_FALSE; + } } /* now allocate actual register(s). I.e. set n->Store->Index >= 0 */ @@ -431,6 +434,9 @@ new_instruction(slang_emit_info *emitInfo, gl_inst_opcode opcode) _mesa_realloc_instructions(prog->Instructions, prog->NumInstructions, emitInfo->MaxInstructions); + if (!prog->Instructions) { + return NULL; + } } inst = prog->Instructions + prog->NumInstructions; @@ -451,12 +457,14 @@ emit_arl_load(slang_emit_info *emitInfo, gl_register_file file, GLint index, GLuint swizzle) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL); - inst->SrcReg[0].File = file; - inst->SrcReg[0].Index = index; - inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); - inst->DstReg.File = PROGRAM_ADDRESS; - inst->DstReg.Index = 0; - inst->DstReg.WriteMask = WRITEMASK_X; + if (inst) { + inst->SrcReg[0].File = file; + inst->SrcReg[0].Index = index; + inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); + inst->DstReg.File = PROGRAM_ADDRESS; + inst->DstReg.Index = 0; + inst->DstReg.WriteMask = WRITEMASK_X; + } return inst; } @@ -765,7 +773,9 @@ static struct prog_instruction * emit_comment(slang_emit_info *emitInfo, const char *comment) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_NOP); - inst_comment(inst, comment); + if (inst) { + inst_comment(inst, comment); + } return inst; } @@ -792,7 +802,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]->Children[0]); /* A */ emit(emitInfo, n->Children[0]->Children[1]); /* B */ emit(emitInfo, n->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ + if (!alloc_node_storage(emitInfo, n, -1)) { /* dest */ + return NULL; + } inst = emit_instruction(emitInfo, OPCODE_MAD, @@ -813,7 +825,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]); /* A */ emit(emitInfo, n->Children[1]->Children[0]); /* B */ emit(emitInfo, n->Children[1]->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ + if (!alloc_node_storage(emitInfo, n, -1)) { /* dest */ + return NULL; + } inst = emit_instruction(emitInfo, OPCODE_MAD, @@ -839,7 +853,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) } /* result storage */ - alloc_node_storage(emitInfo, n, -1); + if (!alloc_node_storage(emitInfo, n, -1)) { + return NULL; + } inst = emit_instruction(emitInfo, info->InstOpcode, @@ -1093,7 +1109,9 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) * the intermediate result. Use a temp register instead. */ _mesa_bzero(&tmpNode, sizeof(tmpNode)); - alloc_node_storage(emitInfo, &tmpNode, n->Store->Size); + if (!alloc_node_storage(emitInfo, &tmpNode, n->Store->Size)) { + return NULL; + } /* tmp = max(ch[0], ch[1]) */ inst = emit_instruction(emitInfo, OPCODE_MAX, @@ -1191,6 +1209,9 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) * really just a NOP to attach the label to. */ inst = new_instruction(emitInfo, OPCODE_BGNSUB); + if (!inst) { + return NULL; + } inst_comment(inst, n->Label->Name); } @@ -1202,10 +1223,16 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) inst = prev_instruction(emitInfo); if (inst && inst->Opcode != OPCODE_RET) { inst = new_instruction(emitInfo, OPCODE_RET); + if (!inst) { + return NULL; + } } if (emitInfo->EmitBeginEndSub) { inst = new_instruction(emitInfo, OPCODE_ENDSUB); + if (!inst) { + return NULL; + } inst_comment(inst, n->Label->Name); } @@ -1215,6 +1242,9 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) /* emit the function call */ inst = new_instruction(emitInfo, OPCODE_CAL); + if (!inst) { + return NULL; + } /* The branch target is just the subroutine number (changed later) */ inst->BranchTarget = subroutineId; inst_comment(inst, n->Label->Name); @@ -1235,7 +1265,9 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n) assert(n->Opcode == IR_RETURN); assert(n->Label); inst = new_instruction(emitInfo, OPCODE_RET); - inst->DstReg.CondMask = COND_TR; /* always return */ + if (inst) { + inst->DstReg.CondMask = COND_TR; /* always return */ + } return inst; } @@ -1249,6 +1281,9 @@ emit_kill(slang_emit_info *emitInfo) * Note that ARB-KILL depends on sign of vector operand. */ inst = new_instruction(emitInfo, OPCODE_KIL_NV); + if (!inst) { + return NULL; + } inst->DstReg.CondMask = COND_TR; /* always kill */ assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB); @@ -1600,8 +1635,10 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) if (emitInfo->EmitHighLevelInstructions) { if (emitInfo->EmitCondCodes) { /* IF condcode THEN ... */ - struct prog_instruction *ifInst; - ifInst = new_instruction(emitInfo, OPCODE_IF); + struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_IF); + if (!ifInst) { + return NULL; + } ifInst->DstReg.CondMask = COND_NE; /* if cond is non-zero */ /* only test the cond code (1 of 4) that was updated by the * previous instruction. @@ -1620,6 +1657,9 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) else { /* conditional jump to else, or endif */ struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_BRA); + if (!ifInst) { + return NULL; + } ifInst->DstReg.CondMask = COND_EQ; /* BRA if cond is zero */ inst_comment(ifInst, "if zero"); ifInst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); @@ -1632,12 +1672,17 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) /* have else body */ elseInstLoc = prog->NumInstructions; if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ELSE); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ELSE); + if (!inst) { + return NULL; + } } else { /* jump to endif instruction */ - struct prog_instruction *inst; - inst = new_instruction(emitInfo, OPCODE_BRA); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_BRA); + if (!inst) { + return NULL; + } inst_comment(inst, "else"); inst->DstReg.CondMask = COND_TR; /* always branch */ } @@ -1650,7 +1695,10 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) } if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ENDIF); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ENDIF); + if (!inst) { + return NULL; + } } if (n->Children[2]) { @@ -1671,7 +1719,10 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) /* emit OPCODE_BGNLOOP */ beginInstLoc = prog->NumInstructions; if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_BGNLOOP); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_BGNLOOP); + if (!inst) { + return NULL; + } } /* body */ @@ -1689,10 +1740,16 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) if (emitInfo->EmitHighLevelInstructions) { /* emit OPCODE_ENDLOOP */ endInst = new_instruction(emitInfo, OPCODE_ENDLOOP); + if (!endInst) { + return NULL; + } } else { /* emit unconditional BRA-nch */ endInst = new_instruction(emitInfo, OPCODE_BRA); + if (!endInst) { + return NULL; + } endInst->DstReg.CondMask = COND_TR; /* always true */ } /* ENDLOOP's BranchTarget points to the BGNLOOP inst */ @@ -1762,7 +1819,9 @@ emit_cont_break(slang_emit_info *emitInfo, slang_ir_node *n) } n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_TR; /* always true */ + if (inst) { + inst->DstReg.CondMask = COND_TR; /* always true */ + } return inst; } @@ -1798,8 +1857,10 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) */ const GLuint condWritemask = inst->DstReg.WriteMask; inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + if (inst) { + inst->DstReg.CondMask = COND_NE; + inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + } return inst; } else { @@ -1817,7 +1878,13 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); + if (!inst) { + return NULL; + } inst = new_instruction(emitInfo, OPCODE_ENDIF); + if (!inst) { + return NULL; + } emitInfo->prog->Instructions[ifInstLoc].BranchTarget = emitInfo->prog->NumInstructions; @@ -1828,8 +1895,10 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) const GLuint condWritemask = inst->DstReg.WriteMask; assert(emitInfo->EmitCondCodes); inst = new_instruction(emitInfo, OPCODE_BRA); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + if (inst) { + inst->DstReg.CondMask = COND_NE; + inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + } return inst; } } @@ -2201,7 +2270,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) if (n->Comment) { inst = new_instruction(emitInfo, OPCODE_NOP); - inst->Comment = _mesa_strdup(n->Comment); + if (inst) { + inst->Comment = _mesa_strdup(n->Comment); + } inst = NULL; } @@ -2503,6 +2574,9 @@ _slang_emit_code(slang_ir_node *n, slang_var_table *vt, if (withEnd) { struct prog_instruction *inst; inst = new_instruction(&emitInfo, OPCODE_END); + if (!inst) { + return GL_FALSE; + } } _slang_resolve_subroutines(&emitInfo); diff --git a/mesalib/src/mesa/shader/slang/slang_link.c b/mesalib/src/mesa/shader/slang/slang_link.c index 144c12652..0a2bc4978 100644 --- a/mesalib/src/mesa/shader/slang/slang_link.c +++ b/mesalib/src/mesa/shader/slang/slang_link.c @@ -515,7 +515,7 @@ _slang_update_inputs_outputs(struct gl_program *prog) } if (inst->DstReg.File == PROGRAM_OUTPUT) { - prog->OutputsWritten |= 1 << inst->DstReg.Index; + prog->OutputsWritten |= BITFIELD64_BIT(inst->DstReg.Index); if (inst->DstReg.RelAddr) { /* If the output attribute is indexed with relative addressing * we know that it must be a varying or texcoord such as @@ -528,14 +528,17 @@ _slang_update_inputs_outputs(struct gl_program *prog) if (prog->Target == GL_VERTEX_PROGRAM_ARB) { if (inst->DstReg.Index == VERT_RESULT_TEX0) { /* mark all texcoord outputs as written */ - const GLbitfield mask = - ((1 << MAX_TEXTURE_COORD_UNITS) - 1) << VERT_RESULT_TEX0; + const GLbitfield64 mask = + BITFIELD64_RANGE(VERT_RESULT_TEX0, + (VERT_RESULT_TEX0 + + MAX_TEXTURE_COORD_UNITS - 1)); prog->OutputsWritten |= mask; } else if (inst->DstReg.Index == VERT_RESULT_VAR0) { /* mark all generic varying outputs as written */ - const GLbitfield mask = - ((1 << MAX_VARYING) - 1) << VERT_RESULT_VAR0; + const GLbitfield64 mask = + BITFIELD64_RANGE(VERT_RESULT_VAR0, + (VERT_RESULT_VAR0 + MAX_VARYING - 1)); prog->OutputsWritten |= mask; } } @@ -807,7 +810,8 @@ _slang_link(GLcontext *ctx, if (shProg->VertexProgram) { _slang_update_inputs_outputs(&shProg->VertexProgram->Base); _slang_count_temporaries(&shProg->VertexProgram->Base); - if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { + if (!(shProg->VertexProgram->Base.OutputsWritten + & BITFIELD64_BIT(VERT_RESULT_HPOS))) { /* the vertex program did not compute a vertex position */ link_error(shProg, "gl_Position was not written by vertex shader\n"); @@ -825,7 +829,7 @@ _slang_link(GLcontext *ctx, if (shProg->FragmentProgram) { const GLbitfield varyingRead = shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0; - const GLbitfield varyingWritten = shProg->VertexProgram ? + const GLbitfield64 varyingWritten = shProg->VertexProgram ? shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0; if ((varyingRead & varyingWritten) != varyingRead) { link_error(shProg, @@ -836,9 +840,10 @@ _slang_link(GLcontext *ctx, /* check that gl_FragColor and gl_FragData are not both written to */ if (shProg->FragmentProgram) { - GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten; - if ((outputsWritten & ((1 << FRAG_RESULT_COLOR))) && - (outputsWritten >= (1 << FRAG_RESULT_DATA0))) { + const GLbitfield64 outputsWritten = + shProg->FragmentProgram->Base.OutputsWritten; + if ((outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) && + (outputsWritten >= BITFIELD64_BIT(FRAG_RESULT_DATA0))) { link_error(shProg, "Fragment program cannot write both gl_FragColor" " and gl_FragData[].\n"); return; diff --git a/mesalib/src/mesa/shader/slang/slang_simplify.c b/mesalib/src/mesa/shader/slang/slang_simplify.c index b8a21f642..13b9ca3c8 100644 --- a/mesalib/src/mesa/shader/slang/slang_simplify.c +++ b/mesalib/src/mesa/shader/slang/slang_simplify.c @@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; + GLint values[16]; + values[0] = -1; + _mesa_GetIntegerv(info[i].Token, values); + ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ + return values[0]; } } return -1; diff --git a/mesalib/src/mesa/shader/slang/slang_vartable.c b/mesalib/src/mesa/shader/slang/slang_vartable.c index a4ebacc09..e07e3a226 100644 --- a/mesalib/src/mesa/shader/slang/slang_vartable.c +++ b/mesalib/src/mesa/shader/slang/slang_vartable.c @@ -311,10 +311,10 @@ _slang_free_temp(slang_var_table *vt, slang_ir_storage *store) { struct table *t = vt->Top; GLuint i; - GLuint r = store->Index; + GLint r = store->Index; assert(store->Size > 0); assert(r >= 0); - assert(r + store->Size <= vt->MaxRegisters * 4); + assert((GLuint)r + store->Size <= vt->MaxRegisters * 4); if (dbg) printf("Free temp sz %d at %d.%s (level %d) store %p\n", store->Size, r, _mesa_swizzle_string(store->Swizzle, 0, 0), -- cgit v1.2.3