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