[PATCH v3 0/4] target/s390x: Improve carry computation

Richard Henderson posted 4 patches 3 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201214221356.68039-1-richard.henderson@linaro.org
Maintainers: Cornelia Huck <cohuck@redhat.com>, David Hildenbrand <david@redhat.com>, Thomas Huth <thuth@redhat.com>, Richard Henderson <richard.henderson@linaro.org>
target/s390x/internal.h    |  11 +-
target/s390x/cc_helper.c   | 123 +++-------------
target/s390x/helper.c      |  10 +-
target/s390x/translate.c   | 289 ++++++++++++++++++++-----------------
target/s390x/insn-data.def |  76 +++++-----
5 files changed, 216 insertions(+), 293 deletions(-)
[PATCH v3 0/4] target/s390x: Improve carry computation
Posted by Richard Henderson 3 years, 4 months ago
While testing the float128_muladd changes for s390x host,
emulating under x86_64 of course, I noticed that the code
we generate for strings of ALCGR and SLBGR is pretty awful.

I realized that we were missing a trick: the output cc is
based only on the output (result and carry) and so we don't
need to save the inputs.  And once we do that, we can use
the output carry as a direct input to the next insn.

Changes for v3:
  * Rebased.
Changes for v2:
  * Add a few more comments, and enhance the patch descriptions.


r~

Richard Henderson (4):
  target/s390x: Improve cc computation for ADD LOGICAL
  target/s390x: Improve ADD LOGICAL WITH CARRY
  target/s390x: Improve cc computation for SUBTRACT LOGICAL
  target/s390x: Improve SUB LOGICAL WITH BORROW

 target/s390x/internal.h    |  11 +-
 target/s390x/cc_helper.c   | 123 +++-------------
 target/s390x/helper.c      |  10 +-
 target/s390x/translate.c   | 289 ++++++++++++++++++++-----------------
 target/s390x/insn-data.def |  76 +++++-----
 5 files changed, 216 insertions(+), 293 deletions(-)

-- 
2.25.1


Re: [PATCH v3 0/4] target/s390x: Improve carry computation
Posted by David Hildenbrand 3 years, 4 months ago
On 14.12.20 23:13, Richard Henderson wrote:
> While testing the float128_muladd changes for s390x host,
> emulating under x86_64 of course, I noticed that the code
> we generate for strings of ALCGR and SLBGR is pretty awful.
> 
> I realized that we were missing a trick: the output cc is
> based only on the output (result and carry) and so we don't
> need to save the inputs.  And once we do that, we can use
> the output carry as a direct input to the next insn.
> 

LGTM, @Conny, can you pick these?

-- 
Thanks,

David / dhildenb


Re: [PATCH v3 0/4] target/s390x: Improve carry computation
Posted by Cornelia Huck 3 years, 4 months ago
On Mon, 14 Dec 2020 16:13:52 -0600
Richard Henderson <richard.henderson@linaro.org> wrote:

> While testing the float128_muladd changes for s390x host,
> emulating under x86_64 of course, I noticed that the code
> we generate for strings of ALCGR and SLBGR is pretty awful.
> 
> I realized that we were missing a trick: the output cc is
> based only on the output (result and carry) and so we don't
> need to save the inputs.  And once we do that, we can use
> the output carry as a direct input to the next insn.
> 
> Changes for v3:
>   * Rebased.
> Changes for v2:
>   * Add a few more comments, and enhance the patch descriptions.
> 
> 
> r~
> 
> Richard Henderson (4):
>   target/s390x: Improve cc computation for ADD LOGICAL
>   target/s390x: Improve ADD LOGICAL WITH CARRY
>   target/s390x: Improve cc computation for SUBTRACT LOGICAL
>   target/s390x: Improve SUB LOGICAL WITH BORROW
> 
>  target/s390x/internal.h    |  11 +-
>  target/s390x/cc_helper.c   | 123 +++-------------
>  target/s390x/helper.c      |  10 +-
>  target/s390x/translate.c   | 289 ++++++++++++++++++++-----------------
>  target/s390x/insn-data.def |  76 +++++-----
>  5 files changed, 216 insertions(+), 293 deletions(-)
> 

Thanks, applied.