From c56d78611641cfa7eff5b046054b051206a97dc6 Mon Sep 17 00:00:00 2001 From: Homer Hsing Date: Fri, 28 Sep 2012 13:46:21 +0800 Subject: [PATCH] Make sure Gen6 ENDIF work --- assembler/src/gram.y | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/assembler/src/gram.y b/assembler/src/gram.y index 826a3fc..df0fe62 100644 --- a/assembler/src/gram.y +++ b/assembler/src/gram.y @@ -431,6 +431,10 @@ instruction: unaryinstruction ifelseinstruction: ENDIF { // for Gen4 + if(gen_level > 5) { + fprintf(stderr, "ENDIF Syntax error: should be 'ENDIF execsize relativelocation'\n"); + YYERROR; + } memset(&$$, 0, sizeof($$)); $$.header.opcode = $1; $$.header.thread_control |= BRW_THREAD_SWITCH; @@ -440,8 +444,12 @@ ifelseinstruction: ENDIF } | ENDIF execsize relativelocation instoptions { - // for Gen7+ - /* Gen7 bspec: predication is prohibited */ + // for Gen6+ + /* Gen6, Gen7 bspec: predication is prohibited */ + if(gen_level <= 5) { + fprintf(stderr, "ENDIF Syntax error: should be 'ENDIF'\n"); + YYERROR; + } memset(&$$, 0, sizeof($$)); $$.header.opcode = $1; $$.header.execution_size = $2; -- 2.7.4