[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 1/2] softfloat: add APIs to handle alternative sNaN propag

From: Richard Henderson
Subject: Re: [PATCH v4 1/2] softfloat: add APIs to handle alternative sNaN propagation for fmax/fmin
Date: Sat, 16 Oct 2021 10:59:02 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/16/21 1:54 AM, frank.chang@sifive.com wrote:
From: Chih-Min Chao<chihmin.chao@sifive.com>

For "fmax/fmin ft0, ft1, ft2" and if one of the inputs is sNaN,

   The original logic:
     Return NaN and set invalid flag if ft1 == sNaN || ft2 == sNan.

   The alternative path:
     Set invalid flag if ft1 == sNaN || ft2 == sNaN.
     Return NaN only if ft1 == NaN && ft2 == NaN.

The IEEE 754 spec allows both implementation and some architecture such
as riscv choose different defintions in two spec versions.
(riscv-spec-v2.2 use original version, riscv-spec-20191213 changes to

Signed-off-by: Chih-Min Chao<chihmin.chao@sifive.com>
Signed-off-by: Frank Chang<frank.chang@sifive.com>
  fpu/softfloat-parts.c.inc | 25 +++++++++++++++++++++++--
  fpu/softfloat.c           | 19 +++++++++++++------
  include/fpu/softfloat.h   | 10 ++++++++++
  3 files changed, 46 insertions(+), 8 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]