xref: /netbsd-src/lib/libm/arch/m68k/s_rint.S (revision eb7c1594f145c931049e1fd9eb056a5987e87e59)
1*eb7c1594Sagc/*	$NetBSD: s_rint.S,v 1.7 2003/08/07 16:44:41 agc Exp $	*/
2bebf6897Sthorpej
33f2d2fc0Sis/*-
43f2d2fc0Sis * Copyright (c) 1990 The Regents of the University of California.
53f2d2fc0Sis * All rights reserved.
63f2d2fc0Sis *
73f2d2fc0Sis * This code is derived from software contributed to Berkeley by
83f2d2fc0Sis * the Systems Programming Group of the University of Utah Computer
93f2d2fc0Sis * Science Department.
103f2d2fc0Sis *
113f2d2fc0Sis * Redistribution and use in source and binary forms, with or without
123f2d2fc0Sis * modification, are permitted provided that the following conditions
133f2d2fc0Sis * are met:
143f2d2fc0Sis * 1. Redistributions of source code must retain the above copyright
153f2d2fc0Sis *    notice, this list of conditions and the following disclaimer.
163f2d2fc0Sis * 2. Redistributions in binary form must reproduce the above copyright
173f2d2fc0Sis *    notice, this list of conditions and the following disclaimer in the
183f2d2fc0Sis *    documentation and/or other materials provided with the distribution.
19*eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors
203f2d2fc0Sis *    may be used to endorse or promote products derived from this software
213f2d2fc0Sis *    without specific prior written permission.
223f2d2fc0Sis *
233f2d2fc0Sis * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
243f2d2fc0Sis * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
253f2d2fc0Sis * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
263f2d2fc0Sis * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
273f2d2fc0Sis * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
283f2d2fc0Sis * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
293f2d2fc0Sis * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
303f2d2fc0Sis * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
313f2d2fc0Sis * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
323f2d2fc0Sis * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
333f2d2fc0Sis * SUCH DAMAGE.
343f2d2fc0Sis */
353f2d2fc0Sis
363f2d2fc0Sis#include <machine/asm.h>
373f2d2fc0Sis
383f2d2fc0Sis;_sccsid:
393f2d2fc0Sis;.asciz	"from: @(#)floor.s	5.1 (Berkeley) 5/17/90"
403f2d2fc0Sis
41*eb7c1594SagcRCSID("$NetBSD: s_rint.S,v 1.7 2003/08/07 16:44:41 agc Exp $")
423f2d2fc0Sis
433f2d2fc0Sis| rint(x)
443f2d2fc0Sis| delivers integer nearest x in direction of prevailing rounding mode
453f2d2fc0SisENTRY(rint)
46bebf6897Sthorpej	fintd	%sp@(4),%fp0	| use prevailing rounding mode
473f2d2fc0Sis#ifndef __SVR4_ABI__
48bebf6897Sthorpej	fmoved	%fp0,%sp@-
49bebf6897Sthorpej	movel	%sp@+,%d0
50bebf6897Sthorpej	movel	%sp@+,%d1
513f2d2fc0Sis#endif
523f2d2fc0Sis	rts
53