Remove fast round(3) implementation for hppa. It is a nice idea, but does not
authormiod <miod@openbsd.org>
Fri, 27 Jan 2023 16:42:03 +0000 (16:42 +0000)
committermiod <miod@openbsd.org>
Fri, 27 Jan 2023 16:42:03 +0000 (16:42 +0000)
round in the right direction for halfway values.
(noticed in the perl test results thanks to afresh1@)

lib/libm/arch/hppa/s_round.c [deleted file]
lib/libm/arch/hppa/s_roundf.c [deleted file]

diff --git a/lib/libm/arch/hppa/s_round.c b/lib/libm/arch/hppa/s_round.c
deleted file mode 100644 (file)
index f634781..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*     $OpenBSD: s_round.c,v 1.8 2016/09/12 19:47:02 guenther Exp $    */
-/*
- * Written by Michael Shalayeff. Public Domain
- */
-
-#include <sys/types.h>
-#include <machine/ieeefp.h>
-#include "math.h"
-
-double
-round(double x)
-{
-       u_int64_t ofpsr, fpsr;
-
-       __asm__ volatile("fstds %%fr0,0(%0)" :: "r" (&ofpsr) : "memory");
-       fpsr = (ofpsr & ~((u_int64_t)FP_RM << (9 + 32))) |
-           ((u_int64_t)FP_RN << (9 + 32));
-       __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&fpsr) : "memory");
-
-       __asm__ volatile("frnd,dbl %0,%0" : "+f" (x));
-
-       __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory");
-       return (x);
-}
-DEF_STD(round);
-LDBL_CLONE(round);
diff --git a/lib/libm/arch/hppa/s_roundf.c b/lib/libm/arch/hppa/s_roundf.c
deleted file mode 100644 (file)
index 4cc3de6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*     $OpenBSD: s_roundf.c,v 1.5 2015/01/20 04:41:01 krw Exp $        */
-/*
- * Written by Michael Shalayeff. Public Domain
- */
-
-#include <sys/types.h>
-#include <machine/ieeefp.h>
-#include "math.h"
-
-float
-roundf(float x)
-{
-       u_int64_t ofpsr, fpsr;
-
-       __asm__ volatile("fstds %%fr0,0(%0)" :: "r" (&ofpsr) : "memory");
-       fpsr = (ofpsr & ~((u_int64_t)FP_RM << (9 + 32))) |
-           ((u_int64_t)FP_RN << (9 + 32));
-       __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&fpsr) : "memory");
-
-       __asm__ volatile("frnd,sgl %0,%0" : "+f" (x));
-
-       __asm__ volatile("fldds 0(%0), %%fr0" :: "r" (&ofpsr) : "memory");
-       return (x);
-}