28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: cpu_transputer.h,v 1.1 2006/07/20 21:53:00 debug Exp $ |
* $Id: cpu_transputer.h,v 1.6 2006/07/23 15:42:20 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include "misc.h" |
#include "misc.h" |
48 |
/* |
/* |
49 |
* Features of various transputer processors according to |
* Features of various transputer processors according to |
50 |
* http://www.enlight.ru/docs/cpu/t-puters/talp/app_g.txt: |
* http://www.enlight.ru/docs/cpu/t-puters/talp/app_g.txt: |
51 |
|
* |
52 |
|
* (TODO: Add the T9000 too?) |
53 |
*/ |
*/ |
54 |
|
|
55 |
#define T_T4_FP 1 /* T4 floating point */ |
#define T_T4_FP 1 /* T4 floating point */ |
99 |
/* EX */ "stnl", /* store non-local */ \ |
/* EX */ "stnl", /* store non-local */ \ |
100 |
/* FX */ "opr" /* operate */ } |
/* FX */ "opr" /* operate */ } |
101 |
|
|
102 |
|
#define T_OPC_J 0 |
103 |
|
#define T_OPC_LDLP 1 |
104 |
|
#define T_OPC_PFIX 2 |
105 |
|
#define T_OPC_LDNL 3 |
106 |
|
#define T_OPC_LDC 4 |
107 |
|
#define T_OPC_LDNLP 5 |
108 |
|
#define T_OPC_NFIX 6 |
109 |
|
#define T_OPC_LDL 7 |
110 |
|
#define T_OPC_ADC 8 |
111 |
|
#define T_OPC_CALL 9 |
112 |
|
#define T_OPC_CJ 10 |
113 |
|
#define T_OPC_AJW 11 |
114 |
|
#define T_OPC_EQC 12 |
115 |
|
#define T_OPC_STL 13 |
116 |
|
#define T_OPC_STNL 14 |
117 |
|
#define T_OPC_OPR 15 |
118 |
|
|
119 |
|
/* Indirect ("operate") opcodes: */ |
120 |
|
#define N_TRANSPUTER_OPC_F_NAMES 0x90 |
121 |
|
#define TRANSPUTER_OPC_F_NAMES { \ |
122 |
|
"rev", "lb", "bsub", "endp", "diff", "add", "gcall","in", \ |
123 |
|
"prod", "gt", "wsub", "out", "sub", "startp","outbyte","outword",\ |
124 |
|
"seterr","0x11","resetch","csub0", "0x14", "stopp","ladd", "stlb", \ |
125 |
|
"sthf", "norm", "ldiv", "ldpi", "stlf", "xdble","ldpri","rem", \ |
126 |
|
"ret", "lend", "ldtimer","0x23","0x24","0x25", "0x26", "0x27", \ |
127 |
|
"0x28", "testerr","testpranal","tin", "div", "0x2d", "dist", "disc", \ |
128 |
|
"diss", "lmul", "not", "xor", "bcnt", "lshr", "lshl", "lsum", \ |
129 |
|
"lsub", "runp", "xword","sb", "gajw", "savel","saveh","wcnt", \ |
130 |
|
"shr" , "shl", "mint", "alt", "altwt","altend","and","enbt", \ |
131 |
|
"enbc", "enbs", "move", "or", "csngl", "ccnt1", "talt", "ldiff", \ |
132 |
|
"sthb", "taltwt","sum", "mul","sttimer","stoperr","cword","clrhalterr",\ |
133 |
|
"sethalterr", "testhalterr", "dup", "move2dinit", \ |
134 |
|
"move2dall", "move2dnonzero","move2dzero","0x5f", \ |
135 |
|
"0x60", "0x61", "0x62", "unpacksn","0x64","0x65","0x66","0x67", \ |
136 |
|
"0x68", "0x69", "0x6a", "0x6b", "postnormsn","roundsn","0x6e","0x6f", \ |
137 |
|
"0x70", "ldinf","fmul", "cflerr", \ |
138 |
|
"crcword", "crcbyte", "bitcnt", "bitrevword", \ |
139 |
|
"bitrevnbits","0x79","0x7a","0x7b", "0x7c", "0x7d", "0x7e", "0x7f", \ |
140 |
|
"0x80", "wsubdb","0x82", "0x83", "0x84", "0x85", "0x86", "0x87", \ |
141 |
|
"0x88", "0x89", "0x8a", "0x8b", "0x8c", "0x8d", "0x8e", "0x8f" } |
142 |
|
|
143 |
|
#define T_OPC_F_REV 0x00 |
144 |
|
#define T_OPC_F_LB 0x01 |
145 |
|
#define T_OPC_F_BSUB 0x02 |
146 |
|
#define T_OPC_F_ENDP 0x03 |
147 |
|
#define T_OPC_F_DIFF 0x04 |
148 |
|
#define T_OPC_F_ADD 0x05 |
149 |
|
#define T_OPC_F_GCALL 0x06 |
150 |
|
#define T_OPC_F_IN 0x07 |
151 |
|
#define T_OPC_F_PROD 0x08 |
152 |
|
#define T_OPC_F_GT 0x09 |
153 |
|
#define T_OPC_F_WSUB 0x0a |
154 |
|
#define T_OPC_F_OUT 0x0b |
155 |
|
#define T_OPC_F_SUB 0x0c |
156 |
|
#define T_OPC_F_STARTP 0x0d |
157 |
|
#define T_OPC_F_OUTBYTE 0x0e |
158 |
|
#define T_OPC_F_OUTWORD 0x0f |
159 |
|
#define T_OPC_F_SETERR 0x10 |
160 |
|
#define T_OPC_F_RESETCH 0x12 |
161 |
|
#define T_OPC_F_CSUB0 0x13 |
162 |
|
#define T_OPC_F_STOPP 0x15 |
163 |
|
#define T_OPC_F_LADD 0x16 |
164 |
|
#define T_OPC_F_STLB 0x17 |
165 |
|
#define T_OPC_F_STHF 0x18 |
166 |
|
#define T_OPC_F_NORM 0x19 |
167 |
|
#define T_OPC_F_LDIV 0x1a |
168 |
|
#define T_OPC_F_LDPI 0x1b |
169 |
|
#define T_OPC_F_STLF 0x1c |
170 |
|
#define T_OPC_F_XDBLE 0x1d |
171 |
|
#define T_OPC_F_LDPRI 0x1e |
172 |
|
#define T_OPC_F_REM 0x1f |
173 |
|
#define T_OPC_F_RET 0x20 |
174 |
|
#define T_OPC_F_LEND 0x21 |
175 |
|
#define T_OPC_F_LDTIMER 0x22 |
176 |
|
#define T_OPC_F_TESTERR 0x29 |
177 |
|
#define T_OPC_F_TESTPRANAL 0x2a |
178 |
|
#define T_OPC_F_TIN 0x2b |
179 |
|
#define T_OPC_F_DIV 0x2c |
180 |
|
#define T_OPC_F_DIST 0x2e |
181 |
|
#define T_OPC_F_DISC 0x2f |
182 |
|
#define T_OPC_F_DISS 0x30 |
183 |
|
#define T_OPC_F_LMUL 0x31 |
184 |
|
#define T_OPC_F_NOT 0x32 |
185 |
|
#define T_OPC_F_XOR 0x33 |
186 |
|
#define T_OPC_F_BCNT 0x34 |
187 |
|
#define T_OPC_F_LSHR 0x35 |
188 |
|
#define T_OPC_F_LSHL 0x36 |
189 |
|
#define T_OPC_F_LSUM 0x37 |
190 |
|
#define T_OPC_F_LSUB 0x38 |
191 |
|
#define T_OPC_F_RUNP 0x39 |
192 |
|
#define T_OPC_F_XWORD 0x3a |
193 |
|
#define T_OPC_F_SB 0x3b |
194 |
|
#define T_OPC_F_GAJW 0x3c |
195 |
|
#define T_OPC_F_SAVEL 0x3d |
196 |
|
#define T_OPC_F_SAVEH 0x3e |
197 |
|
#define T_OPC_F_WCNT 0x3f |
198 |
|
#define T_OPC_F_SHR 0x40 |
199 |
|
#define T_OPC_F_SHL 0x41 |
200 |
|
#define T_OPC_F_MINT 0x42 |
201 |
|
#define T_OPC_F_ALT 0x43 |
202 |
|
#define T_OPC_F_ALTWT 0x44 |
203 |
|
#define T_OPC_F_ALTEND 0x45 |
204 |
|
#define T_OPC_F_AND 0x46 |
205 |
|
#define T_OPC_F_ENBT 0x47 |
206 |
|
#define T_OPC_F_ENBC 0x48 |
207 |
|
#define T_OPC_F_ENBS 0x49 |
208 |
|
#define T_OPC_F_MOVE 0x4a |
209 |
|
#define T_OPC_F_OR 0x4b |
210 |
|
#define T_OPC_F_CSNGL 0x4c |
211 |
|
#define T_OPC_F_CCNT1 0x4d |
212 |
|
#define T_OPC_F_TALT 0x4e |
213 |
|
#define T_OPC_F_LDIFF 0x4f |
214 |
|
#define T_OPC_F_STHB 0x50 |
215 |
|
#define T_OPC_F_TALTWT 0x51 |
216 |
|
#define T_OPC_F_SUM 0x52 |
217 |
|
#define T_OPC_F_STTIMER 0x54 |
218 |
|
#define T_OPC_F_MUL 0x53 |
219 |
|
#define T_OPC_F_STOPERR 0x55 |
220 |
|
#define T_OPC_F_CWORD 0x56 |
221 |
|
#define T_OPC_F_CLRHALTERR 0x57 |
222 |
|
#define T_OPC_F_SETHALTERR 0x58 |
223 |
|
#define T_OPC_F_TESTHALTERR 0x59 |
224 |
|
#define T_OPC_F_DUP 0x5a |
225 |
|
#define T_OPC_F_MOVE2DINIT 0x5b |
226 |
|
#define T_OPC_F_MOVE2DALL 0x5c |
227 |
|
#define T_OPC_F_MOVE2DNONZERO 0x5d |
228 |
|
#define T_OPC_F_MOVE2DZERO 0x5e |
229 |
|
#define T_OPC_F_UNPACKSN 0x63 |
230 |
|
#define T_OPC_F_POSTNORMSN 0x6c |
231 |
|
#define T_OPC_F_ROUNDSN 0x6d |
232 |
|
#define T_OPC_F_LDINF 0x71 |
233 |
|
#define T_OPC_F_FMUL 0x72 |
234 |
|
#define T_OPC_F_CFLERR 0x73 |
235 |
|
#define T_OPC_F_CRCWORD 0x74 |
236 |
|
#define T_OPC_F_CRCBYTE 0x75 |
237 |
|
#define T_OPC_F_BITCNT 0x76 |
238 |
|
#define T_OPC_F_BITREVWORD 0x77 |
239 |
|
#define T_OPC_F_BITREVNBITS 0x78 |
240 |
|
#define T_OPC_F_WSUBSB 0x81 |
241 |
|
|
242 |
#define TRANSPUTER_N_IC_ARGS 1 |
#define TRANSPUTER_N_IC_ARGS 1 |
243 |
#define TRANSPUTER_INSTR_ALIGNMENT_SHIFT 0 |
#define TRANSPUTER_INSTR_ALIGNMENT_SHIFT 0 |
262 |
|
|
263 |
uint64_t fa, fb, fc; /* Floating point registers */ |
uint64_t fa, fb, fc; /* Floating point registers */ |
264 |
|
|
265 |
int error; |
int error; /* Error flags... */ |
266 |
int halt_on_error; |
int halt_on_error; |
267 |
int fp_error; |
int fp_error; |
268 |
|
|
269 |
|
uint32_t bptrreg0; /* High Priority Front Pointer */ |
270 |
|
uint32_t fptrreg0; /* High Priority Back Pointer */ |
271 |
|
uint32_t fptrreg1; /* Low Priority Front Pointer */ |
272 |
|
uint32_t bptrreg1; /* Low Priority Back Pointer */ |
273 |
|
|
274 |
/* |
/* |
275 |
* Instruction translation cache and 32-bit virtual -> physical -> |
* Instruction translation cache and 32-bit virtual -> physical -> |
276 |
* host address translation: |
* host address translation: |