xref: /csrg-svn/lib/libc/vax/gen/fixunsdfsi.s (revision 54420)
1*54420Sbostic/*-
2*54420Sbostic * Copyright (c) 1992 The Regents of the University of California.
3*54420Sbostic * All rights reserved.
4*54420Sbostic *
5*54420Sbostic * %sccs.include.redist.c%
6*54420Sbostic */
7*54420Sbostic
8*54420Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*54420Sbostic	.asciz "@(#)fixunsdfsi.s	5.1 (Berkeley) 06/25/92"
10*54420Sbostic#endif /* LIBC_SCCS and not lint */
11*54420Sbostic
12*54420Sbostic#include "DEFS.h"
13*54420Sbostic
14*54420Sbostic	.data
15*54420Sbostic	.align	2
16*54420SbosticLbig:	.double	0d2.14748364800000000000e+09
17*54420Sbostic	.text
18*54420Sbostic
19*54420Sbostic/*
20*54420Sbostic * VAX conversions overflow politely,
21*54420Sbostic * but we'll be conservative just in case someone is trapping overflow.
22*54420Sbostic */
23*54420SbosticENTRY(__fixunsdfsi, 0)
24*54420Sbostic	cmpd	4(ap),Lbig
25*54420Sbostic	jgeq	1f
26*54420Sbostic	cvtdl	4(ap),r0
27*54420Sbostic	ret
28*54420Sbostic
29*54420Sbostic1:	subd3	Lbig,4(ap),r0
30*54420Sbostic	cvtdl	r0,r0
31*54420Sbostic	addl2	$2147483648,r0
32*54420Sbostic	ret
33