patch-2.3.4 linux/arch/sparc/math-emu/fcmps.c
Next file: linux/arch/sparc/math-emu/fdmulq.c
Previous file: linux/arch/sparc/math-emu/fcmpq.c
Back to the patch index
Back to the overall index
- Lines: 43
- Date:
Sat May 29 11:09:04 1999
- Orig file:
v2.3.3/linux/arch/sparc/math-emu/fcmps.c
- Orig date:
Wed Mar 10 16:53:36 1999
diff -u --recursive --new-file v2.3.3/linux/arch/sparc/math-emu/fcmps.c linux/arch/sparc/math-emu/fcmps.c
@@ -1,18 +1,33 @@
+/* $Id: fcmps.c,v 1.8 1999/05/28 13:41:51 jj Exp $
+ * arch/sparc/math-emu/fcmps.c
+ *
+ * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
+ * Copyright (C) 1998 Peter Maydell (pmaydell@chiark.greenend.org.uk)
+ *
+ */
+
+#include "sfp-util.h"
#include "soft-fp.h"
#include "single.h"
int FCMPS(void *rd, void *rs2, void *rs1)
{
+ FP_DECL_EX;
FP_DECL_S(A); FP_DECL_S(B);
long ret;
- unsigned long *fsr = rd;
+ unsigned long fsr;
- __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 0;
+ FP_UNPACK_RAW_SP(A, rs1);
+ FP_UNPACK_RAW_SP(B, rs2);
+ FP_CMP_S(ret, B, A, 3);
+ if (ret == 3 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B)))
+ FP_SET_EXCEPTION(FP_EX_INVALID);
+ if (!FP_INHIBIT_RESULTS) {
+ if (ret == -1) ret = 2;
+ fsr = *(long *)rd;
+ fsr &= ~0xc00;
+ fsr |= (ret << 10);
+ *(long *)rd = fsr;
+ }
+ FP_HANDLE_EXCEPTIONS;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)