[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/28] tcg: Make use of bswap flags in tcg_gen_qemu_st_*
From: |
Richard Henderson |
Subject: |
[PATCH 19/28] tcg: Make use of bswap flags in tcg_gen_qemu_st_* |
Date: |
Mon, 14 Jun 2021 01:37:51 -0700 |
By removing TCG_BSWAP_IZ we indicate that the input is
not zero-extended, and thus can remove an explicit extend.
By removing TCG_BSWAP_OZ, we allow the implementation to
leave high bits set, which will be ignored by the store.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg-op.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 702da7afb7..5dbcd1b0cf 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -2915,8 +2915,7 @@ void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg
idx, MemOp memop)
swap = tcg_temp_new_i32();
switch (memop & MO_SIZE) {
case MO_16:
- tcg_gen_ext16u_i32(swap, val);
- tcg_gen_bswap16_i32(swap, swap, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
+ tcg_gen_bswap16_i32(swap, val, 0);
break;
case MO_32:
tcg_gen_bswap32_i32(swap, val);
@@ -3013,12 +3012,10 @@ void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr,
TCGArg idx, MemOp memop)
swap = tcg_temp_new_i64();
switch (memop & MO_SIZE) {
case MO_16:
- tcg_gen_ext16u_i64(swap, val);
- tcg_gen_bswap16_i64(swap, swap, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
+ tcg_gen_bswap16_i64(swap, val, 0);
break;
case MO_32:
- tcg_gen_ext32u_i64(swap, val);
- tcg_gen_bswap32_i64(swap, swap, TCG_BSWAP_IZ | TCG_BSWAP_OZ);
+ tcg_gen_bswap32_i64(swap, val, 0);
break;
case MO_64:
tcg_gen_bswap64_i64(swap, val);
--
2.25.1
- [PATCH 09/28] tcg/ppc: Split out tcg_out_bswap64, (continued)
- [PATCH 09/28] tcg/ppc: Split out tcg_out_bswap64, Richard Henderson, 2021/06/14
- [PATCH 11/28] tcg/ppc: Use power10 byte-reverse instructions, Richard Henderson, 2021/06/14
- [PATCH 16/28] tcg: Handle new bswap flags during optimize, Richard Henderson, 2021/06/14
- [PATCH 15/28] tcg/tci: Support bswap flags, Richard Henderson, 2021/06/14
- [PATCH 20/28] target/arm: Improve REV32, Richard Henderson, 2021/06/14
- [PATCH 19/28] tcg: Make use of bswap flags in tcg_gen_qemu_st_*,
Richard Henderson <=
- [PATCH 25/28] target/mips: Fix gen_mxu_s32ldd_s32lddr, Richard Henderson, 2021/06/14
- [PATCH 27/28] tcg/aarch64: Unset TCG_TARGET_HAS_MEMORY_BSWAP, Richard Henderson, 2021/06/14
- [PATCH 12/28] tcg/s390: Support bswap flags, Richard Henderson, 2021/06/14
- [PATCH 21/28] target/arm: Improve vector REV, Richard Henderson, 2021/06/14
- [PATCH 23/28] target/i386: Improve bswap translation, Richard Henderson, 2021/06/14