Skip to content
Snippets Groups Projects
Commit 0e903037 authored by Chih-Min Chao's avatar Chih-Min Chao Committed by Alistair Francis
Browse files

softfloat: add APIs to handle alternative sNaN propagation for fmax/fmin


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
 alternative)

Signed-off-by: default avatarChih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: default avatarFrank Chang <frank.chang@sifive.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20211021160847.2748577-2-frank.chang@sifive.com>
Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
parent 50d16087
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment