Re: [PATCH 9/9] qapi: Extend -compat to set policy for unstable interfaces

2021-10-26 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> New option parameters unstable-input and unstable-output set policy >> for unstable interfaces just like deprecated-input and >> deprecated-output set policy for deprecated interfaces (see commit >> 6dd75472d5

Re: [PATCH 5/9] qapi: Generalize struct member policy checking

2021-10-26 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 10/25/21 07:25, Markus Armbruster wrote: >> The generated visitor functions call visit_deprecated_accept() and >> visit_deprecated() when visiting a struct member with special feature >> flag 'deprecated'. This makes the feature flag visible to the actual >>

Re: [PATCH 2/9] qapi: Mark unstable QMP parts with feature 'unstable'

2021-10-26 Thread Markus Armbruster
John Snow writes: > On Tue, Oct 26, 2021 at 3:56 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > On Mon, Oct 25, 2021 at 1:25 AM Markus Armbruster >> wrote: >> > >> >> Add special feature 'unstable' everywhere the name starts with 'x-', >> >> except for InputBarrierProperties

Re: [PATCH 1/9] qapi: New special feature flag "unstable"

2021-10-26 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Oct 26, 2021 at 05:15:10PM +0200, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> >> > On Tue, Oct 26, 2021 at 11:37:19AM +0200, Markus Armbruster wrote: [...] >> >> Management applications are better off with a feature flag than with a >> >>

[PATCH v2] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-10-26 Thread Gavin Shan
The empty NUMA nodes, where no memory resides, aren't exposed through ACPI SRAT table. It's not user preferred behaviour because the corresponding memory node devices are missed from the guest kernel as the following example shows. It means the guest kernel doesn't have the node information as

[PATCH-for-6.0.1 1/2] gitlab: only let pages be published from default branch

2021-10-26 Thread Philippe Mathieu-Daudé
From: Daniel P. Berrangé GitLab will happily publish pages generated by the latest CI pipeline from any branch: https://docs.gitlab.com/ee/user/project/pages/introduction.html "Remember that GitLab Pages are by default branch/tag agnostic and their deployment relies solely on what you

[PATCH-for-6.0.1 0/2] gitlab-ci: Only push docker images to mainstream registry from /master

2021-10-26 Thread Philippe Mathieu-Daudé
Hi Michael, 2 more patches to avoid gitlab-ci mayhem when you push the stable tags. See this cover for more info: https://www.mail-archive.com/qemu-devel@nongnu.org/msg846861.html Based-on: <20211019140944.152419-1-michael.r...@amd.com> "Patch Round-up for stable 6.0.1, freeze on 2021-10-26"

[PATCH-for-6.0.1 2/2] gitlab-ci: Only push docker images to registry from /master branch

2021-10-26 Thread Philippe Mathieu-Daudé
Users expect images pulled from registry.gitlab.com/qemu-project/qemu/ to be stable. QEMU repository workflow pushes merge candidates to the /staging branch, and on success the same commit is pushed as /master. If /staging fails, we do not want to push the built images to the registry. Therefore

Re: [PATCH v4 5/5] block: Deprecate transaction type drive-backup

2021-10-26 Thread Markus Armbruster
John Snow writes: > On Mon, Oct 25, 2021 at 12:24 AM Markus Armbruster > wrote: > >> Several moons ago, Vladimir posted >> >> Subject: [PATCH v2 3/3] qapi: deprecate drive-backup >> Date: Wed, 5 May 2021 16:58:03 +0300 >> Message-Id:

Re: [PATCH] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-10-26 Thread Gavin Shan
On 10/26/21 8:47 PM, Igor Mammedov wrote: On Tue, 26 Oct 2021 07:41:01 +0800 Gavin Shan wrote: The empty NUMA nodes, where no memory resides, aren't exposed through ACPI SRAT table. It's not user preferred behaviour because the corresponding memory node devices are missed from the guest

Re: [PATCH] hw/arm/virt: Expose empty NUMA nodes through ACPI

2021-10-26 Thread Gavin Shan
On 10/26/21 5:25 PM, Andrew Jones wrote: On Tue, Oct 26, 2021 at 07:41:01AM +0800, Gavin Shan wrote: The empty NUMA nodes, where no memory resides, aren't exposed through ACPI SRAT table. It's not user preferred behaviour because the corresponding memory node devices are missed from the guest

Re: [PATCH 0/3] hw/input/lasips2: QOM'ify the Lasi PS/2

2021-10-26 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial@ (fully reviewed). On 9/20/21 08:40, Philippe Mathieu-Daudé wrote: > Slowly nuking non-QOM devices: Lasi PS/2's turn. > > Philippe Mathieu-Daudé (3): > hw/input/lasips2: Fix typos in function names > hw/input/lasips2: Move LASIPS2State declaration to >

[PATCH v2] hw: Add a 'Sensor devices' qdev category

2021-10-26 Thread Philippe Mathieu-Daudé
Sensors models are listed in the 'Misc devices' category. Move them to their own category. Reviewed-by: Cédric Le Goater Reviewed-by: Hao Wu Signed-off-by: Philippe Mathieu-Daudé --- v2: Only include hw/sensor/, removed AER915 device from hw/arm/z2.c --- include/hw/qdev-core.h | 1 +

[PATCH v2 4/4] target/arm: Use tcg_constant_i64() in do_sat_addsub_64()

2021-10-26 Thread Philippe Mathieu-Daudé
The immediate value used for comparison is constant and read-only. Move it to the constant pool. This frees a TCG temporary for unsigned saturation opcodes. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate-sve.c | 17 - 1 file

[PATCH v2 3/4] target/arm: Use the constant variant of store_cpu_field() when possible

2021-10-26 Thread Philippe Mathieu-Daudé
When using a constant variable, we can replace the store_cpu_field() call by store_cpu_field_constant() which avoid using TCG temporaries. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate.c | 21 ++--- 1 file changed, 6

[PATCH v2 1/4] target/arm: Use tcg_constant_i32() in op_smlad()

2021-10-26 Thread Philippe Mathieu-Daudé
Avoid using a TCG temporary for a read-only constant. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index

[PATCH v2 2/4] target/arm: Introduce store_cpu_field_constant() helper

2021-10-26 Thread Philippe Mathieu-Daudé
Similarly to the store_cpu_field() helper which takes a TCG temporary, store its value to the CPUState, introduce the store_cpu_field_constant() helper which store a constant to CPUState (without using any TCG temporary). Update the single store_cpu_offset() user in do_coproc_insn().

[PATCH v2 0/4] target/arm: Use tcg_constant_*

2021-10-26 Thread Philippe Mathieu-Daudé
Missing review: patch #2 Introduce store_cpu_field_constant() helper to avoid using temporary when the value is constant (and read-only). Since v1: - Really use tcg_constant() in patch 2 (Richard) Philippe Mathieu-Daudé (4): target/arm: Use tcg_constant_i32() in op_smlad() target/arm:

Re: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector

2021-10-26 Thread Jason Wang
在 2021/10/27 上午2:17, Zhang Chen 写道: Make the vnet header a necessary part of filter transfer protocol. So remove the module's vnet_hdr_support switch here. It make other modules(like another filter-redirector,colo-compare...) know how to parse net packet correctly. If local device is not the

Re: [PATCH] target/avr: Optimize various functions using extract opcode

2021-10-26 Thread Philippe Mathieu-Daudé
Hi Richard, On 10/3/21 17:24, Richard Henderson wrote: > On 10/3/21 10:21 AM, Philippe Mathieu-Daudé wrote: >> When running the scripts/coccinelle/tcg_gen_extract.cocci >> Coccinelle semantic patch on target/avr/, we get: >> >>    [DBG] candidate at target/avr/translate.c:228 >>    [DBG]

Re: [PATCH] e1000: fix tx re-entrancy problem

2021-10-26 Thread Jason Wang
在 2021/10/22 上午12:10, Jon Maloy 写道: The fact that the MMIO handler is not re-entrant causes an infinite loop under certain conditions: Guest write to TDT -> Loopback -> RX (DMA to TDT) -> TX We now eliminate the effect of this problem locally in e1000, by adding a boolean in struct

[PATCH v2] .mailmap: Fix more contributor entries

2021-10-26 Thread Philippe Mathieu-Daudé
These authors have some incorrect author email field. Acked-by: Pan Nengyuan Reviewed-by: Alex Chen Reviewed-by: Hyman Huang Reviewed-by: Haibin Zhang Signed-off-by: Philippe Mathieu-Daudé --- Patch fully reviewed/acked. --- .mailmap | 4 1 file changed, 4 insertions(+) diff --git

Re: [PATCH v2 1/3] file-posix: add `aio-max-batch` option

2021-10-26 Thread Markus Armbruster
Stefano Garzarella writes: > Commit d7ddd0a161 ("linux-aio: limit the batch size using > `aio-max-batch` parameter") added a way to limit the batch size > of Linux AIO backend for the entire AIO context. > > The same AIO context can be shared by multiple devices, so > latency-sensitive devices

Re: [PATCH] MAINTAINERS: Split HPPA TCG vs HPPA machines/hardware

2021-10-26 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial@ (patch reviewed) On 10/4/21 10:38, Philippe Mathieu-Daudé wrote: > Hardware emulated models don't belong to the TCG MAINTAINERS > section. Move them to the 'HP-PARISC Machines' section. > > Signed-off-by: Philippe Mathieu-Daudé > --- > MAINTAINERS | 5 ++--- > 1 file

[PATCH v2 4/4] MAINTAINERS: Agree to maintain nanoMIPS TCG frontend

2021-10-26 Thread Philippe Mathieu-Daudé
As of this commit, the nanoMIPS toolchains haven't been merged in mainstream projects. However MediaTek provides a toolchain: https://github.com/MediaTek-Labs/nanomips-gnu-toolchain/releases/tag/nanoMIPS-2021.02-01 QEMU deprecation policy schedules code for removal. If we don't need / want to

[PATCH v2 1/4] MAINTAINERS: Add MIPS general architecture support entry

2021-10-26 Thread Philippe Mathieu-Daudé
The architecture is covered in TCG (frontend and backend) and hardware models. Add a generic section matching the 'mips' word in patch subjects. Reviewed-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211004092515.3819836-2-f4...@amsat.org> --- MAINTAINERS | 7 ++- 1

[PATCH v2 3/4] MAINTAINERS: Split MIPS TCG frontend vs MIPS machines/hardware

2021-10-26 Thread Philippe Mathieu-Daudé
Hardware emulated models don't belong to the TCG MAINTAINERS section. Move them to a new 'Overall MIPS Machines' section in the 'MIPS Machines' group. Reviewed-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211004092515.3819836-4-f4...@amsat.org> --- MAINTAINERS | 10

[PATCH v2 2/4] MAINTAINERS: Add entries to cover MIPS CPS / GIC hardware

2021-10-26 Thread Philippe Mathieu-Daudé
MIPS CPS and GIC models are unrelated to the TCG frontend. Move them as new sections under the 'Devices' group. Cc: Paul Burton Reviewed-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff

[PATCH v2 0/4] MAINTAINERS: Sanitize 'MIPS TCG CPUs' section

2021-10-26 Thread Philippe Mathieu-Daudé
Move various files unrelated to MIPS TCG frontend into new sections. Since v1: - Do not add Paul without his consent - un-deprecate nanoMIPS Philippe Mathieu-Daudé (4): MAINTAINERS: Add MIPS general architecture support entry MAINTAINERS: Add entries to cover MIPS CPS / GIC hardware

Re: [PATCH 0/6] More SH4 clean ups

2021-10-26 Thread Philippe Mathieu-Daudé
On 10/27/21 03:32, BALATON Zoltan wrote: > Based-on: > ^ (hw/sh4: Codeing style fixes) > > Continuing the clean up stared in previous series this now removes > printfs and QOM-ify sh_serial. > > Is there somebody who will merge these? I don't think there's anybody > sending pull request for SH4

Re: Deprecate the ppc405 boards in QEMU? (was: [PATCH v3 4/7] MAINTAINERS: Orphan obscure ppc platforms)

2021-10-26 Thread Philippe Mathieu-Daudé
On 10/5/21 18:20, Daniel P. Berrangé wrote: > On Tue, Oct 05, 2021 at 06:15:35PM +0200, Philippe Mathieu-Daudé wrote: >> On 10/5/21 10:49, Daniel P. Berrangé wrote: >>> On Tue, Oct 05, 2021 at 06:44:23AM +0200, Christophe Leroy wrote: >> I will look at it, please allow me a few weeks though.

Re: [PATCH] hw/net: store timers for e1000 in vmstate

2021-10-26 Thread Jason Wang
On Tue, Oct 26, 2021 at 6:36 PM Pavel Dovgalyuk wrote: > > Setting timers randomly when vmstate is loaded breaks > execution determinism. > Therefore this patch allows saving mit and autoneg timers > for e1000. It makes execution deterministic and allows > snapshotting and reverse debugging in

Re: [PATCH v2 0/3] memory: memory_region_is_mapped() cleanups

2021-10-26 Thread Peter Xu
On Tue, Oct 26, 2021 at 06:06:46PM +0200, David Hildenbrand wrote: > This is the follow-up of [1]. > > Playing with memory_region_is_mapped(), I realized that memory regions > mapped via an alias behave a little bit "differently", as they don't have > their ->container set. The patches look ok

Re: [PATCH 4/4] MAINTAINERS: Agree to maintain nanoMIPS TCG frontend

2021-10-26 Thread Philippe Mathieu-Daudé
On 10/4/21 22:08, Jiaxun Yang wrote: > 在 2021/10/4 10:25, Philippe Mathieu-Daudé 写道: >> As of this commit, the nanoMIPS toolchains haven't been merged >> in mainstream projects. However MediaTek provides a toolchain: >>

Re: [PATCH 2/4] MAINTAINERS: Add entries to cover MIPS CPS / GIC hardware

2021-10-26 Thread Philippe Mathieu-Daudé
On 10/12/21 00:21, Philippe Mathieu-Daudé wrote: > Hi Paul, > > You are the maintainer of the Boston machine which is the > only one using these peripherals; would you agree to be > (co-)maintainer of these files? I am going to respin this patch removing Paul name. > On 10/4/21 11:25, Philippe

Re: [PATCH v2 2/2] target/riscv: remove force HS exception

2021-10-26 Thread Alistair Francis
On Wed, Oct 27, 2021 at 12:54 AM Jose Martins wrote: > > There is no need to "force an hs exception" as the current privilege > level, the state of the global ie and of the delegation registers should > be enough to route the interrupt to the appropriate privilege level in >

Re: [PATCH v2 1/2] target/riscv: fix VS interrupts forwarding to HS

2021-10-26 Thread Alistair Francis
On Wed, Oct 27, 2021 at 12:53 AM Jose Martins wrote: > > VS interrupts (2, 6, 10) were not correctly forwarded to hs-mode when > not delegated in hideleg (which was not being taken into account). This > was mainly because hs level sie was not always considered enabled when > it should. The spec

Re: [PATCH v2 0/2] mconfigptr support

2021-10-26 Thread Alistair Francis
On Mon, Oct 25, 2021 at 10:51 PM Rahul Pathak wrote: > > Patches add the mconfigptr csr support. > mconfigptr is newly incorporated in risc-v privileged architecture > specification 1.12 version. > priv spec 1.12.0 version check is also added. > > > qemu-system-riscv64 -nographic -machine virt

Re: [PATCH v2 2/2] target/riscv: csr: Implement mconfigptr CSR

2021-10-26 Thread Alistair Francis
On Mon, Oct 25, 2021 at 10:55 PM Rahul Pathak wrote: > > Signed-off-by: Rahul Pathak > --- > target/riscv/cpu_bits.h | 1 + > target/riscv/csr.c | 19 +++ > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h

Re: [PATCH v2 1/2] target/riscv: Add priv spec 1.12.0 version check

2021-10-26 Thread Alistair Francis
On Mon, Oct 25, 2021 at 10:55 PM Rahul Pathak wrote: > > Signed-off-by: Rahul Pathak > --- > target/riscv/cpu.c | 4 +++- > target/riscv/cpu.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c > index 788fa0b11c..83c3814a5a 100644

Re: [PATCH 4/6] hw/sh4/r2d: Use error_report instead of fprintf to stderr

2021-10-26 Thread Richard Henderson
On 10/26/21 6:32 PM, BALATON Zoltan wrote: Signed-off-by: BALATON Zoltan --- hw/sh4/r2d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 3/6] hw/sh4: Change debug printfs to traces

