Browse Source

Hexagon (target/hexagon) s/gen_log_pred_write/gen_pred_write

The function doesn't "log" anything, it just generates the write

Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
pull/316/head
Taylor Simpson 5 months ago
committed by Brian Cain
parent
commit
b68bcbf6ea
  1. 4
      target/hexagon/gen_tcg.h
  2. 14
      target/hexagon/genptr.c
  3. 2
      target/hexagon/genptr.h
  4. 4
      target/hexagon/hex_common.py
  5. 2
      target/hexagon/idef-parser/parser-helpers.c

4
target/hexagon/gen_tcg.h

@ -599,7 +599,7 @@
TCGv p0 = tcg_temp_new(); \
gen_helper_cabacdecbin_pred(p0, RssV, RttV); \
gen_helper_cabacdecbin_val(RddV, RssV, RttV); \
gen_log_pred_write(ctx, 0, p0); \
gen_pred_write(ctx, 0, p0); \
} while (0)
/*
@ -914,7 +914,7 @@
do { \
TCGv p0 = tcg_temp_new(); \
gen_comparei(TCG_COND_EQ, p0, RsV, uiV); \
gen_log_pred_write(ctx, 0, p0); \
gen_pred_write(ctx, 0, p0); \
} while (0)
#define fGEN_TCG_J2_jump(SHORTCODE) \

14
target/hexagon/genptr.c

@ -120,7 +120,7 @@ TCGv get_result_pred(DisasContext *ctx, int pnum)
}
}
void gen_log_pred_write(DisasContext *ctx, int pnum, TCGv val)
void gen_pred_write(DisasContext *ctx, int pnum, TCGv val)
{
TCGv pred = get_result_pred(ctx, pnum);
TCGv base_val = tcg_temp_new();
@ -215,7 +215,7 @@ static void gen_write_p3_0(DisasContext *ctx, TCGv control_reg)
TCGv hex_p8 = tcg_temp_new();
for (int i = 0; i < NUM_PREGS; i++) {
tcg_gen_extract_tl(hex_p8, control_reg, i * 8, 8);
gen_log_pred_write(ctx, i, hex_p8);
gen_pred_write(ctx, i, hex_p8);
}
}
@ -557,7 +557,7 @@ static void gen_ploopNsr(DisasContext *ctx, int N, TCGv RsV, int riV)
tcg_gen_mov_tl(get_result_gpr(ctx, HEX_REG_LC0), RsV);
tcg_gen_movi_tl(get_result_gpr(ctx, HEX_REG_SA0), ctx->pkt->pc + riV);
gen_set_usr_fieldi(ctx, USR_LPCFG, N);
gen_log_pred_write(ctx, 3, tcg_constant_tl(0));
gen_pred_write(ctx, 3, tcg_constant_tl(0));
}
static void gen_ploopNsi(DisasContext *ctx, int N, int count, int riV)
@ -597,7 +597,7 @@ static void gen_cmpnd_cmp_jmp(DisasContext *ctx,
if (ctx->insn->part1) {
TCGv pred = tcg_temp_new();
gen_compare(cond1, pred, arg1, arg2);
gen_log_pred_write(ctx, pnum, pred);
gen_pred_write(ctx, pnum, pred);
} else {
TCGv pred = tcg_temp_new();
tcg_gen_mov_tl(pred, ctx->new_pred_value[pnum]);
@ -654,7 +654,7 @@ static void gen_cmpnd_tstbit0_jmp(DisasContext *ctx,
TCGv pred = tcg_temp_new();
tcg_gen_andi_tl(pred, arg, 1);
gen_8bitsof(pred, pred);
gen_log_pred_write(ctx, pnum, pred);
gen_pred_write(ctx, pnum, pred);
} else {
TCGv pred = tcg_temp_new();
tcg_gen_mov_tl(pred, ctx->new_pred_value[pnum]);
@ -834,7 +834,7 @@ static void gen_endloop0(DisasContext *ctx)
TCGLabel *label1 = gen_new_label();
tcg_gen_brcondi_tl(TCG_COND_NE, lpcfg, 1, label1);
{
gen_log_pred_write(ctx, 3, tcg_constant_tl(0xff));
gen_pred_write(ctx, 3, tcg_constant_tl(0xff));
}
gen_set_label(label1);
@ -908,7 +908,7 @@ static void gen_endloop01(DisasContext *ctx)
*/
tcg_gen_brcondi_tl(TCG_COND_NE, lpcfg, 1, label1);
{
gen_log_pred_write(ctx, 3, tcg_constant_tl(0xff));
gen_pred_write(ctx, 3, tcg_constant_tl(0xff));
}
gen_set_label(label1);

2
target/hexagon/genptr.h

@ -37,7 +37,7 @@ TCGv gen_read_reg(TCGv result, int num);
TCGv gen_read_preg(TCGv pred, uint8_t num);
TCGv get_result_gpr(DisasContext *ctx, int rnum);
TCGv get_result_pred(DisasContext *ctx, int pnum);
void gen_log_pred_write(DisasContext *ctx, int pnum, TCGv val);
void gen_pred_write(DisasContext *ctx, int pnum, TCGv val);
void gen_set_usr_field(DisasContext *ctx, int field, TCGv val);
void gen_set_usr_fieldi(DisasContext *ctx, int field, int x);
void gen_set_usr_field_if(DisasContext *ctx, int field, TCGv val);

4
target/hexagon/hex_common.py

@ -571,7 +571,7 @@ class PredDest(Register, Single, Dest):
"""))
def log_write(self, f, tag):
f.write(code_fmt(f"""\
gen_log_pred_write(ctx, {self.reg_num}, {self.reg_tcg()});
gen_pred_write(ctx, {self.reg_num}, {self.reg_tcg()});
"""))
def analyze_write(self, f, tag, regno):
f.write(code_fmt(f"""\
@ -608,7 +608,7 @@ class PredReadWrite(Register, Single, ReadWrite):
"""))
def log_write(self, f, tag):
f.write(code_fmt(f"""\
gen_log_pred_write(ctx, {self.reg_num}, {self.reg_tcg()});
gen_pred_write(ctx, {self.reg_num}, {self.reg_tcg()});
"""))
def analyze_read(self, f, regno):
f.write(code_fmt(f"""\

2
target/hexagon/idef-parser/parser-helpers.c

@ -1713,7 +1713,7 @@ void gen_pred_assign(Context *c, YYLTYPE *locp, HexValue *left_pred,
/* Extract first 8 bits, and store new predicate value */
OUT(c, locp, "tcg_gen_andi_i32(", left_pred, ", ", &r, ", 0xff);\n");
if (is_direct) {
OUT(c, locp, "gen_log_pred_write(ctx, ", pred_id, ", ", left_pred,
OUT(c, locp, "gen_pred_write(ctx, ", pred_id, ", ", left_pred,
");\n");
}
}

Loading…
Cancel
Save