xref: /original-bsd/lib/libc/tahoe/fpe/cmpd.s (revision c3e32dec)
1/*
2 * Copyright (c) 1986, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Computer Consoles Inc.
7 *
8 * %sccs.include.redist.c%
9 */
10
11#if defined(SYSLIBC_SCCS) && !defined(lint)
12	.asciz "@(#)cmpd.s	8.1 (Berkeley) 06/04/93"
13#endif /* SYSLIBC_SCCS and not lint */
14
15#include "DEFS.h"
16
17XENTRY(cmpd, R12|R11|R10|R9)
18	movl	4(fp),r12
19	movl	8(fp),r10
20	movl	12(fp),r11
21	movl	16(fp),r9
22	tstl	r12
23	jgeq	L16
24	xorl2	$-2147483648,r12
25	tstl	r10
26	jeql	L17
27	mnegl	r10,r10
28	mcoml	r12,r12
29	jbr	L16
30L17:	mnegl	r12,r12
31L16:	tstl	r11
32	jgeq	L19
33	xorl2	$-2147483648,r11
34	tstl	r9
35	jeql	L20
36	mnegl	r9,r9
37	mcoml	r11,r11
38	jbr	L19
39L20:	mnegl	r11,r11
40L19:	cmpl	r12,r11
41	jeql	L22
42	cmpl	r12,r11
43	jleq	L9999
44	movl	$1,r0
45	jbr	L9998
46L9999:	mnegl	$1,r0
47L9998:	ret
48L22:	cmpl	r10,r9
49	jeql	L23
50	cmpl	r10,r9
51	jlequ	L9997
52	movl	$1,r0
53	jbr	L9996
54L9997:	mnegl	$1,r0
55L9996:	ret
56L23:	clrl	r0
57	ret
58