[PATCH for-9.1 00/15] tcg: Canonicalize operations during optimize

Richard Henderson posted 15 patches 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240312143839.136408-1-richard.henderson@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, WANG Xuerui <git@xen0n.name>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <Alistair.Francis@wdc.com>
tcg/i386/tcg-target-con-set.h        |   3 +-
tcg/i386/tcg-target-con-str.h        |   1 -
tcg/loongarch64/tcg-target-con-set.h |   2 +-
tcg/loongarch64/tcg-target-con-str.h |   1 -
tcg/riscv/tcg-target-con-set.h       |   4 +-
tcg/riscv/tcg-target-con-str.h       |   2 -
tcg/optimize.c                       | 318 +++++++++++++++++++++++----
tcg/tcg-op.c                         | 244 +++++---------------
tcg/aarch64/tcg-target.c.inc         |  50 ++---
tcg/arm/tcg-target.c.inc             |   6 +-
tcg/i386/tcg-target.c.inc            |  20 +-
tcg/loongarch64/tcg-target.c.inc     |  31 +--
tcg/ppc/tcg-target.c.inc             |  32 +--
tcg/riscv/tcg-target.c.inc           |  58 +----
tcg/s390x/tcg-target.c.inc           |  56 +----
15 files changed, 393 insertions(+), 435 deletions(-)
[PATCH for-9.1 00/15] tcg: Canonicalize operations during optimize
Posted by Richard Henderson 1 month, 2 weeks ago
This is a follow-on to 6334a968eec3 ("tcg/optimize: Canonicalize
subi to addi during optimization"), which I wrote at the end of
the previous devel cycle, then forgot about during the current.

In addition to sub->add, canonicalize andc->and etc.

The early expansion that we produce for deposit does not fold
constants well; expand unsupported deposit during optimize.


r~


Richard Henderson (15):
  tcg/optimize: Fold andc with immediate to and
  tcg/optimize: Fold orc with immediate to or
  tcg/optimize: Fold eqv with immediate to xor
  tcg/i386: Do not accept immediate operand for andc
  tcg/aarch64: Do not accept immediate operand for andc, orc, eqv
  tcg/arm: Do not accept immediate operand for andc
  tcg/ppc: Do not accept immediate operand for andc, orc, eqv
  tcg/loongarch64: Do not accept immediate operand for andc, orc
  tcg/s390x: Do not accept immediate operand for andc, orc
  tcg/riscv: Do not accept immediate operand for andc, orc, eqv
  tcg/riscv: Do not accept immediate operands for sub
  tcg/riscv: Do not accept zero operands for logicals, multiply or
    divide
  tcg/optimize: Fold and to extu during optimize
  tcg: Use arg_is_const_val in fold_sub_to_neg
  tcg/optimize: Lower unsupported deposit during optimize

 tcg/i386/tcg-target-con-set.h        |   3 +-
 tcg/i386/tcg-target-con-str.h        |   1 -
 tcg/loongarch64/tcg-target-con-set.h |   2 +-
 tcg/loongarch64/tcg-target-con-str.h |   1 -
 tcg/riscv/tcg-target-con-set.h       |   4 +-
 tcg/riscv/tcg-target-con-str.h       |   2 -
 tcg/optimize.c                       | 318 +++++++++++++++++++++++----
 tcg/tcg-op.c                         | 244 +++++---------------
 tcg/aarch64/tcg-target.c.inc         |  50 ++---
 tcg/arm/tcg-target.c.inc             |   6 +-
 tcg/i386/tcg-target.c.inc            |  20 +-
 tcg/loongarch64/tcg-target.c.inc     |  31 +--
 tcg/ppc/tcg-target.c.inc             |  32 +--
 tcg/riscv/tcg-target.c.inc           |  58 +----
 tcg/s390x/tcg-target.c.inc           |  56 +----
 15 files changed, 393 insertions(+), 435 deletions(-)

-- 
2.34.1