blob: 18a26898de5b67d4b3a1375147c3bb923576f9ce [file] [log] [blame]
Kai Tietz518dd332007-08-10 09:54:15 +00001/*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 * Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>.
5 *
6 * Removed header file dependency for use in libmingwex.a by
7 * Danny Smith <dannysmith@users.sourceforge.net>
8 */
9
10 .file "nearbyintf.S"
11 .text
12 .align 4
13.globl _nearbyintf
14 .def _nearbyintf; .scl 2; .type 32; .endef
15_nearbyintf:
16 flds 8(%rsp)
17 pushq %rax
18 pushq %rcx
19 fnstcw (%rsp)
20 movq (%rsp), %rax
21 orq $0x20, %rax
22 movq %rax, 8(%rsp)
23 fldcw 8(%rsp)
24 frndint
25 fclex
26 fldcw (%rsp)
27 popq %rcx
28 popq %rax
29 ret