qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Brenken <david.brenken@efs-auto.org>
To: qemu-devel@nongnu.org
Cc: kbastian@mail.uni-paderborn.de,
	David Brenken <david.brenken@efs-auto.de>,
	Georg Hofstetter <georg.hofstetter@efs-auto.de>,
	Andreas Konopik <andreas.konopik@efs-auto.de>
Subject: [PATCH v2 1/1] tricore: fixed faulty conditions for extr and imask
Date: Thu, 11 Feb 2021 12:53:29 +0100	[thread overview]
Message-ID: <20210211115329.8984-2-david.brenken@efs-auto.org> (raw)
In-Reply-To: <20210211115329.8984-1-david.brenken@efs-auto.org>

From: Andreas Konopik <andreas.konopik@efs-auto.de>

Signed-off-by: Andreas Konopik <andreas.konopik@efs-auto.de>
Signed-off-by: Georg Hofstetter <georg.hofstetter@efs-auto.de>
Signed-off-by: David Brenken <david.brenken@efs-auto.de>
---
 target/tricore/translate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index 7752630ac1..ebeddf8f4a 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -5777,8 +5777,8 @@ static void decode_rcpw_insert(DisasContext *ctx)
     switch (op2) {
     case OPC2_32_RCPW_IMASK:
         CHECK_REG_PAIR(r2);
-        /* if pos + width > 31 undefined result */
-        if (pos + width <= 31) {
+        /* if pos + width > 32 undefined result */
+        if (pos + width <= 32) {
             tcg_gen_movi_tl(cpu_gpr_d[r2+1], ((1u << width) - 1) << pos);
             tcg_gen_movi_tl(cpu_gpr_d[r2], (const4 << pos));
         }
@@ -6999,7 +6999,7 @@ static void decode_rrpw_extract_insert(DisasContext *ctx)
 
     switch (op2) {
     case OPC2_32_RRPW_EXTR:
-        if (pos + width <= 31) {
+        if (pos + width <= 32) {
             /* optimize special cases */
             if ((pos == 0) && (width == 8)) {
                 tcg_gen_ext8s_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]);
@@ -7021,7 +7021,7 @@ static void decode_rrpw_extract_insert(DisasContext *ctx)
         break;
     case OPC2_32_RRPW_IMASK:
         CHECK_REG_PAIR(r3);
-        if (pos + width <= 31) {
+        if (pos + width <= 32) {
             tcg_gen_movi_tl(cpu_gpr_d[r3+1], ((1u << width) - 1) << pos);
             tcg_gen_shli_tl(cpu_gpr_d[r3], cpu_gpr_d[r2], pos);
         }
-- 
2.30.0



  reply	other threads:[~2021-02-11 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 11:53 [PATCH v2 0/1] tricore: fixed faulty conditions for extr and imask David Brenken
2021-02-11 11:53 ` David Brenken [this message]
2021-02-11 12:10   ` [PATCH v2 1/1] " Philippe Mathieu-Daudé
2021-02-11 13:49     ` Konopik, Andreas (EFS-GH2)
2021-03-05 12:43       ` Bastian Koppelmann
2021-03-05 11:50   ` Bastian Koppelmann

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=20210211115329.8984-2-david.brenken@efs-auto.org \
    --to=david.brenken@efs-auto.org \
    --cc=andreas.konopik@efs-auto.de \
    --cc=david.brenken@efs-auto.de \
    --cc=georg.hofstetter@efs-auto.de \
    --cc=kbastian@mail.uni-paderborn.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).