11.1Sragge/* 21.1Sragge * Copyright (c) 1983, 1993 31.1Sragge * The Regents of the University of California. All rights reserved. 41.1Sragge * 51.1Sragge * Redistribution and use in source and binary forms, with or without 61.1Sragge * modification, are permitted provided that the following conditions 71.1Sragge * are met: 81.1Sragge * 1. Redistributions of source code must retain the above copyright 91.1Sragge * notice, this list of conditions and the following disclaimer. 101.1Sragge * 2. Redistributions in binary form must reproduce the above copyright 111.1Sragge * notice, this list of conditions and the following disclaimer in the 121.1Sragge * documentation and/or other materials provided with the distribution. 131.4Sagc * 3. Neither the name of the University nor the names of its contributors 141.1Sragge * may be used to endorse or promote products derived from this software 151.1Sragge * without specific prior written permission. 161.1Sragge * 171.1Sragge * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 181.1Sragge * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 191.1Sragge * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 201.1Sragge * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 211.1Sragge * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 221.1Sragge * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 231.1Sragge * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 241.1Sragge * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 251.1Sragge * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 261.1Sragge * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 271.1Sragge * SUCH DAMAGE. 281.1Sragge */ 291.1Sragge 301.5Smatt#include "DEFS.h" 311.5Smatt 321.1Sragge#if defined(LIBC_SCCS) && !defined(lint) 331.1Sragge /* .asciz "@(#)modf.s 8.1 (Berkeley) 6/4/93" */ 341.5SmattRCSID("$NetBSD: modf.S,v 1.5 2011/01/25 02:38:15 matt Exp $") 351.1Sragge#endif /* LIBC_SCCS and not lint */ 361.1Sragge 371.1Sragge/* 381.1Sragge * double modf (value, iptr) 391.1Sragge * double value, *iptr; 401.1Sragge * 411.1Sragge * Modf returns the fractional part of "value", 421.1Sragge * and stores the integer part indirectly through "iptr". 431.1Sragge */ 441.1Sragge 451.1SraggeENTRY(modf, 0) 461.2Smatt emodd 4(%ap),$0,$0f1.0,%r2,%r0 471.1Sragge jvs 1f # integer overflow 481.2Smatt cvtld %r2,*12(%ap) 491.1Sragge ret 501.1Sragge1: 511.2Smatt subd3 %r0,4(%ap),*12(%ap) 521.3Smatt ret 531.5SmattEND(modf) 541.3Smatt 551.3SmattENTRY(modff, 0) 561.3Smatt emodf 4(%ap),$0,$0f1.0,%r2,%r0 571.3Smatt jvs 1f # integer overflow 581.3Smatt cvtlf %r2,*8(%ap) 591.3Smatt ret 601.3Smatt1: 611.3Smatt subf3 %r0,4(%ap),*8(%ap) 621.1Sragge ret 631.5SmattEND(modff) 64