xref: /openbsd-src/lib/libc/arch/sparc64/gen/fabs.S (revision aeb694e3afa554db8dd44ee8140d036724efada5)
1*aeb694e3Smartynas/*	$OpenBSD: fabs.S,v 1.7 2011/07/08 22:28:33 martynas Exp $	*/
2*aeb694e3Smartynas/*	$NetBSD: fabs.S,v 1.2 2000/07/23 07:12:22 eeh Exp $	*/
3*aeb694e3Smartynas/*
4*aeb694e3Smartynas * Copyright (c) 1992, 1993
5*aeb694e3Smartynas *	The Regents of the University of California.  All rights reserved.
6*aeb694e3Smartynas *
7*aeb694e3Smartynas * This software was developed by the Computer Systems Engineering group
8*aeb694e3Smartynas * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9*aeb694e3Smartynas * contributed to Berkeley.
10*aeb694e3Smartynas *
11*aeb694e3Smartynas * Redistribution and use in source and binary forms, with or without
12*aeb694e3Smartynas * modification, are permitted provided that the following conditions
13*aeb694e3Smartynas * are met:
14*aeb694e3Smartynas * 1. Redistributions of source code must retain the above copyright
15*aeb694e3Smartynas *    notice, this list of conditions and the following disclaimer.
16*aeb694e3Smartynas * 2. Redistributions in binary form must reproduce the above copyright
17*aeb694e3Smartynas *    notice, this list of conditions and the following disclaimer in the
18*aeb694e3Smartynas *    documentation and/or other materials provided with the distribution.
19*aeb694e3Smartynas * 3. Neither the name of the University nor the names of its contributors
20*aeb694e3Smartynas *    may be used to endorse or promote products derived from this software
21*aeb694e3Smartynas *    without specific prior written permission.
22*aeb694e3Smartynas *
23*aeb694e3Smartynas * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24*aeb694e3Smartynas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25*aeb694e3Smartynas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26*aeb694e3Smartynas * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27*aeb694e3Smartynas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28*aeb694e3Smartynas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29*aeb694e3Smartynas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30*aeb694e3Smartynas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31*aeb694e3Smartynas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32*aeb694e3Smartynas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33*aeb694e3Smartynas * SUCH DAMAGE.
34*aeb694e3Smartynas */
35*aeb694e3Smartynas
36*aeb694e3Smartynas#include <machine/asm.h>
37*aeb694e3Smartynas
38*aeb694e3Smartynas/* fabs - floating absolute value */
39*aeb694e3Smartynas
40*aeb694e3SmartynasENTRY(fabs)
41*aeb694e3Smartynas	retl
42*aeb694e3Smartynas	 fabsd	%f0, %f0		! return absolute value
43