summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2007-06-01 05:56:50 +0000
committerjason <jason@openbsd.org>2007-06-01 05:56:50 +0000
commit024d6bf53ac1b1d7ed411df5c0b2a08c8fdf0b57 (patch)
treebf1eae328d862a6d36a744fe07f6fac1d5cab2dc
parentadd __signbitl() for 68881 (not used yet) (diff)
downloadwireguard-openbsd-024d6bf53ac1b1d7ed411df5c0b2a08c8fdf0b57.tar.xz
wireguard-openbsd-024d6bf53ac1b1d7ed411df5c0b2a08c8fdf0b57.zip
amd64 version of __signbit() (pedro sized quad floats... really just IEEE
extended padded to 16 bytes)
-rw-r--r--lib/libm/arch/amd64/s_signbitl_e.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libm/arch/amd64/s_signbitl_e.c b/lib/libm/arch/amd64/s_signbitl_e.c
new file mode 100644
index 00000000000..110377a2e0c
--- /dev/null
+++ b/lib/libm/arch/amd64/s_signbitl_e.c
@@ -0,0 +1,19 @@
+/* $OpenBSD: s_signbitl_e.c,v 1.1 2007/06/01 05:56:50 jason Exp $ */
+
+/*
+ * Written by Jason L. Wright (jason@thought.net) in 2007 and placed
+ * into the public domain.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+/* __signbitl for extended long double */
+
+int
+__signbitl(long double l)
+{
+ ieee_quad_shape_type e;
+ e.value = l;
+ return (e.parts.mswlo & 0x8000);
+}