diff options
author | Homer Hsing <homer.xing@intel.com> | 2012-09-27 15:31:56 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-09-28 04:06:00 -0400 |
commit | e1122bde00707a51d5067c65be3094bcad8e419a (patch) | |
tree | 6f42a5022d494de606c6c606ae4a6661883ea412 | |
parent | 4afd395e4793369a50e2654305f31eec936a5616 (diff) |
Support Gen6 CALL instruction.
-rw-r--r-- | src/gram.y | 36 |
1 files changed, 27 insertions, 9 deletions
@@ -594,19 +594,37 @@ multibranchinstruction: subroutineinstruction: predicate CALL execsize dst relativelocation instoptions { - if($3 != 1 /* encoded int 2 */) { - fprintf(stderr, "The execution size of CALL should be 2.\n"); - YYERROR; - } - if($4.reg_type != BRW_REGISTER_TYPE_UD && $4.reg_type != BRW_REGISTER_TYPE_D) { - fprintf(stderr, "The dest type of CALL should be UD or D.\n"); - YYERROR; - } + /* + Gen6 bspec: + source, dest type should be DWORD. + dest must be QWord aligned. + source0 region control must be <2,2,1>. + execution size must be 2. + QtrCtrl is prohibited. + JIP is an immediate operand, must be of type W. + Gen7 bspec: + source, dest type should be DWORD. + dest must be QWord aligned. + source0 region control must be <2,2,1>. + execution size must be 2. + */ memset(&$$, 0, sizeof($$)); set_instruction_predicate(&$$, &$1); $$.header.opcode = $2; - $$.header.execution_size = $3; + $$.header.execution_size = 1; /* execution size must be 2. Here 1 is encoded 2. */ + + $4.reg_type = BRW_REGISTER_TYPE_D; /* dest type should be DWORD */ set_instruction_dest(&$$, &$4); + + struct src_operand src0; + memset(&src0, 0, sizeof(src0)); + src0.reg_type = BRW_REGISTER_TYPE_D; /* source type should be DWORD */ + /* source0 region control must be <2,2,1>. */ + src0.horiz_stride = 1; /*encoded 1*/ + src0.width = 1; /*encoded 2*/ + src0.vert_stride = 2; /*encoded 2*/ + set_instruction_src0(&$$, &src0); + $$.first_reloc_target = $5.reloc_target; $$.first_reloc_offset = $5.imm32; } |