summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2001-04-18 11:53:40 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2001-04-18 11:53:40 +0000
commit54c22b4e455c4ee5bf806552c61fe0e104eca7e1 (patch)
tree89d43686c1fa148bc138ceca6563994682f81d00
parent333fd2a223850c59c490c2a30350bb5883f1586a (diff)
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.
-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: