md.h revision 1.1.2.2 1 1.1.2.2 jdolecek /* $NetBSD: md.h,v 1.1.2.2 2002/06/23 17:37:14 jdolecek Exp $ */
2 1.1.2.2 jdolecek
3 1.1.2.2 jdolecek /* $OpenBSD: md.h,v 1.4 2001/03/29 03:58:18 mickey Exp $ */
4 1.1.2.2 jdolecek
5 1.1.2.2 jdolecek /*
6 1.1.2.2 jdolecek * Copyright 1996 1995 by Open Software Foundation, Inc.
7 1.1.2.2 jdolecek * All Rights Reserved
8 1.1.2.2 jdolecek *
9 1.1.2.2 jdolecek * Permission to use, copy, modify, and distribute this software and
10 1.1.2.2 jdolecek * its documentation for any purpose and without fee is hereby granted,
11 1.1.2.2 jdolecek * provided that the above copyright notice appears in all copies and
12 1.1.2.2 jdolecek * that both the copyright notice and this permission notice appear in
13 1.1.2.2 jdolecek * supporting documentation.
14 1.1.2.2 jdolecek *
15 1.1.2.2 jdolecek * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
16 1.1.2.2 jdolecek * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17 1.1.2.2 jdolecek * FOR A PARTICULAR PURPOSE.
18 1.1.2.2 jdolecek *
19 1.1.2.2 jdolecek * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
20 1.1.2.2 jdolecek * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21 1.1.2.2 jdolecek * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
22 1.1.2.2 jdolecek * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
23 1.1.2.2 jdolecek * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 1.1.2.2 jdolecek *
25 1.1.2.2 jdolecek */
26 1.1.2.2 jdolecek /*
27 1.1.2.2 jdolecek * pmk1.1
28 1.1.2.2 jdolecek */
29 1.1.2.2 jdolecek /*
30 1.1.2.2 jdolecek * (c) Copyright 1986 HEWLETT-PACKARD COMPANY
31 1.1.2.2 jdolecek *
32 1.1.2.2 jdolecek * To anyone who acknowledges that this file is provided "AS IS"
33 1.1.2.2 jdolecek * without any express or implied warranty:
34 1.1.2.2 jdolecek * permission to use, copy, modify, and distribute this file
35 1.1.2.2 jdolecek * for any purpose is hereby granted without fee, provided that
36 1.1.2.2 jdolecek * the above copyright notice and this notice appears in all
37 1.1.2.2 jdolecek * copies, and that the name of Hewlett-Packard Company not be
38 1.1.2.2 jdolecek * used in advertising or publicity pertaining to distribution
39 1.1.2.2 jdolecek * of the software without specific, written prior permission.
40 1.1.2.2 jdolecek * Hewlett-Packard Company makes no representations about the
41 1.1.2.2 jdolecek * suitability of this software for any purpose.
42 1.1.2.2 jdolecek */
43 1.1.2.2 jdolecek
44 1.1.2.2 jdolecek #include <sys/cdefs.h>
45 1.1.2.2 jdolecek
46 1.1.2.2 jdolecek /*****************************************************************
47 1.1.2.2 jdolecek * Muliply/Divide SFU Internal State *
48 1.1.2.2 jdolecek *****************************************************************/
49 1.1.2.2 jdolecek struct mdsfu_register {
50 1.1.2.2 jdolecek int rslt_hi,
51 1.1.2.2 jdolecek rslt_lo,
52 1.1.2.2 jdolecek ovflow;
53 1.1.2.2 jdolecek };
54 1.1.2.2 jdolecek
55 1.1.2.2 jdolecek #define result_hi result->rslt_hi
56 1.1.2.2 jdolecek #define result_lo result->rslt_lo
57 1.1.2.2 jdolecek #define overflow result->ovflow
58 1.1.2.2 jdolecek
59 1.1.2.2 jdolecek /*
60 1.1.2.2 jdolecek * Constants
61 1.1.2.2 jdolecek */
62 1.1.2.2 jdolecek
63 1.1.2.2 jdolecek #undef FALSE
64 1.1.2.2 jdolecek #define FALSE 0
65 1.1.2.2 jdolecek
66 1.1.2.2 jdolecek #undef TRUE
67 1.1.2.2 jdolecek #define TRUE (!FALSE)
68 1.1.2.2 jdolecek
69 1.1.2.2 jdolecek #undef NIL
70 1.1.2.2 jdolecek #define NIL 0
71 1.1.2.2 jdolecek
72 1.1.2.2 jdolecek #define WORD_LEN 32
73 1.1.2.2 jdolecek #define BIT0 1<<31
74 1.1.2.2 jdolecek #define BIT28 0x8
75 1.1.2.2 jdolecek #define BIT29 0x4
76 1.1.2.2 jdolecek #define BIT30 0x2
77 1.1.2.2 jdolecek #define BIT31 0x1
78 1.1.2.2 jdolecek
79 1.1.2.2 jdolecek /* Simply copy the arguments to the emulated copies of the registers */
80 1.1.2.2 jdolecek #define mdrr(reg1,reg2,result) {result_hi = reg1;result_lo = reg2;}
81 1.1.2.2 jdolecek
82 1.1.2.2 jdolecek /*
83 1.1.2.2 jdolecek * Structures
84 1.1.2.2 jdolecek */
85 1.1.2.2 jdolecek
86 1.1.2.2 jdolecek struct md_state {
87 1.1.2.2 jdolecek int resulthi, /* high word of result */
88 1.1.2.2 jdolecek resultlo; /* low word of result */
89 1.1.2.2 jdolecek };
90 1.1.2.2 jdolecek
91 1.1.2.2 jdolecek void divsfm __P((int, int, struct mdsfu_register *));
92 1.1.2.2 jdolecek void divsfr __P((int, int, struct mdsfu_register *));
93 1.1.2.2 jdolecek void divsim __P((int, int, struct mdsfu_register *));
94 1.1.2.2 jdolecek void divsir __P((int, int, struct mdsfu_register *));
95 1.1.2.2 jdolecek
96 1.1.2.2 jdolecek void divu __P((int, int, int, struct mdsfu_register *));
97 1.1.2.2 jdolecek void divufr __P((unsigned int, unsigned int, struct mdsfu_register *));
98 1.1.2.2 jdolecek void divuir __P((unsigned int, unsigned int, struct mdsfu_register *));
99 1.1.2.2 jdolecek
100 1.1.2.2 jdolecek void mpyaccs __P((int, int, struct mdsfu_register *));
101 1.1.2.2 jdolecek void mpyaccu __P((unsigned int, unsigned int, struct mdsfu_register *));
102 1.1.2.2 jdolecek void mpys __P((int, int, struct mdsfu_register *));
103 1.1.2.2 jdolecek void mpyscv __P((int, int, struct mdsfu_register *));
104 1.1.2.2 jdolecek void mpyu __P((unsigned int, unsigned int, struct mdsfu_register *));
105 1.1.2.2 jdolecek void mpyucv __P((unsigned int, unsigned int, struct mdsfu_register *));
106 1.1.2.2 jdolecek
107 1.1.2.2 jdolecek int impys __P((int *, int *, struct mdsfu_register *));
108 1.1.2.2 jdolecek int impyu __P((int *, int *, struct mdsfu_register *));
109