diff options
author | Homer Hsing <homer.xing@intel.com> | 2012-09-28 14:02:25 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-09-28 04:06:01 -0400 |
commit | 03789fc7240cc14ce4d3b6ed25afc3bfd8c83e7f (patch) | |
tree | 6ea74cc27cd51bb52eb3a5bdf6624cffe28f0736 | |
parent | 34f06e1ea81354bb09bf5f9134cbfd9f7cc81922 (diff) |
Make sure Gen6 IF works
-rw-r--r-- | src/gram.y | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -485,26 +485,37 @@ ifelseinstruction: ENDIF } | predicate IF execsize relativelocation { - /* for Gen4 */ + /* for Gen4, Gen5 */ /* The branch instructions require that the IP register * be the destination and first source operand, while the * offset is the second source operand. The offset is added * to the pre-incremented IP. */ + /* for Gen6 */ + if(gen_level > 6) { + fprintf(stderr, "Syntax error: IF should be 'IF execsize JIP UIP'\n"); + YYERROR; + } memset(&$$, 0, sizeof($$)); + set_instruction_predicate(&$$, &$1); $$.header.opcode = $2; $$.header.execution_size = $3; - $$.header.thread_control |= BRW_THREAD_SWITCH; - set_instruction_predicate(&$$, &$1); - set_instruction_dest(&$$, &ip_dst); - set_instruction_src0(&$$, &ip_src); - set_instruction_src1(&$$, &$4); + if(gen_level <= 5) { + $$.header.thread_control |= BRW_THREAD_SWITCH; + set_instruction_dest(&$$, &ip_dst); + set_instruction_src0(&$$, &ip_src); + set_instruction_src1(&$$, &$4); + } $$.first_reloc_target = $4.reloc_target; $$.first_reloc_offset = $4.imm32; } | predicate IF execsize relativelocation relativelocation { /* for Gen7+ */ + if(gen_level < 7) { + fprintf(stderr, "Syntax error: IF should be 'IF execsize relativelocation'\n"); + YYERROR; + } memset(&$$, 0, sizeof($$)); set_instruction_predicate(&$$, &$1); $$.header.opcode = $2; |