#define BRW_OPCODE_POP 47
#define BRW_OPCODE_WAIT 48
#define BRW_OPCODE_SEND 49
+#define BRW_OPCODE_MATH 56
#define BRW_OPCODE_ADD 64
#define BRW_OPCODE_MUL 65
#define BRW_OPCODE_AVG 66
%token <integer> AVG ADD SEL AND OR XOR SHR SHL ASR CMP CMPN PLN
%token <integer> SEND NOP JMPI IF IFF WHILE ELSE BREAK CONT HALT MSAVE
%token <integer> PUSH MREST POP WAIT DO ENDIF ILLEGAL
+%token <integer> MATH_INST
%token NULL_TOKEN MATH SAMPLER GATEWAY READ WRITE URB THREAD_SPAWNER
%type <instruction> breakinstruction syncinstruction specialinstruction
%type <instruction> msgtarget
%type <instruction> instoptions instoption_list predicate
+%type <instruction> mathinstruction
%type <string> label
%type <program> instrseq
%type <integer> instoption
| breakinstruction
| syncinstruction
| specialinstruction
+ | mathinstruction
;
unaryinstruction:
}
;
+mathinstruction: predicate MATH_INST execsize dst src srcimm math_function instoptions
+ {
+ bzero(&$$, sizeof($$));
+ $$.header.opcode = $2;
+ $$.header.sfid_destreg__conditionalmod = $7;
+ $$.header.execution_size = $3;
+ set_instruction_options(&$$, &$8);
+ set_instruction_predicate(&$$, &$1);
+ if (set_instruction_dest(&$$, &$4) != 0)
+ YYERROR;
+ if (set_instruction_src0(&$$, &$5) != 0)
+ YYERROR;
+ if (set_instruction_src1(&$$, &$6) != 0)
+ YYERROR;
+ }
+;
+
breakinstruction: breakop locationstackcontrol
{
struct direct_reg dst;
#include "string.h"
int saved_state = 0;
extern char *input_filename;
-
+extern long int gen_level;
%}
%x BLOCK_COMMENT
%x LINENUMBER
/* send argument tokens */
"mlen" { return MSGLEN; }
"rlen" { return RETURNLEN; }
-"math" { return MATH; }
+"math" { if (gen_level >= 6) { yylval.integer = BRW_OPCODE_MATH; return MATH_INST; } else return MATH; }
"sampler" { return SAMPLER; }
"gateway" { return GATEWAY; }
"read" { return READ; }