fabs.S revision 1.8
11.8Smatt/*	$NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt 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.1Sglass
371.1Sglass#if defined(LIBC_SCCS) && !defined(lint)
381.8Smatt#if 0
391.8Smatt	RCSID("from: @(#)fabs.s	8.1 (Berkeley) 2/16/94")
401.8Smatt#else
411.8Smatt	RCSID("$NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $")
421.8Smatt#endif
431.1Sglass#endif /* LIBC_SCCS and not lint */
441.1Sglass
451.5Sjonathan
461.1Sglass	.set	noreorder
471.1Sglass
481.1Sglass/*
491.1Sglass * fabs(x)
501.1Sglass *	double x;
511.1Sglass *
521.1Sglass * Return absolute value of x.
531.1Sglass */
541.3SmycroftLEAF(fabs)
551.1Sglass	j	ra
561.1Sglass	abs.d	$f0, $f12		# compute absolute value of x
571.3SmycroftEND(fabs)
58