xref: /original-bsd/lib/libc/tahoe/fpe/cmpf.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 "@(#)cmpf.s	8.1 (Berkeley) 06/04/93"
13#endif /* SYSLIBC_SCCS and not lint */
14
15/*
16 * cmpf(f1, f2)
17 *	float f1, f2;
18 * return -1, 0, 1 as f1 <, ==, > f2
19 */
20#include "DEFS.h"
21
22XENTRY(cmpf, 0)
23	cmpl	4(fp),12(fp)
24	jneq	1f
25	clrl	r0
26	ret
271:
28	movl	4(fp),r0
29	jgeq	1f
30	xorl2	$0x80000000,r0
31	mnegl	r0,r0
321:
33	movl	12(fp),r1
34	jgeq	1f
35	xorl2	$0x80000000,r1
36	mnegl	r1,r1
371:
38	cmpl	r0,r1
39	jleq	1f
40	movl	$1,r0
41	ret
421:
43	mnegl	$1,r0
44	ret
45