13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "round.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(round,function)
33 #include "libm_synonyms.h"
34 #undef fabs
35
36 .section .rodata
37 .align 4
38 .Lhalf: .float 0.5
39
40 ENTRY(round)
41 movl %esp,%ecx
42 subl $8,%esp
43 fstcw -8(%ecx)
44 fldl 4(%ecx)
45 movw -8(%ecx),%dx
46 andw $0xf3ff,%dx
47 movw %dx,-4(%ecx)
48 fldcw -4(%ecx) / set RD = to_nearest
49 fld %st(0)
50 frndint / [x],x
51 fstcw -4(%ecx)
52 movw -4(%ecx),%dx
53 andw $0xf3ff,%dx
|
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "round.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(round,function)
33 #undef fabs
34
35 .section .rodata
36 .align 4
37 .Lhalf: .float 0.5
38
39 ENTRY(round)
40 movl %esp,%ecx
41 subl $8,%esp
42 fstcw -8(%ecx)
43 fldl 4(%ecx)
44 movw -8(%ecx),%dx
45 andw $0xf3ff,%dx
46 movw %dx,-4(%ecx)
47 fldcw -4(%ecx) / set RD = to_nearest
48 fld %st(0)
49 frndint / [x],x
50 fstcw -4(%ecx)
51 movw -4(%ecx),%dx
52 andw $0xf3ff,%dx
|