]> www.infradead.org Git - users/dwmw2/qemu.git/commit
target-sparc: fix fcmp{s,d,q} instructions wrt exception
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 7 Sep 2012 15:13:28 +0000 (17:13 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Oct 2012 06:42:06 +0000 (01:42 -0500)
commitb16148e1c6de2d71ed048c86eeb9e2c05a9eb06a
treea71561c76dfdb9bab7d996d76050647b8b039f39
parentdafd8866beba60d2e3e2e3af4c3ed60538051cf0
target-sparc: fix fcmp{s,d,q} instructions wrt exception

fcmp{s,d,q} instructions are supposed to ignore quiet NaN (contrary to
the fcmpe{s,d,q} instructions), but the current code is wrongly setting
the NV exception in that case. Moreover the current code is duplicated:
first the arguments are checked for NaN to generate an exception, and
later in case the comparison is unordered (which can only happens if one
of the argument is a NaN), the same check is done to generate an
exception.

Fix that by calling clear_float_exceptions() followed by
check_ieee_exceptions() as for the other floating point instructions.
Use the _compare_quiet functions for fcmp{s,d,q} and the _compare ones
for fcmpe{s,d,q}. Simplify the flag setting by not clearing a flag that
is set the line just below.

This fix allows the math glibc testsuite to pass.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-sparc/fop_helper.c