fabs.S revision 1.9
11.9Sriastrad/*	$NetBSD: fabs.S,v 1.9 2018/11/07 22:21:42 riastradh Exp $	*/
21.4Sjonathan
31.1Sglass/*-
41.1Sglass * Copyright (c) 1993
51.1Sglass *	The Regents of the University of California.  All rights reserved.
61.1Sglass *
71.1Sglass * This code is derived from software contributed to Berkeley by
81.1Sglass * Ralph Campbell.
91.1Sglass *
101.1Sglass * Redistribution and use in source and binary forms, with or without
111.1Sglass * modification, are permitted provided that the following conditions
121.1Sglass * are met:
131.1Sglass * 1. Redistributions of source code must retain the above copyright
141.1Sglass *    notice, this list of conditions and the following disclaimer.
151.1Sglass * 2. Redistributions in binary form must reproduce the above copyright
161.1Sglass *    notice, this list of conditions and the following disclaimer in the
171.1Sglass *    documentation and/or other materials provided with the distribution.
181.7Sagc * 3. Neither the name of the University nor the names of its contributors
191.1Sglass *    may be used to endorse or promote products derived from this software
201.1Sglass *    without specific prior written permission.
211.1Sglass *
221.1Sglass * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
231.1Sglass * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
241.1Sglass * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
251.1Sglass * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
261.1Sglass * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
271.1Sglass * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
281.1Sglass * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
291.1Sglass * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
301.1Sglass * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
311.1Sglass * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
321.1Sglass * SUCH DAMAGE.
331.1Sglass */
341.1Sglass
351.5Sjonathan#include <mips/asm.h>
361.9Sriastrad#include <mips/math.h>
371.1Sglass
381.1Sglass#if defined(LIBC_SCCS) && !defined(lint)
391.8Smatt#if 0
401.8Smatt	RCSID("from: @(#)fabs.s	8.1 (Berkeley) 2/16/94")
411.8Smatt#else
421.9Sriastrad	RCSID("$NetBSD: fabs.S,v 1.9 2018/11/07 22:21:42 riastradh Exp $")
431.8Smatt#endif
441.1Sglass#endif /* LIBC_SCCS and not lint */
451.1Sglass
461.5Sjonathan
471.1Sglass	.set	noreorder
481.1Sglass
491.9Sriastrad#ifndef __HAVE_LONG_DOUBLE
501.9SriastradSTRONG_ALIAS(fabsl, fabs)
511.9Sriastrad#endif
521.9Sriastrad
531.1Sglass/*
541.1Sglass * fabs(x)
551.1Sglass *	double x;
561.1Sglass *
571.1Sglass * Return absolute value of x.
581.1Sglass */
591.3SmycroftLEAF(fabs)
601.1Sglass	j	ra
611.1Sglass	abs.d	$f0, $f12		# compute absolute value of x
621.3SmycroftEND(fabs)
63