xref: /original-bsd/lib/libm/vax/infnan.s (revision 89a39cb6)
1/*
2 * Copyright (c) 1985 Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 * All recipients should regard themselves as participants in an ongoing
8 * research project and hence should feel obligated to report their
9 * experiences (good or bad) with these elementary function codes, using
10 * the sendbug(8) program, to the authors.
11 *
12 *	@(#)infnan.s	5.4 (Berkeley) 06/01/90
13 */
14	.data
15	.align	2
16_sccsid:
17.asciz	"@(#)infnan.s	1.1 (Berkeley) 8/21/85; 5.4 (ucb.elefunt) 06/01/90"
18
19/*
20 * infnan(arg) int arg;
21 * where arg :=    EDOM	if result is  NaN
22 *	     :=  ERANGE	if result is +INF
23 *	     := -ERANGE if result is -INF
24 *
25 * The Reserved Operand Fault is generated inside of this routine.
26 */
27	.globl	_infnan
28	.set	EDOM,33
29	.set	ERANGE,34
30	.text
31	.align 1
32_infnan:
33	.word	0x0
34	cmpl	4(ap),$ERANGE
35	bneq	1f
36	movl	$ERANGE,_errno
37	brb	2f
381:	movl	$EDOM,_errno
392:	emodd	$0,$0,$0x8000,r0,r0	# generates the reserved operand fault
40	ret
41