ok kettenis.
--- /dev/null
+/* $OpenBSD: fpclassifyl.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/*
+ * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+
+int
+__fpclassifyl(long double e)
+{
+ struct ieee_ext *p = (struct ieee_ext *)&e;
+
+ if (p->ext_exp == 0) {
+ if (p->ext_frach == 0 && p->ext_frachm == 0 &&
+ p->ext_fraclm == 0 && p->ext_fracl == 0)
+ return FP_ZERO;
+ else
+ return FP_SUBNORMAL;
+ }
+
+ if (p->ext_exp == EXT_EXP_INFNAN) {
+ if (p->ext_frach == 0 && p->ext_frachm == 0 &&
+ p->ext_fraclm == 0 && p->ext_fracl == 0)
+ return FP_INFINITE;
+ else
+ return FP_NAN;
+ }
+
+ return FP_NORMAL;
+}
+DEF_STRONG(__fpclassifyl);
--- /dev/null
+/* $OpenBSD: infinity.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/*
+ * IEEE-compatible infinity.c -- public domain.
+ */
+
+#include <endian.h>
+#include <math.h>
+
+char __infinity[] __attribute__((__aligned__(sizeof(double)))) =
+#if BYTE_ORDER == BIG_ENDIAN
+ { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0};
+#else
+ { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f};
+#endif
--- /dev/null
+/* $OpenBSD: isfinitel.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/*
+ * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+
+int
+__isfinitel(long double e)
+{
+ struct ieee_ext *p = (struct ieee_ext *)&e;
+
+ return (p->ext_exp != EXT_EXP_INFNAN);
+}
--- /dev/null
+/* $OpenBSD: isinfl.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/*
+ * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+
+int
+__isinfl(long double e)
+{
+ struct ieee_ext *p = (struct ieee_ext *)&e;
+
+ return (p->ext_exp == EXT_EXP_INFNAN &&
+ p->ext_frach == 0 && p->ext_frachm == 0 &&
+ p->ext_fraclm == 0 && p->ext_fracl == 0);
+}
--- /dev/null
+/* $OpenBSD: isnanl.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/*
+ * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+
+int
+__isnanl(long double e)
+{
+ struct ieee_ext *p = (struct ieee_ext *)&e;
+
+ return (p->ext_exp == EXT_EXP_INFNAN &&
+ (p->ext_frach != 0 || p->ext_frachm != 0 ||
+ p->ext_fraclm != 0 || p->ext_fracl != 0));
+}
--- /dev/null
+/* $OpenBSD: isnormall.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/*
+ * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+
+int
+__isnormall(long double e)
+{
+ struct ieee_ext *p = (struct ieee_ext *)&e;
+
+ return (p->ext_exp != 0 && p->ext_exp != EXT_EXP_INFNAN);
+}
--- /dev/null
+/* $OpenBSD: nan.c,v 1.1 2021/04/27 04:36:00 drahn Exp $ */
+/* Written by Martynas Venckus. Public Domain. */
+
+#include <endian.h>
+#include <math.h>
+
+/* bytes for qNaN on an arm (IEEE single format) */
+char __nan[] __attribute__((__aligned__(sizeof(float)))) =
+#if BYTE_ORDER == BIG_ENDIAN
+ { 0x7f, 0xc0, 0, 0 };
+#else /* BYTE_ORDER == BIG_ENDIAN */
+ { 0, 0, 0xc0, 0x7f };
+#endif /* BYTE_ORDER == BIG_ENDIAN */