CMPtype __c6xabi_gtf(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); CMPtype r; FP_UNPACK_RAW_S(A, a); FP_UNPACK_RAW_S(B, b); FP_CMP_S(r, A, B, -2, 2); FP_HANDLE_EXCEPTIONS; return r > 0; }
int FCMPS(void *rd, void *rs2, void *rs1) { FP_DECL_S(A); FP_DECL_S(B); long ret; unsigned long *fsr = rd; __FP_UNPACK_S(A, rs1); __FP_UNPACK_S(B, rs2); FP_CMP_S(ret, B, A, 1); if (ret == -1) ret = 2; *fsr = (*fsr & ~0xc00) | (ret << 10); return 1; }
CMPtype __c6xabi_ltf(SFtype a, SFtype b) { FP_DECL_EX; FP_DECL_S(A); FP_DECL_S(B); CMPtype r; FP_UNPACK_RAW_S(A, a); FP_UNPACK_RAW_S(B, b); FP_CMP_S(r, A, B, 2); if (r == 2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B))) FP_SET_EXCEPTION(FP_EX_INVALID); FP_HANDLE_EXCEPTIONS; return r < 0; }
int efscmpgt(u32 *ccr, int crD, void *rA, void *rB) { FP_DECL_S(A); FP_DECL_S(B); long cmp; int ret = 0; #ifdef DEBUG printk("%s: %p (%08x) %d %p %p\n", __FUNCTION__, ccr, *ccr, crD, rA, rB); #endif __FP_UNPACK_S(A, rA); __FP_UNPACK_S(B, rB); #ifdef DEBUG printk("A: %ld %lu %ld (%ld)\n", A_s, A_f, A_e, A_c); printk("B: %ld %lu %ld (%ld)\n", B_s, B_f, B_e, B_c); #endif FP_CMP_S(cmp, A, B, 2); if (cmp == 1) { cmp = 0x4; } else { cmp = 0; } *ccr &= ~(15 << ((7 - crD) << 2)); *ccr |= (cmp << ((7 - crD) << 2)); #ifdef DEBUG printk("CR: %08x\n", *ccr); #endif return ret; }