Open luyahan opened 4 years ago
@liweiwei90 这个问题上游修复了么,在全家桶分支上是否fix了?
我在全家桶运行了下,也存在这个问题,我跟踪一下。
这里结果是0是合理的,fs9是由0存进去的double数据,然后用在了flt.s中,它是非nan-boxing的,所以会被用作cannonical-NAN,根据spec中的描述这里确实应该返回0:“FLT.S and FLE.S perform what the IEEE 754-2008 standard refers to as signaling comparisons: that is, they set the invalid operation exception flag if either input is NaN. FEQ.S performs a quiet comparison: it only sets the invalid operation exception flag if either input is a signaling NaN. For all three instructions, the result is 0 if either operand is NaN.”
如果是希望-5和0比较,第一条指令应该用fmv.s.x
qemu: Hifive unleashed:
测试代码:
fs9为0x0, 理论上 float=NaN. 故flt.s s3,%1,fs9 之后 s3应该为0.
refer to https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/mfGw77uQYwc/m/1IrLgMpWAwAJ.