mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tcg: Expand fallback sub2 with 32-bit operations
No need to expand to i64 to perform the subtract. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
+9
-8
@@ -1123,14 +1123,15 @@ void tcg_gen_sub2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al,
|
||||
if (TCG_TARGET_HAS_sub2_i32) {
|
||||
tcg_gen_op6_i32(INDEX_op_sub2_i32, rl, rh, al, ah, bl, bh);
|
||||
} else {
|
||||
TCGv_i64 t0 = tcg_temp_ebb_new_i64();
|
||||
TCGv_i64 t1 = tcg_temp_ebb_new_i64();
|
||||
tcg_gen_concat_i32_i64(t0, al, ah);
|
||||
tcg_gen_concat_i32_i64(t1, bl, bh);
|
||||
tcg_gen_sub_i64(t0, t0, t1);
|
||||
tcg_gen_extr_i64_i32(rl, rh, t0);
|
||||
tcg_temp_free_i64(t0);
|
||||
tcg_temp_free_i64(t1);
|
||||
TCGv_i32 t0 = tcg_temp_ebb_new_i32();
|
||||
TCGv_i32 t1 = tcg_temp_ebb_new_i32();
|
||||
tcg_gen_sub_i32(t0, al, bl);
|
||||
tcg_gen_setcond_i32(TCG_COND_LTU, t1, al, bl);
|
||||
tcg_gen_sub_i32(rh, ah, bh);
|
||||
tcg_gen_sub_i32(rh, rh, t1);
|
||||
tcg_gen_mov_i32(rl, t0);
|
||||
tcg_temp_free_i32(t0);
|
||||
tcg_temp_free_i32(t1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user