[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 5/6] target-arm: Silence NaNs resulting from half
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v3 5/6] target-arm: Silence NaNs resulting from half-precision conversions |
Date: |
Thu, 10 Feb 2011 11:29:00 +0000 |
Silence the NaNs that may result from half-precision conversion,
as we do for the other conversions.
Signed-off-by: Peter Maydell <address@hidden>
---
target-arm/helper.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index d29c42b..e427747 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -2627,14 +2627,22 @@ float32 HELPER(vfp_fcvt_f16_to_f32)(uint32_t a,
CPUState *env)
{
float_status *s = &env->vfp.fp_status;
int ieee = (env->vfp.xregs[ARM_VFP_FPSCR] & (1 << 26)) == 0;
- return float16_to_float32(make_float16(a), ieee, s);
+ float32 r = float16_to_float32(make_float16(a), ieee, s);
+ if (ieee) {
+ return float32_maybe_silence_nan(r);
+ }
+ return r;
}
uint32_t HELPER(vfp_fcvt_f32_to_f16)(float32 a, CPUState *env)
{
float_status *s = &env->vfp.fp_status;
int ieee = (env->vfp.xregs[ARM_VFP_FPSCR] & (1 << 26)) == 0;
- return float16_val(float32_to_float16(a, ieee, s));
+ float16 r = float32_to_float16(a, ieee, s);
+ if (ieee) {
+ r = float16_maybe_silence_nan(r);
+ }
+ return float16_val(r);
}
float32 HELPER(recps_f32)(float32 a, float32 b, CPUState *env)
--
1.7.1
- [Qemu-devel] [PATCH v3 0/6] target-arm: Fix floating point conversions, Peter Maydell, 2011/02/10
- [Qemu-devel] [PATCH v3 5/6] target-arm: Silence NaNs resulting from half-precision conversions,
Peter Maydell <=
- [Qemu-devel] [PATCH v3 4/6] softfloat: Correctly handle NaNs in float16_to_float32(), Peter Maydell, 2011/02/10
- [Qemu-devel] [PATCH v3 2/6] softfloat: Honour default_nan_mode for float-to-float conversions, Peter Maydell, 2011/02/10
- [Qemu-devel] [PATCH v3 1/6] softfloat: Add float16 type and float16 NaN handling functions, Peter Maydell, 2011/02/10
- [Qemu-devel] [PATCH v3 6/6] target-arm: Use standard FPSCR for Neon half-precision operations, Peter Maydell, 2011/02/10
- [Qemu-devel] [PATCH v3 3/6] softfloat: Fix single-to-half precision float conversions, Peter Maydell, 2011/02/10
- Re: [Qemu-devel] [PATCH v3 0/6] target-arm: Fix floating point conversions, Aurelien Jarno, 2011/02/10