Add a syntax for urb write messages.

This commit is contained in:
Eric Anholt 2006-08-24 16:37:04 -07:00 committed by Damien Lespiau
parent 5232981c88
commit e865196a9d
3 changed files with 30 additions and 2 deletions

View File

@ -72,6 +72,7 @@
%token NOP
%token MSGLEN RETURNLEN
%token <integer> ALLOCATE USED COMPLETE TRANSPOSE INTERLEAVE
%token SATURATE
%token <integer> INTEGER
@ -90,6 +91,7 @@
%type <integer> conditionalmodifier saturate negate abs
%type <integer> regtype srcimmtype execsize dstregion
%type <integer> subregnum sampler_datatype
%type <integer> urb_swizzle urb_allocate urb_used urb_complete
%type <region> region
%type <direct_gen_reg> directgenreg directmsgreg addrreg accreg flagreg maskreg
%type <direct_gen_reg> nullreg
@ -289,9 +291,16 @@ msgtarget: NULL_TOKEN
$$.bits3.dp_write.msg_type = $7;
$$.bits3.dp_write.send_commit_msg = $9;
}
| URB
| URB INTEGER urb_swizzle urb_allocate urb_used urb_complete
{
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_URB;
$$.bits3.urb.opcode = BRW_URB_OPCODE_WRITE;
$$.bits3.urb.offset = $2;
$$.bits3.urb.swizzle_control = $3;
$$.bits3.urb.pad = 0;
$$.bits3.urb.allocate = $4;
$$.bits3.urb.used = $5;
$$.bits3.urb.complete = $6;
}
| THREAD_SPAWNER
{
@ -300,6 +309,19 @@ msgtarget: NULL_TOKEN
}
;
urb_allocate: ALLOCATE { $$ = 1; }
| /* empty */ { $$ = 0; }
urb_used: USED { $$ = 1; }
| /* empty */ { $$ = 0; }
urb_complete: COMPLETE { $$ = 1; }
| /* empty */ { $$ = 0; }
urb_swizzle: TRANSPOSE { $$ = BRW_URB_SWIZZLE_TRANSPOSE; }
| INTERLEAVE { $$ = BRW_URB_SWIZZLE_INTERLEAVE; }
| /* empty */ { $$ = BRW_URB_SWIZZLE_NONE; }
sampler_datatype:
TYPE_F
| TYPE_UD

View File

@ -55,6 +55,12 @@ int saved_state = INITIAL;
"urb" { return URB; }
"thread_spawner" { return THREAD_SPAWNER; }
"allocate" { return ALLOCATE; }
"used" { return USED; }
"complete" { return COMPLETE; }
"transpose" { return TRANSPOSE; }
"interleave" { return INTERLEAVE; }
";" { return SEMICOLON; }
"(" { return LPAREN; }
")" { return RPAREN; }

View File

@ -6,7 +6,7 @@ mul (1) g7.4<1>F g7.4<0,1,0>F g6.4<0,1,0>F { align1 };
mov (8) m1<1>F g7<0,1,0>F { align1 };
mov (8) m2<1>F g7.4<0,1,0>F { align1 };
mov (8) m3<1>F g3<8,8,1>F { align1 };
send (8) 0 null g0<8,8,1>F urb mlen 4 rlen 0 write +0 transpose used complete EOT{ align1 };
send (8) 0 null g0<8,8,1>F urb 0 transpose used complete mlen 4 rlen 0 { align1 EOT };
nop;
nop;
nop;