From 1f58efa747e8cfedc3f4277bc0409ac3c348f6df Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Sep 2006 11:56:12 -0700 Subject: [PATCH] Add support for the WAIT instruction. --- assembler/src/gram.y | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/assembler/src/gram.y b/assembler/src/gram.y index 64b7336..9d450b2 100644 --- a/assembler/src/gram.y +++ b/assembler/src/gram.y @@ -116,7 +116,7 @@ void set_direct_src_operand(struct src_operand *src, struct direct_reg *reg, %type instruction unaryinstruction binaryinstruction %type binaryaccinstruction triinstruction sendinstruction %type jumpinstruction branchloopinstruction elseinstruction -%type specialinstruction +%type syncinstruction specialinstruction %type msgtarget %type instoptions instoption_list predicate %type instrseq @@ -185,6 +185,7 @@ instruction: unaryinstruction | jumpinstruction | branchloopinstruction | elseinstruction + | syncinstruction | specialinstruction ; @@ -375,6 +376,26 @@ breakop: BREAK | CONT | WAIT maskpushop: MSAVE | PUSH ; +syncinstruction: predicate WAIT notifyreg + { + struct direct_reg null; + struct dst_operand null_dst; + struct src_operand null_src; + + null.reg_file = BRW_ARCHITECTURE_REGISTER_FILE; + null.reg_nr = BRW_ARF_NULL; + null.subreg_nr = 0; + + bzero(&$$, sizeof($$)); + $$.header.opcode = $2; + set_direct_dst_operand(&null_dst, &null, BRW_REGISTER_TYPE_UD); + set_instruction_dest(&$$, &null_dst); + set_direct_src_operand(&null_src, &null, BRW_REGISTER_TYPE_UD); + set_instruction_src0(&$$, &$3); + set_instruction_src1(&$$, &null_src); + } +; + specialinstruction: NOP { bzero(&$$, sizeof($$)); -- 2.7.4