diff mbox series

[v4,158/163] tcg: Stash MemOp size in TCGOP_FLAGS

Message ID 20250415192515.232910-159-richard.henderson@linaro.org
State New
Headers show
Series tcg: Convert to TCGOutOp structures | expand

Commit Message

Richard Henderson April 15, 2025, 7:25 p.m. UTC
This will enable removing INDEX_op_qemu_st8_*_i32,
by exposing the operand size to constraint selection.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg-op-ldst.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé April 16, 2025, 6:55 a.m. UTC | #1
On 15/4/25 21:25, Richard Henderson wrote:
> This will enable removing INDEX_op_qemu_st8_*_i32,
> by exposing the operand size to constraint selection.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/tcg-op-ldst.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Pierrick Bouvier April 16, 2025, 8:54 p.m. UTC | #2
On 4/15/25 12:25, Richard Henderson wrote:
> This will enable removing INDEX_op_qemu_st8_*_i32,
> by exposing the operand size to constraint selection.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/tcg-op-ldst.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c
> index 73838e2701..b0872d6637 100644
> --- a/tcg/tcg-op-ldst.c
> +++ b/tcg/tcg-op-ldst.c
> @@ -91,11 +91,15 @@ static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st)
>   static void gen_ldst(TCGOpcode opc, TCGType type, TCGTemp *vl, TCGTemp *vh,
>                        TCGTemp *addr, MemOpIdx oi)
>   {
> +    TCGOp *op;
> +
>       if (vh) {
> -        tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), temp_arg(addr), oi);
> +        op = tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh),
> +                         temp_arg(addr), oi);
>       } else {
> -        tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi);
> +        op = tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi);
>       }
> +    TCGOP_FLAGS(op) = get_memop(oi) & MO_SIZE;
>   }
>   
>   static void gen_ldst_i64(TCGOpcode opc, TCGv_i64 v, TCGTemp *addr, MemOpIdx oi)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c
index 73838e2701..b0872d6637 100644
--- a/tcg/tcg-op-ldst.c
+++ b/tcg/tcg-op-ldst.c
@@ -91,11 +91,15 @@  static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st)
 static void gen_ldst(TCGOpcode opc, TCGType type, TCGTemp *vl, TCGTemp *vh,
                      TCGTemp *addr, MemOpIdx oi)
 {
+    TCGOp *op;
+
     if (vh) {
-        tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), temp_arg(addr), oi);
+        op = tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh),
+                         temp_arg(addr), oi);
     } else {
-        tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi);
+        op = tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi);
     }
+    TCGOP_FLAGS(op) = get_memop(oi) & MO_SIZE;
 }
 
 static void gen_ldst_i64(TCGOpcode opc, TCGv_i64 v, TCGTemp *addr, MemOpIdx oi)