124569Szliu/* 224569Szliu * Copyright (c) 1985 Regents of the University of California. 324569Szliu * 424569Szliu * Use and reproduction of this software are granted in accordance with 524569Szliu * the terms and conditions specified in the Berkeley Software License 624569Szliu * Agreement (in particular, this entails acknowledgement of the programs' 724569Szliu * source, and inclusion of this notice) with the additional understanding 824569Szliu * that all recipients should regard themselves as participants in an 924569Szliu * ongoing research project and hence should feel obligated to report 1024569Szliu * their experiences (good or bad) with these elementary function codes, 1124569Szliu * using "sendbug 4bsd-bugs@BERKELEY", to the authors. 12*24729Selefunt */ 13*24729Selefunt .data 14*24729Selefunt .align 2 15*24729Selefunt_sccsid: 16*24729Selefunt.asciz "@(#)infnan.s 1.1 (Berkeley) 8/21/85; 1.3 (ucb.elefunt) 09/12/85" 17*24729Selefunt 18*24729Selefunt/* 1924569Szliu * infnan(arg) int arg; 2024569Szliu * where arg := EDOM if result is NaN 2124569Szliu * := ERANGE if result is +INF 2224569Szliu * := -ERANGE if result is -INF 2324569Szliu * 2424569Szliu * The Reserved Operand Fault is generated inside of this routine. 2524569Szliu */ 2624569Szliu .globl _infnan 2724569Szliu .set EDOM,33 2824569Szliu .set ERANGE,34 2924569Szliu .text 3024569Szliu .align 1 3124569Szliu_infnan: 3224569Szliu .word 0x0 3324569Szliu cmpl 4(ap),$ERANGE 3424569Szliu bneq 1f 3524569Szliu movl $ERANGE,_errno 3624569Szliu brb 2f 3724569Szliu1: movl $EDOM,_errno 3824569Szliu2: emodd $0,$0,$0x8000,r0,r0 # generates the reserved operand fault 3924569Szliu ret 40