On 7/30/20 2:52 AM, Chih-Min Chao wrote: > 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 if ft1 == sNaN && ft2 == sNaN > > The ieee754 spec allows both implementation and some architecture such > as riscv choose differenct defintion in two spec versions. > (riscv-spec-v2.2 use original version, riscv-spec-20191213 changes to > alternative) > > Signed-off-by: Chih-Min Chao <chihmin.c...@sifive.com>
If both ft1 and ft2 are SNaN, surely the returned result is silenced? That is something that is handled by pick_nan, but is not handled here. Also, the patch subject should be modified to emphasize that this only applies to min/max and not propagation of all SNaN. r~