Skip to content
Snippets Groups Projects
Commit 9cb4e398 authored by Alex Bennée's avatar Alex Bennée Committed by Peter Maydell
Browse files

fpu/softfloat: check for Inf / x or 0 / x before /0


The re-factoring of div_floats changed the order of checking meaning
an operation like -inf/0 erroneously raises the divbyzero flag.
IEEE-754 (2008) specifies this should only occur for operations on
finite operands.

We fix this by moving the check on the dividend being Inf/0 to before
the divisor is zero check.

Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Message-id: 20180416135442.30606-1-alex.bennee@linaro.org
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Reviewed-by: default avatarBastian Koppelmann <kbastian@mail.uni-paderborn.de>
Tested-by: default avatarBastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 2a6b5372
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