2021-10-26 Thread Richard Henderson
On 10/26/21 6:32 PM, BALATON Zoltan wrote: +trace_sh_serial("write", size, offs, val); switch (offs) { case 0x00: /* SMR */ s->smr = val & ((s->feat & SH_SERIAL_FEAT_SCIF) ? 0x7b : 0xff); @@ -302,10 +298,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,

Re: [PATCH 2/6] hw//sh4: Use qemu_log instead of fprintf to stderr

2021-10-26 Thread Richard Henderson
On 10/26/21 6:32 PM, BALATON Zoltan wrote: Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 7 --- hw/sh4/sh7750.c | 13 ++--- 2 files changed, 10 insertions(+), 10 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 1/6] hw/sh4: Fix a typo in a comment

2021-10-26 Thread Richard Henderson
On 10/26/21 6:32 PM, BALATON Zoltan wrote: Signed-off-by: BALATON Zoltan --- hw/timer/sh_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

[PATCH 3/6] hw/sh4: Change debug printfs to traces

2021-10-26 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 13 ++- hw/char/trace-events | 3 ++ hw/intc/sh_intc.c | 79 +++ hw/intc/trace-events | 8 + hw/sh4/sh7750.c | 8 ++--- hw/sh4/trace-events | 3 ++ hw/sh4/trace.h|

