freedreno/afuc: Handle xmov modifiers
[mesa.git] / src / freedreno / afuc / parser.y
index 9f82286692c1596d741137cf36c02891228d8fff..5a8164e59fe224f51b8a0beb4293694cc2f50aeb 100644 (file)
@@ -118,15 +118,6 @@ label(const char *str)
        const char *str;
 }
 
-%{
-static void print_token(FILE *file, int type, YYSTYPE value)
-{
-       fprintf(file, "\ntype: %d\n", type);
-}
-
-#define YYPRINT(file, type, value) print_token(file, type, value)
-%}
-
 %token <num> T_INT
 %token <num> T_HEX
 %token <num> T_CONTROL_REG
@@ -162,12 +153,15 @@ static void print_token(FILE *file, int type, YYSTYPE value)
 %token <tok> T_OP_BRNE
 %token <tok> T_OP_BREQ
 %token <tok> T_OP_RET
+%token <tok> T_OP_IRET
 %token <tok> T_OP_CALL
 %token <tok> T_OP_JUMP
 %token <tok> T_OP_WAITIN
 %token <tok> T_OP_PREEMPTLEAVE
+%token <tok> T_OP_SETSECURE
 %token <tok> T_LSHIFT
 %token <tok> T_REP
+%token <num> T_XMOV
 
 %type <num> reg
 %type <num> immediate
@@ -189,6 +183,7 @@ instr_or_label:    instr_r
 
 /* instructions that can optionally have (rep) flag: */
 instr_r:           alu_instr
+|                  T_XMOV alu_instr { instr->xmov = $1; }
 |                  config_instr
 
 /* need to special case:
@@ -254,7 +249,9 @@ branch_instr:      branch_op reg ',' T_BIT ',' T_LABEL_REF     { src1($2); bit($
 
 other_instr:       T_OP_CALL T_LABEL_REF { new_instr($1); label($2); }
 |                  T_OP_PREEMPTLEAVE T_LABEL_REF { new_instr($1); label($2); }
+|                  T_OP_SETSECURE reg ',' T_LABEL_REF { new_instr($1); src1($2); label($4); }
 |                  T_OP_RET              { new_instr($1); }
+|                  T_OP_IRET             { new_instr($1); }
 |                  T_OP_JUMP T_LABEL_REF { new_instr($1); label($2); }
 |                  T_OP_WAITIN           { new_instr($1); }
 |                  T_OP_NOP              { new_instr($1); }