[PATCH v4 000/101] tcg: Generic expansion of most operations

Richard Henderson posted 101 patches 1 week, 2 days ago
accel/tcg/tcg-runtime.h                    |   13 -
include/qemu/compiler.h                    |   15 +
include/tcg/tcg-op-common.h                |  579 ++--
include/tcg/tcg-op-mem.h                   |   20 +-
include/tcg/tcg-temp-internal.h            |    2 +
include/tcg/tcg.h                          |   59 +-
tcg/tcg-internal.h                         |   43 +-
include/tcg/tcg-op-def.h.inc               |   84 +
accel/tcg/tcg-runtime.c                    |   58 -
tcg/tcg-op-gvec.c                          |   41 -
tcg/tcg-op-ldst.c                          |   54 -
tcg/tcg-op.c                               | 3086 ++++++++------------
tcg/tcg.c                                  |  214 +-
target/ppc/translate/fixedpoint-impl.c.inc |    4 +-
14 files changed, 1735 insertions(+), 2537 deletions(-)
create mode 100644 include/tcg/tcg-op-def.h.inc
[PATCH v4 000/101] tcg: Generic expansion of most operations
Posted by Richard Henderson 1 week, 2 days ago
The driver here is the boilerplate I needed to write for the
recent lea opcode addition.

This eliminates the majority of the code duplication between
the _i32 and _i64 expanders.  What remains are those expanders
that truly differ between the two widths, or that are only
present for one width.

Of course, due to touching most opcode expansion, I noticed a
few cleanups and improvements in the process.

Changes for v4:
  - Introduce the use of g_autoptr() for TCGTemp.
  - Convert the host memory operations.

Changes for v3:
  - Introduce and use QEMU_*_NONNULL.

Changes for v2:
  - Use DEF<n> instead of DEF_<fmt>, which requires even less boilerplate.
  - Convert a few more operations which are made feasable by the above.

Requires 
  20260914220000.1757165-1-richard.henderson@linaro.org
  ("[PATCH] target/i386/tcg: Always initialize CCPrepare.reg")
  20260914230901.1781309-1-richard.henderson@linaro.org
  ("[PATCH 0/6] target/mips/tcg: MXU fixes and cleanups")
to build cleanly, as the nonnull annotations break them.

https://gitlab.com/rth7680/qemu/-/tree/tcg-regen


r~


