diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-02-22 09:36:21 -0800 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-04-28 13:40:15 -0700 |
| commit | 2225fa242c5d95c5cd83bb6f8566d43dd7a00211 (patch) | |
| tree | 8a84d063b476b6714c836fe8dd88e3e49c5938c0 /tcg/tcg-op.c | |
| parent | 5500bd9e2ec5ec85858fcca06c04a57337aa14c7 (diff) | |
| download | focaccia-qemu-2225fa242c5d95c5cd83bb6f8566d43dd7a00211.tar.gz focaccia-qemu-2225fa242c5d95c5cd83bb6f8566d43dd7a00211.zip | |
tcg: Use extract2 for cross-word 64-bit extract on 32-bit host
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg-op.c')
| -rw-r--r-- | tcg/tcg-op.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index fec6d678a2..f68c4f9702 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2804,9 +2804,18 @@ void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg, tcg_gen_movi_i32(TCGV_HIGH(ret), 0); return; } - /* The field is split across two words. One double-word - shift is better than two double-word shifts. */ - goto do_shift_and; + + /* The field is split across two words. */ + tcg_gen_extract2_i32(TCGV_LOW(ret), TCGV_LOW(arg), + TCGV_HIGH(arg), ofs); + if (len <= 32) { + tcg_gen_extract_i32(TCGV_LOW(ret), TCGV_LOW(ret), 0, len); + tcg_gen_movi_i32(TCGV_HIGH(ret), 0); + } else { + tcg_gen_extract_i32(TCGV_HIGH(ret), TCGV_HIGH(arg), + ofs, len - 32); + } + return; } if (TCG_TARGET_extract_valid(TCG_TYPE_I64, ofs, len)) { @@ -2844,7 +2853,6 @@ void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg, so that we get ext8u, ext16u, and ext32u. */ switch (len) { case 1 ... 8: case 16: case 32: - do_shift_and: tcg_gen_shri_i64(ret, arg, ofs); tcg_gen_andi_i64(ret, ret, (1ull << len) - 1); break; |