xref: /minix3/lib/libm/arch/i387/s_ilogbl.S (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc/*
2*84d9c625SLionel Sambuc * Written by J.T. Conklin <jtc@NetBSD.org>.
3*84d9c625SLionel Sambuc * Public domain.
4*84d9c625SLionel Sambuc */
5*84d9c625SLionel Sambuc
6*84d9c625SLionel Sambuc#include <machine/asm.h>
7*84d9c625SLionel Sambuc
8*84d9c625SLionel SambucRCSID("$NetBSD: s_ilogbl.S,v 1.1 2011/07/28 22:32:28 joerg Exp $")
9*84d9c625SLionel Sambuc
10*84d9c625SLionel Sambuc#include "abi.h"
11*84d9c625SLionel Sambuc
12*84d9c625SLionel SambucENTRY(ilogbl)
13*84d9c625SLionel Sambuc	fldt	ARG_LONG_DOUBLE_ONE
14*84d9c625SLionel Sambuc	fxtract
15*84d9c625SLionel Sambuc	fstp	%st
16*84d9c625SLionel Sambuc#ifdef __i386__
17*84d9c625SLionel Sambuc	pushl	%eax
18*84d9c625SLionel Sambuc	fistpl	0(%esp)
19*84d9c625SLionel Sambuc	popl	%eax
20*84d9c625SLionel Sambuc#else
21*84d9c625SLionel Sambuc	fistpl	-4(%rsp)
22*84d9c625SLionel Sambuc	movl	-4(%rsp), %eax
23*84d9c625SLionel Sambuc#endif
24*84d9c625SLionel Sambuc	ret
25