From: Peter Maydell <peter.maydell@linaro.org>
To: Anthony Liguori <anthony@codemonkey.ws>, qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 04/10] target-arm: Fix VCLE.F32 #0, VCLT.F32 #0 NaN handling
Date: Fri, 1 Apr 2011 15:30:37 +0100 [thread overview]
Message-ID: <1301668243-29886-5-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1301668243-29886-1-git-send-email-peter.maydell@linaro.org>
Implementing the floating-point versions of VCLE #0 and VCLT #0 by
doing a GT comparison and inverting the result gives the wrong
result if the input is a NaN. Implement as a GT comparison with the
operands swapped instead.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target-arm/translate.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/target-arm/translate.c b/target-arm/translate.c
index cf2440e..6ce8b7a 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -5641,25 +5641,31 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
gen_neon_rsb(size, tmp, tmp2);
tcg_temp_free(tmp2);
break;
- case 24: case 27: /* Float VCGT #0, Float VCLE #0 */
+ case 24: /* Float VCGT #0 */
tmp2 = tcg_const_i32(0);
gen_helper_neon_cgt_f32(tmp, cpu_env, tmp, tmp2);
tcg_temp_free(tmp2);
- if (op == 27)
- tcg_gen_not_i32(tmp, tmp);
break;
- case 25: case 28: /* Float VCGE #0, Float VCLT #0 */
+ case 25: /* Float VCGE #0 */
tmp2 = tcg_const_i32(0);
gen_helper_neon_cge_f32(tmp, cpu_env, tmp, tmp2);
tcg_temp_free(tmp2);
- if (op == 28)
- tcg_gen_not_i32(tmp, tmp);
break;
case 26: /* Float VCEQ #0 */
tmp2 = tcg_const_i32(0);
gen_helper_neon_ceq_f32(tmp, cpu_env, tmp, tmp2);
tcg_temp_free(tmp2);
break;
+ case 27: /* Float VCLE #0 */
+ tmp2 = tcg_const_i32(0);
+ gen_helper_neon_cge_f32(tmp, cpu_env, tmp2, tmp);
+ tcg_temp_free(tmp2);
+ break;
+ case 28: /* Float VCLT #0 */
+ tmp2 = tcg_const_i32(0);
+ gen_helper_neon_cgt_f32(tmp, cpu_env, tmp2, tmp);
+ tcg_temp_free(tmp2);
+ break;
case 30: /* Float VABS */
gen_vfp_abs(0);
break;
--
1.7.1
next prev parent reply other threads:[~2011-04-01 14:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 14:30 [Qemu-devel] [PATCH 00/10] [PULL] ARM Neon fixes Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 01/10] target-arm: Make Neon helper routines use correct FP status Peter Maydell
2011-04-01 18:29 ` Blue Swirl
2011-04-01 22:33 ` Peter Maydell
2011-04-03 9:41 ` Blue Swirl
2011-04-03 10:51 ` Peter Maydell
2011-04-03 11:10 ` Blue Swirl
2011-04-03 11:21 ` Peter Maydell
2011-04-03 11:52 ` Blue Swirl
2011-04-03 15:12 ` Aurelien Jarno
2011-04-03 15:32 ` Peter Maydell
2011-04-03 16:01 ` Aurelien Jarno
2011-04-01 14:30 ` [Qemu-devel] [PATCH 02/10] target-arm/neon_helper.c: Use make_float32/float32_val macros Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 03/10] target-arm: Return right result for Neon comparison with NaNs Peter Maydell
2011-04-01 14:30 ` Peter Maydell [this message]
2011-04-01 14:30 ` [Qemu-devel] [PATCH 05/10] target-arm: Correct ABD's handling of negative zeroes Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 06/10] softfloat: Add float*_min() and float*_max() functions Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 07/10] target-arm: Use new softfloat min/max functions for VMAX, VMIN Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 08/10] target-arm: Fix VLD of single element to all lanes Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 09/10] target-arm: Don't leak TCG temp for UNDEFs in Neon load/store space Peter Maydell
2011-04-01 14:30 ` [Qemu-devel] [PATCH 10/10] target-arm/helper.c: For float-int conversion helpers pass ints as ints Peter Maydell
2011-04-01 18:25 ` Blue Swirl
2011-04-03 16:03 ` [Qemu-devel] [PATCH 00/10] [PULL] ARM Neon fixes Aurelien Jarno
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=1301668243-29886-5-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=anthony@codemonkey.ws \
--cc=aurelien@aurel32.net \
--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).