patch-2.2.8 linux/arch/alpha/math-emu/ieee-math.c

Next file: linux/arch/alpha/math-emu/ieee-math.h
Previous file: linux/arch/alpha/math-emu/fp-emul.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/arch/alpha/math-emu/ieee-math.c linux/arch/alpha/math-emu/ieee-math.c
@@ -22,6 +22,7 @@
  * functions are used on exceptional numbers only (well, assuming you
  * don't turn on the "trap on inexact"...).
  */
+#include <linux/sched.h>
 #include "ieee-math.h"
 
 #define STICKY_S	0x20000000	/* both in longword 0 of fraction */
@@ -1339,4 +1340,42 @@
 	normalize(&op_c);
 	op_c.e -= 9;		/* remove excess exp from original shift */
 	return round_t_ieee(f, &op_c, c);
+}
+
+/*
+ * Sqrt a = b, where a and b are ieee s-floating numbers.  "f"
+ * contains the rounding mode etc.
+ */
+unsigned long
+ieee_SQRTS (int f, unsigned long a, unsigned long *b)
+{
+	fpclass_t a_type;
+	EXTENDED op_a, op_b;
+
+	*b = IEEE_QNaN;
+	a_type = extend_ieee(a, &op_a, SINGLE);
+	if (op_a.s == 0) {
+		/* FIXME -- handle positive denormals.  */
+		send_sig(SIGFPE, current, 1);
+	}
+	return FPCR_INV;
+}
+
+/*
+ * Sqrt a = b, where a and b are ieee t-floating numbers.  "f"
+ * contains the rounding mode etc.
+ */
+unsigned long
+ieee_SQRTT (int f, unsigned long a, unsigned long *b)
+{
+	fpclass_t a_type;
+	EXTENDED op_a, op_b;
+
+	*b = IEEE_QNaN;
+	a_type = extend_ieee(a, &op_a, DOUBLE);
+	if (op_a.s == 0) {
+		/* FIXME -- handle positive denormals.  */
+		send_sig(SIGFPE, current, 1);
+	}
+	return FPCR_INV;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)