xref: /openbsd-src/sys/arch/m88k/m88k/fpu.h (revision 32ffafad193fd9d5bc1743017cf37d821be47b78)
1 /*	$OpenBSD: fpu.h,v 1.2 2024/05/22 14:25:47 jsg Exp $	*/
2 
3 /*
4  * Copyright (c) 2014 Miodrag Vallat.
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /*
20  * Internal defines for the floating-point completion code.
21  */
22 
23 /*
24  * Data width (matching the TD field of the instructions)
25  */
26 #define	FTYPE_SNG	0
27 #define	FTYPE_DBL	1
28 #define	FTYPE_EXT	2
29 #define	FTYPE_INT	3	/* not a real T value */
30 
31 #define	IGNORE_PRECISION	FTYPE_SNG
32 
33 /* floating point value */
34 typedef union {
35 	float32		sng;
36 	float64		dbl;
37 } fparg;
38 
39 void	fpu_compare(struct trapframe *, fparg *, fparg *, u_int, u_int, u_int);
40 u_int	fpu_precision(u_int, u_int, u_int);
41 void	fpu_store(struct trapframe *, u_int, u_int, u_int, fparg *);
42