xref: /titanic_50/usr/src/lib/libc/sparcv9/gen/abs.s (revision ff17c8bf86c3e567734be83f90267edee20f580f)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
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/*
23 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29	.file	"%M%"
30
31#include "SYS.h"
32
33/*
34 * int abs(int arg);
35 */
36	ENTRY(abs)
37	cmp	%o0, 0
38	bneg,a	%icc, 1f
39	neg %o0
401:
41	retl
42	nop
43	SET_SIZE(abs)
44
45/*
46 * long labs(long arg);
47 */
48	ENTRY(labs)
49	brlz,a	%o0, 1f
50	neg %o0
511:
52	retl
53	nop
54	SET_SIZE(labs)
55
56/*
57 * long long llabs(long long arg);
58 */
59	ENTRY(llabs)
60	brlz,a	%o0, 1f
61	neg %o0
621:
63	retl
64	nop
65	SET_SIZE(llabs)
66