[PATCH 5/6] hw/char/sh_serial: QOM-ify

2021-10-26 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 127 ++-- hw/sh4/sh7750.c | 62 +++-- include/hw/sh4/sh.h | 9 +--- 3 files changed, 123 insertions(+), 75 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c

[PATCH 1/6] hw/sh4: Fix a typo in a comment

2021-10-26 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/timer/sh_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 02eb865908..0a18ac8276 100644 --- a/hw/timer/sh_timer.c +++ b/hw/timer/sh_timer.c @@ -107,7 +107,7 @@ static void

[PATCH 4/6] hw/sh4/r2d: Use error_report instead of fprintf to stderr

2021-10-26 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/sh4/r2d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 57ccae7249..72759413f3 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu/units.h"

[PATCH 0/6] More SH4 clean ups

2021-10-26 Thread BALATON Zoltan
Based-on: ^ (hw/sh4: Codeing style fixes) Continuing the clean up stared in previous series this now removes printfs and QOM-ify sh_serial. Is there somebody who will merge these? I don't think there's anybody sending pull request for SH4 so maybe Peret/Richard might need to take it. Regards,

[PATCH 6/6] hw/char/sh_serial: Add device id to trace output

2021-10-26 Thread BALATON Zoltan
Normally there are at least two sh_serial instances. Add device id to trace messages to make it clear which instance they belong to otherwise its not possible to tell which serial device is accessed. Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 6 -- hw/char/trace-events | 2 +-

