summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-09-28 14:02:25 +0800
committerDamien Lespiau <damien.lespiau@intel.com>2013-03-04 15:54:34 +0000
commit2ad18c1c97a14edd9733b1d7319a1c50a170be92 (patch)
treed978d9f5aab2e7a6828752e0b9b9d9d6748cc9cc
parentc56d78611641cfa7eff5b046054b051206a97dc6 (diff)
Make sure Gen6 IF works
-rw-r--r--assembler/src/gram.y23
1 files changed, 17 insertions, 6 deletions
diff --git a/assembler/src/gram.y b/assembler/src/gram.y
index df0fe622..03b77417 100644
--- a/assembler/src/gram.y
+++ b/assembler/src/gram.y
@@ -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;