xref: /csrg-svn/lib/libc/vax/gen/modf.s (revision 42637)
134480Sbostic/*
234480Sbostic * Copyright (c) 1983 Regents of the University of California.
334480Sbostic * All rights reserved.
434480Sbostic *
5*42637Sbostic * %sccs.include.redist.c%
634480Sbostic */
713417Sroot
834819Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*42637Sbostic	.asciz "@(#)modf.s	5.5 (Berkeley) 06/01/90"
1034819Sbostic#endif /* LIBC_SCCS and not lint */
1134480Sbostic
1213417Sroot/*
1313417Sroot * double modf (value, iptr)
1413417Sroot * double value, *iptr;
1513417Sroot *
1613417Sroot * Modf returns the fractional part of "value",
1713417Sroot * and stores the integer part indirectly through "iptr".
1813417Sroot */
1913417Sroot
2013417Sroot#include "DEFS.h"
2113417Sroot
2217329SsamENTRY(modf, 0)
2313417Sroot	emodd	4(ap),$0,$0f1.0,r2,r0
2413417Sroot	jvs	1f			# integer overflow
2513417Sroot	cvtld	r2,*12(ap)
2613417Sroot	ret
2713417Sroot1:
2813417Sroot	subd3	r0,4(ap),*12(ap)
2913417Sroot	ret
30