[PATCH v2 19/76] target/avr: Drop R from trans_COM

2023-02-26 Thread Richard Henderson
This variable is not used, only allocated and freed. Signed-off-by: Richard Henderson --- target/avr/translate.c | 4 1 file changed, 4 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index e7f0e2bbe3..4f8112c3e6 100644 --- a/target/avr/translate.c +++ b/target/av

[PATCH v2 21/76] target/cris: Drop cris_alu_free_temps

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/cris/translate.c | 20 1 file changed, 20 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index a959b27373..76db745fe2 100644 --- a/target/cri

[PATCH v2 36/76] target/microblaze: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 54 --- 1 file changed, 54 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 037a652cb9..e

[PATCH v2 45/76] target/mips: Fix trans_mult_acc return

2023-02-26 Thread Richard Henderson
Success from trans_* subroutines should be true. Fixes: 5fa38eedbd ("target/mips: Convert Vr54xx MACC* opcodes to decodetree") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/tcg/vr54xx_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 60/76] target/s390x: Drop tcg_temp_free from translate_vx.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate_vx.c.inc | 143 1 file changed, 143 deletions(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc index

[PATCH v2 37/76] target/mips: Drop tcg_temp_free from micromips_translate.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/micromips_translate.c.inc | 8 1 file changed, 8 deletions(-) diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/micromips_translate.c.inc index 63289

[PATCH v2 52/76] target/riscv: Drop temp_new

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Replace the few uses with tcg_temp_new. Reviewed-by: Weiwei Li Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/riscv/translate.c

[PATCH v2 46/76] target/mips: Drop tcg_temp_free from vr54xx_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/vr54xx_translate.c | 4 1 file changed, 4 deletions(-) diff --git a/target/mips/tcg/vr54xx_translate.c b/target/mips/tcg/vr54xx_translate.c index a7d241e4e7..804672f84c 100644

[PATCH v4 07/31] tcg: Add liveness_pass_0

2023-02-26 Thread Richard Henderson
Attempt to reduce the lifetime of TEMP_TB. Signed-off-by: Richard Henderson --- tcg/tcg.c | 70 +++ 1 file changed, 70 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 7ee935701a..6646770268 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -285

[PATCH v2 29/76] target/hppa: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 93 + 1 file changed, 1 insertion(+), 92 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index cee960949

[PATCH v4 14/31] tcg: Use tcg_constant_ptr in do_dup

2023-02-26 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index a10d406bba..877b0b659b 100644 --- a/tcg/tcg-op-gvec.c

[PATCH v2 72/76] target/xtensa: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Reviewed-by: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 107 -- 1 file changed, 107 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c

[PATCH 21/70] target/hppa: Avoid use of tcg_const_i32 throughout

2023-02-26 Thread Richard Henderson
All uses were read-write, so replace with a new allocation and initialization. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3ea50d0c

[PATCH v4 17/31] tcg: Don't re-use TEMP_TB temporaries

2023-02-26 Thread Richard Henderson
Reusing TEMP_TB interferes with detecting whether the temp can be adjusted to TEMP_EBB. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/tcg.c | 101 -- 2 files changed, 53 insertions(+), 50 deletions(-) diff --git a/includ

[PATCH 32/70] target/mips: Avoid tcg_const_tl in gen_r6_ld

2023-02-26 Thread Richard Henderson
Allocate a separate temp for modification. Signed-off-by: Richard Henderson --- target/mips/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 5c5660da5a..bec0a26c83 100644 --- a/target/mips/tcg/

[PATCH 07/70] target/arm: Avoid tcg_const_ptr in gen_sve_{ldr,str}

2023-02-26 Thread Richard Henderson
This hides the implicit initialization of a variable. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 3ca60fb36b..92ab290106 100644 --- a/target

[PATCH v2 74/76] tracing: remove transform.py

2023-02-26 Thread Richard Henderson
This file, and a couple of uses, got left behind when the tcg stuff was removed from tracetool. Fixes: 126d4123c50a ("tracing: excise the tcg related from tracetool") Signed-off-by: Richard Henderson --- meson.build| 1 - scripts/tracetool/__init__.py | 23 - scripts/

[PATCH v2 42/76] target/mips: Drop tcg_temp_free from octeon_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/octeon_translate.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/target/mips/tcg/octeon_translate.c b/target/mips/tcg/octeon_translate.c index 6a207d2e7

[PATCH v4 27/31] target/ppc: Don't use tcg_temp_local_new

2023-02-26 Thread Richard Henderson
Since tcg_temp_new is now identical, use that. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/ppc/translate.c | 6 +++--- target/ppc/translate/spe-impl.c.inc | 8 target/ppc/translate/vmx-impl.c.inc | 4 ++-- 3 files changed, 9 insertions(+

[PATCH 33/70] target/mips: Avoid tcg_const_* throughout

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 4 +- target/mips/tcg/translate.c | 56 +++ target/mips/tcg/tx79_translate.c | 4 +- target/mips/tcg/micromips_translate.c.inc

[PATCH v2 41/76] target/mips: Drop tcg_temp_free from nanomips_translate.c.inc

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/nanomips_translate.c.inc | 127 ++- 1 file changed, 10 insertions(+), 117 deletions(-) diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/na

[PATCH v2 58/76] target/s390x: Use tcg_constant_* in translate_vx.c.inc

2023-02-26 Thread Richard Henderson
In most cases, this is a simple local allocate and free replaced by tcg_constant_*. In three cases, a variable temp was initialized with a constant value -- reorg to localize the constant. In gen_acc, this fixes a leak. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Signed-o

[PATCH v2 27/76] target/hexagon/idef-parser: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. This removes gen_rvalue_free, gen_rvalue_free_manual and free_variables, whose only purpose was to emit tcg_temp_free. Signed-off-by: Richard Henderson --- target/hexagon/idef-parser/README.rst | 8 -- target/hexagon/idef-parser

[PATCH 12/70] target/avr: Avoid use of tcg_const_i32 in SBIC, SBIS

2023-02-26 Thread Richard Henderson
The use of separate data/port variables is existing practice elsewhere, e.g. SBI, CBI. Signed-off-by: Richard Henderson --- target/avr/translate.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index b9506a8

[PATCH v4 16/31] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers

2023-02-26 Thread Richard Henderson
Here we are creating a temp whose value needs to be replaced, but always storing NULL into CPUState.plugin_mem_cbs. Use tcg_constant_ptr(0) explicitly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 8 ++-- 1 file changed, 2 insertions(+),

[PATCH v2 44/76] target/mips: Drop tcg_temp_free from tx79_translate.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/tx79_translate.c | 41 1 file changed, 41 deletions(-) diff --git a/target/mips/tcg/tx79_translate.c b/target/mips/tcg/tx79_translate.c index 4e479c2

[PATCH v2 20/76] target/avr: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/avr/translate.c | 228 - 1 file changed, 228 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index 4f8112c3e6..b9506a8d86 100

[PATCH 03/70] target/arm: Improve arm_rmode_to_sf

2023-02-26 Thread Richard Henderson
Use proper enumeration types for input and output. Use a const array to perform the mapping, with an assert that the input is valid. Signed-off-by: Richard Henderson --- target/arm/internals.h | 12 +--- target/arm/translate-mve.c | 2 +- target/arm/vfp_helper.c| 33

[PATCH 20/70] target/hppa: Avoid tcg_const_i64 in trans_fid_f

2023-02-26 Thread Richard Henderson
Use a C test instead of a pre-processor test for the id. Use tcg_constant_i64 instead of tcg_const_i64. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.

[PATCH v2 75/76] tcg: Create tcg/tcg-temp-internal.h

2023-02-26 Thread Richard Henderson
Move the tcg_temp_free_* and tcg_temp_ebb_new_* declarations and inlines to the new header. These are private to the implementation, and will prevent tcg_temp_free_* from creaping back into the guest front ends. Signed-off-by: Richard Henderson --- include/tcg/tcg-temp-internal.h | 83

[PATCH 05/70] target/arm: Create gen_set_rmode, gen_restore_rmode

2023-02-26 Thread Richard Henderson
Split out common subroutines for handing rounding mode changes during translation. Use tcg_constant_i32 and tcg_temp_new_i32 instead of tcg_const_i32. Signed-off-by: Richard Henderson --- target/arm/translate.h | 17 ++ target/arm/translate-a64.c | 47 +++

[PATCH v4 25/31] target/i386: Don't use tcg_temp_local_new

2023-02-26 Thread Richard Henderson
Since tcg_temp_new is now identical, use that. In some cases we can avoid a copy from A0 or T0. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/t

[PATCH 48/70] target/rx: Avoid tcg_const_i32 when new temp needed

2023-02-26 Thread Richard Henderson
These three cases use a constant as first input, and then overwrite the temp in the output. Separate them. Signed-off-by: Richard Henderson --- target/rx/translate.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c in

[PATCH 45/70] target/riscv: Avoid tcg_const_*

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/riscv/translate.c | 4 ++-- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/insn_trans/trans_rvzfh.c.inc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ri

[PATCH v2 00/76] tcg: Drop tcg_temp_free from translators

2023-02-26 Thread Richard Henderson
Based-on: 20230225085945.1798188-1-richard.hender...@linaro.org ("[PATCH v3 00/30] tcg: Simplify temporary usage") In the above patch set, we changed the lifetime of the temps allocated by the guest translators, and eliminated their reuse, so that we have the best chance of reducing their strength

[PATCH 53/70] target/sh4: Avoid tcg_const_i32

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/sh4/translate.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 70a45c26e8..97da8bce48 100644 --- a/target

[PATCH 26/70] target/m68k: Avoid tcg_const_i32 when modified

2023-02-26 Thread Richard Henderson
In several instances, a temp is initialized with a for use as a constant, and then subsequently used as an unrelated temp. Split them. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a

[PATCH 34/70] target/ppc: Split out gen_vx_vmul10

2023-02-26 Thread Richard Henderson
Move the body out of this large macro. Use tcg_constant_i64. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 95 +++-- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vm

[PATCH 51/70] target/s390x: Avoid tcg_const_i64

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 7969051ce9..32d61fc40d 100644 --- a/targ

[PATCH 36/70] target/ppc: Avoid tcg_const_i64 in do_vcntmb

2023-02-26 Thread Richard Henderson
Compute both partial results separately and accumulate at the end, instead of accumulating in the middle. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/ppc/translate/vmx-

[PATCH v4 29/31] exec/gen-icount: Don't use tcg_temp_local_new_i32

2023-02-26 Thread Richard Henderson
Since tcg_temp_new_i32 is now identical, use that. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/gen-icount.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h index 4d8b1f9ae5

[PATCH 64/70] target/xtensa: Avoid tcg_const_i32 in translate_l32r

2023-02-26 Thread Richard Henderson
Use addi on the addition side and tcg_constant_i32 on the other. Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index d727f9ffd8..41b84082de 100644 ---

[PATCH 16/70] target/hexagon/idef-parser: Use gen_tmp for LPCFG

2023-02-26 Thread Richard Henderson
The GET_USR_FIELD macro initializes the output, so the initial assignment of zero is discarded. This is the only use of get_tmp_value outside of parser-helper.c, so make it static. Signed-off-by: Richard Henderson --- target/hexagon/idef-parser/parser-helpers.h | 6 -- target/hexagon/idef-p

[PATCH 11/70] target/arm: Avoid tcg_const_ptr in handle_rev

2023-02-26 Thread Richard Henderson
Here it is not trivial to notice first initialization, so explicitly zero the temps. Use an array for the output, rather than separate tcg_rd/tcg_rd_hi variables. Fixes a bug by adding a missing clear_vec_high. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 26 ++

[PATCH v2 30/76] target/i386: Drop tcg_temp_free

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 41 target/i386/tcg/decode-new.c.inc | 15 target/i386/tcg/emit.c.inc | 6 - 3 files changed, 62 deletions(

[PATCH v4 08/31] tcg: Remove TEMP_NORMAL

2023-02-26 Thread Richard Henderson
TEMP_NORMAL is a subset of TEMP_EBB. Promote single basic block temps to single extended basic block. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 -- tcg/tcg.c | 19 +++ 2 files changed, 3 insertions(+), 18 deletions(-

[PATCH 25/70] target/m68k: Use tcg_constant_i32 in gen_ea_mode

2023-02-26 Thread Richard Henderson
Return a constant for an immediate input. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 7a87811427..7435e51acc 100644 --- a/target/m68k/translate.c +++ b/tar

[PATCH v4 30/31] tcg: Remove tcg_temp_local_new_*, tcg_const_local_*

2023-02-26 Thread Richard Henderson
These symbols are now unused. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 2 -- include/tcg/tcg.h| 28 tcg/tcg.c| 16 3 files changed, 46 deletions(-) diff --git a/include/tcg/tcg

[PATCH v2 67/76] target/sparc: Remove egress label in disas_sparc_context

2023-02-26 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/sparc/translate.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bdf464f802..560fb32e28 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @

[PATCH 67/70] target/xtensa: Avoid tcg_const_i32

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index f906ba7ed5..0cf3075649 100644 --- a/target/xtensa/transl

[PATCH 37/70] target/ppc: Avoid tcg_const_* in vmx-impl.c.inc

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index ca27c11d87..112233b5

[PATCH v4 01/31] tcg: Adjust TCGContext.temps_in_use check

2023-02-26 Thread Richard Henderson
Change the temps_in_use check to use assert not fprintf. Move the assert for double-free before the check for count, since that is the more immediate problem. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 12 +--- 1 file changed, 5 insertions(+), 7

[PATCH 28/70] target/m68k: Avoid tcg_const_* throughout

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 158 1 file changed, 77 insertions(+), 81 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 3d97aaf578..e16c608ef8 1

[PATCH 40/70] target/ppc: Avoid tcg_const_* in fp-impl.c.inc

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/fp-impl.c.inc | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/fp-impl.c.inc b/target/ppc/translate/fp-impl.c.inc index d5d88e7d49..57d

[PATCH 04/70] target/arm: Consistently use ARMFPRounding during translation

2023-02-26 Thread Richard Henderson
In preparation for extracting new helpers, ensure that the rounding mode is represented as ARMFPRounding and not FloatRoundMode. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 16 target/arm/translate-sve.c | 18 +- target/arm/translate-vfp.c |

[PATCH 17/70] target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign

2023-02-26 Thread Richard Henderson
The allocation is immediately followed by tcg_gen_mov_i32, so the initial assignment of zero is discarded. Signed-off-by: Richard Henderson --- target/hexagon/idef-parser/parser-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/idef-parser/parser-helper

[PATCH v2 71/76] target/xtensa: Drop reset_sar_tracker

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Remove sar_m32_allocated, as sar_m32 non-null is equivalent. Reviewed-by: Max Filippov Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/t

[PATCH v2 76/76] docs/devel/tcg-ops: Drop recommendation to free temps

2023-02-26 Thread Richard Henderson
Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- docs/devel/tcg-ops.rst | 4 1 file changed, 4 deletions(-) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 561c416574..f3f451b77f 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@

[PATCH 09/70] target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn

2023-02-26 Thread Richard Henderson
It is easy enough to use mov instead of or-with-zero and relying on the optimizer to fold away the or. Use an array for the output, rather than separate tcg_res{l,h} variables. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 41 +++--- 1 file cha

[PATCH v4 11/31] tcg: Add tcg_gen_movi_ptr

2023-02-26 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 839d91c0c7..66b1461caa 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -1285,6

[PATCH 41/70] target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc

2023-02-26 Thread Richard Henderson
All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/power8-pmu-regs.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/power8-pmu-regs.c.inc b/target/ppc/power8-pmu-regs.c.inc index 42f2cd04a1..d900e13cad 100644 --- a/target/ppc/

[PATCH 22/70] target/i386: Simplify POPF

2023-02-26 Thread Richard Henderson
Compute the eflags write mask separately, leaving one call to the helper. Use tcg_constant_i32. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 55 - 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/target/i386/tcg/translate.

[PATCH v4 24/31] target/hppa: Don't use tcg_temp_local_new

2023-02-26 Thread Richard Henderson
This wasn't actually used at all, just some unused macro re-definitions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 0102cf451b..cee

[PATCH v2 59/76] target/s390x: Drop free_compare

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Remove the g1 and g2 members of DisasCompare, as they were used to track which temps needed to be freed. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 46 +--- 1 file changed, 1 inse

[PATCH 49/70] target/rx: Avoid tcg_const_i32

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/rx/translate.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 6b218d5d5e..70fad98e93 100644 --- a/tar

[PATCH 06/70] target/arm: Improve trans_BFCI

2023-02-26 Thread Richard Henderson
Reorg temporary usage so that we can use tcg_constant_i32. tcg_gen_deposit_i32 already has a width == 32 special case, so remove the check here. Signed-off-by: Richard Henderson --- target/arm/translate.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/target/ar

[PATCH v2 43/76] target/mips: Drop tcg_temp_free from translate_addr_const.c

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries. Signed-off-by: Richard Henderson --- target/mips/tcg/translate_addr_const.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/target/mips/tcg/translate_addr_const.c b/target/mips/tcg/translate_addr_const.c index 96f483418e..a51

[PATCH 70/70] tcg: Drop tcg_const_*

2023-02-26 Thread Richard Henderson
These functions are no longer used. Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 4 include/tcg/tcg.h| 6 -- tcg/tcg.c| 16 3 files changed, 26 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 353d430a63..1d68

[PATCH 46/70] target/rx: Use tcg_gen_abs_i32

2023-02-26 Thread Richard Henderson
Remove the local definition of rx_abs. Signed-off-by: Richard Henderson --- target/rx/translate.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 6624414739..998e6e0b7e 100644 --- a/target/rx/translate.c +++ b/t

[PATCH 39/70] target/ppc: Avoid tcg_const_* in vsx-impl.c.inc

2023-02-26 Thread Richard Henderson
All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/vsx-impl.c.inc | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc index

[PATCH 59/70] target/tricore: Use setcondi instead of explicit allocation

2023-02-26 Thread Richard Henderson
This removes the only use of temp. Signed-off-by: Richard Henderson --- target/tricore/translate.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index d5129f22f5..6b7b876808 100644 --- a/target/tricore/translate

[PATCH v2 51/76] target/riscv: Drop ftemp_new

2023-02-26 Thread Richard Henderson
Translators are no longer required to free tcg temporaries, therefore there's no need to record temps for later freeing. Replace the few uses with tcg_temp_new_i64. Reviewed-by: Weiwei Li Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/riscv/translate.c | 24 ++

[PATCH v4 18/31] tcg: Change default temp lifetime to TEMP_TB

2023-02-26 Thread Richard Henderson
Guest front-ends now get temps that span the lifetime of the translation block by default, which avoids accidentally using the temp across branches and invalidating the data. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 8 1 file changed,

[PATCH 42/70] target/ppc: Rewrite trans_ADDG6S

2023-02-26 Thread Richard Henderson
Compute all carry bits in parallel instead of a loop. Signed-off-by: Richard Henderson --- target/ppc/translate/fixedpoint-impl.c.inc | 44 +++--- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/target/ppc/translate/fixedpoint-impl.c.inc b/target/ppc/translate/fi

<    1   2