1# 2# Copyright (c) 1985 Regents of the University of California. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms are permitted 6# provided that this notice is preserved and that due credit is given 7# to the University of California at Berkeley. The name of the University 8# may not be used to endorse or promote products derived from this 9# software without specific prior written permission. This software 10# is provided ``as is'' without express or implied warranty. 11# 12# All recipients should regard themselves as participants in an ongoing 13# research project and hence should feel obligated to report their 14# experiences (good or bad) with these elementary function codes, using 15# the sendbug(8) program, to the authors. 16# 17# @(#)infnan.s 5.3 (Berkeley) 04/29/88 18# 19 .data 20 .align 2 21_sccsid: 22.asciz "@(#)infnan.s 5.3 (ucb.elefunt) 04/29/88" 23 24/* 25 * double infnan(arg) 26 * int arg; 27 * where arg := EDOM if result is NaN 28 * := ERANGE if result is +INF 29 * := -ERANGE if result is -INF 30 * 31 * The Reserved Operand Fault is generated inside of this routine. 32 */ 33 .globl _infnan 34 .set EDOM,33 35 .set ERANGE,34 36 .text 37 .align 2 38_infnan: 39 .word 0x0000 # save nothing 40 cmpl 4(fp),$ERANGE 41 bneq 1f 42 movl $ERANGE,_errno 43 brb 2f 441: movl $EDOM,_errno 452: cmpf2 $0x80000000,$0x80000000 # generates the reserved operand fault 46 ret 47