[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered()
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function |
Date: |
Wed, 13 Apr 2011 15:52:11 +0100 |
On 12 April 2011 22:59, Aurelien Jarno <address@hidden> wrote:
> Use float64_unordered() in helper_cmptun() instead of doing the
> the comparison manually. This also fixes the wrong behaviours with
> sNaNs.
>
> Signed-off-by: Aurelien Jarno <address@hidden>
> ---
> target-alpha/op_helper.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
> index 6c2ae20..e07ae69 100644
> --- a/target-alpha/op_helper.c
> +++ b/target-alpha/op_helper.c
> @@ -904,10 +904,11 @@ uint64_t helper_cmptun (uint64_t a, uint64_t b)
> fa = t_to_float64(a);
> fb = t_to_float64(b);
>
> - if (float64_is_quiet_nan(fa) || float64_is_quiet_nan(fb))
> + if (float64_unordered(fa, fb, &FP_STATUS)) {
> return 0x4000000000000000ULL;
> - else
> + } else {
> return 0;
> + }
> }
I'm not sure this is right. The Alpha Architecture Handbook is a
bit opaque, but the Compiler Writer's Guide is clearer:
www.compaq.com/cpq-alphaserver/technology/literature/cmpwrgd.pdf
page D-4 says that CMPTUN (like CMPTEQ) should generate InvalidOp
for SNaNs but not for QNaNs. (Contrast CMPTLT, CMPTLE, which set
InvalidOp for both SNaNs and QNaNs.)
So I think you want the _quiet version here. (And helper_cmpteq
needs to use float64_eq_quiet rather than float64_eq.)
-- PMM
- [Qemu-devel] [PATCH 00/19] softfloat and FPU fixes/improvements, Aurelien Jarno, 2011/04/12
- [Qemu-devel] [PATCH 05/19] target-i386: add floatx_{add, mul, sub} and use them, Aurelien Jarno, 2011/04/12
- [Qemu-devel] [PATCH 07/19] softfloat-native: add float*_unordered_quiet() functions, Aurelien Jarno, 2011/04/12
- [Qemu-devel] [PATCH 06/19] softfloat: add float*_unordered_{, quiet}() functions, Aurelien Jarno, 2011/04/12
- [Qemu-devel] [PATCH 15/19] target-arm: fix wrong usage of floatx80_eq_quiet(), Aurelien Jarno, 2011/04/12
- [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Aurelien Jarno, 2011/04/12
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Peter Maydell, 2011/04/14
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Richard Henderson, 2011/04/14
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Peter Maydell, 2011/04/14
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Richard Henderson, 2011/04/14
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Peter Maydell, 2011/04/14
- Re: [Qemu-devel] [PATCH 08/19] target-alpha: use new float64_unordered() function, Richard Henderson, 2011/04/14