qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Alexander Graf <agraf@suse.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
Date: Thu, 26 May 2011 06:56:43 +0200	[thread overview]
Message-ID: <4DDDDD8B.5000606@mail.berlios.de> (raw)
In-Reply-To: <4DDDD7C8.70701@mail.berlios.de>

Am 26.05.2011 06:32, schrieb Stefan Weil:
> Am 26.05.2011 00:15, schrieb Alexander Graf:
>> On 25.05.2011, at 22:25, Stefan Weil wrote:
>>
>>> tcg_gen_shl_i64 needs an argument of type TCGv_i64.
>>> Using tmp4 needs some additional changes.
>>>
>>> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
>>> ---
>>> target-s390x/translate.c |    8 +++++---
>>> 1 files changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/target-s390x/translate.c b/target-s390x/translate.c
>>> index 8e71df3..3614516 100644
>>> --- a/target-s390x/translate.c
>>> +++ b/target-s390x/translate.c
>>> @@ -2056,7 +2056,6 @@ do_mh:
>>>             even for very long ones... */
>>>          tmp = get_address(s, 0, b2, d2);
>>>          tmp3 = tcg_const_i64(stm_len);
>>> -        tmp4 = tcg_const_i64(32);
>>>          for (i = r1;; i = (i + 1) % 16) {
>>>              switch (op) {
>>>              case 0x4:
>>> @@ -2070,7 +2069,9 @@ do_mh:
>>> #else
>>>                  tmp2 = tcg_temp_new_i64();
>>>                  tcg_gen_qemu_ld32u(tmp2, tmp, get_mem_index(s));
>>> -                tcg_gen_shl_i64(tmp2, tmp2, 4);
>>> +                tmp4 = tcg_const_i64(4);
>>> +                tcg_gen_shl_i64(tmp2, tmp2, tmp4);
>>> +                tcg_temp_free_i64(tmp4);
>>>                  tcg_gen_ext32u_i64(regs[i], regs[i]);
>>>                  tcg_gen_or_i64(regs[i], regs[i], tmp2);
>>> #endif
>>> @@ -2081,7 +2082,9 @@ do_mh:
>>>                  break;
>>>              case 0x26:
>>>                  tmp2 = tcg_temp_new_i64();
>>> +                tmp4 = tcg_const_i64(32);
>> This moves the const inside the loop, which is exactly what I was 
>> trying to avoid here. The problem is that every new const generated 
>> here issues 1 additional tcg op, which really sums up when there's 
>> too many of them. I've had the buffer exceed here plenty of times.
>>
>> Alex
>
> I noticed that, too. But adding a tmp5 and generating two const 
> outside the loop
> of whom only one or even none is used is also a bad solution.
>
> What about moving the loop inside the switch statement (one loop for 
> every case)?
> This does not look nice but looks like the best solution here.
>
> If you prefer a different solution, just omit this part of my patch 
> series.
>
> Grüße, Stefan

Would it be possible to use tcg_gen_shli_64 / tcg_gen_shri_64 and remove
tmp4 completely?

Stefan

  reply	other threads:[~2011-05-26  4:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 20:25 [Qemu-devel] [PATCH 00/12] target-s390x: Several small fixes Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64() Stefan Weil
2011-05-25 22:15   ` Alexander Graf
2011-05-26  4:32     ` Stefan Weil
2011-05-26  4:56       ` Stefan Weil [this message]
2011-05-26  7:26         ` Alexander Graf
2011-05-25 20:25 ` [Qemu-devel] [PATCH 02/12] target-s390x: Fix duplicate call of tcg_temp_new_i64 Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 03/12] target-s390x: Add missing tcg_temp_free_i64() Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 04/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 05/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 06/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 07/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 08/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 09/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 10/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 11/12] " Stefan Weil
2011-05-25 20:25 ` [Qemu-devel] [PATCH 12/12] target-s390x: Add missing tcg_temp_free_i32() Stefan Weil
2011-05-25 22:10 ` [Qemu-devel] [PATCH 00/12] target-s390x: Several small fixes Peter Maydell
2011-05-25 22:17   ` Alexander Graf
2011-05-26 21:48     ` Andreas Färber
2011-05-27  4:59       ` Stefan Weil
2011-05-27  8:37         ` Alexander Graf
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 " Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64() Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 02/12] target-s390x: Fix duplicate call of tcg_temp_new_i64 Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 03/12] target-s390x: Add missing tcg_temp_free_i64() in gen_jcc() Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 04/12] target-s390x: Add missing tcg_temp_free_i64() in do_mh() Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 05/12] target-s390x: Add missing tcg_temp_free_i64() in disas_b2() Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 06/12] target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x8e Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 07/12] target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x90 Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 08/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x8 Stefan Weil
2011-05-28  0:08   ` Alexander Graf
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 09/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x9 Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 10/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0xa Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 11/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0xb Stefan Weil
2011-05-27 17:03 ` [Qemu-devel] [PATCH v2 12/12] target-s390x: Add missing tcg_temp_free_i32() Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDDDD8B.5000606@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).