If rd=rs1 or rd=rs2, the NaN check examined the wrong value.
require_fp;
bool greater = f64_lt_quiet(f64(FRS2), f64(FRS1)) ||
(f64_eq(f64(FRS2), f64(FRS1)) && (f64(FRS2).v & F64_SIGN));
-WRITE_FRD(greater || isNaNF64UI(f64(FRS2).v) ? FRS1 : FRS2);
if (isNaNF64UI(f64(FRS1).v) && isNaNF64UI(f64(FRS2).v))
WRITE_FRD(f64(defaultNaNF64UI));
+else
+ WRITE_FRD(greater || isNaNF64UI(f64(FRS2).v) ? FRS1 : FRS2);
set_fp_exceptions;
require_fp;
bool greater = f128_lt_quiet(f128(FRS2), f128(FRS1)) ||
(f128_eq(f128(FRS2), f128(FRS1)) && (f128(FRS2).v[1] & F64_SIGN));
-WRITE_FRD(greater || isNaNF128(f128(FRS2)) ? FRS1 : FRS2);
if (isNaNF128(f128(FRS1)) && isNaNF128(f128(FRS2)))
WRITE_FRD(f128(defaultNaNF128()));
+else
+ WRITE_FRD(greater || isNaNF128(f128(FRS2)) ? FRS1 : FRS2);
set_fp_exceptions;
require_fp;
bool greater = f32_lt_quiet(f32(FRS2), f32(FRS1)) ||
(f32_eq(f32(FRS2), f32(FRS1)) && (f32(FRS2).v & F32_SIGN));
-WRITE_FRD(greater || isNaNF32UI(f32(FRS2).v) ? FRS1 : FRS2);
if (isNaNF32UI(f32(FRS1).v) && isNaNF32UI(f32(FRS2).v))
WRITE_FRD(f32(defaultNaNF32UI));
+else
+ WRITE_FRD(greater || isNaNF32UI(f32(FRS2).v) ? FRS1 : FRS2);
set_fp_exceptions;
require_fp;
bool less = f64_lt_quiet(f64(FRS1), f64(FRS2)) ||
(f64_eq(f64(FRS1), f64(FRS2)) && (f64(FRS1).v & F64_SIGN));
-WRITE_FRD(less || isNaNF64UI(f64(FRS2).v) ? FRS1 : FRS2);
if (isNaNF64UI(f64(FRS1).v) && isNaNF64UI(f64(FRS2).v))
WRITE_FRD(f64(defaultNaNF64UI));
+else
+ WRITE_FRD(less || isNaNF64UI(f64(FRS2).v) ? FRS1 : FRS2);
set_fp_exceptions;
require_fp;
bool less = f128_lt_quiet(f128(FRS1), f128(FRS2)) ||
(f128_eq(f128(FRS1), f128(FRS2)) && (f128(FRS1).v[1] & F64_SIGN));
-WRITE_FRD(less || isNaNF128(f128(FRS2)) ? FRS1 : FRS2);
if (isNaNF128(f128(FRS1)) && isNaNF128(f128(FRS2)))
WRITE_FRD(f128(defaultNaNF128()));
+else
+ WRITE_FRD(less || isNaNF128(f128(FRS2)) ? FRS1 : FRS2);
set_fp_exceptions;
require_fp;
bool less = f32_lt_quiet(f32(FRS1), f32(FRS2)) ||
(f32_eq(f32(FRS1), f32(FRS2)) && (f32(FRS1).v & F32_SIGN));
-WRITE_FRD(less || isNaNF32UI(f32(FRS2).v) ? FRS1 : FRS2);
if (isNaNF32UI(f32(FRS1).v) && isNaNF32UI(f32(FRS2).v))
WRITE_FRD(f32(defaultNaNF32UI));
+else
+ WRITE_FRD(less || isNaNF32UI(f32(FRS2).v) ? FRS1 : FRS2);
set_fp_exceptions;