From c3be8d13910e2ef19a2e10bfdb2f354a90fb75be Mon Sep 17 00:00:00 2001 From: Homer Hsing Date: Thu, 27 Sep 2012 15:39:28 +0800 Subject: Support Gen6 RET instruction. --- src/gram.y | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/gram.y b/src/gram.y index 5d83fd9..5e4277d 100644 --- a/src/gram.y +++ b/src/gram.y @@ -630,29 +630,21 @@ subroutineinstruction: } | predicate RET execsize dstoperandex src instoptions { - if($3 != 1 /* encoded int 2 */) { - fprintf(stderr, "The execution size of RET should be 2.\n"); - YYERROR; - } - if($4.reg_file != BRW_ARCHITECTURE_REGISTER_FILE && $4.reg_nr != BRW_ARF_NULL) { - fprintf(stderr, "The dest reg of RET should be NULL.\n"); - YYERROR; - } - if($5.reg_type != BRW_REGISTER_TYPE_UD && $5.reg_type != BRW_REGISTER_TYPE_D) { - fprintf(stderr, "The source reg type of RET should be UD or D.\n"); - YYERROR; - } - if($5.horiz_stride != 1 /*encoded 1*/ - || $5.width != 1 /*encoded 2*/ - || $5.vert_stride != 2 /*encoded 2*/) { - fprintf(stderr, "The source reg region of RET should be <2,2,1>.\n"); - YYERROR; - } + /* + Gen6, 7: + source cannot be accumulator. + dest must be null. + src0 region control must be <2,2,1> (not specified clearly. should be same as CALL) + */ memset(&$$, 0, sizeof($$)); set_instruction_predicate(&$$, &$1); $$.header.opcode = $2; - $$.header.execution_size = $3; - set_instruction_dest(&$$, &$4); + $$.header.execution_size = 1; /* execution size of RET should be 2 */ + set_instruction_dest(&$$, dst_null_reg); + $5.reg_type = BRW_REGISTER_TYPE_D; + $5.horiz_stride = 1; /*encoded 1*/ + $5.width = 1; /*encoded 2*/ + $5.vert_stride = 2; /*encoded 2*/ set_instruction_src0(&$$, &$5); } ; -- cgit v1.2.3