xref: /openbsd-src/lib/libc/arch/sparc64/fpu/fpu_extern.h (revision 19e206fb182c723cefb89a4645724c8854d9b2bd)
1*19e206fbSguenther /*	$OpenBSD: fpu_extern.h,v 1.4 2016/05/08 18:41:17 guenther Exp $	*/
202b90beaSjason 
302b90beaSjason /*-
402b90beaSjason  * Copyright (c) 1995 The NetBSD Foundation, Inc.
502b90beaSjason  * All rights reserved.
602b90beaSjason  *
702b90beaSjason  * This code is derived from software contributed to The NetBSD Foundation
802b90beaSjason  * by Christos Zoulas.
902b90beaSjason  *
1002b90beaSjason  * Redistribution and use in source and binary forms, with or without
1102b90beaSjason  * modification, are permitted provided that the following conditions
1202b90beaSjason  * are met:
1302b90beaSjason  * 1. Redistributions of source code must retain the above copyright
1402b90beaSjason  *    notice, this list of conditions and the following disclaimer.
1502b90beaSjason  * 2. Redistributions in binary form must reproduce the above copyright
1602b90beaSjason  *    notice, this list of conditions and the following disclaimer in the
1702b90beaSjason  *    documentation and/or other materials provided with the distribution.
1802b90beaSjason  *
1902b90beaSjason  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2002b90beaSjason  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2102b90beaSjason  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2202b90beaSjason  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2302b90beaSjason  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2402b90beaSjason  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2502b90beaSjason  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2602b90beaSjason  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2702b90beaSjason  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2802b90beaSjason  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2902b90beaSjason  * POSSIBILITY OF SUCH DAMAGE.
3002b90beaSjason  *
3102b90beaSjason  *	$NetBSD: fpu_extern.h,v 1.4 2000/08/03 18:32:08 eeh Exp $
3202b90beaSjason  * $FreeBSD: src/lib/libc/sparc64/fpu/fpu_extern.h,v 1.6 2002/04/27 21:56:28 jake Exp $
3302b90beaSjason  */
3402b90beaSjason 
3502b90beaSjason #ifndef _SPARC64_FPU_FPU_EXTERN_H_
3602b90beaSjason #define _SPARC64_FPU_FPU_EXTERN_H_
3702b90beaSjason 
3802b90beaSjason struct utrapframe;
3902b90beaSjason union instr;
4002b90beaSjason struct fpemu;
4102b90beaSjason struct fpn;
4202b90beaSjason 
43*19e206fbSguenther __BEGIN_HIDDEN_DECLS
4402b90beaSjason /* fpu.c */
4502b90beaSjason int __fpu_exception(struct utrapframe *tf);
4602b90beaSjason 
4702b90beaSjason /* fpu_add.c */
4802b90beaSjason struct fpn *__fpu_add(struct fpemu *);
4902b90beaSjason 
5002b90beaSjason /* fpu_compare.c */
5102b90beaSjason void __fpu_compare(struct fpemu *, int, int);
5202b90beaSjason 
5302b90beaSjason /* fpu_div.c */
5402b90beaSjason struct fpn *__fpu_div(struct fpemu *);
5502b90beaSjason 
5602b90beaSjason /* fpu_explode.c */
5702b90beaSjason int __fpu_itof(struct fpn *, u_int);
5890c97895Sotto int __fpu_uitof(struct fpn *, u_int);
5902b90beaSjason int __fpu_xtof(struct fpn *, u_int64_t);
6090c97895Sotto int __fpu_uxtof(struct fpn *, u_int64_t);
6102b90beaSjason int __fpu_stof(struct fpn *, u_int);
6202b90beaSjason int __fpu_dtof(struct fpn *, u_int, u_int );
6302b90beaSjason int __fpu_qtof(struct fpn *, u_int, u_int , u_int , u_int );
6402b90beaSjason void __fpu_explode(struct fpemu *, struct fpn *, int, int );
6502b90beaSjason 
6602b90beaSjason /* fpu_implode.c */
6702b90beaSjason u_int __fpu_ftoi(struct fpemu *, struct fpn *);
6802b90beaSjason u_int __fpu_ftox(struct fpemu *, struct fpn *, u_int *);
6902b90beaSjason u_int __fpu_ftos(struct fpemu *, struct fpn *);
7002b90beaSjason u_int __fpu_ftod(struct fpemu *, struct fpn *, u_int *);
7102b90beaSjason u_int __fpu_ftoq(struct fpemu *, struct fpn *, u_int *);
7202b90beaSjason void __fpu_implode(struct fpemu *, struct fpn *, int, u_int *);
7302b90beaSjason 
7402b90beaSjason /* fpu_mul.c */
7502b90beaSjason struct fpn *__fpu_mul(struct fpemu *);
7602b90beaSjason 
7702b90beaSjason /* fpu_sqrt.c */
7802b90beaSjason struct fpn *__fpu_sqrt(struct fpemu *);
7902b90beaSjason 
8002b90beaSjason /* fpu_subr.c */
8102b90beaSjason /*
8202b90beaSjason  * Shift a number right some number of bits, taking care of round/sticky.
8302b90beaSjason  * Note that the result is probably not a well-formed number (it will lack
8402b90beaSjason  * the normal 1-bit mant[0]&FP_1).
8502b90beaSjason  */
8602b90beaSjason int __fpu_shr(register struct fpn *, register int);
8702b90beaSjason void __fpu_norm(register struct fpn *);
8802b90beaSjason /* Build a new Quiet NaN (sign=0, frac=all 1's). */
8902b90beaSjason struct fpn *__fpu_newnan(register struct fpemu *);
90*19e206fbSguenther __END_HIDDEN_DECLS
9102b90beaSjason 
9202b90beaSjason #endif /* !_SPARC64_FPU_FPU_EXTERN_H_ */
93