11.14Sdholland/*	$NetBSD: fabs.S,v 1.14 2019/01/27 02:42:32 dholland Exp $	*/
21.2Sthorpej
31.1Spaulus/*-
41.3Sjtc * Copyright (c) 1996 The NetBSD Foundation, Inc.
51.1Spaulus * All rights reserved.
61.1Spaulus *
71.3Sjtc * This code is derived from software contributed to The NetBSD Foundation
81.3Sjtc * by
91.1Spaulus *
101.1Spaulus * Redistribution and use in source and binary forms, with or without
111.1Spaulus * modification, are permitted provided that the following conditions
121.1Spaulus * are met:
131.1Spaulus * 1. Redistributions of source code must retain the above copyright
141.1Spaulus *    notice, this list of conditions and the following disclaimer.
151.1Spaulus * 2. Redistributions in binary form must reproduce the above copyright
161.1Spaulus *    notice, this list of conditions and the following disclaimer in the
171.1Spaulus *    documentation and/or other materials provided with the distribution.
181.1Spaulus *
191.3Sjtc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.3Sjtc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.3Sjtc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.4Sjtc * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.4Sjtc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.3Sjtc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.3Sjtc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.3Sjtc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.3Sjtc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.3Sjtc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.3Sjtc * POSSIBILITY OF SUCH DAMAGE.
301.1Spaulus */
311.1Spaulus
321.3Sjtc#include <machine/asm.h>
331.12Sriastrad#include <machine/math.h>
341.2Sthorpej
351.14SdhollandRCSID("$NetBSD: fabs.S,v 1.14 2019/01/27 02:42:32 dholland Exp $")
361.12Sriastrad
371.12Sriastrad#ifndef __HAVE_LONG_DOUBLE
381.12SriastradSTRONG_ALIAS(fabsl, fabs)
391.12Sriastrad#endif
401.1Spaulus
411.1SpaulusENTRY(fabs)
421.11Smatt#if defined(__SVR4_ABI__) && defined(__HAVE_FPU__)
431.9Smatt	bclr	#31,4(%sp)
441.9Smatt	fmoved	4(%sp),%fp0
451.5Skleink#else
461.9Smatt	movl	4(%sp),%d0
471.9Smatt	movl	8(%sp),%d1
481.6Sthorpej	bclr	#31,%d0
491.5Skleink#endif
501.1Spaulus	rts
511.10SmattEND(fabs)
52