Richard Henderson (101):
  include/qemu/compiler: Add QEMU_*_NONNULL attributes
  include/qemu/compiler: Define QEMU_ALIAS
  tcg: Annontate functions in tcg.h with QEMU_*_NONNULL
  tcg: Annontate functions in tcg-op-mem.h with QEMU_*_NONNULL
  tcg: Annontate functions in tcg-internal.h with QEMU_*_NONNULL
  tcg: Use QEMU_ALIAS to define most tcg_gen_*_ptr
  tcg: Use QEMU_*_NONULL with all tcg_gen_*_ptr
  tcg: Prepare for easy temp lifetimes
  tcg: Generic expansion of tcg_gen_mov_*
  tcg: Generic expansion of tcg_gen_movi_*
  tcg: Generic expansion of tcg_gen_discard_*
  tcg: Generic expansion of tcg_gen_add_*
  tcg: Generic expansion of tcg_gen_addi_*
  tcg: Generic expansion of tcg_gen_sub_*
  tcg: Generic expansion of tcg_gen_subi_*
  tcg: Generic expansion of tcg_gen_neg_*
  tcg: Generic expansion of tcg_gen_subfi_*
  tcg: Generic expansion of tcg_gen_and_*
  tcg: Generic expansion of tcg_gen_or_*
  tcg: Generic expansion of tcg_gen_xor_*
  tcg: Generic expansion of tcg_gen_shl_*
  tcg: Generic expansion of tcg_gen_shr_*
  tcg: Generic expansion of tcg_gen_sar_*
  tcg: Generic expansion of tcg_gen_mul_*
  tcg: Generic expansion of tcg_gen_shli_*
  tcg: Generic expansion of tcg_gen_shri_*
  tcg: Generic expansion of tcg_gen_sari_*
  tcg: Generic expansion of tcg_gen_andi_*
  tcg: Generic expansion of tcg_gen_ori_*
  tcg: Generic expansion of tcg_gen_xori_*
  tcg: Generic expansion of tcg_gen_muli_*
  tcg: Generic expansion of tcg_gen_not_*
  tcg: Drop division helpers
  tcg: Generic expansion of tcg_gen_div_*
  tcg: Generic expansion of tcg_gen_rem_*
  tcg: Generic expansion of tcg_gen_divu_*
  tcg: Generic expansion of tcg_gen_remu_*
  tcg: Generic expansion of tcg_gen_andc_*
  tcg: Generic expansion of tcg_gen_eqv_*
  tcg: Generic expansion of tcg_gen_nand_*
  tcg: Generic expansion of tcg_gen_nor_*
  tcg: Generic expansion of tcg_gen_orc_*
  tcg: Generic expansion of tcg_gen_brcond_*
  tcg: Generic expansion of tcg_gen_brcondi_*
  tcg: Generic expansion of tcg_gen_setcond_*
  tcg: Generic expansion of tcg_gen_setcondi_*
  tcg: Generic expansion of tcg_gen_negsetcond_*
  tcg: Generic expansion of tcg_gen_negsetcondi_*
  tcg: Generic expansion of tcg_gen_movcond_*
  tcg: Split out gen_extrl_i64_i32
  tcg: Split out gen_extu_i32_i64
  tcg: Split out gen_extrh_i64_i32
  tcg: Split out gen_ext_i32_i64
  tcg: Generic expansion of tcg_gen_clz_*
  tcg: Use signed integer for tcg_gen_{clz,ctz}i_{i32,i64}
  tcg: Generic expansion of tcg_gen_clzi_*
  tcg: Generic expansion of tcg_gen_ctpop_*
  tcg: Generic expansion of tcg_gen_ctz_*
  tcg: Generic expansion of tcg_gen_ctzi_*
  tcg: Generic expansion of tcg_gen_clrsb_*
  tcg: Generic expansion of tcg_gen_rotl_*
  tcg: Generic expansion of tcg_gen_rotr_*
  tcg: Generic expansion of tcg_gen_rotri_*
  tcg: Generic expansion of tcg_gen_rotli_*
  tcg: Generic expansion of tcg_gen_deposit_*
  tcg: Generic expansion of tcg_gen_extract_*
  tcg: Generic expansion of tcg_gen_sextract_*
  tcg: Generic expansion of tcg_gen_deposit_z_*
  tcg: Generic expansion of tcg_gen_ext8s_*
  tcg: Generic expansion of tcg_gen_ext8u_*
  tcg: Generic expansion of tcg_gen_ext16s_*
  tcg: Generic expansion of tcg_gen_ext16u_*
  tcg: Generic expansion of tcg_gen_ext_*
  tcg: Generic expansion of tcg_gen_smin_*
  tcg: Generic expansion of tcg_gen_smax_*
  tcg: Generic expansion of tcg_gen_umin_*
  tcg: Generic expansion of tcg_gen_umax_*
  tcg: Generic expansion of tcg_gen_abs_*
  tcg: Generic expansion of tcg_gen_ussub_*
  tcg: Use umax in ussub if available
  tcg: Generic expansion of tcg_gen_extract2_*
  tcg: Generic expansion of tcg_gen_addcio_*
  tcg: Generic expansion of tcg_gen_add2_*
  tcg: Generic expansion of tcg_gen_sub2_*
  tcg: Generic expansion of tcg_gen_mulu2_*
  tcg: Generic expansion of tcg_gen_muls2_*
  tcg: Use unsigned for flags for bswap and revbit operations
  tcg: Generic expansion of tcg_gen_bswap16_*
  tcg: Split out gen_bitswap
  tcg: Generic expansion of tcg_gen_revbit8_*
  tcg: Generic expansion of tcg_gen_ld_*
  tcg: Generic expansion of tcg_gen_ld8s_*
  tcg: Generic expansion of tcg_gen_ld8u_*
  tcg: Generic expansion of tcg_gen_ld16s_*
  tcg: Generic expansion of tcg_gen_ld16u_*
  tcg: Generic expansion of tcg_gen_st_*
  tcg: Generic expansion of tcg_gen_st8_*
  tcg: Generic expansion of tcg_gen_st16_*
  tcg: Generic expansion of tcg_gen_dup_*
  tcg: Expand missing mulu2_i64 during liveness
  tcg: Annontate functions in tcg-op-common.h with QEMU_*_NONNULL

 accel/tcg/tcg-runtime.h                    |   13 -
 include/qemu/compiler.h                    |   15 +
 include/tcg/tcg-op-common.h                |  579 ++--
 include/tcg/tcg-op-mem.h                   |   20 +-
 include/tcg/tcg-temp-internal.h            |    2 +
 include/tcg/tcg.h                          |   59 +-
 tcg/tcg-internal.h                         |   43 +-
 include/tcg/tcg-op-def.h.inc               |   84 +
 accel/tcg/tcg-runtime.c                    |   58 -
 tcg/tcg-op-gvec.c                          |   41 -
 tcg/tcg-op-ldst.c                          |   54 -
 tcg/tcg-op.c                               | 3086 ++++++++------------
 tcg/tcg.c                                  |  214 +-
 target/ppc/translate/fixedpoint-impl.c.inc |    4 +-
 14 files changed, 1735 insertions(+), 2537 deletions(-)
 create mode 100644 include/tcg/tcg-op-def.h.inc

-- 
2.53.0