target/hexagon/idef-parser: Remove unused code paths
Removes code paths used by COF instructions, which are no longer processed by idef-parser. Tested-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Signed-off-by: Anton Johansson <anjo@rev.ng> Message-Id: <20230131223133.8592-1-anjo@rev.ng>
This commit is contained in:
parent
877a3d20cd
commit
bbb71568de
@ -82,7 +82,6 @@ enum ImmUnionTag {
|
||||
VALUE,
|
||||
QEMU_TMP,
|
||||
IMM_PC,
|
||||
IMM_NPC,
|
||||
IMM_CONSTEXT,
|
||||
};
|
||||
|
||||
|
@ -140,8 +140,6 @@ STRING_LIT \"(\\.|[^"\\])*\"
|
||||
yylval->rvalue.is_dotnew = true;
|
||||
yylval->rvalue.signedness = SIGNED;
|
||||
return PRED; }
|
||||
"IV1DEAD()" |
|
||||
"fPAUSE(uiV);" { return ';'; }
|
||||
"+=" { return INC; }
|
||||
"-=" { return DEC; }
|
||||
"++" { return PLUSPLUS; }
|
||||
@ -159,9 +157,8 @@ STRING_LIT \"(\\.|[^"\\])*\"
|
||||
"else" { return ELSE; }
|
||||
"for" { return FOR; }
|
||||
"fREAD_IREG" { return ICIRC; }
|
||||
"fPART1" { return PART1; }
|
||||
"if" { return IF; }
|
||||
"fFRAME_SCRAMBLE" { return FSCR; }
|
||||
"fFRAME_SCRAMBLE" |
|
||||
"fFRAME_UNSCRAMBLE" { return FSCR; }
|
||||
"fFRAMECHECK" { return FCHK; }
|
||||
"Constant_extended" { return CONSTEXT; }
|
||||
@ -312,11 +309,7 @@ STRING_LIT \"(\\.|[^"\\])*\"
|
||||
"(unsigned int)" { yylval->cast.bit_width = 32;
|
||||
yylval->cast.signedness = UNSIGNED;
|
||||
return CAST; }
|
||||
"fREAD_PC()" |
|
||||
"PC" { return PC; }
|
||||
"fREAD_NPC()" |
|
||||
"NPC" { return NPC; }
|
||||
"fGET_LPCFG" |
|
||||
"fREAD_PC()" { return PC; }
|
||||
"USR.LPCFG" { return LPCFG; }
|
||||
"LOAD_CANCEL(EA)" { return LOAD_CANCEL; }
|
||||
"STORE_CANCEL(EA)" |
|
||||
@ -360,14 +353,6 @@ STRING_LIT \"(\\.|[^"\\])*\"
|
||||
yylval->rvalue.bit_width = 32;
|
||||
yylval->rvalue.signedness = UNSIGNED;
|
||||
return REG; }
|
||||
"fREAD_LC"[01] { yylval->rvalue.type = REGISTER;
|
||||
yylval->rvalue.reg.type = CONTROL;
|
||||
yylval->rvalue.reg.id = HEX_REG_LC0
|
||||
+ (yytext[8] - '0') * 2;
|
||||
yylval->rvalue.reg.bit_width = 32;
|
||||
yylval->rvalue.bit_width = 32;
|
||||
yylval->rvalue.signedness = UNSIGNED;
|
||||
return REG; }
|
||||
"LC"[01] { yylval->rvalue.type = REGISTER;
|
||||
yylval->rvalue.reg.type = CONTROL;
|
||||
yylval->rvalue.reg.id = HEX_REG_LC0
|
||||
@ -376,14 +361,6 @@ STRING_LIT \"(\\.|[^"\\])*\"
|
||||
yylval->rvalue.bit_width = 32;
|
||||
yylval->rvalue.signedness = UNSIGNED;
|
||||
return REG; }
|
||||
"fREAD_SA"[01] { yylval->rvalue.type = REGISTER;
|
||||
yylval->rvalue.reg.type = CONTROL;
|
||||
yylval->rvalue.reg.id = HEX_REG_SA0
|
||||
+ (yytext[8] - '0') * 2;
|
||||
yylval->rvalue.reg.bit_width = 32;
|
||||
yylval->rvalue.bit_width = 32;
|
||||
yylval->rvalue.signedness = UNSIGNED;
|
||||
return REG; }
|
||||
"SA"[01] { yylval->rvalue.type = REGISTER;
|
||||
yylval->rvalue.reg.type = CONTROL;
|
||||
yylval->rvalue.reg.id = HEX_REG_SA0
|
||||
|
@ -52,8 +52,8 @@
|
||||
%token IN INAME VAR
|
||||
%token ABS CROUND ROUND CIRCADD COUNTONES INC DEC ANDA ORA XORA PLUSPLUS ASL
|
||||
%token ASR LSR EQ NEQ LTE GTE MIN MAX ANDL FOR ICIRC IF MUN FSCR FCHK SXT
|
||||
%token ZXT CONSTEXT LOCNT BREV SIGN LOAD STORE PC NPC LPCFG
|
||||
%token LOAD_CANCEL CANCEL IDENTITY PART1 ROTL INSBITS SETBITS EXTRANGE
|
||||
%token ZXT CONSTEXT LOCNT BREV SIGN LOAD STORE PC LPCFG
|
||||
%token LOAD_CANCEL CANCEL IDENTITY ROTL INSBITS SETBITS EXTRANGE
|
||||
%token CAST4_8U FAIL CARRY_FROM_ADD ADDSAT64 LSBNEW
|
||||
%token TYPE_SIZE_T TYPE_INT TYPE_SIGNED TYPE_UNSIGNED TYPE_LONG
|
||||
|
||||
@ -336,15 +336,6 @@ assign_statement : lvalue '=' rvalue
|
||||
OUT(c, &@1, &$1, " = ", &$3, ";\n");
|
||||
$$ = $1;
|
||||
}
|
||||
| PC '=' rvalue
|
||||
{
|
||||
@1.last_column = @3.last_column;
|
||||
yyassert(c, &@1, !is_inside_ternary(c),
|
||||
"Assignment side-effect not modeled!");
|
||||
$3 = gen_rvalue_truncate(c, &@1, &$3);
|
||||
$3 = rvalue_materialize(c, &@1, &$3);
|
||||
OUT(c, &@1, "gen_write_new_pc(", &$3, ");\n");
|
||||
}
|
||||
| LOAD '(' IMM ',' IMM ',' SIGN ',' var ',' lvalue ')'
|
||||
{
|
||||
@1.last_column = @12.last_column;
|
||||
@ -412,7 +403,6 @@ control_statement : frame_check
|
||||
| cancel_statement
|
||||
| if_statement
|
||||
| for_statement
|
||||
| fpart1_statement
|
||||
;
|
||||
|
||||
frame_check : FCHK '(' rvalue ',' rvalue ')' ';'
|
||||
@ -462,17 +452,6 @@ for_statement : FOR '(' IMM '=' IMM ';' IMM '<' IMM ';' IMM PLUSPLUS ')'
|
||||
}
|
||||
;
|
||||
|
||||
fpart1_statement : PART1
|
||||
{
|
||||
OUT(c, &@1, "if (insn->part1) {\n");
|
||||
}
|
||||
'(' statements ')'
|
||||
{
|
||||
@1.last_column = @3.last_column;
|
||||
OUT(c, &@1, "return; }\n");
|
||||
}
|
||||
;
|
||||
|
||||
if_stmt : IF '(' rvalue ')'
|
||||
{
|
||||
@1.last_column = @3.last_column;
|
||||
@ -512,20 +491,6 @@ rvalue : FAIL
|
||||
rvalue.signedness = UNSIGNED;
|
||||
$$ = rvalue;
|
||||
}
|
||||
| NPC
|
||||
{
|
||||
/*
|
||||
* NPC is only read from CALLs, so we can hardcode it
|
||||
* at translation time
|
||||
*/
|
||||
HexValue rvalue;
|
||||
memset(&rvalue, 0, sizeof(HexValue));
|
||||
rvalue.type = IMMEDIATE;
|
||||
rvalue.imm.type = IMM_NPC;
|
||||
rvalue.bit_width = 32;
|
||||
rvalue.signedness = UNSIGNED;
|
||||
$$ = rvalue;
|
||||
}
|
||||
| CONSTEXT
|
||||
{
|
||||
HexValue rvalue;
|
||||
@ -781,11 +746,6 @@ rvalue : FAIL
|
||||
/* Ones count */
|
||||
$$ = gen_ctpop_op(c, &@1, &$3);
|
||||
}
|
||||
| LPCFG
|
||||
{
|
||||
$$ = gen_tmp(c, &@1, 32, UNSIGNED);
|
||||
OUT(c, &@1, "GET_USR_FIELD(USR_LPCFG, ", &$$, ");\n");
|
||||
}
|
||||
| EXTRACT '(' rvalue ',' rvalue ')'
|
||||
{
|
||||
@1.last_column = @6.last_column;
|
||||
|
@ -97,16 +97,8 @@
|
||||
#define fWRITE_LR(A) (LR = A)
|
||||
#define fWRITE_FP(A) (FP = A)
|
||||
#define fWRITE_SP(A) (SP = A)
|
||||
/*
|
||||
* Note: There is a rule in the parser that matches `PC = ...` and emits
|
||||
* a call to `gen_write_new_pc`. We need to call `gen_write_new_pc` to
|
||||
* get the correct semantics when there are multiple stores in a packet.
|
||||
*/
|
||||
#define fBRANCH(LOC, TYPE) (PC = LOC)
|
||||
#define fJUMPR(REGNO, TARGET, TYPE) (PC = TARGET)
|
||||
#define fWRITE_LOOP_REGS0(START, COUNT) SA0 = START; (LC0 = COUNT)
|
||||
#define fWRITE_LOOP_REGS1(START, COUNT) SA1 = START; (LC1 = COUNT)
|
||||
#define fWRITE_LC0(VAL) (LC0 = VAL)
|
||||
#define fWRITE_LC1(VAL) (LC1 = VAL)
|
||||
#define fSET_LPCFG(VAL) (USR.LPCFG = VAL)
|
||||
#define fWRITE_P0(VAL) P0 = VAL;
|
||||
@ -121,7 +113,6 @@
|
||||
#define fEA_GPI(IMM) (EA = fREAD_GP() + IMM)
|
||||
#define fPM_I(REG, IMM) (REG = REG + IMM)
|
||||
#define fPM_M(REG, MVAL) (REG = REG + MVAL)
|
||||
#define fWRITE_NPC(VAL) (PC = VAL)
|
||||
|
||||
/* Unary operators */
|
||||
#define fROUND(A) (A + 0x8000)
|
||||
|
@ -185,9 +185,6 @@ void imm_print(Context *c, YYLTYPE *locp, HexImm *imm)
|
||||
case IMM_PC:
|
||||
EMIT(c, "ctx->base.pc_next");
|
||||
break;
|
||||
case IMM_NPC:
|
||||
EMIT(c, "ctx->npc");
|
||||
break;
|
||||
case IMM_CONSTEXT:
|
||||
EMIT(c, "insn->extension_valid");
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user