target/arm: Use tcg_constant in {incr, wrap}_last_active
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20220426163043.100432-40-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
e152b48b07
commit
4b308bd5f7
@ -2793,11 +2793,9 @@ static void incr_last_active(DisasContext *s, TCGv_i32 last, int esz)
|
|||||||
if (is_power_of_2(vsz)) {
|
if (is_power_of_2(vsz)) {
|
||||||
tcg_gen_andi_i32(last, last, vsz - 1);
|
tcg_gen_andi_i32(last, last, vsz - 1);
|
||||||
} else {
|
} else {
|
||||||
TCGv_i32 max = tcg_const_i32(vsz);
|
TCGv_i32 max = tcg_constant_i32(vsz);
|
||||||
TCGv_i32 zero = tcg_const_i32(0);
|
TCGv_i32 zero = tcg_constant_i32(0);
|
||||||
tcg_gen_movcond_i32(TCG_COND_GEU, last, last, max, zero, last);
|
tcg_gen_movcond_i32(TCG_COND_GEU, last, last, max, zero, last);
|
||||||
tcg_temp_free_i32(max);
|
|
||||||
tcg_temp_free_i32(zero);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2809,11 +2807,9 @@ static void wrap_last_active(DisasContext *s, TCGv_i32 last, int esz)
|
|||||||
if (is_power_of_2(vsz)) {
|
if (is_power_of_2(vsz)) {
|
||||||
tcg_gen_andi_i32(last, last, vsz - 1);
|
tcg_gen_andi_i32(last, last, vsz - 1);
|
||||||
} else {
|
} else {
|
||||||
TCGv_i32 max = tcg_const_i32(vsz - (1 << esz));
|
TCGv_i32 max = tcg_constant_i32(vsz - (1 << esz));
|
||||||
TCGv_i32 zero = tcg_const_i32(0);
|
TCGv_i32 zero = tcg_constant_i32(0);
|
||||||
tcg_gen_movcond_i32(TCG_COND_LT, last, last, zero, max, last);
|
tcg_gen_movcond_i32(TCG_COND_LT, last, last, zero, max, last);
|
||||||
tcg_temp_free_i32(max);
|
|
||||||
tcg_temp_free_i32(zero);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user