1*6cb10275Sriastradh/* $NetBSD: modf.S,v 1.3 2014/03/18 18:20:37 riastradh Exp $ */ 2d35c3886Smatt 3d35c3886Smatt/*- 4d35c3886Smatt * Copyright (c) 1990 The Regents of the University of California. 5d35c3886Smatt * All rights reserved. 6d35c3886Smatt * 7d35c3886Smatt * This code is derived from software contributed to Berkeley by 8d35c3886Smatt * the Systems Programming Group of the University of Utah Computer 9d35c3886Smatt * Science Department. 10d35c3886Smatt * 11d35c3886Smatt * Redistribution and use in source and binary forms, with or without 12d35c3886Smatt * modification, are permitted provided that the following conditions 13d35c3886Smatt * are met: 14d35c3886Smatt * 1. Redistributions of source code must retain the above copyright 15d35c3886Smatt * notice, this list of conditions and the following disclaimer. 16d35c3886Smatt * 2. Redistributions in binary form must reproduce the above copyright 17d35c3886Smatt * notice, this list of conditions and the following disclaimer in the 18d35c3886Smatt * documentation and/or other materials provided with the distribution. 19d35c3886Smatt * 3. Neither the name of the University nor the names of its contributors 20d35c3886Smatt * may be used to endorse or promote products derived from this software 21d35c3886Smatt * without specific prior written permission. 22d35c3886Smatt * 23d35c3886Smatt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24d35c3886Smatt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25d35c3886Smatt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26d35c3886Smatt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27d35c3886Smatt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28d35c3886Smatt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29d35c3886Smatt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30d35c3886Smatt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31d35c3886Smatt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32d35c3886Smatt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33d35c3886Smatt * SUCH DAMAGE. 34d35c3886Smatt */ 35d35c3886Smatt 36d35c3886Smatt#include <machine/asm.h> 37d35c3886Smatt 38d35c3886Smatt#if defined(LIBC_SCCS) && !defined(lint) 39d35c3886Smatt#if 0 40d35c3886Smatt RCSID("from: @(#)modf.s 5.1 (Berkeley) 5/12/90") 41d35c3886Smatt#else 42*6cb10275Sriastradh RCSID("$NetBSD: modf.S,v 1.3 2014/03/18 18:20:37 riastradh Exp $") 43d35c3886Smatt#endif 44d35c3886Smatt#endif /* LIBC_SCCS and not lint */ 45d35c3886Smatt 46d35c3886Smatt/* 47d35c3886Smatt * double modf(val, iptr) 48d35c3886Smatt * returns: xxx and n (in *iptr) where val == n.xxx 49d35c3886Smatt */ 50d35c3886SmattENTRY(modf) 51d35c3886Smatt fmoved 4(%sp),%fp0 52d35c3886Smatt movel 12(%sp),%a0 536125de07Smatt#ifdef __mcoldfire__ 546125de07Smatt fintrzd %fp0,%fp1 556125de07Smatt#else 56d35c3886Smatt fintrzx %fp0,%fp1 576125de07Smatt#endif 58d35c3886Smatt fmoved %fp1,(%a0) 596125de07Smatt#ifdef __mcoldfire__ 606125de07Smatt fsubd %fp1,%fp0 616125de07Smatt#else 62d35c3886Smatt fsubx %fp1,%fp0 636125de07Smatt#endif 64d35c3886Smatt#ifndef __SVR4_ABI__ 65d35c3886Smatt fmoved %fp0,-(%sp) 66d35c3886Smatt movel (%sp)+,%d0 67d35c3886Smatt movel (%sp)+,%d1 68d35c3886Smatt#endif 69d35c3886Smatt rts 70d35c3886SmattEND(modf) 71