]> git.proxmox.com Git - mirror_qemu.git/commit
fpu/softfloat: set invalid excp flag for RISC-V muladd instructions
authorFrank Chang <frank.chang@sifive.com>
Tue, 20 Apr 2021 01:31:48 +0000 (09:31 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 11 May 2021 10:02:07 +0000 (20:02 +1000)
commit3a7f7757ba95a374f73ed08cd5a9af366299ef81
treec7bfc35e1fb8ca53f77e8433584541589984fee5
parentd11e316d843b2d370a547700407947356e4117cb
fpu/softfloat: set invalid excp flag for RISC-V muladd instructions

In IEEE 754-2008 spec:
  Invalid operation exception is signaled when doing:
  fusedMultiplyAdd(0, Inf, c) or fusedMultiplyAdd(Inf, 0, c)
  unless c is a quiet NaN; if c is a quiet NaN then it is
  implementation defined whether the invalid operation exception
  is signaled.

In RISC-V Unprivileged ISA spec:
  The fused multiply-add instructions must set the invalid
  operation exception flag when the multiplicands are Inf and
  zero, even when the addend is a quiet NaN.

This commit set invalid operation execption flag for RISC-V when
multiplicands of muladd instructions are Inf and zero.

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210420013150.21992-1-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
fpu/softfloat-specialize.c.inc