[PATCH 2/6] hw//sh4: Use qemu_log instead of fprintf to stderr

2021-10-26 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 7 --- hw/sh4/sh7750.c | 13 ++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 1b1e6a6a04..c4231975c7 100644 --- a/hw/char/sh_serial.c +++

Re: [PATCH v3] migration/rdma: Fix out of order wrid

2021-10-26 Thread lizhij...@fujitsu.com
ping again On 18/10/2021 18:18, Li, Zhijian/李 智坚 wrote: > ping > > > On 27/09/2021 15:07, Li Zhijian wrote: >> destination: >> ../qemu/build/qemu-system-x86_64 -enable-kvm -netdev >> tap,id=hn0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown -device >> e1000,netdev=hn0,mac=50:52:54:00:11:22

[PATCH v4 51/51] tcg/optimize: Propagate sign info for shifting

2021-10-26 Thread Richard Henderson
For constant shifts, we can simply shift the s_mask. For variable shifts, we know that sar does not reduce the s_mask, which helps for sequences like ext32s_i64 t, in sar_i64 t, t, v ext32s_i64 out, t allowing the final extend to be eliminated. Reviewed-by: Alex Bennée

[PATCH v4 47/51] tcg/optimize: Optimize sign extensions

2021-10-26 Thread Richard Henderson
Certain targets, like riscv, produce signed 32-bit results. This can lead to lots of redundant extensions as values are manipulated. Begin by tracking only the obvious sign-extensions, and converting them to simple copies when possible. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson

