diff options
| author | Taylor Simpson <tsimpson@quicinc.com> | 2023-04-27 15:59:59 -0700 |
|---|---|---|
| committer | Taylor Simpson <tsimpson@quicinc.com> | 2023-05-18 12:40:52 -0700 |
| commit | 25e1d87d1041a27c1f34480b53059faeb6600fef (patch) | |
| tree | 576b6915c7e2745fabc87ca670c53b42fa6fab5b /target/hexagon/genptr.c | |
| parent | d24f0b2b89d0f4f595a1b62c00c4c951d1d5fce9 (diff) | |
| download | focaccia-qemu-25e1d87d1041a27c1f34480b53059faeb6600fef.tar.gz focaccia-qemu-25e1d87d1041a27c1f34480b53059faeb6600fef.zip | |
Hexagon (target/hexagon) Clean up pred_written usage
Only endloop instructions will conditionally write to a predicate. When there is an endloop instruction, we preload the values into new_pred_value. The only place pred_written is needed is when HEX_DEBUG is on. We remove the last use of check_for_attrib. However, new uses will be introduced later in this series, so we mark it with G_GNUC_UNUSED. Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230427230012.3800327-9-tsimpson@quicinc.com>
Diffstat (limited to 'target/hexagon/genptr.c')
| -rw-r--r-- | target/hexagon/genptr.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c index dac62b90a6..9bbaca6300 100644 --- a/target/hexagon/genptr.c +++ b/target/hexagon/genptr.c @@ -137,7 +137,9 @@ void gen_log_pred_write(DisasContext *ctx, int pnum, TCGv val) tcg_gen_and_tl(hex_new_pred_value[pnum], hex_new_pred_value[pnum], base_val); } - tcg_gen_ori_tl(hex_pred_written, hex_pred_written, 1 << pnum); + if (HEX_DEBUG) { + tcg_gen_ori_tl(hex_pred_written, hex_pred_written, 1 << pnum); + } set_bit(pnum, ctx->pregs_written); } @@ -826,15 +828,13 @@ static void gen_endloop0(DisasContext *ctx) /* * if (lpcfg == 1) { - * hex_new_pred_value[3] = 0xff; - * hex_pred_written |= 1 << 3; + * p3 = 0xff; * } */ TCGLabel *label1 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_NE, lpcfg, 1, label1); { - tcg_gen_movi_tl(hex_new_pred_value[3], 0xff); - tcg_gen_ori_tl(hex_pred_written, hex_pred_written, 1 << 3); + gen_log_pred_write(ctx, 3, tcg_constant_tl(0xff)); } gen_set_label(label1); @@ -903,14 +903,12 @@ static void gen_endloop01(DisasContext *ctx) /* * if (lpcfg == 1) { - * hex_new_pred_value[3] = 0xff; - * hex_pred_written |= 1 << 3; + * p3 = 0xff; * } */ tcg_gen_brcondi_tl(TCG_COND_NE, lpcfg, 1, label1); { - tcg_gen_movi_tl(hex_new_pred_value[3], 0xff); - tcg_gen_ori_tl(hex_pred_written, hex_pred_written, 1 << 3); + gen_log_pred_write(ctx, 3, tcg_constant_tl(0xff)); } gen_set_label(label1); |