add Berkeley specific copyright
[unix-history] / usr / src / lib / libm / tahoe / infnan.s
CommitLineData
bc0f2b0e
KB
1# Copyright (c) 1985 Regents of the University of California.
2# All rights reserved.
3#
2bc65d90 4# %sccs.include.redist.sh%
bc0f2b0e 5#
2bc65d90 6# @(#)infnan.s 5.5 (Berkeley) %G%
bc0f2b0e 7#
e432105d
KB
8 .data
9 .align 2
10_sccsid:
2bc65d90 11.asciz "@(#)infnan.s 5.5 (ucb.elefunt) %G%"
e432105d
KB
12
13/*
14 * double infnan(arg)
15 * int arg;
16 * where arg := EDOM if result is NaN
17 * := ERANGE if result is +INF
18 * := -ERANGE if result is -INF
19 *
20 * The Reserved Operand Fault is generated inside of this routine.
21 */
22 .globl _infnan
23 .set EDOM,33
24 .set ERANGE,34
25 .text
26 .align 2
27_infnan:
28 .word 0x0000 # save nothing
29 cmpl 4(fp),$ERANGE
30 bneq 1f
31 movl $ERANGE,_errno
32 brb 2f
331: movl $EDOM,_errno
342: cmpf2 $0x80000000,$0x80000000 # generates the reserved operand fault
35 ret