mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
Hexagon (target/hexagon) Short-circuit packet predicate writes
In certain cases, we can avoid the overhead of writing to hex_new_pred_value and write directly to hex_pred. We consider predicate reads/writes when computing ctx->need_commit. The get_result_pred() function uses this field to decide between hex_new_pred_value and hex_pred. Then, we can early-exit from gen_pred_writes. Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230427230012.3800327-13-tsimpson@quicinc.com>
This commit is contained in:
parent
d54c56156f
commit
455e169d7c
3 changed files with 24 additions and 6 deletions
|
@ -386,6 +386,14 @@ static bool need_commit(DisasContext *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
/* Check for overlap between predicate reads and writes */
|
||||
for (int i = 0; i < ctx->preg_log_idx; i++) {
|
||||
int pnum = ctx->preg_log[i];
|
||||
if (test_bit(pnum, ctx->pregs_read)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -503,7 +511,7 @@ static void gen_start_packet(DisasContext *ctx)
|
|||
* Preload the predicated pred registers into hex_new_pred_value[pred_num]
|
||||
* Only endloop instructions conditionally write to pred registers
|
||||
*/
|
||||
if (pkt->pkt_has_endloop) {
|
||||
if (ctx->need_commit && pkt->pkt_has_endloop) {
|
||||
for (int i = 0; i < ctx->preg_log_idx; i++) {
|
||||
int pred_num = ctx->preg_log[i];
|
||||
tcg_gen_mov_tl(hex_new_pred_value[pred_num], hex_pred[pred_num]);
|
||||
|
@ -622,8 +630,8 @@ static void gen_reg_writes(DisasContext *ctx)
|
|||
|
||||
static void gen_pred_writes(DisasContext *ctx)
|
||||
{
|
||||
/* Early exit if the log is empty */
|
||||
if (!ctx->preg_log_idx) {
|
||||
/* Early exit if not needed or the log is empty */
|
||||
if (!ctx->need_commit || !ctx->preg_log_idx) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue