xref: /openbsd-src/lib/libc/arch/sparc64/stdlib/abs.S (revision 3cb4a9ae39a41124757f9dec4485e8e633b3a874)
1*3cb4a9aeSguenther/*	$OpenBSD: abs.S,v 1.5 2015/09/13 16:27:59 guenther Exp $	*/
24ce65becSart/*	$NetBSD: abs.S,v 1.1 1998/09/11 04:56:32 eeh Exp $	*/
34ce65becSart
44ce65becSart/*
54ce65becSart * Copyright (c) 1992, 1993
64ce65becSart *	The Regents of the University of California.  All rights reserved.
74ce65becSart *
84ce65becSart * This software was developed by the Computer Systems Engineering group
94ce65becSart * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
104ce65becSart * contributed to Berkeley.
114ce65becSart *
124ce65becSart * Redistribution and use in source and binary forms, with or without
134ce65becSart * modification, are permitted provided that the following conditions
144ce65becSart * are met:
154ce65becSart * 1. Redistributions of source code must retain the above copyright
164ce65becSart *    notice, this list of conditions and the following disclaimer.
174ce65becSart * 2. Redistributions in binary form must reproduce the above copyright
184ce65becSart *    notice, this list of conditions and the following disclaimer in the
194ce65becSart *    documentation and/or other materials provided with the distribution.
206580fee3Smillert * 3. Neither the name of the University nor the names of its contributors
214ce65becSart *    may be used to endorse or promote products derived from this software
224ce65becSart *    without specific prior written permission.
234ce65becSart *
244ce65becSart * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
254ce65becSart * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
264ce65becSart * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
274ce65becSart * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
284ce65becSart * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
294ce65becSart * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
304ce65becSart * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
314ce65becSart * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
324ce65becSart * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
334ce65becSart * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
344ce65becSart * SUCH DAMAGE.
354ce65becSart *
364ce65becSart * from: Header: abs.s,v 1.1 91/07/06 18:01:57 torek Exp
374ce65becSart */
384ce65becSart
39*3cb4a9aeSguenther#include "SYS.h"
404ce65becSart
414ce65becSart/* abs - int absolute value */
424ce65becSart
434ce65becSart
444ce65becSartENTRY(abs)
454ce65becSart	neg	%o0, %o1
464ce65becSart	retl
474ce65becSart	 movrlz	%o0, %o1, %o0
484d8a837aSguentherEND_STRONG(abs)
49