I referred to SoftFloat library in QEMU code, and the case "Operand is smaller 
than INT_MIN" is different between SoftFloat and Mips-B, while the case 
"Operand is a NaN" is different between SoftFloat and Mips-A.

Aleksandar
________________________________________
From: Maciej Rozycki
Sent: Tuesday, June 07, 2016 4:39 AM
To: Aleksandar Markovic
Cc: qemu-devel@nongnu.org; peter.mayd...@linaro.org; pro...@gmail.com; 
kbast...@mail.uni-paderborn.de; mark.cave-ayl...@ilande.co.uk; ag...@suse.de; 
blauwir...@gmail.com; jcmvb...@gmail.com; Aleksandar Markovic; 
qemu-...@nongnu.org; qemu-...@nongnu.org; Petar Jovanovic; pbonz...@redhat.com; 
Miodrag Dinic; edgar.igles...@gmail.com; g...@mprc.pku.edu.cn; Leon Alrae; 
afaer...@suse.de; Aurelien Jarno; r...@twiddle.net
Subject: Re: [PATCH v6 8/9] target-mips: Add nan2008 flavor of 
<CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>

On Mon, 16 May 2016, Aleksandar Markovic wrote:

> 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.

 A bug in SoftFloat probably -- it has only been fixed quite recently to
handle all MIPS architecture's peculiarites correctly and this case must
have been missed then, making data produced not necessarily identical
between the legacy-NaN hard-float and the soft-float ABIs, even though
intent has been for it to be.

 FAOD, you refer to SoftFloat in the most recent version of GCC, do you?

  Maciej

Reply via email to