qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Simpson <tsimpson@quicinc.com>
To: qemu-devel@nongnu.org
Cc: ale@rev.ng, bcain@quicinc.com, richard.henderson@linaro.org,
	f4bug@amsat.org, tsimpson@quicinc.com, mlambert@quicinc.com
Subject: [PATCH v2 01/12] Hexagon (target/hexagon) fix bug in circular addressing
Date: Wed,  9 Feb 2022 18:15:45 -0800	[thread overview]
Message-ID: <20220210021556.9217-2-tsimpson@quicinc.com> (raw)
In-Reply-To: <20220210021556.9217-1-tsimpson@quicinc.com>

From: Michael Lambert <mlambert@quicinc.com>

Versions V3 and earlier should treat the "K_const" and "length" values
as unsigned.

Modified circ_test_v3() in tests/tcg/hexagon/circ.c to reproduce the bug

Signed-off-by: Michael Lambert <mlambert@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 target/hexagon/op_helper.c | 6 +++---
 tests/tcg/hexagon/circ.c   | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index 057baf9a48..47bd51e0ca 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
+ *  Copyright(c) 2019-2022 Qualcomm Innovation Center, Inc. All Rights Reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -304,8 +304,8 @@ void HELPER(debug_commit_end)(CPUHexagonState *env, int has_st0, int has_st1)
 
 int32_t HELPER(fcircadd)(int32_t RxV, int32_t offset, int32_t M, int32_t CS)
 {
-    int32_t K_const = sextract32(M, 24, 4);
-    int32_t length = sextract32(M, 0, 17);
+    uint32_t K_const = extract32(M, 24, 4);
+    uint32_t length = extract32(M, 0, 17);
     uint32_t new_ptr = RxV + offset;
     uint32_t start_addr;
     uint32_t end_addr;
diff --git a/tests/tcg/hexagon/circ.c b/tests/tcg/hexagon/circ.c
index 67a1aa3054..354416eb6d 100644
--- a/tests/tcg/hexagon/circ.c
+++ b/tests/tcg/hexagon/circ.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
+ *  Copyright(c) 2019-2022 Qualcomm Innovation Center, Inc. All Rights Reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -415,7 +415,8 @@ static void circ_test_v3(void)
 {
     int *p = wbuf;
     int size = 15;
-    int K = 4;      /* 64 bytes */
+    /* set high bit in K to test unsigned extract in fcirc */
+    int K = 8;      /* 1024 bytes */
     int element;
     int i;
 
-- 
2.17.1


  reply	other threads:[~2022-02-10  2:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10  2:15 [PATCH v2 00/12] Hexagon bug fixes and additional tests Taylor Simpson
2022-02-10  2:15 ` Taylor Simpson [this message]
2022-02-11  0:39   ` [PATCH v2 01/12] Hexagon (target/hexagon) fix bug in circular addressing Richard Henderson
2022-02-10  2:15 ` [PATCH v2 02/12] Hexagon HVX (target/hexagon) fix bug in HVX saturate instructions Taylor Simpson
2022-02-11  0:43   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 03/12] Hexagon (target/hexagon) properly set FPINVF bit in sfcmp.uo and dfcmp.uo Taylor Simpson
2022-02-11  0:44   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 04/12] Hexagon (target/hexagon) properly handle SNaN in dfmin/dfmax/sfmin/sfmax Taylor Simpson
2022-02-11  0:51   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 05/12] Hexagon (target/hexagon) properly handle denorm in arch_sf_recip_common Taylor Simpson
2022-02-11  0:54   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 06/12] Hexagon (tests/tcg/hexagon) test instructions that might set bits in USR Taylor Simpson
2022-02-11  1:02   ` Richard Henderson
2022-02-11  4:09     ` Taylor Simpson
2022-02-10  2:15 ` [PATCH v2 07/12] Hexagon (tests/tcg/hexagon) add floating point instructions to usr.c Taylor Simpson
2022-02-11  1:05   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 08/12] Hexagon (tests/tcg/hexagon) update overflow test Taylor Simpson
2022-02-11  1:06   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 09/12] Hexagon (tests/tcg/hexagon) fix inline asm in preg_alias.c Taylor Simpson
2022-02-10  2:15 ` [PATCH v2 10/12] Hexagon (target/hexagon) fix bug in conv_df2uw_chop Taylor Simpson
2022-02-11  1:06   ` Richard Henderson
2022-02-10  2:15 ` [PATCH v2 11/12] Hexagon (target/hexagon) make VyV operands use a unique temp Taylor Simpson
2022-02-10  2:15 ` [PATCH v2 12/12] Hexagon (target/hexagon) assignment to c4 should wait until packet commit Taylor Simpson
2022-02-11  1:13   ` Richard Henderson

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=20220210021556.9217-2-tsimpson@quicinc.com \
    --to=tsimpson@quicinc.com \
    --cc=ale@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=f4bug@amsat.org \
    --cc=mlambert@quicinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).