xref: /original-bsd/sys/tahoe/math/Ksubf.s (revision 9b5efc43)
1/*-
2 * Copyright (c) 1985 The Regents of the University of California.
3 * 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 *	@(#)Ksubf.s	7.1 (Berkeley) 12/06/90
11 */
12
13#include "../tahoe/SYS.h"
14
15/*
16 * _Ksubf(acc_most,acc_least,op_most,op_least,hfs)
17 *
18 * subf(d1,d2)
19 * {
20 * 	return(d1+(-d2));
21 * }
22 */
23	.text
24ENTRY(Ksubf, 0)
25	tstl	4(fp)	# handle (a-b) where a and/or b = 0.0
26	jneq	next
27	movl	$0,r1
28	movl	12(fp),r0
29	lnd	r0
30	std	r0
31	ret
32next:
33	tstl	12(fp)
34	jneq	doit
35	movl	$0,r1
36	movl	4(fp),r0
37	ret
38doit:
39	lnd	12(fp)	# note: -(0) = 0 by definition!
40	pushl	20(fp)	# hfs
41	pushd
42	pushl	8(fp)
43	pushl	4(fp)	# acc
44	callf	$24,_Kaddf
45	ret
46