SoftFloat: Correctly treat +INF and -INF as equal on 8087 and 287, fixes 287 detection in MCPDiag.

This commit is contained in:
OBattler
2024-03-26 23:29:06 +01:00
parent 0b0cb84bf7
commit 12e4d1b083

View File

@@ -23,6 +23,11 @@ these four paragraphs for those parts of this code that are retained.
* Stanislav Shwartsman [sshwarts at sourceforge net]
* ==========================================================================*/
#include <stdio.h>
#include <stdint.h>
#include <86box/86box.h>
#include "../cpu.h"
#include "softfloatx80.h"
#include "softfloat-round-pack.h"
#include "softfloat-macros.h"
@@ -305,6 +310,18 @@ int floatx80_compare(floatx80 a, floatx80 b, int quiet, struct float_status_t *s
float_class_t aClass = floatx80_class(a);
float_class_t bClass = floatx80_class(b);
if (fpu_type < FPU_287XL) {
if ((aClass == float_positive_inf) || (bClass == float_negative_inf))
{
return float_relation_equal;
}
if ((aClass == float_negative_inf) || (bClass == float_positive_inf))
{
return float_relation_equal;
}
}
if (aClass == float_SNaN || bClass == float_SNaN)
{
/* unsupported reported as SNaN */