[PATCH v4 45/51] tcg/optimize: Use fold_xi_to_x for div

2021-10-26 Thread Richard Henderson
Recognize the identity function for division. Suggested-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index fe2b1eb18e..92684d4b1d 100644 --- a/tcg/optimize.c +++

[PATCH v4 46/51] tcg/optimize: Use fold_xx_to_i for rem

2021-10-26 Thread Richard Henderson
Recognize the constant function for remainder. Suggested-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 92684d4b1d..6c6c523a85 100644 --- a/tcg/optimize.c +++

[PATCH v4 44/51] tcg/optimize: Use fold_xi_to_x for mul

2021-10-26 Thread Richard Henderson
Recognize the identity function for low-part multiply. Suggested-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index bea82305db..fe2b1eb18e 100644 --- a/tcg/optimize.c +++

[PATCH v4 50/51] tcg/optimize: Propagate sign info for bit counting

2021-10-26 Thread Richard Henderson
The results are generally 6 bit unsigned values, though the count leading and trailing bits may produce any value for a zero input. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcg/optimize.c

[PATCH v4 33/51] tcg/optimize: Add type to OptContext

2021-10-26 Thread Richard Henderson
Compute the type of the operation early. There are at least 4 places that used a def->flags ladder to determine the type of the operation being optimized. There were two places that assumed !TCG_OPF_64BIT means TCG_TYPE_I32, and so could potentially compute incorrect results for vector

