xref: /original-bsd/sys/tahoe/math/Kcmpf.s (revision a9c19d04)
1/*	Kcmpf.s	1.3	86/01/05	*/
2
3#include "../tahoe/SYS.h"
4
5/*
6 * cmpf(o1, o2)
7 *	register o1, o2;
8 *{
9 *	if(o1 < 0) {
10 *		o1 ^= 0x80000000;
11 *		o1 = -o1;
12 *	}
13 *	if(o2 < 0) {
14 *		o2 ^= 0x80000000;
15 *		o2 = -o2;
16 *	}
17 *	if(o1 != o2)
18 *		return(o1>o2 ? 1 : -1);
19 *	return(0);
20 *}
21 */
22	.text
23ENTRY(Kcmpf, 0)
24	movl	4(fp),r12
25	jgeq	1f
26	xorl2	$0x80000000,r12
27	mnegl	r12,r12
281:
29	movl	12(fp),r11
30	jgeq	1f
31	xorl2	$0x80000000,r11
32	mnegl	r11,r11
331:
34	cmpl	r12,r11
35	jneq	1f
36	clr	r0; ret
371:
38	jleq	1f
39	movl	$1,r0; ret
401:
41	mnegl	$1,r0; ret
42