All of lore.kernel.org
 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 10/12] Hexagon (target/hexagon) fix bug in conv_df2uw_chop
Date: Wed,  9 Feb 2022 18:15:54 -0800	[thread overview]
Message-ID: <20220210021556.9217-11-tsimpson@quicinc.com> (raw)
In-Reply-To: <20220210021556.9217-1-tsimpson@quicinc.com>

Fix typo that checked for 32 bit nan instead of 64 bit

Test case added in tests/tcg/hexagon/usr.c

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 target/hexagon/op_helper.c | 2 +-
 tests/tcg/hexagon/usr.c    | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index 7f40e09486..47729a48bd 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -829,7 +829,7 @@ uint32_t HELPER(conv_df2uw_chop)(CPUHexagonState *env, float64 RssV)
     uint32_t RdV;
     arch_fpop_start(env);
     /* Hexagon checks the sign before rounding */
-    if (float64_is_neg(RssV) && !float32_is_any_nan(RssV)) {
+    if (float64_is_neg(RssV) && !float64_is_any_nan(RssV)) {
         float_raise(float_flag_invalid, &env->fp_status);
         RdV = 0;
     } else {
diff --git a/tests/tcg/hexagon/usr.c b/tests/tcg/hexagon/usr.c
index a0006da25a..1b7d43baf4 100644
--- a/tests/tcg/hexagon/usr.c
+++ b/tests/tcg/hexagon/usr.c
@@ -1072,6 +1072,10 @@ int main()
     TEST_P_OP_P(conv_df2d,        DF_SNaN,  0xffffffffffffffffULL,  USR_FPINVF);
     TEST_R_OP_P(conv_df2uw_chop,  DF_QNaN,  0xffffffff,             USR_FPINVF);
     TEST_R_OP_P(conv_df2uw_chop,  DF_SNaN,  0xffffffff,             USR_FPINVF);
+
+    /* Test for typo in HELPER(conv_df2uw_chop) */
+    TEST_R_OP_P(conv_df2uw_chop, 0xffffff7f00000001ULL, 0xffffffff, USR_FPINVF);
+
     TEST_R_OP_P(conv_df2w_chop,   DF_QNaN,  0xffffffff,             USR_FPINVF);
     TEST_R_OP_P(conv_df2w_chop,   DF_SNaN,  0xffffffff,             USR_FPINVF);
     TEST_P_OP_P(conv_df2ud_chop,  DF_QNaN,  0xffffffffffffffffULL,  USR_FPINVF);
-- 
2.17.1


  parent reply	other threads:[~2022-02-10  2:20 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 ` [PATCH v2 01/12] Hexagon (target/hexagon) fix bug in circular addressing Taylor Simpson
2022-02-11  0:39   ` 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 ` Taylor Simpson [this message]
2022-02-11  1:06   ` [PATCH v2 10/12] Hexagon (target/hexagon) fix bug in conv_df2uw_chop 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-11-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.