[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/12] Hexagon (target/hexagon) fix bug in conv_df2uw_chop
From: |
Taylor Simpson |
Subject: |
[PULL 10/12] Hexagon (target/hexagon) fix bug in conv_df2uw_chop |
Date: |
Tue, 8 Mar 2022 13:54:33 -0800 |
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>
Message-Id: <20220210021556.9217-11-tsimpson@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
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 366caf9ec8..63e5ad5d68 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 11415f8295..a531511cec 100644
--- a/tests/tcg/hexagon/usr.c
+++ b/tests/tcg/hexagon/usr.c
@@ -1068,6 +1068,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
- [PULL 00/12] Hexagon (target/hexagon) queue, Taylor Simpson, 2022/03/08
- [PULL 12/12] target/hexagon: remove unused variable, Taylor Simpson, 2022/03/08
- [PULL 09/12] Hexagon (tests/tcg/hexagon) fix inline asm in preg_alias.c, Taylor Simpson, 2022/03/08
- [PULL 04/12] Hexagon (target/hexagon) properly handle denorm in arch_sf_recip_common, Taylor Simpson, 2022/03/08
- [PULL 10/12] Hexagon (target/hexagon) fix bug in conv_df2uw_chop,
Taylor Simpson <=
- [PULL 06/12] Hexagon (tests/tcg/hexagon) test instructions that might set bits in USR, Taylor Simpson, 2022/03/08
- [PULL 02/12] Hexagon HVX (target/hexagon) fix bug in HVX saturate instructions, Taylor Simpson, 2022/03/08
- [PULL 11/12] Hexagon (target/hexagon) assignment to c4 should wait until packet commit, Taylor Simpson, 2022/03/08
- [PULL 07/12] Hexagon (tests/tcg/hexagon) add floating point instructions to usr.c, Taylor Simpson, 2022/03/08
- [PULL 05/12] Hexagon (target/hexagon) properly handle NaN in dfmin/dfmax/sfmin/sfmax, Taylor Simpson, 2022/03/08
- [PULL 01/12] Hexagon (target/hexagon) fix bug in circular addressing, Taylor Simpson, 2022/03/08
- [PULL 08/12] Hexagon (tests/tcg/hexagon) update overflow test, Taylor Simpson, 2022/03/08
- [PULL 03/12] Hexagon (target/hexagon) properly set FPINVF bit in sfcmp.uo and dfcmp.uo, Taylor Simpson, 2022/03/08
- Re: [PULL 00/12] Hexagon (target/hexagon) queue, Peter Maydell, 2022/03/10