fpu_extern.h revision 92905
1/*- 2 * Copyright (c) 1995 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Christos Zoulas. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the NetBSD 19 * Foundation, Inc. and its contributors. 20 * 4. Neither the name of The NetBSD Foundation nor the names of its 21 * contributors may be used to endorse or promote products derived 22 * from this software without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 25 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 * 36 * from: NetBSD: fpu_extern.h,v 1.4 2000/08/03 18:32:08 eeh Exp 37 * 38 * $FreeBSD: head/lib/libc/sparc64/fpu/fpu_extern.h 92905 2002-03-21 22:49:10Z obrien $ 39 */ 40 41#ifndef _SPARC64_FPU_FPU_EXTERN_H_ 42#define _SPARC64_FPU_FPU_EXTERN_H_ 43 44struct proc; 45struct fpstate; 46struct utrapframe; 47union instr; 48struct fpemu; 49struct fpn; 50 51/* fpu.c */ 52void __fpu_exception(struct utrapframe *tf); 53void __fpu_panic(char *msg); 54 55/* fpu_add.c */ 56struct fpn *__fpu_add(struct fpemu *); 57 58/* fpu_compare.c */ 59void __fpu_compare(struct fpemu *, int, int); 60 61/* fpu_div.c */ 62struct fpn *__fpu_div(struct fpemu *); 63 64/* fpu_explode.c */ 65int __fpu_itof(struct fpn *, u_int); 66int __fpu_xtof(struct fpn *, u_int64_t); 67int __fpu_stof(struct fpn *, u_int); 68int __fpu_dtof(struct fpn *, u_int, u_int ); 69int __fpu_qtof(struct fpn *, u_int, u_int , u_int , u_int ); 70void __fpu_explode(struct fpemu *, struct fpn *, int, int ); 71 72/* fpu_implode.c */ 73u_int __fpu_ftoi(struct fpemu *, struct fpn *); 74u_int __fpu_ftox(struct fpemu *, struct fpn *, u_int *); 75u_int __fpu_ftos(struct fpemu *, struct fpn *); 76u_int __fpu_ftod(struct fpemu *, struct fpn *, u_int *); 77u_int __fpu_ftoq(struct fpemu *, struct fpn *, u_int *); 78void __fpu_implode(struct fpemu *, struct fpn *, int, u_int *); 79 80/* fpu_mul.c */ 81struct fpn *__fpu_mul(struct fpemu *); 82 83/* fpu_sqrt.c */ 84struct fpn *__fpu_sqrt(struct fpemu *); 85 86/* fpu_subr.c */ 87/* 88 * Shift a number right some number of bits, taking care of round/sticky. 89 * Note that the result is probably not a well-formed number (it will lack 90 * the normal 1-bit mant[0]&FP_1). 91 */ 92int __fpu_shr(register struct fpn *, register int); 93void __fpu_norm(register struct fpn *); 94/* Build a new Quiet NaN (sign=0, frac=all 1's). */ 95struct fpn *__fpu_newnan(register struct fpemu *); 96 97#endif /* !_SPARC64_FPU_FPU_EXTERN_H_ */ 98