BI sh64_fcmpund(SIM_CPU *current_cpu, DF drg, DF drh) { sim_fpu f1, f2; sim_fpu_64to (&f1, drg); sim_fpu_64to (&f2, drh); return (sim_fpu_is_nan (&f1) || sim_fpu_is_nan (&f2)); }
BI sh64_fcmpuns(SIM_CPU *current_cpu, SF frg, SF frh) { sim_fpu f1, f2; sim_fpu_32to (&f1, frg); sim_fpu_32to (&f2, frh); return (sim_fpu_is_nan (&f1) || sim_fpu_is_nan (&f2)); }
static CGEN_FP_CMP cmpdf (CGEN_FPU* fpu, DF x, DF y) { sim_fpu op1; sim_fpu op2; sim_fpu_64to (&op1, x); sim_fpu_64to (&op2, y); if (sim_fpu_is_nan (&op1) || sim_fpu_is_nan (&op2)) return FP_CMP_NAN; if (x < y) return FP_CMP_LT; if (x > y) return FP_CMP_GT; return FP_CMP_EQ; }