[PATCH v4 49/51] tcg/optimize: Propagate sign info for setcond

2021-10-26 Thread Richard Henderson
The result is either 0 or 1, which means that we have a 2 bit signed result, and thus 62 bits of sign. For clarity, use the smask_from_zmask function. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v4 42/51] tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values

2021-10-26 Thread Richard Henderson
This "garbage" setting pre-dates the addition of the type changing opcodes INDEX_op_ext_i32_i64, INDEX_op_extu_i32_i64, and INDEX_op_extr{l,h}_i64_i32. So now we have a definitive points at which to adjust z_mask to eliminate such bits from the 32-bit operands. Reviewed-by: Alex Bennée

[PATCH v4 39/51] tcg/optimize: Expand fold_mulu2_i32 to all 4-arg multiplies

2021-10-26 Thread Richard Henderson
Rename to fold_multiply2, and handle muls2_i32, mulu2_i64, and muls2_i64. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 44 +++- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/tcg/optimize.c

[PATCH v4 48/51] tcg/optimize: Propagate sign info for logical operations

2021-10-26 Thread Richard Henderson
Sign repetitions are perforce all identical, whether they are 1 or 0. Bitwise operations preserve the relative quantity of the repetitions. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 29 + 1

[PATCH v4 32/51] tcg/optimize: Split out fold_xi_to_i

2021-10-26 Thread Richard Henderson
Pull the "op r, a, 0 => movi r, 0" optimization into a function, and use it in the outer opcode fold functions. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 38 -- 1 file changed, 20

[PATCH v4 41/51] tcg/optimize: Sink commutative operand swapping into fold functions

2021-10-26 Thread Richard Henderson
Most of these are handled by creating a fold_const2_commutative to handle all of the binary operators. The rest were already handled on a case-by-case basis in the switch, and have their own fold function in which to place the call. We now have only one major switch on TCGOpcode. Introduce

