33 static unsigned int PerformComparison(
const unsigned int opcode);
38 if (opcode & 0x800000) {
43 return PerformComparison(opcode);
47 switch ((opcode & 0x700000) >> 20) {
56 writeFPSR(readRegister(
getRd(opcode)));
59 writeRegister(
getRd(opcode), readFPSR());
93 #ifdef CONFIG_FPE_NWFPE_XP
97 fpa11->fpreg[
getFn(opcode)].fExtended = int32_to_floatx80(readRegister(
getRd(opcode)));
115 unsigned int Fn =
getFm(opcode);
122 switch (fpa11->fType[Fn]) {
135 #ifdef CONFIG_FPE_NWFPE_XP
138 writeRegister(
getRd(opcode), floatx80_to_int32(&roundData, fpa11->fpreg[Fn].fExtended));
154 static unsigned int PerformComparison(
const unsigned int opcode)
157 unsigned int Fn =
getFn(opcode), Fm =
getFm(opcode);
158 int e_flag = opcode & 0x400000;
159 int n_flag = opcode & 0x200000;
160 unsigned int flags = 0;
162 #ifdef CONFIG_FPE_NWFPE_XP
170 switch (fpa11->fType[Fn]) {
175 rFn = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
182 rFn = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
187 if (floatx80_is_nan(fpa11->fpreg[Fn].fExtended))
189 rFn = fpa11->fpreg[Fn].fExtended;
198 rFm = getExtendedConstant(Fm);
199 if (floatx80_is_nan(rFm))
203 switch (fpa11->fType[Fm]) {
208 rFm = float32_to_floatx80(fpa11->fpreg[Fm].fSingle);
215 rFm = float64_to_floatx80(fpa11->fpreg[Fm].fDouble);
220 if (floatx80_is_nan(fpa11->fpreg[Fm].fExtended))
222 rFm = fpa11->fpreg[Fm].fExtended;
234 if (floatx80_lt(rFn, rFm))
238 if (floatx80_eq(rFn, rFm))
242 if (floatx80_lt(rFm, rFn))
250 float32 rFm = getSingleConstant(Fm);
251 float32 rFn = fpa11->fpreg[Fn].fSingle;
260 if (float32_lt_nocheck(rFn, rFm))
264 if (float32_eq_nocheck(rFn, rFm))
268 if (float32_lt_nocheck(rFm, rFn))
271 float64 rFm = getDoubleConstant(Fm);
272 float64 rFn = fpa11->fpreg[Fn].fDouble;
278 rFm ^= 0x8000000000000000ULL;
281 if (float64_lt_nocheck(rFn, rFm))
285 if (float64_eq_nocheck(rFn, rFm))
289 if (float64_lt_nocheck(rFm, rFn))
296 float32 rFm = fpa11->fpreg[Fm].fSingle;
297 float32 rFn = fpa11->fpreg[Fn].fSingle;
307 if (float32_lt_nocheck(rFn, rFm))
311 if (float32_eq_nocheck(rFn, rFm))
315 if (float32_lt_nocheck(rFm, rFn))
323 : fpa11->fpreg[Fm].fDouble;
327 : fpa11->fpreg[Fn].fDouble;
334 rFm ^= 0x8000000000000000ULL;
337 if (float64_lt_nocheck(rFn, rFm))
341 if (float64_eq_nocheck(rFn, rFm))
345 if (float64_lt_nocheck(rFm, rFn))
352 writeConditionCodes(flags);
371 writeConditionCodes(flags);