mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-21 06:46:13 +00:00
Add break, cont, and halt instructions.
This commit is contained in:
parent
9201e4e2a0
commit
4ee9c3d869
@ -8,3 +8,4 @@
|
|||||||
- boolean types
|
- boolean types
|
||||||
- replace GL* with non-GL?
|
- replace GL* with non-GL?
|
||||||
- labels for branch/jump instruction destinations
|
- labels for branch/jump instruction destinations
|
||||||
|
- break/cont syntax should be better.
|
||||||
|
@ -116,12 +116,12 @@ void set_direct_src_operand(struct src_operand *src, struct direct_reg *reg,
|
|||||||
%type <instruction> instruction unaryinstruction binaryinstruction
|
%type <instruction> instruction unaryinstruction binaryinstruction
|
||||||
%type <instruction> binaryaccinstruction triinstruction sendinstruction
|
%type <instruction> binaryaccinstruction triinstruction sendinstruction
|
||||||
%type <instruction> jumpinstruction branchloopinstruction elseinstruction
|
%type <instruction> jumpinstruction branchloopinstruction elseinstruction
|
||||||
%type <instruction> syncinstruction specialinstruction
|
%type <instruction> breakinstruction syncinstruction specialinstruction
|
||||||
%type <instruction> msgtarget
|
%type <instruction> msgtarget
|
||||||
%type <instruction> instoptions instoption_list predicate
|
%type <instruction> instoptions instoption_list predicate
|
||||||
%type <program> instrseq
|
%type <program> instrseq
|
||||||
%type <integer> instoption
|
%type <integer> instoption
|
||||||
%type <integer> unaryop binaryop binaryaccop branchloopop
|
%type <integer> unaryop binaryop binaryaccop branchloopop breakop
|
||||||
%type <integer> conditionalmodifier saturate negate abs chansel
|
%type <integer> conditionalmodifier saturate negate abs chansel
|
||||||
%type <integer> writemask_x writemask_y writemask_z writemask_w
|
%type <integer> writemask_x writemask_y writemask_z writemask_w
|
||||||
%type <integer> regtype srcimmtype execsize dstregion immaddroffset
|
%type <integer> regtype srcimmtype execsize dstregion immaddroffset
|
||||||
@ -141,7 +141,7 @@ void set_direct_src_operand(struct src_operand *src, struct direct_reg *reg,
|
|||||||
%type <src_operand> directsrcoperand srcarchoperandex directsrcaccoperand
|
%type <src_operand> directsrcoperand srcarchoperandex directsrcaccoperand
|
||||||
%type <src_operand> indirectsrcoperand
|
%type <src_operand> indirectsrcoperand
|
||||||
%type <src_operand> src srcimm imm32reg payload srcacc srcaccimm swizzle
|
%type <src_operand> src srcimm imm32reg payload srcacc srcaccimm swizzle
|
||||||
%type <src_operand> relativelocation relativelocation2
|
%type <src_operand> relativelocation relativelocation2 locationstackcontrol
|
||||||
%%
|
%%
|
||||||
|
|
||||||
ROOT: instrseq
|
ROOT: instrseq
|
||||||
@ -185,6 +185,7 @@ instruction: unaryinstruction
|
|||||||
| jumpinstruction
|
| jumpinstruction
|
||||||
| branchloopinstruction
|
| branchloopinstruction
|
||||||
| elseinstruction
|
| elseinstruction
|
||||||
|
| breakinstruction
|
||||||
| syncinstruction
|
| syncinstruction
|
||||||
| specialinstruction
|
| specialinstruction
|
||||||
;
|
;
|
||||||
@ -376,7 +377,32 @@ elseinstruction: ELSE relativelocation
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
breakop: BREAK | CONT | WAIT
|
breakinstruction: breakop locationstackcontrol
|
||||||
|
{
|
||||||
|
struct direct_reg dst;
|
||||||
|
struct dst_operand ip_dst;
|
||||||
|
struct src_operand ip_src;
|
||||||
|
|
||||||
|
/* The jump instruction requires that the IP register
|
||||||
|
* be the destination and first source operand, while the
|
||||||
|
* offset is the second source operand. The offset is added
|
||||||
|
* to the IP pre-increment.
|
||||||
|
*/
|
||||||
|
dst.reg_file = BRW_ARCHITECTURE_REGISTER_FILE;
|
||||||
|
dst.reg_nr = BRW_ARF_IP;
|
||||||
|
dst.subreg_nr = 0;
|
||||||
|
|
||||||
|
bzero(&$$, sizeof($$));
|
||||||
|
$$.header.opcode = $1;
|
||||||
|
set_direct_dst_operand(&ip_dst, &dst, BRW_REGISTER_TYPE_UD);
|
||||||
|
set_instruction_dest(&$$, &ip_dst);
|
||||||
|
set_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
|
||||||
|
set_instruction_src0(&$$, &ip_src);
|
||||||
|
set_instruction_src1(&$$, &$2);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
breakop: BREAK | CONT | HALT
|
||||||
;
|
;
|
||||||
|
|
||||||
maskpushop: MSAVE | PUSH
|
maskpushop: MSAVE | PUSH
|
||||||
@ -1031,7 +1057,7 @@ relativelocation: imm32
|
|||||||
{
|
{
|
||||||
if ($1 > 32767 || $1 < -32768) {
|
if ($1 > 32767 || $1 < -32768) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"error: relative offset %d out of range\n");
|
"error: relative offset %d out of range\n", $1);
|
||||||
YYERROR;
|
YYERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1057,6 +1083,15 @@ relativelocation2:
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
locationstackcontrol:
|
||||||
|
imm32
|
||||||
|
{
|
||||||
|
$$.reg_file = BRW_IMMEDIATE_VALUE;
|
||||||
|
$$.reg_type = BRW_REGISTER_TYPE_D;
|
||||||
|
$$.imm32 = $1;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
/* 1.4.7: Regions */
|
/* 1.4.7: Regions */
|
||||||
dstregion: LANGLE INTEGER RANGLE
|
dstregion: LANGLE INTEGER RANGLE
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user