[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/7] target-arm: Fix VCLE.F32 #0, VCLT.F32 #0 NaN ha
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 4/7] target-arm: Fix VCLE.F32 #0, VCLT.F32 #0 NaN handling |
Date: |
Fri, 11 Mar 2011 18:12:23 +0000 |
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 <address@hidden>
---
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 f4be8dc..adba4bf 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -5639,25 +5639,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
- [Qemu-devel] [PATCH 0/7] ARM: minor Neon fixes (mostly NaN related), Peter Maydell, 2011/03/11
- [Qemu-devel] [PATCH 4/7] target-arm: Fix VCLE.F32 #0, VCLT.F32 #0 NaN handling,
Peter Maydell <=
- [Qemu-devel] [PATCH 3/7] target-arm: Return right result for Neon comparison with NaNs, Peter Maydell, 2011/03/11
- [Qemu-devel] [PATCH 7/7] target-arm: Use new softfloat min/max functions for VMAX, VMIN, Peter Maydell, 2011/03/11
- [Qemu-devel] [PATCH 5/7] target-arm: Correct ABD's handling of negative zeroes, Peter Maydell, 2011/03/11
- [Qemu-devel] [PATCH 2/7] target-arm/neon_helper.c: Use make_float32/float32_val macros, Peter Maydell, 2011/03/11
- [Qemu-devel] [PATCH 1/7] target-arm: Make Neon helper routines use correct FP status, Peter Maydell, 2011/03/11