[PATCH v4 43/51] tcg/optimize: Use fold_xx_to_i for orc

2021-10-26 Thread Richard Henderson
Recognize the constant function for or-compliment. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/optimize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3207817b68..bea82305db 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@

[PATCH v4 40/51] tcg/optimize: Expand fold_addsub2_i32 to 64-bit ops

2021-10-26 Thread Richard Henderson
Rename to fold_addsub2. Use Int128 to implement the wider operation. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 65 ++ 1 file changed, 44 insertions(+), 21 deletions(-)

[PATCH v4 34/51] tcg/optimize: Split out fold_to_not

2021-10-26 Thread Richard Henderson
Split out the conditional conversion from a more complex logical operation to a simple NOT. Create a couple more helpers to make this easy for the outer-most logical operations. Signed-off-by: Richard Henderson --- tcg/optimize.c | 158 +++-- 1 file

[PATCH v4 29/51] tcg/optimize: Split out fold_mov

2021-10-26 Thread Richard Henderson
This is the final entry in the main switch that was in a different form. After this, we have the option to convert the switch into a function dispatch table. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 27

[PATCH v4 31/51] tcg/optimize: Split out fold_xx_to_x

2021-10-26 Thread Richard Henderson
Pull the "op r, a, a => mov r, a" optimization into a function, and use it in the outer opcode fold functions. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 39 --- 1 file changed, 24

[PATCH v4 27/51] tcg/optimize: Split out fold_bswap

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index dd65f1afcd..5374c230da 100644 ---

[PATCH v4 37/51] tcg/optimize: Split out fold_ix_to_i

2021-10-26 Thread Richard Henderson
Pull the "op r, 0, b => movi r, 0" optimization into a function, and use it in fold_shift. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff

[PATCH v4 38/51] tcg/optimize: Split out fold_masks

2021-10-26 Thread Richard Henderson
Move all of the known-zero optimizations into the per-opcode functions. Use fold_masks when there is a possibility of the result being determined, and simply set ctx->z_mask otherwise. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/optimize.c | 545

[PATCH v4 28/51] tcg/optimize: Split out fold_dup, fold_dup2

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 53 +- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 5374c230da..8524fe1f8a

[PATCH v4 16/51] tcg/optimize: Split out fold_setcond2

2021-10-26 Thread Richard Henderson
Reduce some code duplication by folding the NE and EQ cases. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 145 - 1 file changed, 72 insertions(+), 73 deletions(-) diff --git

[PATCH v4 25/51] tcg/optimize: Split out fold_deposit

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3bd5f043c8..2c57d08760 100644 ---

[PATCH v4 36/51] tcg/optimize: Split out fold_xi_to_x

2021-10-26 Thread Richard Henderson
Pull the "op r, a, i => mov r, a" optimization into a function, and use them in the outer-most logical operations. Signed-off-by: Richard Henderson --- tcg/optimize.c | 61 +- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git

[PATCH v4 30/51] tcg/optimize: Split out fold_xx_to_i

2021-10-26 Thread Richard Henderson
Pull the "op r, a, a => movi r, 0" optimization into a function, and use it in the outer opcode fold functions. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 41 - 1 file changed, 24

[PATCH v4 15/51] tcg/optimize: Split out fold_const{1,2}

2021-10-26 Thread Richard Henderson
Split out a whole bunch of placeholder functions, which are currently identical. That won't last as more code gets moved. Use CASE_32_64_VEC for some logical operators that previously missed the addition of vectors. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard

[PATCH v4 22/51] tcg/optimize: Split out fold_movcond

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 56 -- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 9d1d045363..110b3d1cc2

[PATCH v4 20/51] tcg/optimize: Split out fold_mulu2_i32

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index f79cb44944..805522f99d 100644 ---

[PATCH v4 26/51] tcg/optimize: Split out fold_count_zeros

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2c57d08760..dd65f1afcd 100644 ---

[PATCH v4 35/51] tcg/optimize: Split out fold_sub_to_neg

