summaryrefslogtreecommitdiff
path: root/lib/libm/arch/amd64/s_ilogb.S
blob: e8a512e36040631bb781928dc14784892162579e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*	$OpenBSD: s_ilogb.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */
/*
 * Written by J.T. Conklin <jtc@NetBSD.org>.
 * Public domain.
 */

#include <machine/asm.h>

ENTRY(ilogb)
	movsd	%xmm0,-8(%rsp)
	fldl	-8(%rsp)
	fxtract
	fstp	%st
	fistpl	-8(%rsp)
	movl	-8(%rsp),%eax
	ret