xref: /original-bsd/sys/tahoe/math/Ksubf.s (revision b9d18e58)
1/*	Ksubf.s	1.3	86/01/05	*/
2
3#include "../tahoe/SYS.h"
4
5/*
6 * _Ksubf(acc_most,acc_least,op_most,op_least,hfs)
7 *
8 * subf(d1,d2)
9 * {
10 * 	return(d1+(-d2));
11 * }
12 */
13	.text
14ENTRY(Ksubf, 0)
15	tstl	4(fp)	# handle (a-b) where a and/or b = 0.0
16	jneq	next
17	movl	$0,r1
18	movl	12(fp),r0
19	lnd	r0
20	std	r0
21	ret
22next:
23	tstl	12(fp)
24	jneq	doit
25	movl	$0,r1
26	movl	4(fp),r0
27	ret
28doit:
29	lnd	12(fp)	# note: -(0) = 0 by definition!
30	pushl	20(fp)	# hfs
31	pushd
32	pushl	8(fp)
33	pushl	4(fp)	# acc
34	callf	$24,_Kaddf
35	ret
36