2021-10-26 Thread Richard Henderson
Even though there is only one user, place this more complex conversion into its own helper. Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 89 ++ 1 file changed, 47 insertions(+), 42 deletions(-) diff --git

[PATCH v4 21/51] tcg/optimize: Split out fold_addsub2_i32

2021-10-26 Thread Richard Henderson
Add two additional helpers, fold_add2_i32 and fold_sub2_i32 which will not be simple wrappers forever. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 70 +++--- 1 file changed, 44

[PATCH v4 18/51] tcg/optimize: Split out fold_brcond

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c9db14f1d0..24ba6d2830 100644 ---

[PATCH v4 17/51] tcg/optimize: Split out fold_brcond2

2021-10-26 Thread Richard Henderson
Reduce some code duplication by folding the NE and EQ cases. Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 159 + 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[PATCH v4 24/51] tcg/optimize: Split out fold_extract, fold_sextract

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 48 ++-- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index faedbdbfb8..3bd5f043c8

[PATCH v4 12/51] tcg/optimize: Split out finish_folding

2021-10-26 Thread Richard Henderson
Copy z_mask into OptContext, for writeback to the first output within the new function. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 49 + 1 file changed, 33 insertions(+), 16

[PATCH v4 06/51] tcg/optimize: Split out init_arguments

2021-10-26 Thread Richard Henderson
There was no real reason for calls to have separate code here. Unify init for calls vs non-calls using the call path, which handles TCG_CALL_DUMMY_ARG. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c |

[PATCH v4 11/51] tcg/optimize: Return true from tcg_opt_gen_{mov, movi}

2021-10-26 Thread Richard Henderson
This will allow callers to tail call to these functions and return true indicating processing complete. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 + 1 file changed, 5 insertions(+), 4

[PATCH v4 23/51] tcg/optimize: Split out fold_extract2

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 110b3d1cc2..faedbdbfb8 100644 ---

[PATCH v4 14/51] tcg/optimize: Split out fold_mb, fold_qemu_{ld,st}

2021-10-26 Thread Richard Henderson
This puts the separate mb optimization into the same framework as the others. While fold_qemu_{ld,st} are currently identical, that won't last as more code gets moved. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 89

[PATCH v4 08/51] tcg/optimize: Split out fold_call

2021-10-26 Thread Richard Henderson
Calls are special in that they have a variable number of arguments, and need to be able to clobber globals. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 63 -- 1 file changed, 41

[PATCH v4 04/51] tcg/optimize: Change tcg_opt_gen_{mov, movi} interface

2021-10-26 Thread Richard Henderson
Adjust the interface to take the OptContext parameter instead of TCGContext or both. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 67 +- 1 file changed, 34 insertions(+), 33 deletions(-)

[PATCH v4 10/51] tcg/optimize: Change fail return for do_constant_folding_cond*

2021-10-26 Thread Richard Henderson
Return -1 instead of 2 for failure, so that we can use comparisons against 0 for all cases. Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 145 + 1 file changed, 74

[PATCH v4 19/51] tcg/optimize: Split out fold_setcond

2021-10-26 Thread Richard Henderson
Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 24ba6d2830..f79cb44944 100644 --- a/tcg/optimize.c

[PATCH v4 13/51] tcg/optimize: Use a boolean to avoid a mass of continues

2021-10-26 Thread Richard Henderson
Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 368457f4a2..699476e2f1 100644 ---

[PATCH v4 09/51] tcg/optimize: Drop nb_oargs, nb_iargs locals

2021-10-26 Thread Richard Henderson
Rather than try to keep these up-to-date across folding, re-read nb_oargs at the end, after re-reading the opcode. A couple of asserts need dropping, but that will take care of itself as we split the function further. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard

[PATCH v4 07/51] tcg/optimize: Split out copy_propagate

2021-10-26 Thread Richard Henderson
Continue splitting tcg_optimize. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c

[PATCH v4 03/51] tcg/optimize: Remove do_default label

2021-10-26 Thread Richard Henderson
Break the final cleanup clause out of the main switch statement. When fully folding an opcode to mov/movi, use "continue" to process the next opcode, else break to fall into the final cleanup. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by:

  1   2   3   4   >