-%
-%
-%
-
-Stubs to check for extremities of (IEEE) floats,
-the tests have been (artfully) lifted from the hbc-0.9999.3 (lib/fltcode.c)
-source.
-
+/*
+ * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
+ *
+ * $Id: floatExtreme.c,v 1.1 1998/04/10 10:54:28 simonm Exp $
+ *
+ * Stubs to check for extremities of (IEEE) floats,
+ * the tests have been (artfully) lifted from the hbc-0.9999.3 (lib/fltcode.c)
+ * source.
+ */
+
+/*
ToDo:
- avoid hard-wiring the fact that on an
Alpha we repr. a StgFloat as a double.
(introduce int equivalent of {ASSIGN,PK}_FLT? )
+*/
-\begin{code}
-
-#include "rtsdefs.h"
+#include "Rts.h"
#include "ieee-flpt.h"
#include "floatExtreme.h"
#ifdef IEEE_FLOATING_POINT
StgInt
-isDoubleNaN(d)
-StgDouble d;
+isDoubleNaN(StgDouble d)
{
union { double d; int i[2]; } u;
int hx,lx;
}
StgInt
-isDoubleInfinite(d)
-StgDouble d;
+isDoubleInfinite(StgDouble d)
{
union { double d; int i[2]; } u;
int hx,lx;
}
StgInt
-isDoubleDenormalized(d)
-StgDouble d;
+isDoubleDenormalized(StgDouble d)
{
union { double d; int i[2]; } u;
int high, iexp;
}
StgInt
-isDoubleNegativeZero(d)
-StgDouble d;
+isDoubleNegativeZero(StgDouble d)
{
union { double d; int i[2]; } u;
int high, iexp;
/* Same tests, this time for StgFloats. */
StgInt
-isFloatNaN(f)
-StgFloat f;
+isFloatNaN(StgFloat f)
{
#if !defined(alpha_TARGET_OS)
/* StgFloat = double on alphas */
}
StgInt
-isFloatInfinite(f)
-StgFloat f;
+isFloatInfinite(StgFloat f)
{
#if !defined(alpha_TARGET_OS)
/* StgFloat = double on alphas */
}
StgInt
-isFloatDenormalized(f)
-StgFloat f;
+isFloatDenormalized(StgFloat f)
{
#if !defined(alpha_TARGET_OS)
/* StgFloat = double on alphas */
}
StgInt
-isFloatNegativeZero(f)
-StgFloat f;
+isFloatNegativeZero(StgFloat f)
{
#if !defined(alpha_TARGET_OS)
/* StgFloat = double on alphas */
StgInt isFloatNegativeZero(f) StgFloat f; { return 0; }
#endif
-
-
-\end{code}