xref: /csrg-svn/lib/libm/vax/infnan.s (revision 24569)
1*24569Szliu/*
2*24569Szliu * Copyright (c) 1985 Regents of the University of California.
3*24569Szliu *
4*24569Szliu * Use and reproduction of this software are granted  in  accordance  with
5*24569Szliu * the terms and conditions specified in  the  Berkeley  Software  License
6*24569Szliu * Agreement (in particular, this entails acknowledgement of the programs'
7*24569Szliu * source, and inclusion of this notice) with the additional understanding
8*24569Szliu * that  all  recipients  should regard themselves as participants  in  an
9*24569Szliu * ongoing  research  project and hence should  feel  obligated  to report
10*24569Szliu * their  experiences (good or bad) with these elementary function  codes,
11*24569Szliu * using "sendbug 4bsd-bugs@BERKELEY", to the authors.
12*24569Szliu *
13*24569Szliu * @(#)infnan.s	1.1 (ELEFUNT) 09/06/85
14*24569Szliu *
15*24569Szliu * infnan(arg) int arg;
16*24569Szliu * where arg :=    EDOM	if result is  NaN
17*24569Szliu *	     :=  ERANGE	if result is +INF
18*24569Szliu *	     := -ERANGE if result is -INF
19*24569Szliu *
20*24569Szliu * The Reserved Operand Fault is generated inside of this routine.
21*24569Szliu *
22*24569Szliu */
23*24569Szliu	.globl	_infnan
24*24569Szliu	.set	EDOM,33
25*24569Szliu	.set	ERANGE,34
26*24569Szliu	.text
27*24569Szliu	.align 1
28*24569Szliu_infnan:
29*24569Szliu	.word	0x0
30*24569Szliu	cmpl	4(ap),$ERANGE
31*24569Szliu	bneq	1f
32*24569Szliu	movl	$ERANGE,_errno
33*24569Szliu	brb	2f
34*24569Szliu1:	movl	$EDOM,_errno
35*24569Szliu2:	emodd	$0,$0,$0x8000,r0,r0	# generates the reserved operand fault
36*24569Szliu	ret
37