aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/fpu/s_nearbyintl.S
blob: dab2750a23b11aa3002500c54a6258b53b42a579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Written by J.T. Conklin <jtc@netbsd.org>.
 * Public domain.
 */
/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>.  */

#include <machine/asm.h>

ENTRY(__nearbyintl)
	fldt	8(%rsp)
	fnstcw	-4(%rsp)
	movl	-4(%rsp), %eax
	orl	$0x20, %eax
	movl	%eax, -8(%rsp)
	fldcw	-8(%rsp)
	frndint
	fclex
	fldcw	-4(%rsp)
	ret
END (__nearbyintl)
weak_alias (__nearbyintl, nearbyintl)