summaryrefslogtreecommitdiff
path: root/libc/sysdeps/i386/fpu/s_ilogbf.S
diff options
context:
space:
mode:
authorgcc <gcc@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2006-08-17 01:18:26 +0000
committergcc <gcc@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2006-08-17 01:18:26 +0000
commit15f34685e7a9b5caf761af2ebf6afa20438d440b (patch)
treedc04ce3cdf040f198743c15b64557824de174680 /libc/sysdeps/i386/fpu/s_ilogbf.S
parent1e848e0e775a36f6359161f5deb890942ef42ff3 (diff)
downloadeglibc2-15f34685e7a9b5caf761af2ebf6afa20438d440b.tar.gz
Import glibc-mainline for 2006-08-16
git-svn-id: svn://svn.eglibc.org/fsf/trunk@4 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/i386/fpu/s_ilogbf.S')
-rw-r--r--libc/sysdeps/i386/fpu/s_ilogbf.S38
1 files changed, 38 insertions, 0 deletions
diff --git a/libc/sysdeps/i386/fpu/s_ilogbf.S b/libc/sysdeps/i386/fpu/s_ilogbf.S
new file mode 100644
index 000000000..99e53edd7
--- /dev/null
+++ b/libc/sysdeps/i386/fpu/s_ilogbf.S
@@ -0,0 +1,38 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: s_ilogbf.S,v 1.4 1995/10/22 20:32:43 pk Exp $")
+
+ENTRY(__ilogbf)
+ flds 4(%esp)
+/* I added the following ugly construct because ilogb(+-Inf) is
+ required to return INT_MAX in ISO C99.
+ -- jakub@redhat.com. */
+ fxam /* Is NaN or +-Inf? */
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 1f /* Is +-Inf, jump. */
+
+ fxtract
+ pushl %eax
+ cfi_adjust_cfa_offset (4)
+ fstp %st
+
+ fistpl (%esp)
+ fwait
+ popl %eax
+ cfi_adjust_cfa_offset (-4)
+
+ ret
+
+1: fstp %st
+ movl $0x7fffffff, %eax
+ ret
+END (__ilogbf)
+weak_alias (__ilogbf, ilogbf)