summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2018-12-31 12:42:08 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2018-12-31 12:42:08 +0000
commitba4272df063a21cb8963bde2b64b89e7823ff178 (patch)
treef05a70d9ae02a4d959039805068ad5a2fb1e8aab /sys
parent6cb55580502e7d6436fc68e5d9dac0ae96da8645 (diff)
Set floating point condition code even if the result of an emulated
floating point comparison is unordered. The setting should be skipped only if an invalid operation exception is taken. This fixes incorrect emulated compare behaviour with NaN values. NaN issue on octeon reported by afresh1@; OK miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/fp_emulate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/mips64/mips64/fp_emulate.c b/sys/arch/mips64/mips64/fp_emulate.c
index cb497b85e7f..725cb0aabed 100644
--- a/sys/arch/mips64/mips64/fp_emulate.c
+++ b/sys/arch/mips64/mips64/fp_emulate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fp_emulate.c,v 1.20 2018/10/22 17:31:25 krw Exp $ */
+/* $OpenBSD: fp_emulate.c,v 1.21 2018/12/31 12:42:07 visa Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -935,12 +935,12 @@ fpu_c(struct proc *p, struct trapframe *tf, uint fmt, uint ft, uint fs,
/* comparison result intentionaly not written */
goto skip;
}
- } else {
- if ((uo | eq | lt) & op)
- tf->fsr |= FPCSR_CONDVAL(cc);
- else
- tf->fsr &= ~FPCSR_CONDVAL(cc);
}
+
+ if ((uo | eq | lt) & op)
+ tf->fsr |= FPCSR_CONDVAL(cc);
+ else
+ tf->fsr &= ~FPCSR_CONDVAL(cc);
skip:
return 0;