xref: /csrg-svn/lib/libm/vax/infnan.s (revision 34125)
1*34125Sbostic/*
224569Szliu * Copyright (c) 1985 Regents of the University of California.
3*34125Sbostic * All rights reserved.
4*34125Sbostic *
5*34125Sbostic * Redistribution and use in source and binary forms are permitted
6*34125Sbostic * provided that this notice is preserved and that due credit is given
7*34125Sbostic * to the University of California at Berkeley. The name of the University
8*34125Sbostic * may not be used to endorse or promote products derived from this
9*34125Sbostic * software without specific prior written permission. This software
10*34125Sbostic * is provided ``as is'' without express or implied warranty.
11*34125Sbostic *
12*34125Sbostic * All recipients should regard themselves as participants in an ongoing
13*34125Sbostic * research project and hence should feel obligated to report their
14*34125Sbostic * experiences (good or bad) with these elementary function codes, using
15*34125Sbostic * the sendbug(8) program, to the authors.
16*34125Sbostic *
17*34125Sbostic *	@(#)infnan.s	5.2 (Berkeley) 04/29/88
1824729Selefunt */
1924729Selefunt	.data
2024729Selefunt	.align	2
2124729Selefunt_sccsid:
22*34125Sbostic.asciz	"@(#)infnan.s	1.1 (Berkeley) 8/21/85; 5.2 (ucb.elefunt) 04/29/88"
2324729Selefunt
2424729Selefunt/*
2524569Szliu * infnan(arg) int arg;
2624569Szliu * where arg :=    EDOM	if result is  NaN
2724569Szliu *	     :=  ERANGE	if result is +INF
2824569Szliu *	     := -ERANGE if result is -INF
2924569Szliu *
3024569Szliu * The Reserved Operand Fault is generated inside of this routine.
3124569Szliu */
3224569Szliu	.globl	_infnan
3324569Szliu	.set	EDOM,33
3424569Szliu	.set	ERANGE,34
3524569Szliu	.text
3624569Szliu	.align 1
3724569Szliu_infnan:
3824569Szliu	.word	0x0
3924569Szliu	cmpl	4(ap),$ERANGE
4024569Szliu	bneq	1f
4124569Szliu	movl	$ERANGE,_errno
4224569Szliu	brb	2f
4324569Szliu1:	movl	$EDOM,_errno
4424569Szliu2:	emodd	$0,$0,$0x8000,r0,r0	# generates the reserved operand fault
4524569Szliu	ret
46