]> git.proxmox.com Git - mirror_qemu.git/commit
target/mips: Fix minor bug in FPU
authorMateja Marjanovic <Mateja.Marjanovic@rt-rk.com>
Tue, 19 Mar 2019 15:21:56 +0000 (16:21 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 25 Mar 2019 10:34:48 +0000 (10:34 +0000)
commit7ca96e1a9cadc32af7df73dcf4438b08667d07a6
treef99f861a9a7433830f66cec1f8a4e3180cf008d0
parentaec2927dda69f35bab188a9bc577861e62044001
target/mips: Fix minor bug in FPU

Wrong type of NaN was generated for IEEE 754-2008 by MADDF.<D|S> and
MSUBF.<D|S> instructions when the arguments were (Inf, Zero, NaN) or
(Zero, Inf, NaN).

The if-else statement establishes if the system conforms to IEEE
754-1985 or IEEE 754-2008, and defines different behaviors depending
on that. In case of IEEE 754-2008, in mentioned cases of inputs,
<MADDF|MSUBF>.<D|S> returns the input value 'c' [2] (page 53) and
raises floating point exception 'Invalid Operation' [1] (pages 349,
350).

These scenarios were tested and the results in QEMU emulation match
the results obtained on the machine that has a MIPS64R6 CPU.

[1] MIPS Architecture for Programmers Volume II-a: The MIPS64
    Instruction Set Reference Manual, Revision 6.06
[2] MIPS Architecture for Programmers Volume IV-j: The MIPS64
    SIMD Architecture Module, Revision 1.12

Signed-off-by: Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
Message-Id: <1553008916-15274-2-git-send-email-mateja.marjanovic@rt-rk.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[AJB: fixed up commit message]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
fpu/softfloat-specialize.h