qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcg: Extend call args using the correct opcodes
@ 2021-10-28 18:44 Richard Henderson
  2021-10-28 18:59 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Henderson @ 2021-10-28 18:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: luis.pires, alex.bennee, f4bug

Pretending that the source is i64 when it is in fact i32 is
incorrect; we have type-changing opcodes that must be used.
This bug trips up the subsequent change to the optimizer.

Fixes: 4f2331e5b67a
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---

This fixes a problem found in s390x host testing, and should
be considered patch 41.5/51 in

  [PATCH v4 00/51] tcg: optimize redundant sign extensions

just before 

  tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values


r~

---
 tcg/tcg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 024a22cf39..6332cdceca 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1508,11 +1508,11 @@ void tcg_gen_callN(void *func, TCGTemp *ret, int nargs, TCGTemp **args)
 
         if (is_32bit) {
             TCGv_i64 temp = tcg_temp_new_i64();
-            TCGv_i64 orig = temp_tcgv_i64(args[i]);
+            TCGv_i32 orig = temp_tcgv_i32(args[i]);
             if (is_signed) {
-                tcg_gen_ext32s_i64(temp, orig);
+                tcg_gen_ext_i32_i64(temp, orig);
             } else {
-                tcg_gen_ext32u_i64(temp, orig);
+                tcg_gen_extu_i32_i64(temp, orig);
             }
             args[i] = tcgv_i64_temp(temp);
         }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tcg: Extend call args using the correct opcodes
  2021-10-28 18:44 [PATCH] tcg: Extend call args using the correct opcodes Richard Henderson
@ 2021-10-28 18:59 ` Philippe Mathieu-Daudé
  2021-10-28 19:55 ` Luis Fernando Fujita Pires
  2021-11-01 10:14 ` Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-10-28 18:59 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: luis.pires, alex.bennee

On 10/28/21 20:44, Richard Henderson wrote:
> Pretending that the source is i64 when it is in fact i32 is
> incorrect; we have type-changing opcodes that must be used.
> This bug trips up the subsequent change to the optimizer.
> 
> Fixes: 4f2331e5b67a
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> 
> This fixes a problem found in s390x host testing, and should
> be considered patch 41.5/51 in
> 
>   [PATCH v4 00/51] tcg: optimize redundant sign extensions
> 
> just before 
> 
>   tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values
> 
> 
> r~
> 
> ---
>  tcg/tcg.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] tcg: Extend call args using the correct opcodes
  2021-10-28 18:44 [PATCH] tcg: Extend call args using the correct opcodes Richard Henderson
  2021-10-28 18:59 ` Philippe Mathieu-Daudé
@ 2021-10-28 19:55 ` Luis Fernando Fujita Pires
  2021-11-01 10:14 ` Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Fernando Fujita Pires @ 2021-10-28 19:55 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel@nongnu.org
  Cc: alex.bennee@linaro.org, f4bug@amsat.org

From: Richard Henderson <richard.henderson@linaro.org>
> Pretending that the source is i64 when it is in fact i32 is incorrect; we have type-
> changing opcodes that must be used.
> This bug trips up the subsequent change to the optimizer.
> 
> Fixes: 4f2331e5b67a
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> 
> This fixes a problem found in s390x host testing, and should be considered patch
> 41.5/51 in
> 
>   [PATCH v4 00/51] tcg: optimize redundant sign extensions
> 
> just before
> 
>   tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values
> 
> 
> r~
> 
> ---
>  tcg/tcg.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>

--
Luis Pires
Instituto de Pesquisas ELDORADO
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tcg: Extend call args using the correct opcodes
  2021-10-28 18:44 [PATCH] tcg: Extend call args using the correct opcodes Richard Henderson
  2021-10-28 18:59 ` Philippe Mathieu-Daudé
  2021-10-28 19:55 ` Luis Fernando Fujita Pires
@ 2021-11-01 10:14 ` Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2021-11-01 10:14 UTC (permalink / raw)
  To: Richard Henderson; +Cc: luis.pires, qemu-devel, f4bug


Richard Henderson <richard.henderson@linaro.org> writes:

> Pretending that the source is i64 when it is in fact i32 is
> incorrect; we have type-changing opcodes that must be used.
> This bug trips up the subsequent change to the optimizer.
>
> Fixes: 4f2331e5b67a
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-01 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-28 18:44 [PATCH] tcg: Extend call args using the correct opcodes Richard Henderson
2021-10-28 18:59 ` Philippe Mathieu-Daudé
2021-10-28 19:55 ` Luis Fernando Fujita Pires
2021-11-01 10:14 ` Alex Bennée

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).