xref: /titanic_50/usr/src/lib/libc/sparc/fp/base.il (revision 321502cd0930b1eb6d4805e17f16234f3e3ff4b2)
1! .ident	"%Z%%M%	%I%	%E% SMI"
2!
3! Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
4! Use is subject to license terms.
5!
6! CDDL HEADER START
7!
8! The contents of this file are subject to the terms of the
9! Common Development and Distribution License, Version 1.0 only
10! (the "License").  You may not use this file except in compliance
11! with the License.
12!
13! You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14! or http://www.opensolaris.org/os/licensing.
15! See the License for the specific language governing permissions
16! and limitations under the License.
17!
18! When distributing Covered Code, include this CDDL HEADER in each
19! file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20! If applicable, add the following below this CDDL HEADER, with the
21! fields enclosed by brackets "[]" replaced with your own identifying
22! information: Portions Copyright [yyyy] [name of copyright owner]
23!
24! CDDL HEADER END
25!
26
27	.inline	__mul_set,3
28	std	%o0,[%sp+0x48]		! save x
29	ldd	[%sp+0x48],%f0
30	std	%o2,[%sp+0x50]		! save y
31	ldd	[%sp+0x50],%f2
32	.volatile
33	fmuld	%f0,%f2,%f0		! compute result and leave it for return
34	st	%fsr,[%sp+0x44]
35	.nonvolatile
36	ld	[%sp+0x44],%o0
37	and	%o0,1,%o0
38	st	%o0,[%o4]		! store eround
39	.end
40
41	.inline	__div_set,3
42	std	%o0,[%sp+0x48]		! save x
43	ldd	[%sp+0x48],%f0
44	std	%o2,[%sp+0x50]		! save y
45	ldd	[%sp+0x50],%f2
46	.volatile
47	fdivd	%f0,%f2,%f0		! compute result and leave it for return
48	st	%fsr,[%sp+0x44]
49	.nonvolatile
50	ld	[%sp+0x44],%o0
51	and	%o0,1,%o0
52	st	%o0,[%o4]		! store eround
53	.end
54
55        .inline __dabs,2
56	ld	[%o0],%f0
57	ld	[%o0+4],%f1
58	fabss	%f0,%f0
59        .end
60
61	.inline	__get_ieee_flags,1
62	.volatile
63	st	%fsr,[%o0]
64	st	%g0,[%sp+0x44]
65	ld	[%sp+0x44],%fsr
66	.nonvolatile
67	.end
68
69	.inline	__set_ieee_flags,1
70	ld	[%o0],%fsr
71	.end
72