summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/vax
diff options
context:
space:
mode:
authorhugh <hugh@openbsd.org>2001-04-18 11:53:39 +0000
committerhugh <hugh@openbsd.org>2001-04-18 11:53:39 +0000
commit35e430216121355bcc15f67f0ce07c28120f99cd (patch)
tree8f47e737358c351343d15b753c2635972e717093 /lib/libc/arch/vax
parentanother vax tag (diff)
downloadwireguard-openbsd-35e430216121355bcc15f67f0ce07c28120f99cd.tar.xz
wireguard-openbsd-35e430216121355bcc15f67f0ce07c28120f99cd.zip
Most of the systems we run on require an emulated EMODD, so avoid using
it if a CVTDL would do instead. This path is 80x faster on such systems, and falling back to EMODD if necessary hurts little. Helps programs like nawk, a heavy modf user.
Diffstat (limited to 'lib/libc/arch/vax')
-rw-r--r--lib/libc/arch/vax/gen/modf.S10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/arch/vax/gen/modf.S b/lib/libc/arch/vax/gen/modf.S
index 0caa0aaef97..06a05b6bf91 100644
--- a/lib/libc/arch/vax/gen/modf.S
+++ b/lib/libc/arch/vax/gen/modf.S
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS)
.text
- .asciz "$OpenBSD: modf.S,v 1.3 2001/03/18 07:29:04 bjc Exp $"
+ .asciz "$OpenBSD: modf.S,v 1.4 2001/04/18 11:53:39 hugh Exp $"
#endif /* LIBC_SCCS */
/*
@@ -47,8 +47,14 @@
#include "DEFS.h"
ENTRY(modf, R2)
+ cvtdl 4(ap),r2
+ bvs 0f
+ cvtld r2,*12(ap)
+ subd3 *12(ap),4(ap),r0
+ ret
+0:
emodd 4(ap),$0,$0f1.0,r2,r0
- jvs 1f # integer overflow
+ bvs 1f # integer overflow
cvtld r2,*12(ap)
ret
1: