[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v6 8/9] target-mips: Add nan2008 flavor of <CEIL|C
From: |
Leon Alrae |
Subject: |
Re: [Qemu-arm] [PATCH v6 8/9] target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D> |
Date: |
Tue, 31 May 2016 15:13:14 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, May 16, 2016 at 04:12:44PM +0200, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <address@hidden>
>
> New set of helpers for handling nan2008-syle versions of instructions
> <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>, for Mips R6.
>
> All involved instructions have float operand and integer result. Their
> core functionality is implemented via invocations of appropriate SoftFloat
> functions. The problematic cases are when the operand is a NaN, and also
> when the operand (float) is out of the range of the result.
>
> Here one can distinguish three cases:
>
> CASE MIPS-A: (FCR31.NAN2008 == 1)
>
> 1. Operand is a NaN, result should be 0;
> 2. Operand is larger than INT_MAX, result should be INT_MAX;
> 2. Operand is smaller than INT_MIN, result should be INT_MIN.
>
> CASE MIPS-B: (FCR31.NAN2008 == 0)
>
> 1. Operand is a NaN, result should be INT_MAX;
> 2. Operand is larger than INT_MAX, result should be INT_MAX;
> 2. Operand is smaller than INT_MIN, result should be INT_MAX.
>
> CASE SOFTFLOAT:
>
> 1. Operand is a NaN, result is INT_MAX;
> 2. Operand is larger than INT_MAX, result is INT_MAX;
> 2. Operand is smaller than INT_MIN, result is INT_MIN.
>
> It is interesting that neither MIPS-A nor MIPS-B desired behaviors
> are in this sense identical to correspondent SoftFloat behavior.
>
> Current implementation of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>
> implements case MIPS-B. This patch relates to case MIPS-A. For case
> MIPS-A, only return value for NaN-operands should be corrected after
> appropriate SoftFloat library function is called.
>
> Related MSA instructions FTRUNC_S and FTINT_S already handle well
> all cases, in the fashion similar to the code from this patch.
>
> Signed-off-by: Aleksandar Markovic <address@hidden>
> ---
> target-mips/helper.h | 18 +--
> target-mips/op_helper.c | 369
> +++++++++++++++++++++++++++++++++++++++++++++---
> target-mips/translate.c | 122 +++++++++++++---
> 3 files changed, 461 insertions(+), 48 deletions(-)
Reviewed-by: Leon Alrae <address@hidden>
- [Qemu-arm] [PATCH v6 0/9] IEEE 754-2008 support for Mips, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 2/9] softfloat: Clean code format in fpu/softfloat-specialize.h, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 3/9] softfloat: For Mips only, correct default NaN values, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 4/9] softfloat: For Mips only, correct order in pickNaNMulAdd(), Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 5/9] linux-user: Update preprocessor constants for Mips-specific e_flags bits, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 6/9] target-mips: Activate IEEE 754-2008 signaling NaN bit meaning, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 7/9] target-mips: Add abs2008 flavor of <ABS|NEG>.<S|D>, Aleksandar Markovic, 2016/05/16
- [Qemu-arm] [PATCH v6 8/9] target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>, Aleksandar Markovic, 2016/05/16
- Re: [Qemu-arm] [PATCH v6 8/9] target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>,
Leon Alrae <=
- [Qemu-arm] [PATCH v6 9/9] target-mips: Implement FCR31's R/W bitmask and related functionalities, Aleksandar Markovic, 2016/05/16
- Re: [Qemu-arm] [PATCH v6 0/9] IEEE 754-2008 support for Mips, Aleksandar Markovic, 2016/05/25