mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:17 +00:00
tcg: Introduce tcg_zero_i128()
Extract tcg_zero_i128() helper for re-use. Inspired-by: James Hilliard <james.hilliard1@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260520121644.10835-1-philmd@linaro.org> [rth: Move the function to tcg-op.c] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -18,6 +18,8 @@ TCGv_vaddr tcg_constant_vaddr(uintptr_t val);
|
||||
TCGv_vec tcg_constant_vec(TCGType type, unsigned vece, int64_t val);
|
||||
TCGv_vec tcg_constant_vec_matching(TCGv_vec match, unsigned vece, int64_t val);
|
||||
|
||||
TCGv_i128 tcg_zero_i128(void);
|
||||
|
||||
TCGv_i32 tcg_temp_new_i32(void);
|
||||
TCGv_i64 tcg_temp_new_i64(void);
|
||||
TCGv_ptr tcg_temp_new_ptr(void);
|
||||
|
||||
@@ -4804,13 +4804,10 @@ static bool do_STG(DisasContext *s, arg_ldst_tag *a, bool is_zero, bool is_pair)
|
||||
|
||||
if (is_zero) {
|
||||
TCGv_i64 clean_addr = clean_data_tbi(s, addr);
|
||||
TCGv_i64 zero64 = tcg_constant_i64(0);
|
||||
TCGv_i128 zero128 = tcg_temp_new_i128();
|
||||
TCGv_i128 zero128 = tcg_zero_i128();
|
||||
int mem_index = get_mem_index(s);
|
||||
MemOp mop = finalize_memop(s, MO_128 | MO_ALIGN);
|
||||
|
||||
tcg_gen_concat_i64_i128(zero128, zero64, zero64);
|
||||
|
||||
/* This is 1 or 2 atomic 16-byte operations. */
|
||||
tcg_gen_qemu_st_i128(zero128, clean_addr, mem_index, mop);
|
||||
if (is_pair) {
|
||||
|
||||
10
tcg/tcg-op.c
10
tcg/tcg-op.c
@@ -2475,6 +2475,16 @@ void tcg_gen_concat_i64_i128(TCGv_i128 ret, TCGv_i64 lo, TCGv_i64 hi)
|
||||
tcg_gen_mov_i64(TCGV128_HIGH(ret), hi);
|
||||
}
|
||||
|
||||
TCGv_i128 tcg_zero_i128(void)
|
||||
{
|
||||
TCGv_i64 zero64 = tcg_constant_i64(0);
|
||||
TCGv_i128 zero128 = tcg_temp_new_i128();
|
||||
|
||||
tcg_gen_concat_i64_i128(zero128, zero64, zero64);
|
||||
|
||||
return zero128;
|
||||
}
|
||||
|
||||
void tcg_gen_mov_i128(TCGv_i128 dst, TCGv_i128 src)
|
||||
{
|
||||
if (dst != src) {
|
||||
|
||||
Reference in New Issue
Block a user