mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-08-09 03:25:04 +00:00
Fix vminfp & vmaxfp emulation (VEX's jm-ppc-test -a, triggered nan bugs)
This commit is contained in:
@@ -222,6 +222,18 @@ struct op_max {
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct op_max<float> {
|
||||
static inline float apply(float a, float b) {
|
||||
// XXX The maximum of any value and a NaN is a QNaN
|
||||
if (mathlib_isnan(a))
|
||||
return a;
|
||||
if (mathlib_isnan(b))
|
||||
return b;
|
||||
return a > b ? a : b;
|
||||
}
|
||||
};
|
||||
|
||||
template< class TYPE >
|
||||
struct op_min {
|
||||
static inline TYPE apply(TYPE a, TYPE b) {
|
||||
@@ -229,6 +241,18 @@ struct op_min {
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct op_min<float> {
|
||||
static inline float apply(float a, float b) {
|
||||
// XXX The minimum of any value and a NaN is a QNaN
|
||||
if (mathlib_isnan(a))
|
||||
return a;
|
||||
if (mathlib_isnan(b))
|
||||
return b;
|
||||
return a < b ? a : b;
|
||||
}
|
||||
};
|
||||
|
||||
template< int nbytes >
|
||||
struct op_all_ones {
|
||||
static const uint32 value = (1U << (8 * nbytes)) - 1;
|
||||
|
@@ -1427,10 +1427,8 @@ powerpc_cpu::compile_block(uint32 entry_point)
|
||||
case PPC_I(VCMPGTSH):
|
||||
case PPC_I(VCMPGTSW):
|
||||
case PPC_I(VMADDFP):
|
||||
case PPC_I(VMAXFP):
|
||||
case PPC_I(VMAXSH):
|
||||
case PPC_I(VMAXUB):
|
||||
case PPC_I(VMINFP):
|
||||
case PPC_I(VMINSH):
|
||||
case PPC_I(VMINUB):
|
||||
case PPC_I(VNMSUBFP):
|
||||
|
Reference in New Issue
Block a user