|
@@ -247,3 +247,62 @@ static unsigned int PerformComparison(const unsigned int opcode)
|
|
|
/* Fm is a constant. Do the comparison in whatever precision
|
|
|
Fn happens to be stored in. */
|
|
|
if (fpa11->fType[Fn] == typeSingle) {
|
|
|
+ float32 rFm = getSingleConstant(Fm);
|
|
|
+ float32 rFn = fpa11->fpreg[Fn].fSingle;
|
|
|
+
|
|
|
+ if (float32_is_nan(rFn))
|
|
|
+ goto unordered;
|
|
|
+
|
|
|
+ if (n_flag)
|
|
|
+ rFm ^= 0x80000000;
|
|
|
+
|
|
|
+ /* test for less than condition */
|
|
|
+ if (float32_lt_nocheck(rFn, rFm))
|
|
|
+ flags |= CC_NEGATIVE;
|
|
|
+
|
|
|
+ /* test for equal condition */
|
|
|
+ if (float32_eq_nocheck(rFn, rFm))
|
|
|
+ flags |= CC_ZERO;
|
|
|
+
|
|
|
+ /* test for greater than or equal condition */
|
|
|
+ if (float32_lt_nocheck(rFm, rFn))
|
|
|
+ flags |= CC_CARRY;
|
|
|
+ } else {
|
|
|
+ float64 rFm = getDoubleConstant(Fm);
|
|
|
+ float64 rFn = fpa11->fpreg[Fn].fDouble;
|
|
|
+
|
|
|
+ if (float64_is_nan(rFn))
|
|
|
+ goto unordered;
|
|
|
+
|
|
|
+ if (n_flag)
|
|
|
+ rFm ^= 0x8000000000000000ULL;
|
|
|
+
|
|
|
+ /* test for less than condition */
|
|
|
+ if (float64_lt_nocheck(rFn, rFm))
|
|
|
+ flags |= CC_NEGATIVE;
|
|
|
+
|
|
|
+ /* test for equal condition */
|
|
|
+ if (float64_eq_nocheck(rFn, rFm))
|
|
|
+ flags |= CC_ZERO;
|
|
|
+
|
|
|
+ /* test for greater than or equal condition */
|
|
|
+ if (float64_lt_nocheck(rFm, rFn))
|
|
|
+ flags |= CC_CARRY;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ /* Both operands are in registers. */
|
|
|
+ if (fpa11->fType[Fn] == typeSingle
|
|
|
+ && fpa11->fType[Fm] == typeSingle) {
|
|
|
+ float32 rFm = fpa11->fpreg[Fm].fSingle;
|
|
|
+ float32 rFn = fpa11->fpreg[Fn].fSingle;
|
|
|
+
|
|
|
+ if (float32_is_nan(rFn)
|
|
|
+ || float32_is_nan(rFm))
|
|
|
+ goto unordered;
|
|
|
+
|
|
|
+ if (n_flag)
|
|
|
+ rFm ^= 0x80000000;
|
|
|
+
|
|
|
+ /* test for less than condition */
|
|
|
+ if (float32_lt_nocheck(rFn, rFm))
|
|
|
+ flags |= CC_NEGATIVE;
|