xref: /csrg-svn/lib/libc/vax/gen/modf.s (revision 34480)
1*34480Sbostic/*
2*34480Sbostic * Copyright (c) 1983 Regents of the University of California.
3*34480Sbostic * All rights reserved.
4*34480Sbostic *
5*34480Sbostic * Redistribution and use in source and binary forms are permitted
6*34480Sbostic * provided that this notice is preserved and that due credit is given
7*34480Sbostic * to the University of California at Berkeley. The name of the University
8*34480Sbostic * may not be used to endorse or promote products derived from this
9*34480Sbostic * software without specific written prior permission. This software
10*34480Sbostic * is provided ``as is'' without express or implied warranty.
11*34480Sbostic */
1213417Sroot
13*34480Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
14*34480Sbostic_sccsid:.asciz	"@(#)modf.s	5.3 (Berkeley) 05/25/88"
15*34480Sbostic#endif /* SYSLIBC_SCCS and not lint */
16*34480Sbostic
1713417Sroot/*
1813417Sroot * double modf (value, iptr)
1913417Sroot * double value, *iptr;
2013417Sroot *
2113417Sroot * Modf returns the fractional part of "value",
2213417Sroot * and stores the integer part indirectly through "iptr".
2313417Sroot */
2413417Sroot
2513417Sroot#include "DEFS.h"
2613417Sroot
2717329SsamENTRY(modf, 0)
2813417Sroot	emodd	4(ap),$0,$0f1.0,r2,r0
2913417Sroot	jvs	1f			# integer overflow
3013417Sroot	cvtld	r2,*12(ap)
3113417Sroot	ret
3213417Sroot1:
3313417Sroot	subd3	r0,4(ap),*12(ap)
3413417Sroot	ret
35