xref: /minix/lib/libc/arch/x86_64/gen/fpgetprec.S (revision 0a6a1f1d)
1/*	$NetBSD: fpgetprec.S,v 1.2 2014/05/22 15:01:56 uebayasi Exp $	*/
2
3/*
4 * Written by J.T. Conklin, Apr 4, 1995
5 * Public domain.
6 */
7
8#include <machine/asm.h>
9
10/*
11 * XXX store only x87 state. If an application only uses the fp*
12 * interface, this should be in sync with the SSE mxcsr register.
13 */
14
15#ifdef WEAK_ALIAS
16WEAK_ALIAS(fpgetprec, _fpgetprec)
17ENTRY(_fpgetprec)
18#else
19ENTRY(fpgetprec)
20#endif
21	fnstcw -4(%rsp)
22	movl -4(%rsp),%eax
23	rorl $8,%eax
24	andl $3,%eax
25	ret
26#ifdef WEAK_ALIAS
27END(_fpgetprec)
28#else
29END(fpgetprec)
30#endif
31