summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-09-28 13:46:21 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2012-09-28 04:06:01 -0400
commit34f06e1ea81354bb09bf5f9134cbfd9f7cc81922 (patch)
treec77d4739e62057b6dfeeb9b8b3228f661b19a6d3
parentf414c680322e1149ea18f1e130b4fc2894184342 (diff)
Make sure Gen6 ENDIF work
-rw-r--r--src/gram.y12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gram.y b/src/gram.y
index 826a3fc..df0fe62 100644
--- a/src/gram.y
+++ b/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;