frv.cpu revision 1.1.1.2 1 1.1 christos ; Fujitsu FRV opcode support, for GNU Binutils. -*- Scheme -*-
2 1.1 christos ;
3 1.1 christos ; Copyright 2000, 2001, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
4 1.1 christos ;
5 1.1 christos ; Contributed by Red Hat Inc; developed under contract from Fujitsu.
6 1.1 christos ;
7 1.1 christos ; This file is part of the GNU Binutils.
8 1.1 christos ;
9 1.1 christos ; This program is free software; you can redistribute it and/or modify
10 1.1 christos ; it under the terms of the GNU General Public License as published by
11 1.1 christos ; the Free Software Foundation; either version 3 of the License, or
12 1.1 christos ; (at your option) any later version.
13 1.1 christos ;
14 1.1 christos ; This program is distributed in the hope that it will be useful,
15 1.1 christos ; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 1.1 christos ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 1.1 christos ; GNU General Public License for more details.
18 1.1 christos ;
19 1.1 christos ; You should have received a copy of the GNU General Public License
20 1.1 christos ; along with this program; if not, write to the Free Software
21 1.1 christos ; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 1.1 christos ; MA 02110-1301, USA.
23 1.1 christos
24 1.1 christos (include "simplify.inc")
25 1.1 christos
26 1.1 christos ; define-arch must appear first
27 1.1 christos
28 1.1 christos (define-arch
29 1.1 christos (name frv) ; name of cpu architecture
30 1.1 christos (comment "Fujitsu FRV")
31 1.1 christos (insn-lsb0? #t)
32 1.1 christos (machs frv fr550 fr500 fr450 fr400 tomcat simple)
33 1.1 christos (isas frv)
34 1.1 christos )
35 1.1 christos
36 1.1 christos (define-isa
37 1.1 christos (name frv)
38 1.1 christos (base-insn-bitsize 32)
39 1.1 christos ; Initial bitnumbers to decode insns by.
40 1.1 christos (decode-assist (24 23 22 21 20 19 18))
41 1.1 christos (liw-insns 1) ; The frv fetches up to 1 insns at a time.
42 1.1 christos (parallel-insns 8) ; The frv executes up to 8 insns at a time.
43 1.1 christos )
44 1.1 christos
45 1.1 christos ; Cpu family definitions.
46 1.1 christos ;
47 1.1 christos (define-cpu
48 1.1 christos ; cpu names must be distinct from the architecture name and machine names.
49 1.1 christos ; The "b" suffix stands for "base" and is the convention.
50 1.1 christos ; The "f" suffix stands for "family" and is the convention.
51 1.1 christos (name frvbf)
52 1.1 christos (comment "Fujitsu FRV base family")
53 1.1 christos (endian big)
54 1.1 christos (word-bitsize 32)
55 1.1 christos )
56 1.1 christos
58 1.1 christos ; Generic FR-V machine. Supports the entire architecture
59 1.1 christos (define-mach
60 1.1 christos (name frv)
61 1.1 christos (comment "Generic FRV cpu")
62 1.1 christos (cpu frvbf)
63 1.1 christos )
64 1.1 christos (define-model
65 1.1 christos (name frv) (comment "Generic FRV model") (attrs)
66 1.1 christos (mach frv)
67 1.1 christos
68 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
69 1.1 christos
70 1.1 christos ; `state' is a list of variables for recording model state
71 1.1 christos ; (state)
72 1.1 christos
73 1.1 christos (unit u-exec "Execution Unit" ()
74 1.1 christos 1 1 ; issue done
75 1.1 christos () ; state
76 1.1 christos () ; inputs
77 1.1 christos () ; outputs
78 1.1 christos () ; profile action (default)
79 1.1 christos )
80 1.1 christos )
81 1.1 christos
83 1.1 christos ; FR550 machine
84 1.1 christos (define-mach
85 1.1 christos (name fr550)
86 1.1 christos (comment "FR550 cpu")
87 1.1 christos (cpu frvbf)
88 1.1 christos )
89 1.1 christos (define-model
90 1.1 christos (name fr550) (comment "FR550 model") (attrs)
91 1.1 christos (mach fr550)
92 1.1 christos
93 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
94 1.1 christos
95 1.1 christos ; `state' is a list of variables for recording model state
96 1.1 christos (state
97 1.1 christos ; State items
98 1.1 christos ; These are all masks with each bit representing one register.
99 1.1 christos (prev-fr-load DI) ; Previous use of FR register was target of a load
100 1.1 christos (prev-fr-complex-1 DI) ; Previous use of FR register has variable latency
101 1.1 christos (prev-fr-complex-2 DI) ; Previous use of FR register has variable latency
102 1.1 christos (prev-ccr-complex DI) ; Previous use of CCR register has variable latency
103 1.1 christos (prev-acc-mmac DI) ; Previous use of ACC register was a MMAC category
104 1.1 christos (cur-fr-load DI) ; Current use of FR register was target of a load
105 1.1 christos (cur-fr-complex-1 DI) ; Current use of FR register has variable latency
106 1.1 christos (cur-fr-complex-2 DI) ; Current use of FR register has variable latency
107 1.1 christos (cur-ccr-complex SI) ; Current use of CCR register has variable latency
108 1.1 christos (cur-acc-mmac DI) ; Current use of ACC register was a MMAC category
109 1.1 christos )
110 1.1 christos ; Basic unit for instructions with no latency penalties
111 1.1 christos (unit u-exec "Execution Unit" ()
112 1.1 christos 1 1 ; issue done
113 1.1 christos () ; state
114 1.1 christos () ; inputs
115 1.1 christos () ; outputs
116 1.1 christos () ; profile action (default)
117 1.1 christos )
118 1.1 christos ; Basic integer insn unit
119 1.1 christos (unit u-integer "Integer Unit" ()
120 1.1 christos 1 1 ; issue done
121 1.1 christos () ; state
122 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
123 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
124 1.1 christos () ; profile action (default)
125 1.1 christos )
126 1.1 christos ; Integer multiplication unit
127 1.1 christos (unit u-imul "Integer Multiplication Unit" ()
128 1.1 christos 1 1 ; issue done
129 1.1 christos () ; state
130 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
131 1.1 christos ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
132 1.1 christos () ; profile action (default)
133 1.1 christos )
134 1.1 christos ; Integer division unit
135 1.1 christos (unit u-idiv "Integer Division Unit" ()
136 1.1 christos 1 1 ; issue done
137 1.1 christos () ; state
138 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
139 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
140 1.1 christos () ; profile action (default)
141 1.1 christos )
142 1.1 christos ; Branch unit
143 1.1 christos (unit u-branch "Branch Unit" ()
144 1.1 christos 1 1 ; issue done
145 1.1 christos () ; state
146 1.1 christos ((GRi INT -1) (GRj INT -1)
147 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
148 1.1 christos ((pc)) ; outputs
149 1.1 christos () ; profile action (default)
150 1.1 christos )
151 1.1 christos ; Trap unit
152 1.1 christos (unit u-trap "Trap Unit" ()
153 1.1 christos 1 1 ; issue done
154 1.1 christos () ; state
155 1.1 christos ((GRi INT -1) (GRj INT -1)
156 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
157 1.1 christos () ; outputs
158 1.1 christos () ; profile action (default)
159 1.1 christos )
160 1.1 christos ; Condition code check unit
161 1.1 christos (unit u-check "Check Unit" ()
162 1.1 christos 1 1 ; issue done
163 1.1 christos () ; state
164 1.1 christos ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
165 1.1 christos () ; outputs
166 1.1 christos () ; profile action (default)
167 1.1 christos )
168 1.1 christos ; Float Arithmetic unit
169 1.1 christos (unit u-float-arith "Float Arithmetic unit" ()
170 1.1 christos 1 1 ; issue done
171 1.1 christos () ; state
172 1.1 christos ((FRi INT -1) (FRj INT -1) ; inputs
173 1.1 christos (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
174 1.1 christos ((FRk INT -1) (FRdoublek INT -1)) ; outputs
175 1.1 christos () ; profile action (default)
176 1.1 christos )
177 1.1 christos ; Float Dual Arithmetic unit
178 1.1 christos (unit u-float-dual-arith "Float Arithmetic unit" ()
179 1.1 christos ; This unit has a 2 cycle penalty -- see table 14-14 in the fr550 LSI
180 1.1 christos 1 3 ; issue done
181 1.1 christos () ; state
182 1.1 christos ((FRi INT -1) (FRj INT -1) ; inputs
183 1.1 christos (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
184 1.1 christos ((FRk INT -1) (FRdoublek INT -1)) ; outputs
185 1.1 christos () ; profile action (default)
186 1.1 christos )
187 1.1 christos ; Float Div unit
188 1.1 christos (unit u-float-div "Float Div unit" ()
189 1.1 christos 1 1 ; issue done
190 1.1 christos () ; state
191 1.1 christos ((FRi INT -1) (FRj INT -1)) ; inputs
192 1.1 christos ((FRk INT -1)) ; outputs
193 1.1 christos () ; profile action (default)
194 1.1 christos )
195 1.1 christos ; Float Square Root unit
196 1.1 christos (unit u-float-sqrt "Float Square Root unit" ()
197 1.1 christos 1 1 ; issue done
198 1.1 christos () ; state
199 1.1 christos ((FRj INT -1) (FRdoublej INT -1)) ; inputs
200 1.1 christos ((FRk INT -1) (FRdoublek INT -1)) ; outputs
201 1.1 christos () ; profile action (default)
202 1.1 christos )
203 1.1 christos ; Float Compare unit
204 1.1 christos (unit u-float-compare "Float Compare unit" ()
205 1.1 christos 1 1 ; issue done
206 1.1 christos () ; state
207 1.1 christos ((FRi INT -1) (FRj INT -1)
208 1.1 christos (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
209 1.1 christos ((FCCi_2 INT -1)) ; outputs
210 1.1 christos () ; profile action (default)
211 1.1 christos )
212 1.1 christos ; Dual Float Compare unit
213 1.1 christos (unit u-float-dual-compare "Float Dual Compare unit" ()
214 1.1 christos ; This unit has a 2 cycle penalty -- see table 14-14 in the fr550 LSI
215 1.1 christos 1 3 ; issue done
216 1.1 christos () ; state
217 1.1 christos ((FRi INT -1) (FRj INT -1)) ; inputs
218 1.1 christos ((FCCi_2 INT -1)) ; outputs
219 1.1 christos () ; profile action (default)
220 1.1 christos )
221 1.1 christos ; FR Move to GR unit
222 1.1 christos (unit u-fr2gr "FR Move to GR Unit" ()
223 1.1 christos 1 1 ; issue done
224 1.1 christos () ; state
225 1.1 christos ((FRintk INT -1)) ; inputs
226 1.1 christos ((GRj INT -1)) ; outputs
227 1.1 christos () ; profile action (default)
228 1.1 christos )
229 1.1 christos ; GR Move to FR unit
230 1.1 christos (unit u-gr2fr "GR Move to FR Unit" ()
231 1.1 christos 1 1 ; issue done
232 1.1 christos () ; state
233 1.1 christos ((GRj INT -1)) ; inputs
234 1.1 christos ((FRintk INT -1)) ; outputs
235 1.1 christos () ; profile action (default)
236 1.1 christos )
237 1.1 christos ; SPR Move to GR unit
238 1.1 christos (unit u-spr2gr "SPR Move to GR Unit" ()
239 1.1 christos 1 1 ; issue done
240 1.1 christos () ; state
241 1.1 christos ((spr INT -1)) ; inputs
242 1.1 christos ((GRj INT -1)) ; outputs
243 1.1 christos () ; profile action (default)
244 1.1 christos )
245 1.1 christos ; GR Move to SPR unit
246 1.1 christos (unit u-gr2spr "GR Move to SPR Unit" ()
247 1.1 christos 1 1 ; issue done
248 1.1 christos () ; state
249 1.1 christos ((GRj INT -1)) ; inputs
250 1.1 christos ((spr INT -1)) ; outputs
251 1.1 christos () ; profile action (default)
252 1.1 christos )
253 1.1 christos ; GR set half unit
254 1.1 christos (unit u-set-hilo "GR Set Half" ()
255 1.1 christos 1 1 ; issue done
256 1.1 christos () ; state
257 1.1 christos () ; inputs
258 1.1 christos ((GRkhi INT -1) (GRklo INT -1)) ; outputs
259 1.1 christos () ; profile action (default)
260 1.1 christos )
261 1.1 christos ; GR load unit
262 1.1 christos (unit u-gr-load "GR Load Unit" ()
263 1.1 christos 1 1 ; issue done
264 1.1 christos () ; state
265 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
266 1.1 christos ((GRk INT -1) (GRdoublek INT -1)) ; outputs
267 1.1 christos () ; profile action (default)
268 1.1 christos )
269 1.1 christos ; GR store unit
270 1.1 christos (unit u-gr-store "GR Store Unit" ()
271 1.1 christos 1 1 ; issue done
272 1.1 christos () ; state
273 1.1 christos ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
274 1.1 christos () ; outputs
275 1.1 christos () ; profile action (default)
276 1.1 christos )
277 1.1 christos ; FR load unit
278 1.1 christos (unit u-fr-load "FR Load Unit" ()
279 1.1 christos 1 1 ; issue done
280 1.1 christos () ; state
281 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
282 1.1 christos ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
283 1.1 christos () ; profile action (default)
284 1.1 christos )
285 1.1 christos ; FR store unit
286 1.1 christos (unit u-fr-store "FR Store Unit" ()
287 1.1 christos 1 1 ; issue done
288 1.1 christos () ; state
289 1.1 christos ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
290 1.1 christos () ; outputs
291 1.1 christos () ; profile action (default)
292 1.1 christos )
293 1.1 christos ; Swap unit
294 1.1 christos (unit u-swap "Swap Unit" ()
295 1.1 christos 1 1 ; issue done
296 1.1 christos () ; state
297 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
298 1.1 christos ((GRk INT -1)) ; outputs
299 1.1 christos () ; profile action (default)
300 1.1 christos )
301 1.1 christos ; FR Move to FR unit
302 1.1 christos (unit u-fr2fr "FR Move to FR Unit" ()
303 1.1 christos 1 1 ; issue done
304 1.1 christos () ; state
305 1.1 christos ((FRi INT -1)) ; inputs
306 1.1 christos ((FRk INT -1)) ; outputs
307 1.1 christos () ; profile action (default)
308 1.1 christos )
309 1.1 christos ; Clrgr unit
310 1.1 christos (unit u-clrgr "Clrgr Unit" ()
311 1.1 christos 1 1 ; issue done
312 1.1 christos () ; state
313 1.1 christos ((GRk INT -1)) ; inputs
314 1.1 christos () ; outputs
315 1.1 christos () ; profile action (default)
316 1.1 christos )
317 1.1 christos ; Clrfr unit
318 1.1 christos (unit u-clrfr "Clrfr Unit" ()
319 1.1 christos 1 1 ; issue done
320 1.1 christos () ; state
321 1.1 christos ((FRk INT -1)) ; inputs
322 1.1 christos () ; outputs
323 1.1 christos () ; profile action (default)
324 1.1 christos )
325 1.1 christos ; Insn cache invalidate unit
326 1.1 christos (unit u-ici "Insn cache invalidate unit" ()
327 1.1 christos 1 1 ; issue done
328 1.1 christos () ; state
329 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
330 1.1 christos () ; outputs
331 1.1 christos () ; profile action (default)
332 1.1 christos )
333 1.1 christos ; Data cache invalidate unit
334 1.1 christos (unit u-dci "Data cache invalidate unit" ()
335 1.1 christos 1 1 ; issue done
336 1.1 christos () ; state
337 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
338 1.1 christos () ; outputs
339 1.1 christos () ; profile action (default)
340 1.1 christos )
341 1.1 christos ; Data cache flush unit
342 1.1 christos (unit u-dcf "Data cache flush unit" ()
343 1.1 christos 1 1 ; issue done
344 1.1 christos () ; state
345 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
346 1.1 christos () ; outputs
347 1.1 christos () ; profile action (default)
348 1.1 christos )
349 1.1 christos ; Insn cache preload unit
350 1.1 christos (unit u-icpl "Insn cache preload unit" ()
351 1.1 christos 1 1 ; issue done
352 1.1 christos () ; state
353 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
354 1.1 christos () ; outputs
355 1.1 christos () ; profile action (default)
356 1.1 christos )
357 1.1 christos ; Data cache preload unit
358 1.1 christos (unit u-dcpl "Data cache preload unit" ()
359 1.1 christos 1 1 ; issue done
360 1.1 christos () ; state
361 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
362 1.1 christos () ; outputs
363 1.1 christos () ; profile action (default)
364 1.1 christos )
365 1.1 christos ; Insn cache unlock unit
366 1.1 christos (unit u-icul "Insn cache unlock unit" ()
367 1.1 christos 1 1 ; issue done
368 1.1 christos () ; state
369 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
370 1.1 christos () ; outputs
371 1.1 christos () ; profile action (default)
372 1.1 christos )
373 1.1 christos ; Data cache unlock unit
374 1.1 christos (unit u-dcul "Data cache unlock unit" ()
375 1.1 christos 1 1 ; issue done
376 1.1 christos () ; state
377 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
378 1.1 christos () ; outputs
379 1.1 christos () ; profile action (default)
380 1.1 christos )
381 1.1 christos ; commit unit
382 1.1 christos (unit u-commit "Commit Unit" ()
383 1.1 christos 1 1 ; issue done
384 1.1 christos () ; state
385 1.1 christos ((GRk INT -1) (FRk INT -1)) ; inputs
386 1.1 christos () ; outputs
387 1.1 christos () ; profile action (default)
388 1.1 christos )
389 1.1 christos ; Float Conversion unit
390 1.1 christos (unit u-float-convert "Float Conversion unit" ()
391 1.1 christos 1 1 ; issue done
392 1.1 christos () ; state
393 1.1 christos ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs
394 1.1 christos ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs
395 1.1 christos () ; profile action (default)
396 1.1 christos )
397 1.1 christos ; Media units
398 1.1 christos (unit u-media "Media unit" ()
399 1.1 christos 1 1 ; issue done
400 1.1 christos () ; state
401 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
402 1.1 christos ((FRintk INT -1)) ; outputs
403 1.1 christos () ; profile action (default)
404 1.1 christos )
405 1.1 christos (unit u-media-quad "Media-quad unit" ()
406 1.1 christos 1 1 ; issue done
407 1.1 christos () ; state
408 1.1 christos ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs
409 1.1 christos ((FRintkeven INT -1)) ; outputs
410 1.1 christos () ; profile action (default)
411 1.1 christos )
412 1.1 christos (unit u-media-dual-expand "Media Dual Expand unit" ()
413 1.1 christos 1 1 ; issue done
414 1.1 christos () ; state
415 1.1 christos ((FRinti INT -1)) ; inputs
416 1.1 christos ((FRintkeven INT -1)) ; outputs
417 1.1 christos () ; profile action (default)
418 1.1 christos )
419 1.1 christos (unit u-media-3-dual "Media-3-dual unit" ()
420 1.1 christos 1 1 ; issue done
421 1.1 christos () ; state
422 1.1 christos ((FRinti INT -1)) ; inputs
423 1.1 christos ((FRintk INT -1)) ; outputs
424 1.1 christos () ; profile action (default)
425 1.1 christos )
426 1.1 christos (unit u-media-3-acc "Media unit for M-3 using ACC" ()
427 1.1 christos 1 1 ; issue done
428 1.1 christos () ; state
429 1.1 christos ((FRintj INT -1) (ACC40Si INT -1)) ; inputs
430 1.1 christos ((FRintk INT -1)) ; outputs
431 1.1 christos () ; profile action (default)
432 1.1 christos )
433 1.1 christos (unit u-media-3-acc-dual "Media-3-acc-dual unit" ()
434 1.1 christos 1 1 ; issue done
435 1.1 christos () ; state
436 1.1 christos ((ACC40Si INT -1)) ; inputs
437 1.1 christos ((FRintkeven INT -1)) ; outputs
438 1.1 christos () ; profile action (default)
439 1.1 christos )
440 1.1 christos (unit u-media-3-wtacc "Media-3-wtacc unit" ()
441 1.1 christos 1 1 ; issue done
442 1.1 christos () ; state
443 1.1 christos ((FRinti INT -1) (ACC40Sk INT -1)) ; inputs
444 1.1 christos () ; outputs
445 1.1 christos () ; profile action (default)
446 1.1 christos )
447 1.1 christos (unit u-media-3-mclracc "Media-3-mclracc unit" ()
448 1.1 christos 1 1 ; issue done
449 1.1 christos () ; state
450 1.1 christos () ; inputs
451 1.1 christos () ; outputs
452 1.1 christos () ; profile action (default)
453 1.1 christos )
454 1.1 christos (unit u-media-set "Media set" ()
455 1.1 christos 1 1 ; issue done
456 1.1 christos () ; state
457 1.1 christos () ; inputs
458 1.1 christos ((FRintk INT -1)) ; outputs
459 1.1 christos () ; profile action (default)
460 1.1 christos )
461 1.1 christos (unit u-media-4 "Media-4 unit" ()
462 1.1 christos 1 1 ; issue done
463 1.1 christos () ; state
464 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
465 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
466 1.1 christos () ; profile action (default)
467 1.1 christos )
468 1.1 christos (unit u-media-4-acc "Media-4-acc unit" ()
469 1.1 christos 1 1 ; issue done
470 1.1 christos () ; state
471 1.1 christos ((ACC40Si INT -1)) ; inputs
472 1.1 christos ((ACC40Sk INT -1)) ; outputs
473 1.1 christos () ; profile action (default)
474 1.1 christos )
475 1.1 christos (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
476 1.1 christos 1 1 ; issue done
477 1.1 christos () ; state
478 1.1 christos ((ACC40Si INT -1)) ; inputs
479 1.1 christos ((ACC40Sk INT -1)) ; outputs
480 1.1 christos () ; profile action (default)
481 1.1 christos )
482 1.1 christos (unit u-media-4-add-sub "Media-4-add-sub unit" ()
483 1.1 christos 1 1 ; issue done
484 1.1 christos () ; state
485 1.1 christos ((ACC40Si INT -1)) ; inputs
486 1.1 christos ((ACC40Sk INT -1)) ; outputs
487 1.1 christos () ; profile action (default)
488 1.1 christos )
489 1.1 christos (unit u-media-4-add-sub-dual "Media-4-add-sub-dual unit" ()
490 1.1 christos 1 1 ; issue done
491 1.1 christos () ; state
492 1.1 christos ((ACC40Si INT -1)) ; inputs
493 1.1 christos ((ACC40Sk INT -1)) ; outputs
494 1.1 christos () ; profile action (default)
495 1.1 christos )
496 1.1 christos (unit u-media-4-quad "Media-4-quad unit" ()
497 1.1 christos 1 1 ; issue done
498 1.1 christos () ; state
499 1.1 christos ((FRintieven INT -1) (FRintjeven INT -1)) ; inputs
500 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
501 1.1 christos () ; profile action (default)
502 1.1 christos )
503 1.1 christos )
504 1.1 christos
505 1.1 christos ; FR500 machine.
506 1.1 christos (define-mach
507 1.1 christos (name fr500)
508 1.1 christos (comment "FR500 cpu")
509 1.1 christos (cpu frvbf)
510 1.1 christos )
511 1.1 christos (define-model
512 1.1 christos (name fr500) (comment "FR500 model") (attrs)
513 1.1 christos (mach fr500)
514 1.1 christos
515 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
516 1.1 christos
517 1.1 christos ; `state' is a list of variables for recording model state
518 1.1 christos (state
519 1.1 christos ; State items
520 1.1 christos ; These are all masks with each bit representing one register.
521 1.1 christos (prev-fpop DI) ; Previous use of FR register was floating point insn
522 1.1 christos (prev-media DI) ; Previous use of FR register was a media insn
523 1.1 christos (prev-cc-complex DI) ; Previous use of ICC register was not simple
524 1.1 christos (cur-fpop DI) ; Current use of FR register was floating point insn
525 1.1 christos (cur-media DI) ; Current use of FR register was a media insn
526 1.1 christos (cur-cc-complex DI) ; Current use of ICC register was not simple
527 1.1 christos )
528 1.1 christos ; Basic unit for instructions with no latency penalties
529 1.1 christos (unit u-exec "Execution Unit" ()
530 1.1 christos 1 1 ; issue done
531 1.1 christos () ; state
532 1.1 christos () ; inputs
533 1.1 christos () ; outputs
534 1.1 christos () ; profile action (default)
535 1.1 christos )
536 1.1 christos ; Basic integer insn unit
537 1.1 christos (unit u-integer "Integer Unit" ()
538 1.1 christos 1 1 ; issue done
539 1.1 christos () ; state
540 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
541 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
542 1.1 christos () ; profile action (default)
543 1.1 christos )
544 1.1 christos ; Integer multiplication unit
545 1.1 christos (unit u-imul "Integer Multiplication Unit" ()
546 1.1 christos 1 1 ; issue done
547 1.1 christos () ; state
548 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
549 1.1 christos ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
550 1.1 christos () ; profile action (default)
551 1.1 christos )
552 1.1 christos ; Integer division unit
553 1.1 christos (unit u-idiv "Integer Division Unit" ()
554 1.1 christos 1 1 ; issue done
555 1.1 christos () ; state
556 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
557 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
558 1.1 christos () ; profile action (default)
559 1.1 christos )
560 1.1 christos ; Branch unit
561 1.1 christos (unit u-branch "Branch Unit" ()
562 1.1 christos 1 1 ; issue done
563 1.1 christos () ; state
564 1.1 christos ((GRi INT -1) (GRj INT -1)
565 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
566 1.1 christos ((pc)) ; outputs
567 1.1 christos () ; profile action (default)
568 1.1 christos )
569 1.1 christos ; Trap unit
570 1.1 christos (unit u-trap "Trap Unit" ()
571 1.1 christos 1 1 ; issue done
572 1.1 christos () ; state
573 1.1 christos ((GRi INT -1) (GRj INT -1)
574 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
575 1.1 christos () ; outputs
576 1.1 christos () ; profile action (default)
577 1.1 christos )
578 1.1 christos ; Condition code check unit
579 1.1 christos (unit u-check "Check Unit" ()
580 1.1 christos 1 1 ; issue done
581 1.1 christos () ; state
582 1.1 christos ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
583 1.1 christos () ; outputs
584 1.1 christos () ; profile action (default)
585 1.1 christos )
586 1.1 christos ; Clrgr unit
587 1.1 christos (unit u-clrgr "Clrgr Unit" ()
588 1.1 christos 1 1 ; issue done
589 1.1 christos () ; state
590 1.1 christos ((GRk INT -1)) ; inputs
591 1.1 christos () ; outputs
592 1.1 christos () ; profile action (default)
593 1.1 christos )
594 1.1 christos ; Clrfr unit
595 1.1 christos (unit u-clrfr "Clrfr Unit" ()
596 1.1 christos 1 1 ; issue done
597 1.1 christos () ; state
598 1.1 christos ((FRk INT -1)) ; inputs
599 1.1 christos () ; outputs
600 1.1 christos () ; profile action (default)
601 1.1 christos )
602 1.1 christos ; GR set half unit
603 1.1 christos (unit u-set-hilo "GR Set Half" ()
604 1.1 christos 1 1 ; issue done
605 1.1 christos () ; state
606 1.1 christos () ; inputs
607 1.1 christos ((GRkhi INT -1) (GRklo INT -1)) ; outputs
608 1.1 christos () ; profile action (default)
609 1.1 christos )
610 1.1 christos ; GR load unit -- TODO doesn't handle quad
611 1.1 christos (unit u-gr-load "GR Load Unit" ()
612 1.1 christos 1 1 ; issue done
613 1.1 christos () ; state
614 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
615 1.1 christos ((GRk INT -1) (GRdoublek INT -1)) ; outputs
616 1.1 christos () ; profile action (default)
617 1.1 christos )
618 1.1 christos ; GR store unit -- TODO doesn't handle quad
619 1.1 christos (unit u-gr-store "GR Store Unit" ()
620 1.1 christos 1 1 ; issue done
621 1.1 christos () ; state
622 1.1 christos ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
623 1.1 christos () ; outputs
624 1.1 christos () ; profile action (default)
625 1.1 christos )
626 1.1 christos ; GR recovering store unit -- TODO doesn't handle quad
627 1.1 christos (unit u-gr-r-store "GR Recovering Store Unit" ()
628 1.1 christos 1 1 ; issue done
629 1.1 christos () ; state
630 1.1 christos ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
631 1.1 christos () ; outputs
632 1.1 christos () ; profile action (default)
633 1.1 christos )
634 1.1 christos ; FR load unit -- TODO doesn't handle quad
635 1.1 christos (unit u-fr-load "FR Load Unit" ()
636 1.1 christos 1 1 ; issue done
637 1.1 christos () ; state
638 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
639 1.1 christos ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
640 1.1 christos () ; profile action (default)
641 1.1 christos )
642 1.1 christos ; FR store unit -- TODO doesn't handle quad
643 1.1 christos (unit u-fr-store "FR Store Unit" ()
644 1.1 christos 1 1 ; issue done
645 1.1 christos () ; state
646 1.1 christos ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
647 1.1 christos () ; outputs
648 1.1 christos () ; profile action (default)
649 1.1 christos )
650 1.1 christos ; FR recovering store unit -- TODO doesn't handle quad
651 1.1 christos (unit u-fr-r-store "FR Recovering Store Unit" ()
652 1.1 christos 1 1 ; issue done
653 1.1 christos () ; state
654 1.1 christos ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
655 1.1 christos () ; outputs
656 1.1 christos () ; profile action (default)
657 1.1 christos )
658 1.1 christos ; Swap unit
659 1.1 christos (unit u-swap "Swap Unit" ()
660 1.1 christos 1 1 ; issue done
661 1.1 christos () ; state
662 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
663 1.1 christos ((GRk INT -1)) ; outputs
664 1.1 christos () ; profile action (default)
665 1.1 christos )
666 1.1 christos ; FR Move to FR unit
667 1.1 christos (unit u-fr2fr "FR Move to FR Unit" ()
668 1.1 christos 1 1 ; issue done
669 1.1 christos () ; state
670 1.1 christos ((FRi INT -1)) ; inputs
671 1.1 christos ((FRk INT -1)) ; outputs
672 1.1 christos () ; profile action (default)
673 1.1 christos )
674 1.1 christos ; FR Move to GR unit
675 1.1 christos (unit u-fr2gr "FR Move to GR Unit" ()
676 1.1 christos 1 1 ; issue done
677 1.1 christos () ; state
678 1.1 christos ((FRintk INT -1)) ; inputs
679 1.1 christos ((GRj INT -1)) ; outputs
680 1.1 christos () ; profile action (default)
681 1.1 christos )
682 1.1 christos ; SPR Move to GR unit
683 1.1 christos (unit u-spr2gr "SPR Move to GR Unit" ()
684 1.1 christos 1 1 ; issue done
685 1.1 christos () ; state
686 1.1 christos ((spr INT -1)) ; inputs
687 1.1 christos ((GRj INT -1)) ; outputs
688 1.1 christos () ; profile action (default)
689 1.1 christos )
690 1.1 christos ; GR Move to FR unit
691 1.1 christos (unit u-gr2fr "GR Move to FR Unit" ()
692 1.1 christos 1 1 ; issue done
693 1.1 christos () ; state
694 1.1 christos ((GRj INT -1)) ; inputs
695 1.1 christos ((FRintk INT -1)) ; outputs
696 1.1 christos () ; profile action (default)
697 1.1 christos )
698 1.1 christos ; GR Move to SPR unit
699 1.1 christos (unit u-gr2spr "GR Move to SPR Unit" ()
700 1.1 christos 1 1 ; issue done
701 1.1 christos () ; state
702 1.1 christos ((GRj INT -1)) ; inputs
703 1.1 christos ((spr INT -1)) ; outputs
704 1.1 christos () ; profile action (default)
705 1.1 christos )
706 1.1 christos ; Float Arithmetic unit
707 1.1 christos (unit u-float-arith "Float Arithmetic unit" ()
708 1.1 christos 1 1 ; issue done
709 1.1 christos () ; state
710 1.1 christos ((FRi INT -1) (FRj INT -1) ; inputs
711 1.1 christos (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
712 1.1 christos ((FRk INT -1) (FRdoublek INT -1)) ; outputs
713 1.1 christos () ; profile action (default)
714 1.1 christos )
715 1.1 christos ; Float Dual Arithmetic unit
716 1.1 christos (unit u-float-dual-arith "Float Arithmetic unit" ()
717 1.1 christos 1 1 ; issue done
718 1.1 christos () ; state
719 1.1 christos ((FRi INT -1) (FRj INT -1) ; inputs
720 1.1 christos (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
721 1.1 christos ((FRk INT -1) (FRdoublek INT -1)) ; outputs
722 1.1 christos () ; profile action (default)
723 1.1 christos )
724 1.1 christos ; Float Div unit
725 1.1 christos (unit u-float-div "Float Div unit" ()
726 1.1 christos 1 1 ; issue done
727 1.1 christos () ; state
728 1.1 christos ((FRi INT -1) (FRj INT -1)) ; inputs
729 1.1 christos ((FRk INT -1)) ; outputs
730 1.1 christos () ; profile action (default)
731 1.1 christos )
732 1.1 christos ; Float Square Root unit
733 1.1 christos (unit u-float-sqrt "Float Square Root unit" ()
734 1.1 christos 1 1 ; issue done
735 1.1 christos () ; state
736 1.1 christos ((FRj INT -1) (FRdoublej INT -1)) ; inputs
737 1.1 christos ((FRk INT -1) (FRdoublek INT -1)) ; outputs
738 1.1 christos () ; profile action (default)
739 1.1 christos )
740 1.1 christos ; Float Dual Square Root unit
741 1.1 christos (unit u-float-dual-sqrt "Float Dual Square Root unit" ()
742 1.1 christos 1 1 ; issue done
743 1.1 christos () ; state
744 1.1 christos ((FRj INT -1)) ; inputs
745 1.1 christos ((FRk INT -1)) ; outputs
746 1.1 christos () ; profile action (default)
747 1.1 christos )
748 1.1 christos ; Float Compare unit
749 1.1 christos (unit u-float-compare "Float Compare unit" ()
750 1.1 christos 1 1 ; issue done
751 1.1 christos () ; state
752 1.1 christos ((FRi INT -1) (FRj INT -1)
753 1.1 christos (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
754 1.1 christos ((FCCi_2 INT -1)) ; outputs
755 1.1 christos () ; profile action (default)
756 1.1 christos )
757 1.1 christos ; Dual Float Compare unit
758 1.1 christos (unit u-float-dual-compare "Float Dual Compare unit" ()
759 1.1 christos 1 1 ; issue done
760 1.1 christos () ; state
761 1.1 christos ((FRi INT -1) (FRj INT -1)) ; inputs
762 1.1 christos ((FCCi_2 INT -1)) ; outputs
763 1.1 christos () ; profile action (default)
764 1.1 christos )
765 1.1 christos ; Float Conversion unit
766 1.1 christos (unit u-float-convert "Float Conversion unit" ()
767 1.1 christos 1 1 ; issue done
768 1.1 christos () ; state
769 1.1 christos ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs
770 1.1 christos ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs
771 1.1 christos () ; profile action (default)
772 1.1 christos )
773 1.1 christos ; Dual Float Conversion unit
774 1.1 christos (unit u-float-dual-convert "Float Dual Conversion unit" ()
775 1.1 christos 1 1 ; issue done
776 1.1 christos () ; state
777 1.1 christos ((FRj INT -1) (FRintj INT -1)) ; inputs
778 1.1 christos ((FRk INT -1) (FRintk INT -1)) ; outputs
779 1.1 christos () ; profile action (default)
780 1.1 christos )
781 1.1 christos ; Media unit
782 1.1 christos (unit u-media "Media unit" ()
783 1.1 christos 1 1 ; issue done
784 1.1 christos () ; state
785 1.1 christos ((FRinti INT -1) (FRintj INT -1) (ACC40Si INT -1) (ACCGi INT -1)) ; inputs
786 1.1 christos ((FRintk INT -1) (ACC40Sk INT -1) (ACC40Uk INT -1) (ACCGk INT -1)) ; outputs
787 1.1 christos () ; profile action (default)
788 1.1 christos )
789 1.1 christos ; Media Quad Arithmetic unit
790 1.1 christos (unit u-media-quad-arith "Media Quad Arithmetic unit" ()
791 1.1 christos 1 1 ; issue done
792 1.1 christos () ; state
793 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
794 1.1 christos ((FRintk INT -1)) ; outputs
795 1.1 christos () ; profile action (default)
796 1.1 christos )
797 1.1 christos ; Media Dual Multiplication unit
798 1.1 christos (unit u-media-dual-mul "Media Dual Multiplication unit" ()
799 1.1 christos 1 1 ; issue done
800 1.1 christos () ; state
801 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
802 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
803 1.1 christos () ; profile action (default)
804 1.1 christos )
805 1.1 christos ; Media Quad Multiplication unit
806 1.1 christos (unit u-media-quad-mul "Media Quad Multiplication unit" ()
807 1.1 christos 1 1 ; issue done
808 1.1 christos () ; state
809 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
810 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
811 1.1 christos () ; profile action (default)
812 1.1 christos )
813 1.1 christos ; Media Quad Complex unit
814 1.1 christos (unit u-media-quad-complex "Media Quad Complex unit" ()
815 1.1 christos 1 1 ; issue done
816 1.1 christos () ; state
817 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
818 1.1 christos ((ACC40Sk INT -1)) ; outputs
819 1.1 christos () ; profile action (default)
820 1.1 christos )
821 1.1 christos ; Media Dual Expand unit
822 1.1 christos (unit u-media-dual-expand "Media Dual Expand unit" ()
823 1.1 christos 1 1 ; issue done
824 1.1 christos () ; state
825 1.1 christos ((FRinti INT -1)) ; inputs
826 1.1 christos ((FRintk INT -1)) ; outputs
827 1.1 christos () ; profile action (default)
828 1.1 christos )
829 1.1 christos ; Media Dual Unpack unit
830 1.1 christos (unit u-media-dual-unpack "Media Dual Unpack unit" ()
831 1.1 christos 1 1 ; issue done
832 1.1 christos () ; state
833 1.1 christos ((FRinti INT -1)) ; inputs
834 1.1 christos ((FRintk INT -1)) ; outputs
835 1.1 christos () ; profile action (default)
836 1.1 christos )
837 1.1 christos ; Media Dual byte to half unit
838 1.1 christos (unit u-media-dual-btoh "Media Byte to byte" ()
839 1.1 christos 1 1 ; issue done
840 1.1 christos () ; state
841 1.1 christos ((FRintj INT -1)) ; inputs
842 1.1 christos ((FRintk INT -1)) ; outputs
843 1.1 christos () ; profile action (default)
844 1.1 christos )
845 1.1 christos ; Media Dual half to byte unit
846 1.1 christos (unit u-media-dual-htob "Media Half to byte" ()
847 1.1 christos 1 1 ; issue done
848 1.1 christos () ; state
849 1.1 christos ((FRintj INT -1)) ; inputs
850 1.1 christos ((FRintk INT -1)) ; outputs
851 1.1 christos () ; profile action (default)
852 1.1 christos )
853 1.1 christos ; Media Dual byte to half unit extended
854 1.1 christos (unit u-media-dual-btohe "Media Byte to byte extended" ()
855 1.1 christos 1 1 ; issue done
856 1.1 christos () ; state
857 1.1 christos ((FRintj INT -1)) ; inputs
858 1.1 christos ((FRintk INT -1)) ; outputs
859 1.1 christos () ; profile action (default)
860 1.1 christos )
861 1.1 christos ; Barrier unit
862 1.1 christos (unit u-barrier "Barrier unit" ()
863 1.1 christos 1 1 ; issue done
864 1.1 christos () ; state
865 1.1 christos () ; inputs
866 1.1 christos () ; outputs
867 1.1 christos () ; profile action (default)
868 1.1 christos )
869 1.1 christos ; Memory Barrier unit
870 1.1 christos (unit u-membar "Memory Barrier unit" ()
871 1.1 christos 1 1 ; issue done
872 1.1 christos () ; state
873 1.1 christos () ; inputs
874 1.1 christos () ; outputs
875 1.1 christos () ; profile action (default)
876 1.1 christos )
877 1.1 christos ; Insn cache invalidate unit
878 1.1 christos (unit u-ici "Insn cache invalidate unit" ()
879 1.1 christos 1 1 ; issue done
880 1.1 christos () ; state
881 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
882 1.1 christos () ; outputs
883 1.1 christos () ; profile action (default)
884 1.1 christos )
885 1.1 christos ; Data cache invalidate unit
886 1.1 christos (unit u-dci "Data cache invalidate unit" ()
887 1.1 christos 1 1 ; issue done
888 1.1 christos () ; state
889 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
890 1.1 christos () ; outputs
891 1.1 christos () ; profile action (default)
892 1.1 christos )
893 1.1 christos ; Data cache flush unit
894 1.1 christos (unit u-dcf "Data cache flush unit" ()
895 1.1 christos 1 1 ; issue done
896 1.1 christos () ; state
897 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
898 1.1 christos () ; outputs
899 1.1 christos () ; profile action (default)
900 1.1 christos )
901 1.1 christos ; Insn cache preload unit
902 1.1 christos (unit u-icpl "Insn cache preload unit" ()
903 1.1 christos 1 1 ; issue done
904 1.1 christos () ; state
905 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
906 1.1 christos () ; outputs
907 1.1 christos () ; profile action (default)
908 1.1 christos )
909 1.1 christos ; Data cache preload unit
910 1.1 christos (unit u-dcpl "Data cache preload unit" ()
911 1.1 christos 1 1 ; issue done
912 1.1 christos () ; state
913 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
914 1.1 christos () ; outputs
915 1.1 christos () ; profile action (default)
916 1.1 christos )
917 1.1 christos ; Insn cache unlock unit
918 1.1 christos (unit u-icul "Insn cache unlock unit" ()
919 1.1 christos 1 1 ; issue done
920 1.1 christos () ; state
921 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
922 1.1 christos () ; outputs
923 1.1 christos () ; profile action (default)
924 1.1 christos )
925 1.1 christos ; Data cache unlock unit
926 1.1 christos (unit u-dcul "Data cache unlock unit" ()
927 1.1 christos 1 1 ; issue done
928 1.1 christos () ; state
929 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
930 1.1 christos () ; outputs
931 1.1 christos () ; profile action (default)
932 1.1 christos )
933 1.1 christos ; commit unit
934 1.1 christos (unit u-commit "Commit Unit" ()
935 1.1 christos 1 1 ; issue done
936 1.1 christos () ; state
937 1.1 christos ((GRk INT -1) (FRk INT -1)) ; inputs
938 1.1 christos () ; outputs
939 1.1 christos () ; profile action (default)
940 1.1 christos )
941 1.1 christos )
942 1.1 christos
944 1.1 christos ; Tomcat machine. Early version of fr500 machine
945 1.1 christos (define-mach
946 1.1 christos (name tomcat)
947 1.1 christos (comment "Tomcat -- early version of fr500")
948 1.1 christos (cpu frvbf)
949 1.1 christos )
950 1.1 christos (define-model
951 1.1 christos (name tomcat) (comment "Tomcat model") (attrs)
952 1.1 christos (mach tomcat)
953 1.1 christos
954 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
955 1.1 christos
956 1.1 christos ; `state' is a list of variables for recording model state
957 1.1 christos ; (state)
958 1.1 christos
959 1.1 christos (unit u-exec "Execution Unit" ()
960 1.1 christos 1 1 ; issue done
961 1.1 christos () ; state
962 1.1 christos () ; inputs
963 1.1 christos () ; outputs
964 1.1 christos () ; profile action (default)
965 1.1 christos )
966 1.1 christos )
967 1.1 christos
969 1.1 christos ; FR400 machine
970 1.1 christos (define-mach
971 1.1 christos (name fr400)
972 1.1 christos (comment "FR400 cpu")
973 1.1 christos (cpu frvbf)
974 1.1 christos )
975 1.1 christos (define-model
976 1.1 christos (name fr400) (comment "FR400 model") (attrs)
977 1.1 christos (mach fr400)
978 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
979 1.1 christos ; `state' is a list of variables for recording model state
980 1.1 christos (state
981 1.1 christos ; State items
982 1.1 christos ; These are all masks with each bit representing one register.
983 1.1 christos (prev-fp-load DI) ; Previous use of FR register was floating point load
984 1.1 christos (prev-fr-p4 DI) ; Previous use of FR register was media unit 4
985 1.1 christos (prev-fr-p6 DI) ; Previous use of FR register was media unit 6
986 1.1 christos (prev-acc-p2 DI) ; Previous use of ACC register was media unit 2
987 1.1 christos (prev-acc-p4 DI) ; Previous use of ACC register was media unit 4
988 1.1 christos (cur-fp-load DI) ; Current use of FR register is floating point load
989 1.1 christos (cur-fr-p4 DI) ; Current use of FR register is media unit 4
990 1.1 christos (cur-fr-p6 DI) ; Current use of FR register is media unit 6
991 1.1 christos (cur-acc-p2 DI) ; Current use of ACC register is media unit 2
992 1.1 christos (cur-acc-p4 DI) ; Current use of ACC register is media unit 4
993 1.1 christos )
994 1.1 christos (unit u-exec "Execution Unit" ()
995 1.1 christos 1 1 ; issue done
996 1.1 christos () ; state
997 1.1 christos () ; inputs
998 1.1 christos () ; outputs
999 1.1 christos () ; profile action (default)
1000 1.1 christos )
1001 1.1 christos ; Basic integer insn unit
1002 1.1 christos (unit u-integer "Integer Unit" ()
1003 1.1 christos 1 1 ; issue done
1004 1.1 christos () ; state
1005 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1006 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1007 1.1 christos () ; profile action (default)
1008 1.1 christos )
1009 1.1 christos ; Integer multiplication unit
1010 1.1 christos (unit u-imul "Integer Multiplication Unit" ()
1011 1.1 christos 1 1 ; issue done
1012 1.1 christos () ; state
1013 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1014 1.1 christos ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
1015 1.1 christos () ; profile action (default)
1016 1.1 christos )
1017 1.1 christos ; Integer division unit
1018 1.1 christos (unit u-idiv "Integer Division Unit" ()
1019 1.1 christos 1 1 ; issue done
1020 1.1 christos () ; state
1021 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1022 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1023 1.1 christos () ; profile action (default)
1024 1.1 christos )
1025 1.1 christos ; Branch unit
1026 1.1 christos (unit u-branch "Branch Unit" ()
1027 1.1 christos 1 1 ; issue done
1028 1.1 christos () ; state
1029 1.1 christos ((GRi INT -1) (GRj INT -1)
1030 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1031 1.1 christos ((pc)) ; outputs
1032 1.1 christos () ; profile action (default)
1033 1.1 christos )
1034 1.1 christos ; Trap unit
1035 1.1 christos (unit u-trap "Trap Unit" ()
1036 1.1 christos 1 1 ; issue done
1037 1.1 christos () ; state
1038 1.1 christos ((GRi INT -1) (GRj INT -1)
1039 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1040 1.1 christos () ; outputs
1041 1.1 christos () ; profile action (default)
1042 1.1 christos )
1043 1.1 christos ; Condition code check unit
1044 1.1 christos (unit u-check "Check Unit" ()
1045 1.1 christos 1 1 ; issue done
1046 1.1 christos () ; state
1047 1.1 christos ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
1048 1.1 christos () ; outputs
1049 1.1 christos () ; profile action (default)
1050 1.1 christos )
1051 1.1 christos ; GR set half unit
1052 1.1 christos (unit u-set-hilo "GR Set Half" ()
1053 1.1 christos 1 1 ; issue done
1054 1.1 christos () ; state
1055 1.1 christos () ; inputs
1056 1.1 christos ((GRkhi INT -1) (GRklo INT -1)) ; outputs
1057 1.1 christos () ; profile action (default)
1058 1.1 christos )
1059 1.1 christos ; GR load unit -- TODO doesn't handle quad
1060 1.1 christos (unit u-gr-load "GR Load Unit" ()
1061 1.1 christos 1 1 ; issue done
1062 1.1 christos () ; state
1063 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1064 1.1 christos ((GRk INT -1) (GRdoublek INT -1)) ; outputs
1065 1.1 christos () ; profile action (default)
1066 1.1 christos )
1067 1.1 christos ; GR store unit -- TODO doesn't handle quad
1068 1.1 christos (unit u-gr-store "GR Store Unit" ()
1069 1.1 christos 1 1 ; issue done
1070 1.1 christos () ; state
1071 1.1 christos ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
1072 1.1 christos () ; outputs
1073 1.1 christos () ; profile action (default)
1074 1.1 christos )
1075 1.1 christos ; FR load unit -- TODO doesn't handle quad
1076 1.1 christos (unit u-fr-load "FR Load Unit" ()
1077 1.1 christos 1 1 ; issue done
1078 1.1 christos () ; state
1079 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1080 1.1 christos ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
1081 1.1 christos () ; profile action (default)
1082 1.1 christos )
1083 1.1 christos ; FR store unit -- TODO doesn't handle quad
1084 1.1 christos (unit u-fr-store "FR Store Unit" ()
1085 1.1 christos 1 1 ; issue done
1086 1.1 christos () ; state
1087 1.1 christos ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
1088 1.1 christos () ; outputs
1089 1.1 christos () ; profile action (default)
1090 1.1 christos )
1091 1.1 christos ; Swap unit
1092 1.1 christos (unit u-swap "Swap Unit" ()
1093 1.1 christos 1 1 ; issue done
1094 1.1 christos () ; state
1095 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1096 1.1 christos ((GRk INT -1)) ; outputs
1097 1.1 christos () ; profile action (default)
1098 1.1 christos )
1099 1.1 christos ; FR Move to GR unit
1100 1.1 christos (unit u-fr2gr "FR Move to GR Unit" ()
1101 1.1 christos 1 1 ; issue done
1102 1.1 christos () ; state
1103 1.1 christos ((FRintk INT -1)) ; inputs
1104 1.1 christos ((GRj INT -1)) ; outputs
1105 1.1 christos () ; profile action (default)
1106 1.1 christos )
1107 1.1 christos ; SPR Move to GR unit
1108 1.1 christos (unit u-spr2gr "SPR Move to GR Unit" ()
1109 1.1 christos 1 1 ; issue done
1110 1.1 christos () ; state
1111 1.1 christos ((spr INT -1)) ; inputs
1112 1.1 christos ((GRj INT -1)) ; outputs
1113 1.1 christos () ; profile action (default)
1114 1.1 christos )
1115 1.1 christos ; GR Move to FR unit
1116 1.1 christos (unit u-gr2fr "GR Move to FR Unit" ()
1117 1.1 christos 1 1 ; issue done
1118 1.1 christos () ; state
1119 1.1 christos ((GRj INT -1)) ; inputs
1120 1.1 christos ((FRintk INT -1)) ; outputs
1121 1.1 christos () ; profile action (default)
1122 1.1 christos )
1123 1.1 christos ; GR Move to SPR unit
1124 1.1 christos (unit u-gr2spr "GR Move to SPR Unit" ()
1125 1.1 christos 1 1 ; issue done
1126 1.1 christos () ; state
1127 1.1 christos ((GRj INT -1)) ; inputs
1128 1.1 christos ((spr INT -1)) ; outputs
1129 1.1 christos () ; profile action (default)
1130 1.1 christos )
1131 1.1 christos ; Media unit M1 -- see table 13-8 in the fr400 LSI
1132 1.1 christos (unit u-media-1 "Media-1 unit" ()
1133 1.1 christos 1 1 ; issue done
1134 1.1 christos () ; state
1135 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1136 1.1 christos ((FRintk INT -1)) ; outputs
1137 1.1 christos () ; profile action (default)
1138 1.1 christos )
1139 1.1 christos (unit u-media-1-quad "Media-1-quad unit" ()
1140 1.1 christos 1 1 ; issue done
1141 1.1 christos () ; state
1142 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1143 1.1 christos ((FRintk INT -1)) ; outputs
1144 1.1 christos () ; profile action (default)
1145 1.1 christos )
1146 1.1 christos (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" ()
1147 1.1 christos 1 1 ; issue done
1148 1.1 christos () ; state
1149 1.1 christos () ; inputs
1150 1.1 christos ((FRkhi INT -1) (FRklo INT -1)) ; outputs
1151 1.1 christos () ; profile action (default)
1152 1.1 christos )
1153 1.1 christos ; Media unit M2 -- see table 13-8 in the fr400 LSI
1154 1.1 christos (unit u-media-2 "Media-2 unit" ()
1155 1.1 christos 1 1 ; issue done
1156 1.1 christos () ; state
1157 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1158 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1159 1.1 christos () ; profile action (default)
1160 1.1 christos )
1161 1.1 christos (unit u-media-2-quad "Media-2-quad unit" ()
1162 1.1 christos 1 1 ; issue done
1163 1.1 christos () ; state
1164 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1165 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1166 1.1 christos () ; profile action (default)
1167 1.1 christos )
1168 1.1 christos (unit u-media-2-acc "Media-2-acc unit" ()
1169 1.1 christos 1 1 ; issue done
1170 1.1 christos () ; state
1171 1.1 christos ((ACC40Si INT -1)) ; inputs
1172 1.1 christos ((ACC40Sk INT -1)) ; outputs
1173 1.1 christos () ; profile action (default)
1174 1.1 christos )
1175 1.1 christos (unit u-media-2-acc-dual "Media-2-acc-dual unit" ()
1176 1.1 christos 1 1 ; issue done
1177 1.1 christos () ; state
1178 1.1 christos ((ACC40Si INT -1)) ; inputs
1179 1.1 christos ((ACC40Sk INT -1)) ; outputs
1180 1.1 christos () ; profile action (default)
1181 1.1 christos )
1182 1.1 christos (unit u-media-2-add-sub "Media-2-add-sub unit" ()
1183 1.1 christos 1 1 ; issue done
1184 1.1 christos () ; state
1185 1.1 christos ((ACC40Si INT -1)) ; inputs
1186 1.1 christos ((ACC40Sk INT -1)) ; outputs
1187 1.1 christos () ; profile action (default)
1188 1.1 christos )
1189 1.1 christos (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" ()
1190 1.1 christos 1 1 ; issue done
1191 1.1 christos () ; state
1192 1.1 christos ((ACC40Si INT -1)) ; inputs
1193 1.1 christos ((ACC40Sk INT -1)) ; outputs
1194 1.1 christos () ; profile action (default)
1195 1.1 christos )
1196 1.1 christos ; Media unit M3 -- see table 13-8 in the fr400 LSI
1197 1.1 christos (unit u-media-3 "Media-3 unit" ()
1198 1.1 christos 1 1 ; issue done
1199 1.1 christos () ; state
1200 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1201 1.1 christos ((FRintk INT -1)) ; outputs
1202 1.1 christos () ; profile action (default)
1203 1.1 christos )
1204 1.1 christos (unit u-media-3-dual "Media-3-dual unit" ()
1205 1.1 christos 1 1 ; issue done
1206 1.1 christos () ; state
1207 1.1 christos ((FRinti INT -1)) ; inputs
1208 1.1 christos ((FRintk INT -1)) ; outputs
1209 1.1 christos () ; profile action (default)
1210 1.1 christos )
1211 1.1 christos (unit u-media-3-quad "Media-3-quad unit" ()
1212 1.1 christos 1 1 ; issue done
1213 1.1 christos () ; state
1214 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1215 1.1 christos ((FRintk INT -1)) ; outputs
1216 1.1 christos () ; profile action (default)
1217 1.1 christos )
1218 1.1 christos ; Media unit M4 -- see table 13-8 in the fr400 LSI
1219 1.1 christos (unit u-media-4 "Media-4 unit" ()
1220 1.1 christos 1 1 ; issue done
1221 1.1 christos () ; state
1222 1.1 christos ((ACC40Si INT -1) (FRintj INT -1)) ; inputs
1223 1.1 christos ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs
1224 1.1 christos () ; profile action (default)
1225 1.1 christos )
1226 1.1 christos (unit u-media-4-accg "Media-4-accg unit" ()
1227 1.1 christos 1 1 ; issue done
1228 1.1 christos () ; state
1229 1.1 christos ((ACCGi INT -1) (FRinti INT -1)) ; inputs
1230 1.1 christos ((ACCGk INT -1) (FRintk INT -1)) ; outputs
1231 1.1 christos () ; profile action (default)
1232 1.1 christos )
1233 1.1 christos (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
1234 1.1 christos 1 1 ; issue done
1235 1.1 christos () ; state
1236 1.1 christos ((ACC40Si INT -1)) ; inputs
1237 1.1 christos ((FRintk INT -1)) ; outputs
1238 1.1 christos () ; profile action (default)
1239 1.1 christos )
1240 1.1 christos ; Media unit M6 -- see table 13-8 in the fr400 LSI
1241 1.1 christos (unit u-media-6 "Media-6 unit" ()
1242 1.1 christos 1 1 ; issue done
1243 1.1 christos () ; state
1244 1.1 christos ((FRinti INT -1)) ; inputs
1245 1.1 christos ((FRintk INT -1)) ; outputs
1246 1.1 christos () ; profile action (default)
1247 1.1 christos )
1248 1.1 christos ; Media unit M7 -- see table 13-8 in the fr400 LSI
1249 1.1 christos (unit u-media-7 "Media-1 unit" ()
1250 1.1 christos 1 1 ; issue done
1251 1.1 christos () ; state
1252 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1253 1.1 christos ((FCCk INT -1)) ; outputs
1254 1.1 christos () ; profile action (default)
1255 1.1 christos )
1256 1.1 christos ; Media Dual Expand unit
1257 1.1 christos (unit u-media-dual-expand "Media Dual Expand unit" ()
1258 1.1 christos 1 1 ; issue done
1259 1.1 christos () ; state
1260 1.1 christos ((FRinti INT -1)) ; inputs
1261 1.1 christos ((FRintk INT -1)) ; outputs
1262 1.1 christos () ; profile action (default)
1263 1.1 christos )
1264 1.1 christos ; Media Dual half to byte unit
1265 1.1 christos (unit u-media-dual-htob "Media Half to byte" ()
1266 1.1 christos 1 1 ; issue done
1267 1.1 christos () ; state
1268 1.1 christos ((FRintj INT -1)) ; inputs
1269 1.1 christos ((FRintk INT -1)) ; outputs
1270 1.1 christos () ; profile action (default)
1271 1.1 christos )
1272 1.1 christos ; Barrier unit
1273 1.1 christos (unit u-barrier "Barrier unit" ()
1274 1.1 christos 1 1 ; issue done
1275 1.1 christos () ; state
1276 1.1 christos () ; inputs
1277 1.1 christos () ; outputs
1278 1.1 christos () ; profile action (default)
1279 1.1 christos )
1280 1.1 christos ; Memory Barrier unit
1281 1.1 christos (unit u-membar "Memory Barrier unit" ()
1282 1.1 christos 1 1 ; issue done
1283 1.1 christos () ; state
1284 1.1 christos () ; inputs
1285 1.1 christos () ; outputs
1286 1.1 christos () ; profile action (default)
1287 1.1 christos )
1288 1.1 christos ; Insn cache invalidate unit
1289 1.1 christos (unit u-ici "Insn cache invalidate unit" ()
1290 1.1 christos 1 1 ; issue done
1291 1.1 christos () ; state
1292 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1293 1.1 christos () ; outputs
1294 1.1 christos () ; profile action (default)
1295 1.1 christos )
1296 1.1 christos ; Data cache invalidate unit
1297 1.1 christos (unit u-dci "Data cache invalidate unit" ()
1298 1.1 christos 1 1 ; issue done
1299 1.1 christos () ; state
1300 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1301 1.1 christos () ; outputs
1302 1.1 christos () ; profile action (default)
1303 1.1 christos )
1304 1.1 christos ; Data cache flush unit
1305 1.1 christos (unit u-dcf "Data cache flush unit" ()
1306 1.1 christos 1 1 ; issue done
1307 1.1 christos () ; state
1308 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1309 1.1 christos () ; outputs
1310 1.1 christos () ; profile action (default)
1311 1.1 christos )
1312 1.1 christos ; Insn cache preload unit
1313 1.1 christos (unit u-icpl "Insn cache preload unit" ()
1314 1.1 christos 1 1 ; issue done
1315 1.1 christos () ; state
1316 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1317 1.1 christos () ; outputs
1318 1.1 christos () ; profile action (default)
1319 1.1 christos )
1320 1.1 christos ; Data cache preload unit
1321 1.1 christos (unit u-dcpl "Data cache preload unit" ()
1322 1.1 christos 1 1 ; issue done
1323 1.1 christos () ; state
1324 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1325 1.1 christos () ; outputs
1326 1.1 christos () ; profile action (default)
1327 1.1 christos )
1328 1.1 christos ; Insn cache unlock unit
1329 1.1 christos (unit u-icul "Insn cache unlock unit" ()
1330 1.1 christos 1 1 ; issue done
1331 1.1 christos () ; state
1332 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1333 1.1 christos () ; outputs
1334 1.1 christos () ; profile action (default)
1335 1.1 christos )
1336 1.1 christos ; Data cache unlock unit
1337 1.1 christos (unit u-dcul "Data cache unlock unit" ()
1338 1.1 christos 1 1 ; issue done
1339 1.1 christos () ; state
1340 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1341 1.1 christos () ; outputs
1342 1.1 christos () ; profile action (default)
1343 1.1 christos )
1344 1.1 christos )
1345 1.1 christos
1347 1.1 christos ; FR450 machine
1348 1.1 christos (define-mach
1349 1.1 christos (name fr450)
1350 1.1 christos (comment "FR450 cpu")
1351 1.1 christos (cpu frvbf)
1352 1.1 christos )
1353 1.1 christos (define-model
1354 1.1 christos (name fr450) (comment "FR450 model") (attrs)
1355 1.1 christos (mach fr450)
1356 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
1357 1.1 christos ; `state' is a list of variables for recording model state
1358 1.1 christos (state
1359 1.1 christos ; State items
1360 1.1 christos ; These are all masks with each bit representing one register.
1361 1.1 christos (prev-fp-load DI) ; Previous use of FR register was floating point load
1362 1.1 christos (prev-fr-p4 DI) ; Previous use of FR register was media unit 4
1363 1.1 christos (prev-fr-p6 DI) ; Previous use of FR register was media unit 6
1364 1.1 christos (prev-acc-p2 DI) ; Previous use of ACC register was media unit 2
1365 1.1 christos (prev-acc-p4 DI) ; Previous use of ACC register was media unit 4
1366 1.1 christos (cur-fp-load DI) ; Current use of FR register is floating point load
1367 1.1 christos (cur-fr-p4 DI) ; Current use of FR register is media unit 4
1368 1.1 christos (cur-fr-p6 DI) ; Current use of FR register is media unit 6
1369 1.1 christos (cur-acc-p2 DI) ; Current use of ACC register is media unit 2
1370 1.1 christos (cur-acc-p4 DI) ; Current use of ACC register is media unit 4
1371 1.1 christos )
1372 1.1 christos (unit u-exec "Execution Unit" ()
1373 1.1 christos 1 1 ; issue done
1374 1.1 christos () ; state
1375 1.1 christos () ; inputs
1376 1.1 christos () ; outputs
1377 1.1 christos () ; profile action (default)
1378 1.1 christos )
1379 1.1 christos ; Basic integer insn unit
1380 1.1 christos (unit u-integer "Integer Unit" ()
1381 1.1 christos 1 1 ; issue done
1382 1.1 christos () ; state
1383 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1384 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1385 1.1 christos () ; profile action (default)
1386 1.1 christos )
1387 1.1 christos ; Integer multiplication unit
1388 1.1 christos (unit u-imul "Integer Multiplication Unit" ()
1389 1.1 christos 1 1 ; issue done
1390 1.1 christos () ; state
1391 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1392 1.1 christos ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
1393 1.1 christos () ; profile action (default)
1394 1.1 christos )
1395 1.1 christos ; Integer division unit
1396 1.1 christos (unit u-idiv "Integer Division Unit" ()
1397 1.1 christos 1 1 ; issue done
1398 1.1 christos () ; state
1399 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1400 1.1 christos ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
1401 1.1 christos () ; profile action (default)
1402 1.1 christos )
1403 1.1 christos ; Branch unit
1404 1.1 christos (unit u-branch "Branch Unit" ()
1405 1.1 christos 1 1 ; issue done
1406 1.1 christos () ; state
1407 1.1 christos ((GRi INT -1) (GRj INT -1)
1408 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1409 1.1 christos ((pc)) ; outputs
1410 1.1 christos () ; profile action (default)
1411 1.1 christos )
1412 1.1 christos ; Trap unit
1413 1.1 christos (unit u-trap "Trap Unit" ()
1414 1.1 christos 1 1 ; issue done
1415 1.1 christos () ; state
1416 1.1 christos ((GRi INT -1) (GRj INT -1)
1417 1.1 christos (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
1418 1.1 christos () ; outputs
1419 1.1 christos () ; profile action (default)
1420 1.1 christos )
1421 1.1 christos ; Condition code check unit
1422 1.1 christos (unit u-check "Check Unit" ()
1423 1.1 christos 1 1 ; issue done
1424 1.1 christos () ; state
1425 1.1 christos ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
1426 1.1 christos () ; outputs
1427 1.1 christos () ; profile action (default)
1428 1.1 christos )
1429 1.1 christos ; GR set half unit
1430 1.1 christos (unit u-set-hilo "GR Set Half" ()
1431 1.1 christos 1 1 ; issue done
1432 1.1 christos () ; state
1433 1.1 christos () ; inputs
1434 1.1 christos ((GRkhi INT -1) (GRklo INT -1)) ; outputs
1435 1.1 christos () ; profile action (default)
1436 1.1 christos )
1437 1.1 christos ; GR load unit -- TODO doesn't handle quad
1438 1.1 christos (unit u-gr-load "GR Load Unit" ()
1439 1.1 christos 1 1 ; issue done
1440 1.1 christos () ; state
1441 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1442 1.1 christos ((GRk INT -1) (GRdoublek INT -1)) ; outputs
1443 1.1 christos () ; profile action (default)
1444 1.1 christos )
1445 1.1 christos ; GR store unit -- TODO doesn't handle quad
1446 1.1 christos (unit u-gr-store "GR Store Unit" ()
1447 1.1 christos 1 1 ; issue done
1448 1.1 christos () ; state
1449 1.1 christos ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
1450 1.1 christos () ; outputs
1451 1.1 christos () ; profile action (default)
1452 1.1 christos )
1453 1.1 christos ; FR load unit -- TODO doesn't handle quad
1454 1.1 christos (unit u-fr-load "FR Load Unit" ()
1455 1.1 christos 1 1 ; issue done
1456 1.1 christos () ; state
1457 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1458 1.1 christos ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
1459 1.1 christos () ; profile action (default)
1460 1.1 christos )
1461 1.1 christos ; FR store unit -- TODO doesn't handle quad
1462 1.1 christos (unit u-fr-store "FR Store Unit" ()
1463 1.1 christos 1 1 ; issue done
1464 1.1 christos () ; state
1465 1.1 christos ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
1466 1.1 christos () ; outputs
1467 1.1 christos () ; profile action (default)
1468 1.1 christos )
1469 1.1 christos ; Swap unit
1470 1.1 christos (unit u-swap "Swap Unit" ()
1471 1.1 christos 1 1 ; issue done
1472 1.1 christos () ; state
1473 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1474 1.1 christos ((GRk INT -1)) ; outputs
1475 1.1 christos () ; profile action (default)
1476 1.1 christos )
1477 1.1 christos ; FR Move to GR unit
1478 1.1 christos (unit u-fr2gr "FR Move to GR Unit" ()
1479 1.1 christos 1 1 ; issue done
1480 1.1 christos () ; state
1481 1.1 christos ((FRintk INT -1)) ; inputs
1482 1.1 christos ((GRj INT -1)) ; outputs
1483 1.1 christos () ; profile action (default)
1484 1.1 christos )
1485 1.1 christos ; SPR Move to GR unit
1486 1.1 christos (unit u-spr2gr "SPR Move to GR Unit" ()
1487 1.1 christos 1 1 ; issue done
1488 1.1 christos () ; state
1489 1.1 christos ((spr INT -1)) ; inputs
1490 1.1 christos ((GRj INT -1)) ; outputs
1491 1.1 christos () ; profile action (default)
1492 1.1 christos )
1493 1.1 christos ; GR Move to FR unit
1494 1.1 christos (unit u-gr2fr "GR Move to FR Unit" ()
1495 1.1 christos 1 1 ; issue done
1496 1.1 christos () ; state
1497 1.1 christos ((GRj INT -1)) ; inputs
1498 1.1 christos ((FRintk INT -1)) ; outputs
1499 1.1 christos () ; profile action (default)
1500 1.1 christos )
1501 1.1 christos ; GR Move to SPR unit
1502 1.1 christos (unit u-gr2spr "GR Move to SPR Unit" ()
1503 1.1 christos 1 1 ; issue done
1504 1.1 christos () ; state
1505 1.1 christos ((GRj INT -1)) ; inputs
1506 1.1 christos ((spr INT -1)) ; outputs
1507 1.1 christos () ; profile action (default)
1508 1.1 christos )
1509 1.1 christos ; Media unit M1 -- see table 14-8 in the fr450 LSI
1510 1.1 christos (unit u-media-1 "Media-1 unit" ()
1511 1.1 christos 1 1 ; issue done
1512 1.1 christos () ; state
1513 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1514 1.1 christos ((FRintk INT -1)) ; outputs
1515 1.1 christos () ; profile action (default)
1516 1.1 christos )
1517 1.1 christos (unit u-media-1-quad "Media-1-quad unit" ()
1518 1.1 christos 1 1 ; issue done
1519 1.1 christos () ; state
1520 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1521 1.1 christos ((FRintk INT -1)) ; outputs
1522 1.1 christos () ; profile action (default)
1523 1.1 christos )
1524 1.1 christos (unit u-media-hilo "Media-hilo unit -- a variation of the Media-1 unit" ()
1525 1.1 christos 1 1 ; issue done
1526 1.1 christos () ; state
1527 1.1 christos () ; inputs
1528 1.1 christos ((FRkhi INT -1) (FRklo INT -1)) ; outputs
1529 1.1 christos () ; profile action (default)
1530 1.1 christos )
1531 1.1 christos ; Media unit M2 -- see table 14-8 in the fr450 LSI
1532 1.1 christos (unit u-media-2 "Media-2 unit" ()
1533 1.1 christos 1 1 ; issue done
1534 1.1 christos () ; state
1535 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1536 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1537 1.1 christos () ; profile action (default)
1538 1.1 christos )
1539 1.1 christos (unit u-media-2-quad "Media-2-quad unit" ()
1540 1.1 christos 1 1 ; issue done
1541 1.1 christos () ; state
1542 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1543 1.1 christos ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
1544 1.1 christos () ; profile action (default)
1545 1.1 christos )
1546 1.1 christos (unit u-media-2-acc "Media-2-acc unit" ()
1547 1.1 christos 1 1 ; issue done
1548 1.1 christos () ; state
1549 1.1 christos ((ACC40Si INT -1)) ; inputs
1550 1.1 christos ((ACC40Sk INT -1)) ; outputs
1551 1.1 christos () ; profile action (default)
1552 1.1 christos )
1553 1.1 christos (unit u-media-2-acc-dual "Media-2-acc-dual unit" ()
1554 1.1 christos 1 1 ; issue done
1555 1.1 christos () ; state
1556 1.1 christos ((ACC40Si INT -1)) ; inputs
1557 1.1 christos ((ACC40Sk INT -1)) ; outputs
1558 1.1 christos () ; profile action (default)
1559 1.1 christos )
1560 1.1 christos (unit u-media-2-add-sub "Media-2-add-sub unit" ()
1561 1.1 christos 1 1 ; issue done
1562 1.1 christos () ; state
1563 1.1 christos ((ACC40Si INT -1)) ; inputs
1564 1.1 christos ((ACC40Sk INT -1)) ; outputs
1565 1.1 christos () ; profile action (default)
1566 1.1 christos )
1567 1.1 christos (unit u-media-2-add-sub-dual "Media-2-add-sub-dual unit" ()
1568 1.1 christos 1 1 ; issue done
1569 1.1 christos () ; state
1570 1.1 christos ((ACC40Si INT -1)) ; inputs
1571 1.1 christos ((ACC40Sk INT -1)) ; outputs
1572 1.1 christos () ; profile action (default)
1573 1.1 christos )
1574 1.1 christos ; Media unit M3 -- see table 14-8 in the fr450 LSI
1575 1.1 christos (unit u-media-3 "Media-3 unit" ()
1576 1.1 christos 1 1 ; issue done
1577 1.1 christos () ; state
1578 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1579 1.1 christos ((FRintk INT -1)) ; outputs
1580 1.1 christos () ; profile action (default)
1581 1.1 christos )
1582 1.1 christos (unit u-media-3-dual "Media-3-dual unit" ()
1583 1.1 christos 1 1 ; issue done
1584 1.1 christos () ; state
1585 1.1 christos ((FRinti INT -1)) ; inputs
1586 1.1 christos ((FRintk INT -1)) ; outputs
1587 1.1 christos () ; profile action (default)
1588 1.1 christos )
1589 1.1 christos (unit u-media-3-quad "Media-3-quad unit" ()
1590 1.1 christos 1 1 ; issue done
1591 1.1 christos () ; state
1592 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1593 1.1 christos ((FRintk INT -1)) ; outputs
1594 1.1 christos () ; profile action (default)
1595 1.1 christos )
1596 1.1 christos ; Media unit M4 -- see table 14-8 in the fr450 LSI
1597 1.1 christos (unit u-media-4 "Media-4 unit" ()
1598 1.1 christos 1 1 ; issue done
1599 1.1 christos () ; state
1600 1.1 christos ((ACC40Si INT -1) (FRintj INT -1)) ; inputs
1601 1.1 christos ((ACC40Sk INT -1) (FRintk INT -1)) ; outputs
1602 1.1 christos () ; profile action (default)
1603 1.1 christos )
1604 1.1 christos (unit u-media-4-accg "Media-4-accg unit" ()
1605 1.1 christos 1 1 ; issue done
1606 1.1 christos () ; state
1607 1.1 christos ((ACCGi INT -1) (FRinti INT -1)) ; inputs
1608 1.1 christos ((ACCGk INT -1) (FRintk INT -1)) ; outputs
1609 1.1 christos () ; profile action (default)
1610 1.1 christos )
1611 1.1 christos (unit u-media-4-acc-dual "Media-4-acc-dual unit" ()
1612 1.1 christos 1 1 ; issue done
1613 1.1 christos () ; state
1614 1.1 christos ((ACC40Si INT -1)) ; inputs
1615 1.1 christos ((FRintk INT -1)) ; outputs
1616 1.1 christos () ; profile action (default)
1617 1.1 christos )
1618 1.1 christos (unit u-media-4-mclracca "Media-4 unit for MCLRACC with #A=1" ()
1619 1.1 christos 1 1 ; issue done
1620 1.1 christos () ; state
1621 1.1 christos () ; inputs
1622 1.1 christos () ; outputs
1623 1.1 christos () ; profile action (default)
1624 1.1 christos )
1625 1.1 christos ; Media unit M6 -- see table 14-8 in the fr450 LSI
1626 1.1 christos (unit u-media-6 "Media-6 unit" ()
1627 1.1 christos 1 1 ; issue done
1628 1.1 christos () ; state
1629 1.1 christos ((FRinti INT -1)) ; inputs
1630 1.1 christos ((FRintk INT -1)) ; outputs
1631 1.1 christos () ; profile action (default)
1632 1.1 christos )
1633 1.1 christos ; Media unit M7 -- see table 14-8 in the fr450 LSI
1634 1.1 christos (unit u-media-7 "Media-1 unit" ()
1635 1.1 christos 1 1 ; issue done
1636 1.1 christos () ; state
1637 1.1 christos ((FRinti INT -1) (FRintj INT -1)) ; inputs
1638 1.1 christos ((FCCk INT -1)) ; outputs
1639 1.1 christos () ; profile action (default)
1640 1.1 christos )
1641 1.1 christos ; Media Dual Expand unit
1642 1.1 christos (unit u-media-dual-expand "Media Dual Expand unit" ()
1643 1.1 christos 1 1 ; issue done
1644 1.1 christos () ; state
1645 1.1 christos ((FRinti INT -1)) ; inputs
1646 1.1 christos ((FRintk INT -1)) ; outputs
1647 1.1 christos () ; profile action (default)
1648 1.1 christos )
1649 1.1 christos ; Media Dual half to byte unit
1650 1.1 christos (unit u-media-dual-htob "Media Half to byte" ()
1651 1.1 christos 1 1 ; issue done
1652 1.1 christos () ; state
1653 1.1 christos ((FRintj INT -1)) ; inputs
1654 1.1 christos ((FRintk INT -1)) ; outputs
1655 1.1 christos () ; profile action (default)
1656 1.1 christos )
1657 1.1 christos ; Barrier unit
1658 1.1 christos (unit u-barrier "Barrier unit" ()
1659 1.1 christos 1 1 ; issue done
1660 1.1 christos () ; state
1661 1.1 christos () ; inputs
1662 1.1 christos () ; outputs
1663 1.1 christos () ; profile action (default)
1664 1.1 christos )
1665 1.1 christos ; Memory Barrier unit
1666 1.1 christos (unit u-membar "Memory Barrier unit" ()
1667 1.1 christos 1 1 ; issue done
1668 1.1 christos () ; state
1669 1.1 christos () ; inputs
1670 1.1 christos () ; outputs
1671 1.1 christos () ; profile action (default)
1672 1.1 christos )
1673 1.1 christos ; Insn cache invalidate unit
1674 1.1 christos (unit u-ici "Insn cache invalidate unit" ()
1675 1.1 christos 1 1 ; issue done
1676 1.1 christos () ; state
1677 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1678 1.1 christos () ; outputs
1679 1.1 christos () ; profile action (default)
1680 1.1 christos )
1681 1.1 christos ; Data cache invalidate unit
1682 1.1 christos (unit u-dci "Data cache invalidate unit" ()
1683 1.1 christos 1 1 ; issue done
1684 1.1 christos () ; state
1685 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1686 1.1 christos () ; outputs
1687 1.1 christos () ; profile action (default)
1688 1.1 christos )
1689 1.1 christos ; Data cache flush unit
1690 1.1 christos (unit u-dcf "Data cache flush unit" ()
1691 1.1 christos 1 1 ; issue done
1692 1.1 christos () ; state
1693 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1694 1.1 christos () ; outputs
1695 1.1 christos () ; profile action (default)
1696 1.1 christos )
1697 1.1 christos ; Insn cache preload unit
1698 1.1 christos (unit u-icpl "Insn cache preload unit" ()
1699 1.1 christos 1 1 ; issue done
1700 1.1 christos () ; state
1701 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1702 1.1 christos () ; outputs
1703 1.1 christos () ; profile action (default)
1704 1.1 christos )
1705 1.1 christos ; Data cache preload unit
1706 1.1 christos (unit u-dcpl "Data cache preload unit" ()
1707 1.1 christos 1 1 ; issue done
1708 1.1 christos () ; state
1709 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1710 1.1 christos () ; outputs
1711 1.1 christos () ; profile action (default)
1712 1.1 christos )
1713 1.1 christos ; Insn cache unlock unit
1714 1.1 christos (unit u-icul "Insn cache unlock unit" ()
1715 1.1 christos 1 1 ; issue done
1716 1.1 christos () ; state
1717 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1718 1.1 christos () ; outputs
1719 1.1 christos () ; profile action (default)
1720 1.1 christos )
1721 1.1 christos ; Data cache unlock unit
1722 1.1 christos (unit u-dcul "Data cache unlock unit" ()
1723 1.1 christos 1 1 ; issue done
1724 1.1 christos () ; state
1725 1.1 christos ((GRi INT -1) (GRj INT -1)) ; inputs
1726 1.1 christos () ; outputs
1727 1.1 christos () ; profile action (default)
1728 1.1 christos )
1729 1.1 christos )
1730 1.1 christos
1732 1.1 christos ; Simple machine - single issue integer machine
1733 1.1 christos (define-mach
1734 1.1 christos (name simple)
1735 1.1 christos (comment "Simple single issue integer cpu")
1736 1.1 christos (cpu frvbf)
1737 1.1 christos )
1738 1.1 christos (define-model
1739 1.1 christos (name simple) (comment "Simple model") (attrs)
1740 1.1 christos (mach simple)
1741 1.1 christos (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
1742 1.1 christos ; `state' is a list of variables for recording model state
1743 1.1 christos (state)
1744 1.1 christos (unit u-exec "Execution Unit" ()
1745 1.1 christos 1 1 ; issue done
1746 1.1 christos () ; state
1747 1.1 christos () ; inputs
1748 1.1 christos () ; outputs
1749 1.1 christos () ; profile action (default)
1750 1.1 christos )
1751 1.1 christos )
1752 1.1 christos
1754 1.1 christos ; The instruction fetch/execute cycle.
1755 1.1 christos ;
1756 1.1 christos ; This is how to fetch and decode an instruction.
1757 1.1 christos ; Leave it out for now
1758 1.1 christos
1759 1.1 christos ; (define-extract (const SI 0))
1760 1.1 christos
1761 1.1 christos ; This is how to execute a decoded instruction.
1762 1.1 christos ; Leave it out for now
1763 1.1 christos
1764 1.1 christos ; (define-execute (const SI 0))
1765 1.1 christos
1767 1.1 christos ; An attribute to describe which unit an insn runs in.
1768 1.1 christos (define-attr
1769 1.1 christos (for insn)
1770 1.1 christos (type enum)
1771 1.1 christos (name UNIT)
1772 1.1 christos (comment "parallel execution pipeline selection")
1773 1.1 christos ; The order of declaration is significant.
1774 1.1 christos ; See the *_unit_mapping tables in frv.opc
1775 1.1 christos ; Keep variations on the same unit together.
1776 1.1 christos ; Keep the '01' variant immediately after the '1' variant in each unit.
1777 1.1 christos ; Keep the 'ALL' variations immediately after the last numbered variant in each unit.
1778 1.1 christos (values NIL
1779 1.1 christos I0 I1 I01 I2 I3 IALL
1780 1.1 christos FM0 FM1 FM01 FM2 FM3 FMALL FMLOW
1781 1.1 christos B0 B1 B01
1782 1.1 christos C
1783 1.1 christos MULT-DIV ; multiply/division slotted differently on different machines
1784 1.1 christos IACC ; iacc multiply slotted differently on different machines
1785 1.1 christos LOAD ; loads slotted differently on different machines
1786 1.1 christos STORE ; store slotted differently on different machines
1787 1.1 christos SCAN ; scan, scani slotted differently on different machines
1788 1.1 christos DCPL ; dcpl slotted differently on different machines
1789 1.1 christos MDUALACC ; media dual acc slotted differently on different machines
1790 1.1 christos MDCUTSSI ; mdcutssi insn slotted differently on different machines
1791 1.1 christos MCLRACC-1; mclracc A==1 slotted differently on different machines
1792 1.1 christos NUM_UNITS
1793 1.1 christos )
1794 1.1 christos )
1795 1.1 christos ; Attributes to describe major categories of insns
1796 1.1 christos (define-attr
1797 1.1 christos (for insn)
1798 1.1 christos (type enum)
1799 1.1 christos (name FR400-MAJOR)
1800 1.1 christos (comment "fr400 major insn categories")
1801 1.1 christos ; The order of declaration is significant. Keep variations on the same major
1802 1.1 christos ; together.
1803 1.1 christos (values NONE
1804 1.1 christos I-1 I-2 I-3 I-4 I-5
1805 1.1 christos B-1 B-2 B-3 B-4 B-5 B-6
1806 1.1 christos C-1 C-2
1807 1.1 christos M-1 M-2
1808 1.1 christos )
1809 1.1 christos )
1810 1.1 christos (define-attr
1811 1.1 christos (for insn)
1812 1.1 christos (type enum)
1813 1.1 christos (name FR450-MAJOR)
1814 1.1 christos (comment "fr450 major insn categories")
1815 1.1 christos ; The order of declaration is significant. Keep variations on the same major
1816 1.1 christos ; together.
1817 1.1 christos (values NONE
1818 1.1 christos I-1 I-2 I-3 I-4 I-5
1819 1.1 christos B-1 B-2 B-3 B-4 B-5 B-6
1820 1.1 christos C-1 C-2
1821 1.1 christos M-1 M-2 M-3 M-4 M-5 M-6
1822 1.1 christos )
1823 1.1 christos )
1824 1.1 christos (define-attr
1825 1.1 christos (for insn)
1826 1.1 christos (type enum)
1827 1.1 christos (name FR500-MAJOR)
1828 1.1 christos (comment "fr500 major insn categories")
1829 1.1 christos ; The order of declaration is significant. Keep variations on the same major
1830 1.1 christos ; together.
1831 1.1 christos (values NONE
1832 1.1 christos I-1 I-2 I-3 I-4 I-5 I-6
1833 1.1 christos B-1 B-2 B-3 B-4 B-5 B-6
1834 1.1 christos C-1 C-2
1835 1.1 christos F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8
1836 1.1 christos M-1 M-2 M-3 M-4 M-5 M-6 M-7 M-8
1837 1.1 christos )
1838 1.1 christos )
1839 1.1 christos (define-attr
1840 1.1 christos (for insn)
1841 1.1 christos (type enum)
1842 1.1 christos (name FR550-MAJOR)
1843 1.1 christos (comment "fr550 major insn categories")
1844 1.1 christos ; The order of declaration is significant. Keep variations on the same major
1845 1.1 christos ; together.
1846 1.1 christos (values NONE
1847 1.1 christos I-1 I-2 I-3 I-4 I-5 I-6 I-7 I-8
1848 1.1 christos B-1 B-2 B-3 B-4 B-5 B-6
1849 1.1 christos C-1 C-2
1850 1.1 christos F-1 F-2 F-3 F-4
1851 1.1 christos M-1 M-2 M-3 M-4 M-5
1852 1.1 christos )
1853 1.1 christos )
1854 1.1 christos ; Privileged insn
1855 1.1 christos (define-attr
1856 1.1 christos (for insn)
1857 1.1 christos (type boolean)
1858 1.1 christos (name PRIVILEGED)
1859 1.1 christos (comment "insn only allowed in supervisor mode")
1860 1.1 christos )
1861 1.1 christos ; Non-Excepting insn
1862 1.1 christos (define-attr
1863 1.1 christos (for insn)
1864 1.1 christos (type boolean)
1865 1.1 christos (name NON-EXCEPTING)
1866 1.1 christos (comment "non-excepting insn")
1867 1.1 christos )
1868 1.1 christos ; Conditional insn
1869 1.1 christos (define-attr
1870 1.1 christos (for insn)
1871 1.1 christos (type boolean)
1872 1.1 christos (name CONDITIONAL)
1873 1.1 christos (comment "conditional insn")
1874 1.1 christos )
1875 1.1 christos ; insn accesses FR registers
1876 1.1 christos (define-attr
1877 1.1 christos (for insn)
1878 1.1 christos (type boolean)
1879 1.1 christos (name FR-ACCESS)
1880 1.1 christos (comment "insn accesses FR registers")
1881 1.1 christos )
1882 1.1 christos ; insn preserves MSR.OVF
1883 1.1 christos (define-attr
1884 1.1 christos (for insn)
1885 1.1 christos (type boolean)
1886 1.1 christos (name PRESERVE-OVF)
1887 1.1 christos (comment "Preserve value of MSR.OVF")
1888 1.1 christos )
1889 1.1 christos ; "Audio" instruction provided by the fr405 but not the original fr400 core.
1890 1.1 christos (define-attr
1891 1.1 christos (for insn)
1892 1.1 christos (type boolean)
1893 1.1 christos (name AUDIO)
1894 1.1 christos (comment "Audio instruction added with FR405")
1895 1.1 christos )
1896 1.1 christos ; null attribute -- used as a place holder for where an attribue is required.
1897 1.1 christos (define-attr
1898 1.1 christos (for insn)
1899 1.1 christos (type boolean)
1900 1.1 christos (name NA)
1901 1.1 christos (comment "placeholder attribute")
1902 1.1 christos (attrs META) ; do not define in any generated file for now
1903 1.1 christos )
1904 1.1 christos
1905 1.1 christos ; IDOC attribute for instruction documentation.
1906 1.1 christos
1907 1.1 christos (define-attr
1908 1.1 christos (for insn)
1909 1.1 christos (type enum)
1910 1.1 christos (name IDOC)
1911 1.1 christos (comment "insn kind for documentation")
1912 1.1 christos (attrs META)
1913 1.1 christos (values
1914 1.1 christos (MEM - () "Memory")
1915 1.1 christos (ALU - () "ALU")
1916 1.1 christos (FPU - () "FPU")
1917 1.1 christos (BR - () "Branch")
1918 1.1 christos (PRIV - () "Priviledged")
1919 1.1 christos (MISC - () "Miscellaneous")
1920 1.1 christos )
1921 1.1 christos )
1922 1.1 christos
1924 1.1 christos ; Instruction fields.
1925 1.1 christos ;
1926 1.1 christos ; Attributes:
1927 1.1 christos ; PCREL-ADDR: pc relative value (for reloc and disassembly purposes)
1928 1.1 christos ; ABS-ADDR: absolute address (for reloc and disassembly purposes?)
1929 1.1 christos ; RESERVED: bits are not used to decode insn, must be all 0
1930 1.1 christos (dnf f-pack "packing bit" () 31 1)
1931 1.1 christos (dnf f-op "primary opcode" () 24 7)
1932 1.1 christos (dnf f-ope1 "extended opcode" () 11 6)
1933 1.1 christos (dnf f-ope2 "extended opcode" () 9 4)
1934 1.1 christos (dnf f-ope3 "extended opcode" () 15 3)
1935 1.1 christos (dnf f-ope4 "extended opcode" () 7 2)
1936 1.1 christos
1937 1.1 christos (dnf f-GRi "source register 1" () 17 6)
1938 1.1 christos (dnf f-GRj "source register 2" () 5 6)
1939 1.1 christos (dnf f-GRk "destination register" () 30 6)
1940 1.1 christos
1941 1.1 christos (dnf f-FRi "source register 1" () 17 6)
1942 1.1 christos (dnf f-FRj "source register 2" () 5 6)
1943 1.1 christos (dnf f-FRk "destination register" () 30 6)
1944 1.1 christos
1945 1.1 christos (dnf f-CPRi "source register 1" () 17 6)
1946 1.1 christos (dnf f-CPRj "source register 2" () 5 6)
1947 1.1 christos (dnf f-CPRk "destination register" () 30 6)
1948 1.1 christos
1949 1.1 christos (dnf f-ACCGi "source register" () 17 6)
1950 1.1 christos (dnf f-ACCGk "destination register" () 30 6)
1951 1.1 christos
1952 1.1 christos (dnf f-ACC40Si "40 bit signed accumulator" () 17 6)
1953 1.1 christos (dnf f-ACC40Ui "40 bit unsigned accumulator" () 17 6)
1954 1.1 christos (dnf f-ACC40Sk "40 bit accumulator" () 30 6)
1955 1.1 christos (dnf f-ACC40Uk "40 bit accumulator" () 30 6)
1956 1.1 christos
1957 1.1 christos (dnf f-CRi "source register" () 14 3)
1958 1.1 christos (dnf f-CRj "source register" () 2 3)
1959 1.1 christos (dnf f-CRk "destination register" () 27 3)
1960 1.1 christos (dnf f-CCi "condition register" () 11 3)
1961 1.1 christos
1962 1.1 christos (df f-CRj_int "target cr for ck insns" () 26 2 UINT
1963 1.1 christos ((value pc) (sub WI value 4))
1964 1.1 christos ((value pc) (add WI value 4))
1965 1.1 christos )
1966 1.1 christos (dnf f-CRj_float "target cr for fck insns" () 26 2)
1967 1.1 christos
1968 1.1 christos (dnf f-ICCi_1 "condition register" () 11 2)
1969 1.1 christos (dnf f-ICCi_2 "condition register" () 26 2)
1970 1.1 christos (dnf f-ICCi_3 "condition register" () 1 2)
1971 1.1 christos (dnf f-FCCi_1 "condition register" () 11 2)
1972 1.1 christos (dnf f-FCCi_2 "condition register" () 26 2)
1973 1.1 christos (dnf f-FCCi_3 "condition register" () 1 2)
1974 1.1 christos (dnf f-FCCk "condition register" () 26 2)
1975 1.1 christos (dnf f-eir "exception insn register" () 17 6)
1976 1.1 christos
1977 1.1 christos (df f-s10 "10 bit sign extended" () 9 10 INT #f #f)
1978 1.1 christos (df f-s12 "12 bit sign extended" () 11 12 INT #f #f)
1979 1.1 christos (df f-d12 "12 bit sign extended" () 11 12 INT #f #f)
1980 1.1 christos (df f-u16 "16 bit unsigned" () 15 16 UINT #f #f)
1981 1.1 christos (df f-s16 "16 bit sign extended" () 15 16 INT #f #f)
1982 1.1 christos (df f-s6 "6 bit signed" () 5 6 INT #f #f)
1983 1.1 christos (df f-s6_1 "6 bit signed" () 11 6 INT #f #f)
1984 1.1 christos (df f-u6 "6 bit unsigned" () 5 6 UINT #f #f)
1985 1.1 christos (df f-s5 "5 bit signed" () 4 5 INT #f #f)
1986 1.1 christos
1987 1.1.1.2 christos (df f-u12-h "upper 6 bits of u12" () 17 6 INT #f #f)
1988 1.1 christos (df f-u12-l "lower 6 bits of u12" () 5 6 UINT #f #f)
1989 1.1 christos (dnmf f-u12 "12 bit signed immediate" () INT
1990 1.1 christos (f-u12-h f-u12-l)
1991 1.1 christos (sequence () ; insert
1992 1.1 christos (set (ifield f-u12-h) (sra SI (ifield f-u12) 6))
1993 1.1 christos (set (ifield f-u12-l) (and (ifield f-u12) #x3f))
1994 1.1 christos )
1995 1.1 christos (sequence () ; extract
1996 1.1 christos (set (ifield f-u12) (or (mul (ifield f-u12-h) 64)
1997 1.1 christos (ifield f-u12-l)))
1998 1.1 christos )
1999 1.1 christos )
2000 1.1 christos
2001 1.1 christos (dnf f-int-cc "integer branch conditions" () 30 4)
2002 1.1 christos (dnf f-flt-cc "floating branch conditions" () 30 4)
2003 1.1 christos (df f-cond "conditional arithmetic" () 8 1 UINT #f #f)
2004 1.1 christos (df f-ccond "lr branch condition" () 12 1 UINT #f #f)
2005 1.1 christos (df f-hint "2 bit branch prediction hint" () 17 2 UINT #f #f)
2006 1.1 christos (df f-LI "link indicator" () 25 1 UINT #f #f)
2007 1.1 christos (df f-lock "cache lock indicator" () 25 1 UINT #f #f)
2008 1.1 christos (df f-debug "debug mode indicator" () 25 1 UINT #f #f)
2009 1.1 christos (df f-A "all accumulator bit" () 17 1 UINT #f #f)
2010 1.1 christos (df f-ae "cache all entries indicator" () 25 1 UINT #f #f)
2011 1.1 christos
2012 1.1 christos (dnf f-spr-h "upper 6 bits of spr" () 30 6)
2013 1.1 christos (dnf f-spr-l "lower 6 bits of spr" () 17 6)
2014 1.1 christos (dnmf f-spr "special purpose register" () UINT
2015 1.1 christos (f-spr-h f-spr-l)
2016 1.1 christos (sequence () ; insert
2017 1.1 christos (set (ifield f-spr-h) (srl (ifield f-spr) (const 6)))
2018 1.1 christos (set (ifield f-spr-l) (and (ifield f-spr) (const #x3f)))
2019 1.1.1.2 christos )
2020 1.1 christos (sequence () ; extract
2021 1.1 christos (set (ifield f-spr) (or (sll (ifield f-spr-h) (const 6))
2022 1.1 christos (ifield f-spr-l)))
2023 1.1 christos )
2024 1.1 christos )
2025 1.1 christos
2026 1.1 christos (df f-label16 "18 bit pc relative signed offset" (PCREL-ADDR) 15 16 INT
2027 1.1 christos ((value pc) (sra WI (sub WI value pc) (const 2)))
2028 1.1 christos ((value pc) (add WI (mul WI value (const 4)) pc))
2029 1.1 christos )
2030 1.1 christos
2031 1.1 christos (df f-labelH6 "upper 6 bits of label24" () 30 6 INT #f #f)
2032 1.1 christos (dnf f-labelL18 "lower 18 bits of label24" () 17 18)
2033 1.1 christos (dnmf f-label24 "26 bit signed offset" (PCREL-ADDR) INT
2034 1.1 christos (f-labelH6 f-labelL18)
2035 1.1 christos ; insert
2036 1.1 christos (sequence ()
2037 1.1.1.2 christos (set (ifield f-labelH6)
2038 1.1 christos (sra WI (sub (ifield f-label24) pc) (const 20)))
2039 1.1.1.2 christos (set (ifield f-labelL18)
2040 1.1 christos (and (srl (sub (ifield f-label24) pc) (const 2))
2041 1.1 christos (const #x3ffff)))
2042 1.1 christos )
2043 1.1 christos ; extract
2044 1.1 christos (sequence ()
2045 1.1 christos (set (ifield f-label24)
2046 1.1 christos (add (mul (or (mul (ifield f-labelH6) (sll 1 18))
2047 1.1 christos (ifield f-labelL18))
2048 1.1 christos (const 4))
2049 1.1 christos pc)))
2050 1.1 christos )
2051 1.1 christos
2052 1.1 christos (dnf f-LRAE "Load Real Address E flag" () 5 1)
2053 1.1 christos (dnf f-LRAD "Load Real Address D flag" () 4 1)
2054 1.1 christos (dnf f-LRAS "Load Real Address S flag" () 3 1)
2055 1.1 christos
2056 1.1 christos (dnf f-TLBPRopx "TLB Probe operation number" () 28 3)
2057 1.1 christos (dnf f-TLBPRL "TLB Probe L flag" () 25 1)
2058 1.1 christos
2059 1.1 christos (dnf f-ICCi_1-null "null field" (RESERVED) 11 2)
2060 1.1 christos (dnf f-ICCi_2-null "null field" (RESERVED) 26 2)
2061 1.1 christos (dnf f-ICCi_3-null "null field" (RESERVED) 1 2)
2062 1.1 christos (dnf f-FCCi_1-null "null field" (RESERVED) 11 2)
2063 1.1 christos (dnf f-FCCi_2-null "null field" (RESERVED) 26 2)
2064 1.1 christos (dnf f-FCCi_3-null "null field" (RESERVED) 1 2)
2065 1.1 christos (dnf f-rs-null "null field" (RESERVED) 17 6)
2066 1.1 christos (dnf f-GRi-null "null field" (RESERVED) 17 6)
2067 1.1 christos (dnf f-GRj-null "null field" (RESERVED) 5 6)
2068 1.1 christos (dnf f-GRk-null "null field" (RESERVED) 30 6)
2069 1.1 christos (dnf f-FRi-null "null field" (RESERVED) 17 6)
2070 1.1 christos (dnf f-FRj-null "null field" (RESERVED) 5 6)
2071 1.1 christos (dnf f-ACCj-null "null field" (RESERVED) 5 6)
2072 1.1 christos (dnf f-rd-null "null field" (RESERVED) 30 6)
2073 1.1 christos (dnf f-cond-null "null field" (RESERVED) 30 4)
2074 1.1 christos (dnf f-ccond-null "null field" (RESERVED) 12 1)
2075 1.1 christos (dnf f-s12-null "null field" (RESERVED) 11 12)
2076 1.1 christos (dnf f-label16-null "null field" (RESERVED) 15 16)
2077 1.1 christos (dnf f-misc-null-1 "null field" (RESERVED) 30 5)
2078 1.1 christos (dnf f-misc-null-2 "null field" (RESERVED) 11 6)
2079 1.1 christos (dnf f-misc-null-3 "null field" (RESERVED) 11 4)
2080 1.1 christos (dnf f-misc-null-4 "null field" (RESERVED) 17 2)
2081 1.1 christos (dnf f-misc-null-5 "null field" (RESERVED) 17 16)
2082 1.1 christos (dnf f-misc-null-6 "null field" (RESERVED) 30 3)
2083 1.1 christos (dnf f-misc-null-7 "null field" (RESERVED) 17 3)
2084 1.1 christos (dnf f-misc-null-8 "null field" (RESERVED) 5 3)
2085 1.1 christos (dnf f-misc-null-9 "null field" (RESERVED) 5 4)
2086 1.1 christos (dnf f-misc-null-10 "null field" (RESERVED) 16 5)
2087 1.1 christos (dnf f-misc-null-11 "null field" (RESERVED) 5 1)
2088 1.1 christos
2089 1.1 christos (dnf f-LRA-null "null field" (RESERVED) 2 3)
2090 1.1 christos (dnf f-TLBPR-null "null field" (RESERVED) 30 2)
2091 1.1 christos
2092 1.1 christos (dnf f-LI-off "null field" (RESERVED) 25 1)
2093 1.1 christos (dnf f-LI-on "null field" (RESERVED) 25 1)
2094 1.1 christos
2095 1.1 christos ; Relocation annotations.
2096 1.1 christos (dsh h-reloc-ann "relocation annotation" () (register BI))
2097 1.1 christos (dnf f-reloc-ann "relocation annotation" () 0 0)
2098 1.1 christos
2099 1.1 christos (define-pmacro (dann xname xcomment xmode xparse xprint)
2100 1.1 christos (define-operand
2101 1.1 christos (name xname)
2102 1.1 christos (comment xcomment)
2103 1.1 christos (type h-reloc-ann)
2104 1.1 christos (index f-reloc-ann)
2105 1.1 christos (mode xmode)
2106 1.1 christos (handlers (parse xparse) (print xprint))
2107 1.1 christos )
2108 1.1 christos )
2109 1.1 christos
2110 1.1 christos
2112 1.1 christos ; Enums.
2113 1.1 christos
2114 1.1 christos ; insn-op:
2115 1.1 christos ; FIXME: should use die macro or some such
2116 1.1 christos (define-normal-insn-enum insn-op "insn op enums" () OP_ f-op
2117 1.1 christos (
2118 1.1 christos "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
2119 1.1 christos "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F"
2120 1.1 christos "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F"
2121 1.1 christos "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F"
2122 1.1 christos "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F"
2123 1.1 christos "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "5A" "5B" "5C" "5D" "5E" "5F"
2124 1.1 christos "60" "61" "62" "63" "64" "65" "66" "67" "68" "69" "6A" "6B" "6C" "6D" "6E" "6F"
2125 1.1 christos "70" "71" "72" "73" "74" "75" "76" "77" "78" "79" "7A" "7B" "7C" "7D" "7E" "7F"
2126 1.1 christos )
2127 1.1 christos )
2128 1.1 christos
2129 1.1 christos (define-normal-insn-enum insn-ope1 "insn ope enums" () OPE1_ f-ope1
2130 1.1 christos (
2131 1.1 christos "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
2132 1.1 christos "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F"
2133 1.1 christos "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F"
2134 1.1 christos "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F"
2135 1.1 christos )
2136 1.1 christos )
2137 1.1 christos
2138 1.1 christos (define-normal-insn-enum insn-ope2 "insn ope enums" () OPE2_ f-ope2
2139 1.1 christos (
2140 1.1 christos "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"
2141 1.1 christos )
2142 1.1 christos )
2143 1.1 christos
2144 1.1 christos (define-normal-insn-enum insn-ope3 "insn ope enums" () OPE3_ f-ope3
2145 1.1 christos (
2146 1.1 christos "00" "01" "02" "03" "04" "05" "06" "07"
2147 1.1 christos )
2148 1.1 christos )
2149 1.1 christos
2150 1.1 christos (define-normal-insn-enum insn-ope4 "insn ope enums" () OPE4_ f-ope4
2151 1.1 christos (
2152 1.1 christos "0" "1" "2" "3"
2153 1.1 christos )
2154 1.1 christos )
2155 1.1 christos
2156 1.1 christos ; int-cc: integer branch conditions
2157 1.1 christos ; FIXME: should use die macro or some such
2158 1.1 christos (define-normal-insn-enum int-cc "integer branch cond enums" () ICC_ f-int-cc
2159 1.1 christos (
2160 1.1 christos "nev" "c" "v" "lt" "eq" "ls" "n" "le"
2161 1.1 christos "ra" "nc" "nv" "ge" "ne" "hi" "p" "gt"
2162 1.1 christos )
2163 1.1 christos )
2164 1.1 christos
2165 1.1 christos ; flt-cc: floating-point/media branch conditions
2166 1.1 christos ; FIXME: should use die macro or some such
2167 1.1 christos (define-normal-insn-enum flt-cc "float branch cond enums" () FCC_ f-flt-cc
2168 1.1 christos ("nev" "u" "gt" "ug" "lt" "ul" "lg" "ne"
2169 1.1 christos "eq" "ue" "ge" "uge" "le" "ule" "o" "ra")
2170 1.1 christos )
2171 1.1 christos
2173 1.1 christos ; Hardware pieces.
2174 1.1 christos ; These entries list the elements of the raw hardware.
2175 1.1 christos ; They're also used to provide tables and other elements of the assembly
2176 1.1 christos ; language.
2177 1.1 christos (dnh h-pc "program counter" (PC PROFILE) (pc) () () ())
2178 1.1 christos
2179 1.1 christos ; The PSR. The individual fields are referenced more than the entire
2180 1.1 christos ; register, so reference them directly. We can assemble the
2181 1.1 christos ; entire register contents when necessary.
2182 1.1 christos ;
2183 1.1 christos (dsh h-psr_imple "PSR.IMPLE" () (register UQI))
2184 1.1 christos (dsh h-psr_ver "PSR.VER" () (register UQI))
2185 1.1 christos (dsh h-psr_ice "PSR.ICE bit" () (register BI))
2186 1.1 christos (dsh h-psr_nem "PSR.NEM bit" () (register BI))
2187 1.1 christos (dsh h-psr_cm "PSR.CM bit" () (register BI))
2188 1.1 christos (dsh h-psr_be "PSR.BE bit" () (register BI))
2189 1.1 christos (dsh h-psr_esr "PSR.ESR bit" () (register BI))
2190 1.1 christos (dsh h-psr_ef "PSR.EF bit" () (register BI))
2191 1.1 christos (dsh h-psr_em "PSR.EM bit" () (register BI))
2192 1.1 christos (dsh h-psr_pil "PSR.PIL " () (register UQI))
2193 1.1 christos (dsh h-psr_ps "PSR.PS bit" () (register BI))
2194 1.1 christos (dsh h-psr_et "PSR.ET bit" () (register BI))
2195 1.1 christos
2196 1.1 christos ; PSR.S requires special handling because the shadow registers (SR0-SR4) must
2197 1.1 christos ; be switched with GR4-GR7 when changing from user to supervisor mode or
2198 1.1 christos ; vice-versa.
2199 1.1 christos (define-hardware
2200 1.1 christos (name h-psr_s)
2201 1.1 christos (comment "PSR.S bit")
2202 1.1 christos (attrs)
2203 1.1 christos (type register BI)
2204 1.1 christos (get)
2205 1.1 christos (set (newval) (c-call VOID "@cpu@_h_psr_s_set_handler" newval))
2206 1.1 christos )
2207 1.1 christos
2208 1.1 christos ; The TBR. The individual bits are referenced more than the entire
2209 1.1 christos ; register, so reference them directly. We can assemble the
2210 1.1 christos ; entire register contents when necessary.
2211 1.1 christos ;
2212 1.1 christos (dsh h-tbr_tba "TBR.TBA" () (register UWI))
2213 1.1 christos (dsh h-tbr_tt "TBR.TT" () (register UQI))
2214 1.1 christos
2215 1.1 christos ; The BPSR. The individual bits are referenced more than the entire
2216 1.1 christos ; register, so reference them directly. We can assemble the
2217 1.1 christos ; entire register contents when necessary.
2218 1.1 christos ;
2219 1.1 christos (dsh h-bpsr_bs "PSR.S bit" () (register BI))
2220 1.1 christos (dsh h-bpsr_bet "PSR.ET bit" () (register BI))
2221 1.1 christos
2222 1.1 christos ; General registers
2223 1.1 christos ;
2224 1.1 christos (define-keyword
2225 1.1 christos (name gr-names)
2226 1.1 christos (print-name h-gr)
2227 1.1 christos (prefix "")
2228 1.1 christos (values
2229 1.1 christos (sp 1) (fp 2)
2230 1.1 christos (gr0 0)(gr1 1)(gr2 2)(gr3 3)(gr4 4)(gr5 5)(gr6 6)(gr7 7)
2231 1.1 christos (gr8 8)(gr9 9)(gr10 10)(gr11 11)(gr12 12)(gr13 13)(gr14 14)(gr15 15)
2232 1.1 christos (gr16 16)(gr17 17)(gr18 18)(gr19 19)(gr20 20)(gr21 21)(gr22 22)(gr23 23)
2233 1.1 christos (gr24 24)(gr25 25)(gr26 26)(gr27 27)(gr28 28)(gr29 29)(gr30 30)(gr31 31)
2234 1.1 christos (gr32 32)(gr33 33)(gr34 34)(gr35 35)(gr36 36)(gr37 37)(gr38 38)(gr39 39)
2235 1.1 christos (gr40 40)(gr41 41)(gr42 42)(gr43 43)(gr44 44)(gr45 45)(gr46 46)(gr47 47)
2236 1.1 christos (gr48 48)(gr49 49)(gr50 50)(gr51 51)(gr52 52)(gr53 53)(gr54 54)(gr55 55)
2237 1.1 christos (gr56 56)(gr57 57)(gr58 58)(gr59 59)(gr60 60)(gr61 61)(gr62 62)(gr63 63)
2238 1.1 christos )
2239 1.1 christos )
2240 1.1 christos
2241 1.1 christos (define-hardware
2242 1.1 christos (name h-gr)
2243 1.1 christos (comment "general registers")
2244 1.1 christos (attrs PROFILE)
2245 1.1 christos (type register USI (64))
2246 1.1 christos (indices extern-keyword gr-names)
2247 1.1 christos (get (index) (c-call WI "@cpu@_h_gr_get_handler" index))
2248 1.1 christos (set (index newval) (c-call VOID "@cpu@_h_gr_set_handler" index newval))
2249 1.1 christos )
2250 1.1 christos
2251 1.1 christos ; General Registers as double words
2252 1.1 christos ; These registers are shadowed onto h-gr
2253 1.1 christos (define-hardware
2254 1.1 christos (name h-gr_double)
2255 1.1 christos (comment "general registers as double words")
2256 1.1 christos (attrs PROFILE VIRTUAL)
2257 1.1 christos (type register DI (32))
2258 1.1 christos ; FIXME: Need constraint to prohibit odd numbers.
2259 1.1 christos (indices extern-keyword gr-names)
2260 1.1 christos (get (index)
2261 1.1 christos (c-call DI "@cpu@_h_gr_double_get_handler" index))
2262 1.1 christos (set (index newval)
2263 1.1 christos (c-call VOID "@cpu@_h_gr_double_set_handler" index newval))
2264 1.1 christos )
2265 1.1 christos
2266 1.1 christos ; General Registers as high and low half words
2267 1.1 christos ; These registers are shadowed onto h-gr
2268 1.1 christos (define-hardware
2269 1.1 christos (name h-gr_hi)
2270 1.1 christos (comment "general registers as high half word")
2271 1.1 christos (attrs PROFILE VIRTUAL)
2272 1.1 christos (type register UHI (64))
2273 1.1 christos (indices extern-keyword gr-names)
2274 1.1 christos (get (index) (c-call UHI "@cpu@_h_gr_hi_get_handler" index))
2275 1.1 christos (set (index newval) (c-call VOID "@cpu@_h_gr_hi_set_handler" index newval))
2276 1.1 christos )
2277 1.1 christos (define-hardware
2278 1.1 christos (name h-gr_lo)
2279 1.1 christos (comment "general registers as low half word")
2280 1.1 christos (attrs PROFILE VIRTUAL)
2281 1.1 christos (type register UHI (64))
2282 1.1 christos (indices extern-keyword gr-names)
2283 1.1 christos (get (index) (c-call UHI "@cpu@_h_gr_lo_get_handler" index))
2284 1.1 christos (set (index newval) (c-call VOID "@cpu@_h_gr_lo_set_handler" index newval))
2285 1.1 christos )
2286 1.1 christos
2287 1.1 christos ; Floating Point Registers
2288 1.1 christos (define-keyword
2289 1.1 christos (name fr-names)
2290 1.1 christos (print-name h-fr)
2291 1.1 christos (prefix "")
2292 1.1 christos (values
2293 1.1 christos (fr0 0)(fr1 1)(fr2 2)(fr3 3)(fr4 4)(fr5 5)(fr6 6)(fr7 7)
2294 1.1 christos (fr8 8)(fr9 9)(fr10 10)(fr11 11)(fr12 12)(fr13 13)(fr14 14)(fr15 15)
2295 1.1 christos (fr16 16)(fr17 17)(fr18 18)(fr19 19)(fr20 20)(fr21 21)(fr22 22)(fr23 23)
2296 1.1 christos (fr24 24)(fr25 25)(fr26 26)(fr27 27)(fr28 28)(fr29 29)(fr30 30)(fr31 31)
2297 1.1 christos (fr32 32)(fr33 33)(fr34 34)(fr35 35)(fr36 36)(fr37 37)(fr38 38)(fr39 39)
2298 1.1 christos (fr40 40)(fr41 41)(fr42 42)(fr43 43)(fr44 44)(fr45 45)(fr46 46)(fr47 47)
2299 1.1 christos (fr48 48)(fr49 49)(fr50 50)(fr51 51)(fr52 52)(fr53 53)(fr54 54)(fr55 55)
2300 1.1 christos (fr56 56)(fr57 57)(fr58 58)(fr59 59)(fr60 60)(fr61 61)(fr62 62)(fr63 63)
2301 1.1 christos )
2302 1.1 christos )
2303 1.1 christos
2304 1.1 christos (define-hardware
2305 1.1 christos (name h-fr)
2306 1.1 christos (comment "floating point registers")
2307 1.1 christos (attrs PROFILE)
2308 1.1 christos (type register SF (64))
2309 1.1 christos (indices extern-keyword fr-names)
2310 1.1 christos (get (index) (c-call SF "@cpu@_h_fr_get_handler" index))
2311 1.1 christos (set (index newval) (c-call VOID "@cpu@_h_fr_set_handler" index newval))
2312 1.1 christos )
2313 1.1 christos
2314 1.1 christos ; Floating Point Registers as double precision
2315 1.1 christos ; These registers are shadowed onto h-fr
2316 1.1 christos
2317 1.1 christos (define-hardware
2318 1.1 christos (name h-fr_double)
2319 1.1 christos (comment "floating point registers as double precision")
2320 1.1 christos (attrs PROFILE VIRTUAL)
2321 1.1 christos (type register DF (32))
2322 1.1 christos ; FIXME: Need constraint to prohibit odd numbers.
2323 1.1 christos (indices extern-keyword fr-names)
2324 1.1 christos (get (index)
2325 1.1 christos (c-call DF "@cpu@_h_fr_double_get_handler" index))
2326 1.1 christos (set (index newval)
2327 1.1 christos (c-call VOID "@cpu@_h_fr_double_set_handler" index newval))
2328 1.1 christos )
2329 1.1 christos
2330 1.1 christos ; Floating Point Registers as integer words.
2331 1.1 christos ; These registers are shadowed onto h-fr
2332 1.1 christos
2333 1.1 christos (define-hardware
2334 1.1 christos (name h-fr_int)
2335 1.1 christos (comment "floating point registers as integers")
2336 1.1 christos (attrs PROFILE VIRTUAL)
2337 1.1 christos (type register USI (64))
2338 1.1 christos (indices extern-keyword fr-names)
2339 1.1 christos (get (index)
2340 1.1 christos (c-call USI "@cpu@_h_fr_int_get_handler" index))
2341 1.1 christos (set (index newval)
2342 1.1 christos (c-call VOID "@cpu@_h_fr_int_set_handler" index newval))
2343 1.1 christos )
2344 1.1 christos
2345 1.1 christos ; Floating Point Registers as high and low half words
2346 1.1 christos ; These registers are shadowed onto h-fr
2347 1.1 christos (define-hardware
2348 1.1 christos (name h-fr_hi)
2349 1.1 christos (comment "floating point registers as unsigned high half word")
2350 1.1 christos (attrs PROFILE VIRTUAL)
2351 1.1 christos (type register UHI (64))
2352 1.1 christos (indices extern-keyword fr-names)
2353 1.1 christos (get (regno) (srl (reg h-fr_int regno) 16))
2354 1.1 christos (set (regno newval) (set (reg h-fr_int regno)
2355 1.1 christos (or (and (reg h-fr_int regno) #xffff)
2356 1.1 christos (sll newval 16))))
2357 1.1 christos )
2358 1.1 christos (define-hardware
2359 1.1 christos (name h-fr_lo)
2360 1.1 christos (comment "floating point registers as unsigned low half word")
2361 1.1 christos (attrs PROFILE VIRTUAL)
2362 1.1 christos (type register UHI (64))
2363 1.1 christos (indices extern-keyword fr-names)
2364 1.1 christos (get (regno) (and (reg h-fr_int regno) #xffff))
2365 1.1 christos (set (regno newval) (set (reg h-fr_int regno)
2366 1.1 christos (or (and (reg h-fr_int regno) #xffff0000)
2367 1.1 christos (and newval #xffff))))
2368 1.1 christos )
2369 1.1 christos
2370 1.1 christos ; Floating Point Registers as unsigned bytes
2371 1.1 christos ; These registers are shadowed onto h-fr
2372 1.1 christos (define-hardware
2373 1.1 christos (name h-fr_0)
2374 1.1 christos (comment "floating point registers as unsigned byte 0")
2375 1.1 christos (attrs PROFILE VIRTUAL)
2376 1.1 christos (type register UHI (64))
2377 1.1 christos (indices extern-keyword fr-names)
2378 1.1 christos (get (regno) (and (reg h-fr_int regno) #xff))
2379 1.1 christos (set (regno newval)
2380 1.1 christos (sequence ()
2381 1.1 christos (if (gt USI newval #xff)
2382 1.1 christos (set newval #xff))
2383 1.1 christos (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffffff00)
2384 1.1 christos newval))))
2385 1.1 christos )
2386 1.1 christos (define-hardware
2387 1.1 christos (name h-fr_1)
2388 1.1 christos (comment "floating point registers as unsigned byte 1")
2389 1.1 christos (attrs PROFILE VIRTUAL)
2390 1.1 christos (type register UHI (64))
2391 1.1 christos (indices extern-keyword fr-names)
2392 1.1 christos (get (regno) (and (srl (reg h-fr_int regno) 8) #xff))
2393 1.1 christos (set (regno newval)
2394 1.1 christos (sequence ()
2395 1.1 christos (if (gt USI newval #xff)
2396 1.1 christos (set newval #xff))
2397 1.1 christos (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xffff00ff)
2398 1.1 christos (sll newval 8)))))
2399 1.1 christos )
2400 1.1 christos (define-hardware
2401 1.1 christos (name h-fr_2)
2402 1.1 christos (comment "floating point registers as unsigned byte 2")
2403 1.1 christos (attrs PROFILE VIRTUAL)
2404 1.1 christos (type register UHI (64))
2405 1.1 christos (indices extern-keyword fr-names)
2406 1.1 christos (get (regno) (and (srl (reg h-fr_int regno) 16) #xff))
2407 1.1 christos (set (regno newval)
2408 1.1 christos (sequence ()
2409 1.1 christos (if (gt USI newval #xff)
2410 1.1 christos (set newval #xff))
2411 1.1 christos (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #xff00ffff)
2412 1.1 christos (sll newval 16)))))
2413 1.1 christos )
2414 1.1 christos (define-hardware
2415 1.1 christos (name h-fr_3)
2416 1.1 christos (comment "floating point registers as unsigned byte 3")
2417 1.1 christos (attrs PROFILE VIRTUAL)
2418 1.1 christos (type register UHI (64))
2419 1.1 christos (indices extern-keyword fr-names)
2420 1.1 christos (get (regno) (and (srl (reg h-fr_int regno) 24) #xff))
2421 1.1 christos (set (regno newval)
2422 1.1 christos (sequence ()
2423 1.1 christos (if (gt USI newval #xff)
2424 1.1 christos (set newval #xff))
2425 1.1 christos (set (reg h-fr_int regno) (or (and (reg h-fr_int regno) #x00ffffff)
2426 1.1 christos (sll newval 24)))))
2427 1.1 christos )
2428 1.1 christos ; Coprocessor Registers
2429 1.1 christos ;
2430 1.1 christos (define-keyword
2431 1.1 christos (name cpr-names)
2432 1.1 christos (print-name h-cpr)
2433 1.1 christos (prefix "")
2434 1.1 christos (values
2435 1.1 christos (cpr0 0)(cpr1 1)(cpr2 2)(cpr3 3)(cpr4 4)(cpr5 5)(cpr6 6)(cpr7 7)
2436 1.1 christos (cpr8 8)(cpr9 9)(cpr10 10)(cpr11 11)(cpr12 12)(cpr13 13)(cpr14 14)(cpr15 15)
2437 1.1 christos (cpr16 16)(cpr17 17)(cpr18 18)(cpr19 19)(cpr20 20)(cpr21 21)(cpr22 22)(cpr23 23)
2438 1.1 christos (cpr24 24)(cpr25 25)(cpr26 26)(cpr27 27)(cpr28 28)(cpr29 29)(cpr30 30)(cpr31 31)
2439 1.1 christos (cpr32 32)(cpr33 33)(cpr34 34)(cpr35 35)(cpr36 36)(cpr37 37)(cpr38 38)(cpr39 39)
2440 1.1 christos (cpr40 40)(cpr41 41)(cpr42 42)(cpr43 43)(cpr44 44)(cpr45 45)(cpr46 46)(cpr47 47)
2441 1.1 christos (cpr48 48)(cpr49 49)(cpr50 50)(cpr51 51)(cpr52 52)(cpr53 53)(cpr54 54)(cpr55 55)
2442 1.1 christos (cpr56 56)(cpr57 57)(cpr58 58)(cpr59 59)(cpr60 60)(cpr61 61)(cpr62 62)(cpr63 63)
2443 1.1 christos )
2444 1.1 christos )
2445 1.1 christos
2446 1.1 christos (define-hardware
2447 1.1 christos (name h-cpr)
2448 1.1 christos (comment "coprocessor registers")
2449 1.1 christos (attrs PROFILE (MACH frv))
2450 1.1 christos (type register WI (64))
2451 1.1 christos (indices extern-keyword cpr-names)
2452 1.1 christos )
2453 1.1 christos
2454 1.1 christos ; Coprocessor Registers as double words
2455 1.1 christos ; These registers are shadowed onto h-cpr
2456 1.1 christos (define-hardware
2457 1.1 christos (name h-cpr_double)
2458 1.1 christos (comment "coprocessor registers as double words")
2459 1.1 christos (attrs PROFILE VIRTUAL (MACH frv))
2460 1.1 christos (type register DI (32))
2461 1.1 christos ; FIXME: Need constraint to prohibit odd numbers.
2462 1.1 christos (indices extern-keyword cpr-names)
2463 1.1 christos (get (index)
2464 1.1 christos (c-call DI "@cpu@_h_cpr_double_get_handler" index))
2465 1.1 christos (set (index newval)
2466 1.1 christos (c-call VOID "@cpu@_h_cpr_double_set_handler" index newval))
2467 1.1 christos )
2468 1.1 christos
2469 1.1 christos ; Special Purpose Registers
2470 1.1 christos ;
2471 1.1 christos (define-keyword
2472 1.1 christos (name spr-names)
2473 1.1 christos (print-name h-spr)
2474 1.1 christos (prefix "")
2475 1.1 christos (values
2476 1.1 christos (psr 0) (pcsr 1) (bpcsr 2) (tbr 3) (bpsr 4)
2477 1.1 christos
2478 1.1 christos (hsr0 16) (hsr1 17) (hsr2 18) (hsr3 19)
2479 1.1 christos (hsr4 20) (hsr5 21) (hsr6 22) (hsr7 23)
2480 1.1 christos (hsr8 24) (hsr9 25) (hsr10 26) (hsr11 27)
2481 1.1 christos (hsr12 28) (hsr13 29) (hsr14 30) (hsr15 31)
2482 1.1 christos (hsr16 32) (hsr17 33) (hsr18 34) (hsr19 35)
2483 1.1 christos (hsr20 36) (hsr21 37) (hsr22 38) (hsr23 39)
2484 1.1 christos (hsr24 40) (hsr25 41) (hsr26 42) (hsr27 43)
2485 1.1 christos (hsr28 44) (hsr29 45) (hsr30 46) (hsr31 47)
2486 1.1 christos (hsr32 48) (hsr33 49) (hsr34 50) (hsr35 51)
2487 1.1 christos (hsr36 52) (hsr37 53) (hsr38 54) (hsr39 55)
2488 1.1 christos (hsr40 56) (hsr41 57) (hsr42 58) (hsr43 59)
2489 1.1 christos (hsr44 60) (hsr45 61) (hsr46 62) (hsr47 63)
2490 1.1 christos (hsr48 64) (hsr49 65) (hsr50 66) (hsr51 67)
2491 1.1 christos (hsr52 68) (hsr53 69) (hsr54 70) (hsr55 71)
2492 1.1 christos (hsr56 72) (hsr57 73) (hsr58 74) (hsr59 75)
2493 1.1 christos (hsr60 76) (hsr61 77) (hsr62 78) (hsr63 79)
2494 1.1 christos
2495 1.1 christos (ccr 256) (cccr 263) (lr 272) (lcr 273) (iacc0h 280) (iacc0l 281) (isr 288)
2496 1.1 christos
2497 1.1 christos (neear0 352) (neear1 353) (neear2 354) (neear3 355)
2498 1.1 christos (neear4 356) (neear5 357) (neear6 358) (neear7 359)
2499 1.1 christos (neear8 360) (neear9 361) (neear10 362) (neear11 363)
2500 1.1 christos (neear12 364) (neear13 365) (neear14 366) (neear15 367)
2501 1.1 christos (neear16 368) (neear17 369) (neear18 370) (neear19 371)
2502 1.1 christos (neear20 372) (neear21 373) (neear22 374) (neear23 375)
2503 1.1 christos (neear24 376) (neear25 377) (neear26 378) (neear27 379)
2504 1.1 christos (neear28 380) (neear29 381) (neear30 382) (neear31 383)
2505 1.1 christos
2506 1.1 christos (nesr0 384) (nesr1 385) (nesr2 386) (nesr3 387)
2507 1.1 christos (nesr4 388) (nesr5 389) (nesr6 390) (nesr7 391)
2508 1.1 christos (nesr8 392) (nesr9 393) (nesr10 394) (nesr11 395)
2509 1.1 christos (nesr12 396) (nesr13 397) (nesr14 398) (nesr15 399)
2510 1.1 christos (nesr16 400) (nesr17 401) (nesr18 402) (nesr19 403)
2511 1.1 christos (nesr20 404) (nesr21 405) (nesr22 406) (nesr23 407)
2512 1.1 christos (nesr24 408) (nesr25 409) (nesr26 410) (nesr27 411)
2513 1.1 christos (nesr28 412) (nesr29 413) (nesr30 414) (nesr31 415)
2514 1.1 christos
2515 1.1 christos (necr 416)
2516 1.1 christos
2517 1.1 christos (gner0 432) (gner1 433)
2518 1.1 christos
2519 1.1 christos (fner0 434) (fner1 435)
2520 1.1 christos
2521 1.1 christos (epcr0 512) (epcr1 513) (epcr2 514) (epcr3 515)
2522 1.1 christos (epcr4 516) (epcr5 517) (epcr6 518) (epcr7 519)
2523 1.1 christos (epcr8 520) (epcr9 521) (epcr10 522) (epcr11 523)
2524 1.1 christos (epcr12 524) (epcr13 525) (epcr14 526) (epcr15 527)
2525 1.1 christos (epcr16 528) (epcr17 529) (epcr18 530) (epcr19 531)
2526 1.1 christos (epcr20 532) (epcr21 533) (epcr22 534) (epcr23 535)
2527 1.1 christos (epcr24 536) (epcr25 537) (epcr26 538) (epcr27 539)
2528 1.1 christos (epcr28 540) (epcr29 541) (epcr30 542) (epcr31 543)
2529 1.1 christos (epcr32 544) (epcr33 545) (epcr34 546) (epcr35 547)
2530 1.1 christos (epcr36 548) (epcr37 549) (epcr38 550) (epcr39 551)
2531 1.1 christos (epcr40 552) (epcr41 553) (epcr42 554) (epcr43 555)
2532 1.1 christos (epcr44 556) (epcr45 557) (epcr46 558) (epcr47 559)
2533 1.1 christos (epcr48 560) (epcr49 561) (epcr50 562) (epcr51 563)
2534 1.1 christos (epcr52 564) (epcr53 565) (epcr54 566) (epcr55 567)
2535 1.1 christos (epcr56 568) (epcr57 569) (epcr58 570) (epcr59 571)
2536 1.1 christos (epcr60 572) (epcr61 573) (epcr62 574) (epcr63 575)
2537 1.1 christos
2538 1.1 christos (esr0 576) (esr1 577) (esr2 578) (esr3 579)
2539 1.1 christos (esr4 580) (esr5 581) (esr6 582) (esr7 583)
2540 1.1 christos (esr8 584) (esr9 585) (esr10 586) (esr11 587)
2541 1.1 christos (esr12 588) (esr13 589) (esr14 590) (esr15 591)
2542 1.1 christos (esr16 592) (esr17 593) (esr18 594) (esr19 595)
2543 1.1 christos (esr20 596) (esr21 597) (esr22 598) (esr23 599)
2544 1.1 christos (esr24 600) (esr25 601) (esr26 602) (esr27 603)
2545 1.1 christos (esr28 604) (esr29 605) (esr30 606) (esr31 607)
2546 1.1 christos (esr32 608) (esr33 609) (esr34 610) (esr35 611)
2547 1.1 christos (esr36 612) (esr37 613) (esr38 614) (esr39 615)
2548 1.1 christos (esr40 616) (esr41 617) (esr42 618) (esr43 619)
2549 1.1 christos (esr44 620) (esr45 621) (esr46 622) (esr47 623)
2550 1.1 christos (esr48 624) (esr49 625) (esr50 626) (esr51 627)
2551 1.1 christos (esr52 628) (esr53 629) (esr54 630) (esr55 631)
2552 1.1 christos (esr56 632) (esr57 633) (esr58 634) (esr59 635)
2553 1.1 christos (esr60 636) (esr61 637) (esr62 638) (esr63 639)
2554 1.1 christos
2555 1.1 christos (eir0 640) (eir1 641) (eir2 642) (eir3 643)
2556 1.1 christos (eir4 644) (eir5 645) (eir6 646) (eir7 647)
2557 1.1 christos (eir8 648) (eir9 649) (eir10 650) (eir11 651)
2558 1.1 christos (eir12 652) (eir13 653) (eir14 654) (eir15 655)
2559 1.1 christos (eir16 656) (eir17 657) (eir18 658) (eir19 659)
2560 1.1 christos (eir20 660) (eir21 661) (eir22 662) (eir23 663)
2561 1.1 christos (eir24 664) (eir25 665) (eir26 666) (eir27 667)
2562 1.1 christos (eir28 668) (eir29 669) (eir30 670) (eir31 671)
2563 1.1 christos
2564 1.1 christos (esfr0 672) (esfr1 673)
2565 1.1 christos
2566 1.1 christos (sr0 768) (sr1 769) (sr2 770) (sr3 771)
2567 1.1 christos
2568 1.1 christos (scr0 832) (scr1 833) (scr2 834) (scr3 835)
2569 1.1 christos
2570 1.1 christos (fsr0 1024) (fsr1 1025) (fsr2 1026) (fsr3 1027)
2571 1.1 christos (fsr4 1028) (fsr5 1029) (fsr6 1030) (fsr7 1031)
2572 1.1 christos (fsr8 1032) (fsr9 1033) (fsr10 1034) (fsr11 1035)
2573 1.1 christos (fsr12 1036) (fsr13 1037) (fsr14 1038) (fsr15 1039)
2574 1.1 christos (fsr16 1040) (fsr17 1041) (fsr18 1042) (fsr19 1043)
2575 1.1 christos (fsr20 1044) (fsr21 1045) (fsr22 1046) (fsr23 1047)
2576 1.1 christos (fsr24 1048) (fsr25 1049) (fsr26 1050) (fsr27 1051)
2577 1.1 christos (fsr28 1052) (fsr29 1053) (fsr30 1054) (fsr31 1055)
2578 1.1 christos (fsr32 1056) (fsr33 1057) (fsr34 1058) (fsr35 1059)
2579 1.1 christos (fsr36 1060) (fsr37 1061) (fsr38 1062) (fsr39 1063)
2580 1.1 christos (fsr40 1064) (fsr41 1065) (fsr42 1066) (fsr43 1067)
2581 1.1 christos (fsr44 1068) (fsr45 1069) (fsr46 1070) (fsr47 1071)
2582 1.1 christos (fsr48 1072) (fsr49 1073) (fsr50 1074) (fsr51 1075)
2583 1.1 christos (fsr52 1076) (fsr53 1077) (fsr54 1078) (fsr55 1079)
2584 1.1 christos (fsr56 1080) (fsr57 1081) (fsr58 1082) (fsr59 1083)
2585 1.1 christos (fsr60 1084) (fsr61 1085) (fsr62 1086) (fsr63 1087)
2586 1.1 christos
2587 1.1 christos ; FQ0-FQ31 are 64 bit registers.
2588 1.1 christos ; These names allow access to the upper 32 bits of the FQ registers.
2589 1.1 christos (fqop0 1088) (fqop1 1090) (fqop2 1092) (fqop3 1094)
2590 1.1 christos (fqop4 1096) (fqop5 1098) (fqop6 1100) (fqop7 1102)
2591 1.1 christos (fqop8 1104) (fqop9 1106) (fqop10 1108) (fqop11 1110)
2592 1.1 christos (fqop12 1112) (fqop13 1114) (fqop14 1116) (fqop15 1118)
2593 1.1 christos (fqop16 1120) (fqop17 1122) (fqop18 1124) (fqop19 1126)
2594 1.1 christos (fqop20 1128) (fqop21 1130) (fqop22 1132) (fqop23 1134)
2595 1.1 christos (fqop24 1136) (fqop25 1138) (fqop26 1140) (fqop27 1142)
2596 1.1 christos (fqop28 1144) (fqop29 1146) (fqop30 1148) (fqop31 1150)
2597 1.1 christos ; These names allow access to the lower 32 bits of the FQ registers.
2598 1.1 christos (fqst0 1089) (fqst1 1091) (fqst2 1093) (fqst3 1095)
2599 1.1 christos (fqst4 1097) (fqst5 1099) (fqst6 1101) (fqst7 1103)
2600 1.1 christos (fqst8 1105) (fqst9 1107) (fqst10 1109) (fqst11 1111)
2601 1.1 christos (fqst12 1113) (fqst13 1115) (fqst14 1117) (fqst15 1119)
2602 1.1 christos (fqst16 1121) (fqst17 1123) (fqst18 1125) (fqst19 1127)
2603 1.1 christos (fqst20 1129) (fqst21 1131) (fqst22 1133) (fqst23 1135)
2604 1.1 christos (fqst24 1137) (fqst25 1139) (fqst26 1141) (fqst27 1143)
2605 1.1 christos (fqst28 1145) (fqst29 1147) (fqst30 1149) (fqst31 1151)
2606 1.1 christos ; These also access the lower 32 bits of the FQ registers.
2607 1.1 christos ; These are not accessible as spr registers (see LSI appendix - section 13.4)
2608 1.1 christos ; (fq0 1089) (fq1 1091) (fq2 1093) (fq3 1095)
2609 1.1 christos ; (fq4 1097) (fq5 1099) (fq6 1101) (fq7 1103)
2610 1.1 christos ; (fq8 1105) (fq9 1107) (fq10 1109) (fq11 1111)
2611 1.1 christos ; (fq12 1113) (fq13 1115) (fq14 1117) (fq15 1119)
2612 1.1 christos ; (fq16 1121) (fq17 1123) (fq18 1125) (fq19 1127)
2613 1.1 christos ; (fq20 1129) (fq21 1131) (fq22 1133) (fq23 1135)
2614 1.1 christos ; (fq24 1137) (fq25 1139) (fq26 1141) (fq27 1143)
2615 1.1 christos ; (fq28 1145) (fq29 1147) (fq30 1149) (fq31 1151)
2616 1.1 christos
2617 1.1 christos (mcilr0 1272) (mcilr1 1273)
2618 1.1 christos
2619 1.1 christos (msr0 1280) (msr1 1281) (msr2 1282) (msr3 1283)
2620 1.1 christos (msr4 1284) (msr5 1285) (msr6 1286) (msr7 1287)
2621 1.1 christos (msr8 1288) (msr9 1289) (msr10 1290) (msr11 1291)
2622 1.1 christos (msr12 1292) (msr13 1293) (msr14 1294) (msr15 1295)
2623 1.1 christos (msr16 1296) (msr17 1297) (msr18 1298) (msr19 1299)
2624 1.1 christos (msr20 1300) (msr21 1301) (msr22 1302) (msr23 1303)
2625 1.1 christos (msr24 1304) (msr25 1305) (msr26 1306) (msr27 1307)
2626 1.1 christos (msr28 1308) (msr29 1309) (msr30 1310) (msr31 1311)
2627 1.1 christos (msr32 1312) (msr33 1313) (msr34 1314) (msr35 1315)
2628 1.1 christos (msr36 1316) (msr37 1317) (msr38 1318) (msr39 1319)
2629 1.1 christos (msr40 1320) (msr41 1321) (msr42 1322) (msr43 1323)
2630 1.1 christos (msr44 1324) (msr45 1325) (msr46 1326) (msr47 1327)
2631 1.1 christos (msr48 1328) (msr49 1329) (msr50 1330) (msr51 1331)
2632 1.1 christos (msr52 1332) (msr53 1333) (msr54 1334) (msr55 1335)
2633 1.1 christos (msr56 1336) (msr57 1337) (msr58 1338) (msr59 1339)
2634 1.1 christos (msr60 1340) (msr61 1341) (msr62 1342) (msr63 1343)
2635 1.1 christos
2636 1.1 christos ; MQ0-MQ31 are 64 bit registers.
2637 1.1 christos ; These names allow access to the upper 32 bits of the MQ registers.
2638 1.1 christos (mqop0 1344) (mqop1 1346) (mqop2 1348) (mqop3 1350)
2639 1.1 christos (mqop4 1352) (mqop5 1354) (mqop6 1356) (mqop7 1358)
2640 1.1 christos (mqop8 1360) (mqop9 1362) (mqop10 1364) (mqop11 1366)
2641 1.1 christos (mqop12 1368) (mqop13 1370) (mqop14 1372) (mqop15 1374)
2642 1.1 christos (mqop16 1376) (mqop17 1378) (mqop18 1380) (mqop19 1382)
2643 1.1 christos (mqop20 1384) (mqop21 1386) (mqop22 1388) (mqop23 1390)
2644 1.1 christos (mqop24 1392) (mqop25 1394) (mqop26 1396) (mqop27 1398)
2645 1.1 christos (mqop28 1400) (mqop29 1402) (mqop30 1404) (mqop31 1406)
2646 1.1 christos ; These names allow access to the lower 32 bits of the MQ registers.
2647 1.1 christos (mqst0 1345) (mqst1 1347) (mqst2 1349) (mqst3 1351)
2648 1.1 christos (mqst4 1353) (mqst5 1355) (mqst6 1357) (mqst7 1359)
2649 1.1 christos (mqst8 1361) (mqst9 1363) (mqst10 1365) (mqst11 1367)
2650 1.1 christos (mqst12 1369) (mqst13 1371) (mqst14 1373) (mqst15 1375)
2651 1.1 christos (mqst16 1377) (mqst17 1379) (mqst18 1381) (mqst19 1383)
2652 1.1 christos (mqst20 1385) (mqst21 1387) (mqst22 1389) (mqst23 1391)
2653 1.1 christos (mqst24 1393) (mqst25 1395) (mqst26 1397) (mqst27 1399)
2654 1.1 christos (mqst28 1401) (mqst29 1403) (mqst30 1405) (mqst31 1407)
2655 1.1 christos ; These also access the lower 32 bits of the MQ registers.
2656 1.1 christos ; These are not accessible as spr registers (see LSI appendix - section 13.4)
2657 1.1 christos ; (mq0 1345) (mq1 1347) (mq2 1349) (mq3 1351)
2658 1.1 christos ; (mq4 1353) (mq5 1355) (mq6 1357) (mq7 1359)
2659 1.1 christos ; (mq8 1361) (mq9 1363) (mq10 1365) (mq11 1367)
2660 1.1 christos ; (mq12 1369) (mq13 1371) (mq14 1373) (mq15 1375)
2661 1.1 christos ; (mq16 1377) (mq17 1379) (mq18 1381) (mq19 1383)
2662 1.1 christos ; (mq20 1385) (mq21 1387) (mq22 1389) (mq23 1391)
2663 1.1 christos ; (mq24 1393) (mq25 1395) (mq26 1397) (mq27 1399)
2664 1.1 christos ; (mq28 1401) (mq29 1403) (mq30 1405) (mq31 1407)
2665 1.1 christos
2666 1.1 christos ; These are not accessible as spr registers (see LSI appendix - section 13.4)
2667 1.1 christos ; (acc0 1408) (acc1 1409) (acc2 1410) (acc3 1411)
2668 1.1 christos ; (acc4 1412) (acc5 1413) (acc6 1414) (acc7 1415)
2669 1.1 christos ; (acc8 1416) (acc9 1417) (acc10 1418) (acc11 1419)
2670 1.1 christos ; (acc12 1420) (acc13 1421) (acc14 1422) (acc15 1423)
2671 1.1 christos ; (acc16 1424) (acc17 1425) (acc18 1426) (acc19 1427)
2672 1.1 christos ; (acc20 1428) (acc21 1429) (acc22 1430) (acc23 1431)
2673 1.1 christos ; (acc24 1432) (acc25 1433) (acc26 1434) (acc27 1435)
2674 1.1 christos ; (acc28 1436) (acc29 1437) (acc30 1438) (acc31 1439)
2675 1.1 christos ; (acc32 1440) (acc33 1441) (acc34 1442) (acc35 1443)
2676 1.1 christos ; (acc36 1444) (acc37 1445) (acc38 1446) (acc39 1447)
2677 1.1 christos ; (acc40 1448) (acc41 1449) (acc42 1450) (acc43 1451)
2678 1.1 christos ; (acc44 1452) (acc45 1453) (acc46 1454) (acc47 1455)
2679 1.1 christos ; (acc48 1456) (acc49 1457) (acc50 1458) (acc51 1459)
2680 1.1 christos ; (acc52 1460) (acc53 1461) (acc54 1462) (acc55 1463)
2681 1.1 christos ; (acc56 1464) (acc57 1465) (acc58 1466) (acc59 1467)
2682 1.1 christos ; (acc60 1468) (acc61 1469) (acc62 1470) (acc63 1471)
2683 1.1 christos
2684 1.1 christos ; (accg0 1472) (accg1 1473) (accg2 1474) (accg3 1475)
2685 1.1 christos ; (accg4 1476) (accg5 1477) (accg6 1478) (accg7 1479)
2686 1.1 christos ; (accg8 1480) (accg9 1481) (accg10 1482) (accg11 1483)
2687 1.1 christos ; (accg12 1484) (accg13 1485) (accg14 1486) (accg15 1487)
2688 1.1 christos ; (accg16 1488) (accg17 1489) (accg18 1490) (accg19 1491)
2689 1.1 christos ; (accg20 1492) (accg21 1493) (accg22 1494) (accg23 1495)
2690 1.1 christos ; (accg24 1496) (accg25 1497) (accg26 1498) (accg27 1499)
2691 1.1 christos ; (accg28 1500) (accg29 1501) (accg30 1502) (accg31 1503)
2692 1.1 christos ; (accg32 1504) (accg33 1505) (accg34 1506) (accg35 1507)
2693 1.1 christos ; (accg36 1508) (accg37 1509) (accg38 1510) (accg39 1511)
2694 1.1 christos ; (accg40 1512) (accg41 1513) (accg42 1514) (accg43 1515)
2695 1.1 christos ; (accg44 1516) (accg45 1517) (accg46 1518) (accg47 1519)
2696 1.1 christos ; (accg48 1520) (accg49 1521) (accg50 1522) (accg51 1523)
2697 1.1 christos ; (accg52 1524) (accg53 1525) (accg54 1526) (accg55 1527)
2698 1.1 christos ; (accg56 1528) (accg57 1529) (accg58 1530) (accg59 1531)
2699 1.1 christos ; (accg60 1532) (accg61 1533) (accg62 1534) (accg63 1535)
2700 1.1 christos
2701 1.1 christos (ear0 1536) (ear1 1537) (ear2 1538) (ear3 1539)
2702 1.1 christos (ear4 1540) (ear5 1541) (ear6 1542) (ear7 1543)
2703 1.1 christos (ear8 1544) (ear9 1545) (ear10 1546) (ear11 1547)
2704 1.1 christos (ear12 1548) (ear13 1549) (ear14 1550) (ear15 1551)
2705 1.1 christos (ear16 1552) (ear17 1553) (ear18 1554) (ear19 1555)
2706 1.1 christos (ear20 1556) (ear21 1557) (ear22 1558) (ear23 1559)
2707 1.1 christos (ear24 1560) (ear25 1561) (ear26 1562) (ear27 1563)
2708 1.1 christos (ear28 1564) (ear29 1565) (ear30 1566) (ear31 1567)
2709 1.1 christos (ear32 1568) (ear33 1569) (ear34 1570) (ear35 1571)
2710 1.1 christos (ear36 1572) (ear37 1573) (ear38 1574) (ear39 1575)
2711 1.1 christos (ear40 1576) (ear41 1577) (ear42 1578) (ear43 1579)
2712 1.1 christos (ear44 1580) (ear45 1581) (ear46 1582) (ear47 1583)
2713 1.1 christos (ear48 1584) (ear49 1585) (ear50 1586) (ear51 1587)
2714 1.1 christos (ear52 1588) (ear53 1589) (ear54 1590) (ear55 1591)
2715 1.1 christos (ear56 1592) (ear57 1593) (ear58 1594) (ear59 1595)
2716 1.1 christos (ear60 1596) (ear61 1597) (ear62 1598) (ear63 1599)
2717 1.1 christos
2718 1.1 christos (edr0 1600) (edr1 1601) (edr2 1602) (edr3 1603)
2719 1.1 christos (edr4 1604) (edr5 1605) (edr6 1606) (edr7 1607)
2720 1.1 christos (edr8 1608) (edr9 1609) (edr10 1610) (edr11 1611)
2721 1.1 christos (edr12 1612) (edr13 1613) (edr14 1614) (edr15 1615)
2722 1.1 christos (edr16 1616) (edr17 1617) (edr18 1618) (edr19 1619)
2723 1.1 christos (edr20 1620) (edr21 1621) (edr22 1622) (edr23 1623)
2724 1.1 christos (edr24 1624) (edr25 1625) (edr26 1626) (edr27 1627)
2725 1.1 christos (edr28 1628) (edr29 1629) (edr30 1630) (edr31 1631)
2726 1.1 christos (edr32 1632) (edr33 1636) (edr34 1634) (edr35 1635)
2727 1.1 christos (edr36 1636) (edr37 1637) (edr38 1638) (edr39 1639)
2728 1.1 christos (edr40 1640) (edr41 1641) (edr42 1642) (edr43 1643)
2729 1.1 christos (edr44 1644) (edr45 1645) (edr46 1646) (edr47 1647)
2730 1.1 christos (edr48 1648) (edr49 1649) (edr50 1650) (edr51 1651)
2731 1.1 christos (edr52 1652) (edr53 1653) (edr54 1654) (edr55 1655)
2732 1.1 christos (edr56 1656) (edr57 1657) (edr58 1658) (edr59 1659)
2733 1.1 christos (edr60 1660) (edr61 1661) (edr62 1662) (edr63 1663)
2734 1.1 christos
2735 1.1 christos (iamlr0 1664) (iamlr1 1665) (iamlr2 1666) (iamlr3 1667)
2736 1.1 christos (iamlr4 1668) (iamlr5 1669) (iamlr6 1670) (iamlr7 1671)
2737 1.1 christos (iamlr8 1672) (iamlr9 1673) (iamlr10 1674) (iamlr11 1675)
2738 1.1 christos (iamlr12 1676) (iamlr13 1677) (iamlr14 1678) (iamlr15 1679)
2739 1.1 christos (iamlr16 1680) (iamlr17 1681) (iamlr18 1682) (iamlr19 1683)
2740 1.1 christos (iamlr20 1684) (iamlr21 1685) (iamlr22 1686) (iamlr23 1687)
2741 1.1 christos (iamlr24 1688) (iamlr25 1689) (iamlr26 1690) (iamlr27 1691)
2742 1.1 christos (iamlr28 1692) (iamlr29 1693) (iamlr30 1694) (iamlr31 1695)
2743 1.1 christos (iamlr32 1696) (iamlr33 1697) (iamlr34 1698) (iamlr35 1699)
2744 1.1 christos (iamlr36 1700) (iamlr37 1701) (iamlr38 1702) (iamlr39 1703)
2745 1.1 christos (iamlr40 1704) (iamlr41 1705) (iamlr42 1706) (iamlr43 1707)
2746 1.1 christos (iamlr44 1708) (iamlr45 1709) (iamlr46 1710) (iamlr47 1711)
2747 1.1 christos (iamlr48 1712) (iamlr49 1713) (iamlr50 1714) (iamlr51 1715)
2748 1.1 christos (iamlr52 1716) (iamlr53 1717) (iamlr54 1718) (iamlr55 1719)
2749 1.1 christos (iamlr56 1720) (iamlr57 1721) (iamlr58 1722) (iamlr59 1723)
2750 1.1 christos (iamlr60 1724) (iamlr61 1725) (iamlr62 1726) (iamlr63 1727)
2751 1.1 christos
2752 1.1 christos (iampr0 1728) (iampr1 1729) (iampr2 1730) (iampr3 1731)
2753 1.1 christos (iampr4 1732) (iampr5 1733) (iampr6 1734) (iampr7 1735)
2754 1.1 christos (iampr8 1736) (iampr9 1737) (iampr10 1738) (iampr11 1739)
2755 1.1 christos (iampr12 1740) (iampr13 1741) (iampr14 1742) (iampr15 1743)
2756 1.1 christos (iampr16 1744) (iampr17 1745) (iampr18 1746) (iampr19 1747)
2757 1.1 christos (iampr20 1748) (iampr21 1749) (iampr22 1750) (iampr23 1751)
2758 1.1 christos (iampr24 1752) (iampr25 1753) (iampr26 1754) (iampr27 1755)
2759 1.1 christos (iampr28 1756) (iampr29 1757) (iampr30 1758) (iampr31 1759)
2760 1.1 christos (iampr32 1760) (iampr33 1761) (iampr34 1762) (iampr35 1763)
2761 1.1 christos (iampr36 1764) (iampr37 1765) (iampr38 1766) (iampr39 1767)
2762 1.1 christos (iampr40 1768) (iampr41 1769) (iampr42 1770) (iampr43 1771)
2763 1.1 christos (iampr44 1772) (iampr45 1773) (iampr46 1774) (iampr47 1775)
2764 1.1 christos (iampr48 1776) (iampr49 1777) (iampr50 1778) (iampr51 1779)
2765 1.1 christos (iampr52 1780) (iampr53 1781) (iampr54 1782) (iampr55 1783)
2766 1.1 christos (iampr56 1784) (iampr57 1785) (iampr58 1786) (iampr59 1787)
2767 1.1 christos (iampr60 1788) (iampr61 1789) (iampr62 1790) (iampr63 1791)
2768 1.1 christos
2769 1.1 christos (damlr0 1792) (damlr1 1793) (damlr2 1794) (damlr3 1795)
2770 1.1 christos (damlr4 1796) (damlr5 1797) (damlr6 1798) (damlr7 1799)
2771 1.1 christos (damlr8 1800) (damlr9 1801) (damlr10 1802) (damlr11 1803)
2772 1.1 christos (damlr12 1804) (damlr13 1805) (damlr14 1806) (damlr15 1807)
2773 1.1 christos (damlr16 1808) (damlr17 1809) (damlr18 1810) (damlr19 1811)
2774 1.1 christos (damlr20 1812) (damlr21 1813) (damlr22 1814) (damlr23 1815)
2775 1.1 christos (damlr24 1816) (damlr25 1817) (damlr26 1818) (damlr27 1819)
2776 1.1 christos (damlr28 1820) (damlr29 1821) (damlr30 1822) (damlr31 1823)
2777 1.1 christos (damlr32 1824) (damlr33 1825) (damlr34 1826) (damlr35 1827)
2778 1.1 christos (damlr36 1828) (damlr37 1829) (damlr38 1830) (damlr39 1831)
2779 1.1 christos (damlr40 1832) (damlr41 1833) (damlr42 1834) (damlr43 1835)
2780 1.1 christos (damlr44 1836) (damlr45 1837) (damlr46 1838) (damlr47 1839)
2781 1.1 christos (damlr48 1840) (damlr49 1841) (damlr50 1842) (damlr51 1843)
2782 1.1 christos (damlr52 1844) (damlr53 1845) (damlr54 1846) (damlr55 1847)
2783 1.1 christos (damlr56 1848) (damlr57 1849) (damlr58 1850) (damlr59 1851)
2784 1.1 christos (damlr60 1852) (damlr61 1853) (damlr62 1854) (damlr63 1855)
2785 1.1 christos
2786 1.1 christos (dampr0 1856) (dampr1 1857) (dampr2 1858) (dampr3 1859)
2787 1.1 christos (dampr4 1860) (dampr5 1861) (dampr6 1862) (dampr7 1863)
2788 1.1 christos (dampr8 1864) (dampr9 1865) (dampr10 1866) (dampr11 1867)
2789 1.1 christos (dampr12 1868) (dampr13 1869) (dampr14 1870) (dampr15 1871)
2790 1.1 christos (dampr16 1872) (dampr17 1873) (dampr18 1874) (dampr19 1875)
2791 1.1 christos (dampr20 1876) (dampr21 1877) (dampr22 1878) (dampr23 1879)
2792 1.1 christos (dampr24 1880) (dampr25 1881) (dampr26 1882) (dampr27 1883)
2793 1.1 christos (dampr28 1884) (dampr29 1885) (dampr30 1886) (dampr31 1887)
2794 1.1 christos (dampr32 1888) (dampr33 1889) (dampr34 1890) (dampr35 1891)
2795 1.1 christos (dampr36 1892) (dampr37 1893) (dampr38 1894) (dampr39 1895)
2796 1.1 christos (dampr40 1896) (dampr41 1897) (dampr42 1898) (dampr43 1899)
2797 1.1 christos (dampr44 1900) (dampr45 1901) (dampr46 1902) (dampr47 1903)
2798 1.1 christos (dampr48 1904) (dampr49 1905) (dampr50 1906) (dampr51 1907)
2799 1.1 christos (dampr52 1908) (dampr53 1909) (dampr54 1910) (dampr55 1911)
2800 1.1 christos (dampr56 1912) (dampr57 1913) (dampr58 1914) (dampr59 1915)
2801 1.1 christos (dampr60 1916) (dampr61 1917) (dampr62 1918) (dampr63 1919)
2802 1.1 christos
2803 1.1 christos (amcr 1920) (stbar 1921) (mmcr 1922)
2804 1.1 christos (iamvr1 1925) (damvr1 1927)
2805 1.1 christos (cxnr 1936) (ttbr 1937) (tplr 1938) (tppr 1939)
2806 1.1 christos (tpxr 1940)
2807 1.1 christos (timerh 1952) (timerl 1953) (timerd 1954)
2808 1.1 christos (dcr 2048) (brr 2049) (nmar 2050) (btbr 2051)
2809 1.1 christos
2810 1.1 christos (ibar0 2052) (ibar1 2053) (ibar2 2054) (ibar3 2055)
2811 1.1 christos (dbar0 2056) (dbar1 2057) (dbar2 2058) (dbar3 2059)
2812 1.1 christos
2813 1.1 christos (dbdr00 2060) (dbdr01 2061) (dbdr02 2062) (dbdr03 2063)
2814 1.1 christos (dbdr10 2064) (dbdr11 2065) (dbdr12 2066) (dbdr13 2067)
2815 1.1 christos (dbdr20 2068) (dbdr21 2069) (dbdr22 2070) (dbdr23 2071)
2816 1.1 christos (dbdr30 2072) (dbdr31 2073) (dbdr32 2074) (dbdr33 2075)
2817 1.1 christos
2818 1.1 christos (dbmr00 2076) (dbmr01 2077) (dbmr02 2078) (dbmr03 2079)
2819 1.1 christos (dbmr10 2080) (dbmr11 2081) (dbmr12 2082) (dbmr13 2083)
2820 1.1 christos (dbmr20 2084) (dbmr21 2085) (dbmr22 2086) (dbmr23 2087)
2821 1.1 christos (dbmr30 2088) (dbmr31 2089) (dbmr32 2090) (dbmr33 2091)
2822 1.1 christos
2823 1.1 christos (cpcfr 2304) (cpcr 2305) (cpsr 2306) (cptr 2307)
2824 1.1 christos (cphsr0 2308) (cphsr1 2309) (cpesr0 2320) (cpesr1 2321)
2825 1.1 christos (cpemr0 2322) (cpemr1 2323)
2826 1.1 christos
2827 1.1 christos (iperr0 2324) (iperr1 2325) (ipjsr 2326) (ipjrr 2327)
2828 1.1 christos (ipcsr0 2336) (ipcsr1 2337) (ipcwer0 2338) (ipcwer1 2339)
2829 1.1 christos (ipcwr 2340)
2830 1.1 christos
2831 1.1 christos (mbhsr 2352) (mbssr 2353) (mbrsr 2354) (mbsdr 2355)
2832 1.1 christos (mbrdr 2356) (mbsmr 2357) (mbstr0 2359) (mbstr1 2360)
2833 1.1 christos
2834 1.1 christos (slpr 2368) (sldr 2369) (slhsr 2370) (sltr 2371)
2835 1.1 christos (slwr 2372)
2836 1.1 christos
2837 1.1 christos (ihsr8 3848) (ihsr9 3849) (ihsr10 3850)
2838 1.1 christos )
2839 1.1 christos )
2840 1.1 christos
2841 1.1 christos (define-hardware
2842 1.1 christos (name h-spr)
2843 1.1 christos (comment "special purpose registers")
2844 1.1 christos (attrs PROFILE)
2845 1.1 christos (type register UWI (4096))
2846 1.1 christos (indices extern-keyword spr-names)
2847 1.1 christos (get (index) (c-call UWI "@cpu@_h_spr_get_handler" index))
2848 1.1 christos (set (index newval) (c-call VOID "@cpu@_h_spr_set_handler" index newval))
2849 1.1 christos )
2850 1.1 christos
2851 1.1 christos (define-pmacro (spr-pcsr) (reg h-spr 1))
2852 1.1 christos (define-pmacro (spr-bpcsr) (reg h-spr 2))
2853 1.1 christos (define-pmacro (spr-lr) (reg h-spr 272))
2854 1.1 christos (define-pmacro (spr-lcr) (reg h-spr 273))
2855 1.1 christos (define-pmacro (spr-iacc0h) (reg h-spr 280))
2856 1.1 christos (define-pmacro (spr-iacc0l) (reg h-spr 281))
2857 1.1 christos (define-pmacro (spr-sr0) (reg h-spr 768))
2858 1.1 christos (define-pmacro (spr-sr1) (reg h-spr 769))
2859 1.1 christos (define-pmacro (spr-sr2) (reg h-spr 770))
2860 1.1 christos (define-pmacro (spr-sr3) (reg h-spr 771))
2861 1.1 christos
2862 1.1 christos ; Accumulator guard. Actually a subset of the SPR registers, but those SPRs
2863 1.1 christos ; are read-only in most insns. This hardware element is used by those insns
2864 1.1 christos ; which have direct access (mwtaccg, mrdaccg).
2865 1.1 christos (define-keyword
2866 1.1 christos (name accg-names)
2867 1.1 christos (print-name h-accg)
2868 1.1 christos (prefix "")
2869 1.1 christos (values
2870 1.1 christos (accg0 0)(accg1 1)(accg2 2)(accg3 3)
2871 1.1 christos (accg4 4)(accg5 5)(accg6 6)(accg7 7)
2872 1.1 christos (accg8 8)(accg9 9)(accg10 10)(accg11 11)
2873 1.1 christos (accg12 12)(accg13 13)(accg14 14)(accg15 15)
2874 1.1 christos (accg16 16)(accg17 17)(accg18 18)(accg19 19)
2875 1.1 christos (accg20 20)(accg21 21)(accg22 22)(accg23 23)
2876 1.1 christos (accg24 24)(accg25 25)(accg26 26)(accg27 27)
2877 1.1 christos (accg28 28)(accg29 29)(accg30 30)(accg31 31)
2878 1.1 christos (accg32 32)(accg33 33)(accg34 34)(accg35 35)
2879 1.1 christos (accg36 36)(accg37 37)(accg38 38)(accg39 39)
2880 1.1 christos (accg40 40)(accg41 41)(accg42 42)(accg43 43)
2881 1.1 christos (accg44 44)(accg45 45)(accg46 46)(accg47 47)
2882 1.1 christos (accg48 48)(accg49 49)(accg50 50)(accg51 51)
2883 1.1 christos (accg52 52)(accg53 53)(accg54 54)(accg55 55)
2884 1.1 christos (accg56 56)(accg57 57)(accg58 58)(accg59 59)
2885 1.1 christos (accg60 60)(accg61 61)(accg62 62)(accg63 63)
2886 1.1 christos )
2887 1.1 christos )
2888 1.1 christos
2889 1.1 christos (define-hardware
2890 1.1 christos (name h-accg)
2891 1.1 christos (comment "accumulator guard")
2892 1.1 christos (attrs PROFILE VIRTUAL)
2893 1.1 christos (type register UWI (64))
2894 1.1 christos (indices extern-keyword accg-names)
2895 1.1 christos (get (index)
2896 1.1 christos (and (reg h-spr (add index 1472)) #xff))
2897 1.1 christos (set (index newval)
2898 1.1 christos (set (raw-reg UWI h-spr (add index 1472)) (and newval #xff)))
2899 1.1 christos )
2900 1.1 christos
2901 1.1 christos ; 40 bit accumulator. Composed of ACCG and ACC registers concatenated, but
2902 1.1 christos ; referenced more often as the composed 40 bits.
2903 1.1 christos (define-keyword
2904 1.1 christos (name acc-names)
2905 1.1 christos (print-name h-acc40)
2906 1.1 christos (prefix "")
2907 1.1 christos (values
2908 1.1 christos (acc0 0)(acc1 1)(acc2 2)(acc3 3)(acc4 4)(acc5 5)(acc6 6)(acc7 7)
2909 1.1 christos (acc8 8)(acc9 9)(acc10 10)(acc11 11)(acc12 12)(acc13 13)(acc14 14)(acc15 15)
2910 1.1 christos (acc16 16)(acc17 17)(acc18 18)(acc19 19)(acc20 20)(acc21 21)(acc22 22)(acc23 23)
2911 1.1 christos (acc24 24)(acc25 25)(acc26 26)(acc27 27)(acc28 28)(acc29 29)(acc30 30)(acc31 31)
2912 1.1 christos (acc32 32)(acc33 33)(acc34 34)(acc35 35)(acc36 36)(acc37 37)(acc38 38)(acc39 39)
2913 1.1 christos (acc40 40)(acc41 41)(acc42 42)(acc43 43)(acc44 44)(acc45 45)(acc46 46)(acc47 47)
2914 1.1 christos (acc48 48)(acc49 49)(acc50 50)(acc51 51)(acc52 52)(acc53 53)(acc54 54)(acc55 55)
2915 1.1 christos (acc56 56)(acc57 57)(acc58 58)(acc59 59)(acc60 60)(acc61 61)(acc62 62)(acc63 63)
2916 1.1 christos )
2917 1.1 christos )
2918 1.1 christos
2919 1.1 christos (define-hardware
2920 1.1 christos (name h-acc40S)
2921 1.1 christos (comment "40 bit signed accumulator")
2922 1.1 christos (attrs PROFILE VIRTUAL)
2923 1.1 christos (type register DI (64))
2924 1.1 christos (indices extern-keyword acc-names)
2925 1.1 christos ; The accumlator is made up of two 32 bit registers, accgi/acci.
2926 1.1 christos ; We want to extract this as a combined 40 signed bits
2927 1.1 christos (get (index)
2928 1.1 christos (or DI
2929 1.1 christos (sll DI (ext DI (trunc QI (reg h-spr (add index 1472))))
2930 1.1 christos 32)
2931 1.1 christos (zext DI (reg h-spr (add index 1408)))))
2932 1.1 christos ; Bits 40-63 are not written. raw-reg is used to bypass read-only restrictions
2933 1.1 christos ; on ACC and ACCG registers
2934 1.1 christos (set (index newval)
2935 1.1 christos (sequence ()
2936 1.1 christos (c-call VOID "frv_check_spr_write_access" (add index 1408))
2937 1.1 christos (set (raw-reg UWI h-spr
2938 1.1 christos (add index 1472)) (and (srl newval 32) #xff))
2939 1.1 christos (set (raw-reg UWI h-spr
2940 1.1 christos (add index 1408)) (trunc USI newval))))
2941 1.1 christos )
2942 1.1 christos
2943 1.1 christos (define-hardware
2944 1.1 christos (name h-acc40U)
2945 1.1 christos (comment "40 bit unsigned accumulator")
2946 1.1 christos (attrs PROFILE VIRTUAL)
2947 1.1 christos (type register UDI (64))
2948 1.1 christos (indices extern-keyword acc-names)
2949 1.1 christos ; The accumlator is made up of two 32 bit registers, accgi/acci.
2950 1.1 christos ; We want to extract this as a combined 40 unsigned bits
2951 1.1 christos (get (index)
2952 1.1 christos (or DI
2953 1.1 christos (sll DI (zext DI (reg h-spr (add index 1472))) 32)
2954 1.1 christos (zext DI (reg h-spr (add index 1408)))))
2955 1.1 christos ; Bits 40-63 are not written. raw-reg is used to bypass read-only restrictions
2956 1.1 christos ; on ACC and ACCG registers
2957 1.1 christos (set (index newval)
2958 1.1 christos (sequence ()
2959 1.1 christos (c-call VOID "frv_check_spr_write_access" (add index 1408))
2960 1.1 christos (set (raw-reg UWI h-spr
2961 1.1 christos (add index 1472)) (and (srl newval 32) #xff))
2962 1.1 christos (set (raw-reg UWI h-spr
2963 1.1 christos (add index 1408)) (trunc USI newval))))
2964 1.1 christos )
2965 1.1 christos ; 64-bit signed accumulator. Composed of iacc0h and iacc0l registers
2966 1.1 christos ; concatenated, but referenced more often as the composed 64 bits.
2967 1.1 christos (define-keyword
2968 1.1 christos ; This is totally hokey -- I have to have an index!
2969 1.1 christos (name iacc0-names)
2970 1.1 christos (print-name h-iacc0)
2971 1.1 christos (prefix "")
2972 1.1 christos (values (iacc0 0))
2973 1.1 christos )
2974 1.1 christos
2975 1.1 christos (define-hardware
2976 1.1 christos (name h-iacc0)
2977 1.1 christos (comment "64 bit signed accumulator")
2978 1.1 christos (attrs PROFILE VIRTUAL (MACH fr400,fr450))
2979 1.1 christos (type register DI (1))
2980 1.1 christos (indices extern-keyword iacc0-names)
2981 1.1 christos ; The single 64-bit integer accumulator is made up of two 32 bit
2982 1.1 christos ; registers, iacc0h and iacc0l. We want to extract this as a
2983 1.1 christos ; combined 64 signed bits.
2984 1.1 christos (get (idx) (or DI (sll DI (ext DI (spr-iacc0h)) 32) (zext DI (spr-iacc0l))))
2985 1.1 christos (set (idx newval)
2986 1.1 christos (sequence ()
2987 1.1 christos (set (spr-iacc0h) (trunc SI (srl newval 32)))
2988 1.1 christos (set (spr-iacc0l) (trunc SI newval))))
2989 1.1 christos )
2990 1.1 christos
2991 1.1 christos ; Integer condition code registers (CCR)
2992 1.1 christos ;
2993 1.1 christos ; The individual sub registers bits of the CCR are referenced more often than
2994 1.1 christos ; the entire register so set them directly. We can assemble the
2995 1.1 christos ; entire register when necessary.
2996 1.1 christos ;
2997 1.1 christos (define-keyword
2998 1.1 christos (name iccr-names)
2999 1.1 christos (print-name h-iccr)
3000 1.1 christos (prefix "")
3001 1.1 christos (values (icc0 0) (icc1 1) (icc2 2) (icc3 3))
3002 1.1 christos )
3003 1.1 christos
3004 1.1 christos (define-hardware
3005 1.1 christos (name h-iccr)
3006 1.1 christos (comment "Integer condition code registers")
3007 1.1 christos (attrs PROFILE)
3008 1.1 christos (type register UQI (4))
3009 1.1 christos (indices extern-keyword iccr-names)
3010 1.1 christos )
3011 1.1 christos
3012 1.1 christos ; Floating point condition code registers (CCR)
3013 1.1 christos ;
3014 1.1 christos ; The individual sub registers bits of the CCR are referenced more often than
3015 1.1 christos ; the entire register so set them directly. We can assemble the
3016 1.1 christos ; entire register when necessary.
3017 1.1 christos ;
3018 1.1 christos (define-keyword
3019 1.1 christos (name fccr-names)
3020 1.1 christos (print-name h-fccr)
3021 1.1 christos (prefix "")
3022 1.1 christos (values (fcc0 0) (fcc1 1) (fcc2 2) (fcc3 3))
3023 1.1 christos )
3024 1.1 christos
3025 1.1 christos (define-hardware
3026 1.1 christos (name h-fccr)
3027 1.1 christos (comment "Floating point condition code registers")
3028 1.1 christos (attrs PROFILE)
3029 1.1 christos (type register UQI (4))
3030 1.1 christos (indices extern-keyword fccr-names)
3031 1.1 christos )
3032 1.1 christos
3033 1.1 christos ; C condition code registers (CCCR)
3034 1.1 christos ;
3035 1.1 christos (define-keyword
3036 1.1 christos (name cccr-names)
3037 1.1 christos (print-name h-cccr)
3038 1.1 christos (prefix "")
3039 1.1 christos (values (cc0 0) (cc1 1) (cc2 2) (cc3 3) (cc4 4) (cc5 5) (cc6 6) (cc7 7))
3040 1.1 christos )
3041 1.1 christos
3042 1.1 christos (define-hardware
3043 1.1 christos (name h-cccr)
3044 1.1 christos (comment "Condition code registers")
3045 1.1 christos (attrs PROFILE)
3046 1.1 christos (type register UQI (8))
3047 1.1 christos (indices extern-keyword cccr-names)
3048 1.1 christos )
3049 1.1 christos
3051 1.1 christos ; Dummy hardware used to define packing bit on insns
3052 1.1 christos ;
3053 1.1 christos (define-hardware
3054 1.1 christos (name h-pack)
3055 1.1 christos (comment "Packing bit dummy hardware")
3056 1.1 christos (type immediate (UINT 1))
3057 1.1 christos (values keyword "" (("" 1) (".p" 0) (".P" 0)))
3058 1.1 christos )
3059 1.1 christos ; Dummy hardware used to define hint field for branches always taken
3060 1.1 christos ;
3061 1.1 christos (define-hardware
3062 1.1 christos (name h-hint-taken)
3063 1.1 christos (comment "Branch taken hint dummy hardware")
3064 1.1 christos (type immediate (UINT 1))
3065 1.1 christos ; The order of these is important. We want '2' to get written by default,
3066 1.1 christos ; but we also want the docoder/disassembler to allow the values '0', '1' and
3067 1.1 christos ; '3'.
3068 1.1 christos (values keyword "" (("" 2) ("" 0) ("" 1) ("" 3)))
3069 1.1 christos )
3070 1.1 christos ; Dummy hardware used to define hint field for branches never taken
3071 1.1 christos ;
3072 1.1 christos (define-hardware
3073 1.1 christos (name h-hint-not-taken)
3074 1.1 christos (comment "Branch not taken hint dummy hardware")
3075 1.1 christos (type immediate (UINT 1))
3076 1.1 christos ; The order of these is important. We want '0' to get written by default,
3077 1.1 christos ; but we also want the docoder/disassembler to allow the values '1', '2' and
3078 1.1 christos ; '3'.
3079 1.1 christos (values keyword "" (("" 0) ("" 1) ("" 2) ("" 3)))
3080 1.1 christos )
3081 1.1 christos
3083 1.1 christos ; Instruction Operands.
3084 1.1 christos ; These entries provide a layer between the assembler and the raw hardware
3085 1.1 christos ; description, and are used to refer to hardware elements in the semantic
3086 1.1 christos ; code. Usually there's a bit of over-specification, but in more complicated
3087 1.1 christos ; instruction sets there isn't.
3088 1.1 christos
3089 1.1 christos ; FRV specific operand attributes:
3090 1.1 christos
3091 1.1 christos (define-attr
3092 1.1 christos (for operand)
3093 1.1 christos (type boolean)
3094 1.1 christos (name HASH-PREFIX)
3095 1.1 christos (comment "immediates have an optional '#' prefix")
3096 1.1 christos )
3097 1.1 christos
3098 1.1 christos ; ??? Convention says this should be o-sr, but then the insn definitions
3099 1.1 christos ; should refer to o-sr which is clumsy. The "o-" could be implicit, but
3100 1.1 christos ; then it should be implicit for all the symbols here, but then there would
3101 1.1 christos ; be confusion between (f-)simm8 and (h-)simm8.
3102 1.1 christos ; So for now the rule is exactly as it appears here.
3103 1.1 christos
3104 1.1 christos ; dnmop: define-normal-mode-operand: temporary, pending potential removal
3105 1.1 christos ; of modes from h/w.
3106 1.1 christos (define-pmacro (dnmop xname xcomment xattrs xtype xindex xmode)
3107 1.1 christos (define-operand
3108 1.1 christos (name xname)
3109 1.1 christos (comment xcomment)
3110 1.1 christos (.splice attrs (.unsplice xattrs))
3111 1.1 christos (type xtype)
3112 1.1 christos (index xindex)
3113 1.1 christos (mode xmode)
3114 1.1 christos )
3115 1.1 christos )
3116 1.1 christos
3117 1.1 christos ; dnpmop: define-normal-parsed-mode-operand: Normal mode operand with parse handler
3118 1.1 christos (define-pmacro (dnpmop xname xcomment xattrs xtype xindex xmode xparse)
3119 1.1 christos (define-operand
3120 1.1 christos (name xname)
3121 1.1 christos (comment xcomment)
3122 1.1 christos (.splice attrs (.unsplice xattrs))
3123 1.1 christos (type xtype)
3124 1.1 christos (index xindex)
3125 1.1 christos (mode xmode)
3126 1.1 christos (handlers (parse xparse))
3127 1.1 christos )
3128 1.1 christos )
3129 1.1 christos
3130 1.1 christos (dnop pack "packing bit" () h-pack f-pack)
3131 1.1 christos
3132 1.1 christos (dnmop GRi "source register 1" () h-gr f-GRi SI)
3133 1.1 christos (dnmop GRj "source register 2" () h-gr f-GRj SI)
3134 1.1 christos (dnmop GRk "destination register" () h-gr f-GRk SI)
3135 1.1 christos (dnmop GRkhi "destination register" () h-gr_hi f-GRk UHI)
3136 1.1 christos (dnmop GRklo "destination register" () h-gr_lo f-GRk UHI)
3137 1.1 christos (dnpmop GRdoublek "destination register" () h-gr_double f-GRk DI "even_register")
3138 1.1 christos (dnmop ACC40Si "signed accumulator" () h-acc40S f-ACC40Si DI)
3139 1.1 christos (dnmop ACC40Ui "unsigned accumulator" () h-acc40U f-ACC40Ui UDI)
3140 1.1 christos (dnmop ACC40Sk "target accumulator" () h-acc40S f-ACC40Sk DI)
3141 1.1 christos (dnmop ACC40Uk "target accumulator" () h-acc40U f-ACC40Uk UDI)
3142 1.1 christos (dnmop ACCGi "source register" () h-accg f-ACCGi UWI)
3143 1.1 christos (dnmop ACCGk "target register" () h-accg f-ACCGk UWI)
3144 1.1 christos
3145 1.1 christos (dnmop CPRi "source register" ((MACH frv)) h-cpr f-CPRi SI)
3146 1.1 christos (dnmop CPRj "source register" ((MACH frv)) h-cpr f-CPRj SI)
3147 1.1 christos (dnmop CPRk "destination register" ((MACH frv)) h-cpr f-CPRk SI)
3148 1.1 christos (dnpmop CPRdoublek "destination register" ((MACH frv)) h-cpr_double f-CPRk DI "even_register")
3149 1.1 christos
3150 1.1 christos ; floating point operands
3151 1.1 christos (dnmop FRinti "source register 1" () h-fr_int f-FRi SI)
3152 1.1 christos (dnmop FRintj "source register 2" () h-fr_int f-FRj SI)
3153 1.1 christos (dnmop FRintk "target register" () h-fr_int f-FRk SI)
3154 1.1 christos (dnmop FRi "source register 1" () h-fr f-FRi SF)
3155 1.1 christos (dnmop FRj "source register 2" () h-fr f-FRj SF)
3156 1.1 christos (dnmop FRk "destination register" () h-fr f-FRk SF)
3157 1.1 christos (dnmop FRkhi "destination register" () h-fr_hi f-FRk UHI)
3158 1.1 christos (dnmop FRklo "destination register" () h-fr_lo f-FRk UHI)
3159 1.1 christos (dnpmop FRdoublei "source register 1" () h-fr_double f-FRi DF "even_register")
3160 1.1 christos (dnpmop FRdoublej "source register 2" () h-fr_double f-FRj DF "even_register")
3161 1.1 christos (dnpmop FRdoublek "target register" () h-fr_double f-FRk DF "even_register")
3162 1.1 christos
3163 1.1 christos (dnop CRi "source register 1" () h-cccr f-CRi)
3164 1.1 christos (dnop CRj "source register 2" () h-cccr f-CRj)
3165 1.1 christos (dnop CRj_int "destination register" () h-cccr f-CRj_int)
3166 1.1 christos (dnop CRj_float "destination register" () h-cccr f-CRj_float)
3167 1.1 christos (dnop CRk "destination register" () h-cccr f-CRk)
3168 1.1 christos (dnop CCi "condition register" () h-cccr f-CCi)
3169 1.1 christos
3170 1.1 christos (dnop ICCi_1 "condition register" () h-iccr f-ICCi_1)
3171 1.1 christos (dnop ICCi_2 "condition register" () h-iccr f-ICCi_2)
3172 1.1 christos (dnop ICCi_3 "condition register" () h-iccr f-ICCi_3)
3173 1.1 christos (dnop FCCi_1 "condition register" () h-fccr f-FCCi_1)
3174 1.1 christos (dnop FCCi_2 "condition register" () h-fccr f-FCCi_2)
3175 1.1 christos (dnop FCCi_3 "condition register" () h-fccr f-FCCi_3)
3176 1.1 christos (dnop FCCk "condition register" () h-fccr f-FCCk)
3177 1.1 christos
3178 1.1 christos (dnop eir "exception insn reg" () h-uint f-eir)
3179 1.1 christos (dnop s10 "10 bit signed immediate" (HASH-PREFIX) h-sint f-s10)
3180 1.1 christos (dnop u16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-u16)
3181 1.1 christos (dnop s16 "16 bit signed immediate" (HASH-PREFIX) h-sint f-s16)
3182 1.1 christos (dnop s6 "6 bit signed immediate" (HASH-PREFIX) h-sint f-s6)
3183 1.1 christos (dnop s6_1 "6 bit signed immediate" (HASH-PREFIX) h-sint f-s6_1)
3184 1.1 christos (dnop u6 "6 bit unsigned immediate" (HASH-PREFIX) h-uint f-u6)
3185 1.1 christos (dnop s5 "5 bit signed immediate" (HASH-PREFIX) h-sint f-s5)
3186 1.1 christos (dnop cond "conditional arithmetic" (HASH-PREFIX) h-uint f-cond)
3187 1.1 christos (dnop ccond "lr branch condition" (HASH-PREFIX) h-uint f-ccond)
3188 1.1 christos (dnop hint "2 bit branch predictor" (HASH-PREFIX) h-uint f-hint)
3189 1.1 christos (dnop hint_taken "2 bit branch predictor" () h-hint-taken f-hint)
3190 1.1 christos (dnop hint_not_taken "2 bit branch predictor" () h-hint-not-taken f-hint)
3191 1.1 christos
3192 1.1 christos (dnop LI "link indicator" () h-uint f-LI)
3193 1.1 christos (dnop lock "cache lock indicator" (HASH-PREFIX) h-uint f-lock)
3194 1.1 christos (dnop debug "debug mode indicator" (HASH-PREFIX) h-uint f-debug)
3195 1.1 christos (dnop ae "all entries indicator" (HASH-PREFIX) h-uint f-ae)
3196 1.1 christos
3197 1.1 christos (dnop label16 "18 bit pc relative address" () h-iaddr f-label16)
3198 1.1 christos
3199 1.1 christos (dnop LRAE "Load Real Address E flag" () h-uint f-LRAE)
3200 1.1 christos (dnop LRAD "Load Real Address D flag" () h-uint f-LRAD)
3201 1.1 christos (dnop LRAS "Load Real Address S flag" () h-uint f-LRAS)
3202 1.1 christos
3203 1.1 christos (dnop TLBPRopx "TLB Probe operation number" () h-uint f-TLBPRopx)
3204 1.1 christos (dnop TLBPRL "TLB Probe L flag" () h-uint f-TLBPRL)
3205 1.1 christos
3206 1.1 christos (define-operand
3207 1.1 christos (name A0)
3208 1.1 christos (comment "A==0 operand of mclracc")
3209 1.1 christos (attrs)
3210 1.1 christos (type h-uint)
3211 1.1 christos (index f-A)
3212 1.1 christos (mode USI)
3213 1.1 christos (handlers (parse "A0"))
3214 1.1 christos )
3215 1.1 christos
3216 1.1 christos (define-operand
3217 1.1 christos (name A1)
3218 1.1 christos (comment "A==1 operand of mclracc")
3219 1.1 christos (attrs)
3220 1.1 christos (type h-uint)
3221 1.1 christos (index f-A)
3222 1.1 christos (mode USI)
3223 1.1 christos (handlers (parse "A1"))
3224 1.1 christos )
3225 1.1 christos
3226 1.1 christos (define-operand
3227 1.1 christos (name FRintieven)
3228 1.1 christos (comment "(even) source register 1")
3229 1.1 christos (attrs)
3230 1.1 christos (type h-fr_int)
3231 1.1 christos (index f-FRi)
3232 1.1 christos (mode SI)
3233 1.1 christos (handlers (parse "even_register"))
3234 1.1 christos )
3235 1.1 christos
3236 1.1 christos (define-operand
3237 1.1 christos (name FRintjeven)
3238 1.1 christos (comment "(even) source register 2")
3239 1.1 christos (attrs)
3240 1.1 christos (type h-fr_int)
3241 1.1 christos (index f-FRj)
3242 1.1 christos (mode SI)
3243 1.1 christos (handlers (parse "even_register"))
3244 1.1 christos )
3245 1.1 christos
3246 1.1 christos (define-operand
3247 1.1 christos (name FRintkeven)
3248 1.1 christos (comment "(even) target register")
3249 1.1 christos (attrs)
3250 1.1 christos (type h-fr_int)
3251 1.1 christos (index f-FRk)
3252 1.1 christos (mode SI)
3253 1.1 christos (handlers (parse "even_register"))
3254 1.1 christos )
3255 1.1 christos
3256 1.1 christos (define-operand
3257 1.1 christos (name d12)
3258 1.1 christos (comment "12 bit signed immediate")
3259 1.1 christos (attrs)
3260 1.1 christos (type h-sint)
3261 1.1 christos (index f-d12)
3262 1.1 christos (handlers (parse "d12"))
3263 1.1 christos )
3264 1.1 christos
3265 1.1 christos (define-operand
3266 1.1 christos (name s12)
3267 1.1 christos (comment "12 bit signed immediate")
3268 1.1 christos (attrs HASH-PREFIX)
3269 1.1 christos (type h-sint)
3270 1.1 christos (index f-d12)
3271 1.1 christos (handlers (parse "s12"))
3272 1.1 christos )
3273 1.1 christos
3274 1.1 christos (define-operand
3275 1.1 christos (name u12)
3276 1.1 christos (comment "12 bit signed immediate")
3277 1.1 christos (attrs HASH-PREFIX)
3278 1.1 christos (type h-sint)
3279 1.1 christos (index f-u12)
3280 1.1 christos (handlers (parse "u12"))
3281 1.1 christos )
3282 1.1 christos
3283 1.1 christos (define-operand
3284 1.1 christos (name spr)
3285 1.1 christos (comment "special purpose register")
3286 1.1 christos (attrs)
3287 1.1 christos (type h-spr)
3288 1.1 christos (index f-spr)
3289 1.1 christos (handlers (parse "spr") (print "spr"))
3290 1.1 christos )
3291 1.1 christos
3292 1.1 christos (define-operand
3293 1.1 christos (name ulo16)
3294 1.1 christos (comment "16 bit unsigned immediate, for #lo()")
3295 1.1 christos (attrs)
3296 1.1 christos (type h-uint)
3297 1.1 christos (index f-u16)
3298 1.1 christos (handlers (parse "ulo16") (print "lo"))
3299 1.1 christos )
3300 1.1 christos
3301 1.1 christos (define-operand
3302 1.1 christos (name slo16)
3303 1.1 christos (comment "16 bit unsigned immediate, for #lo()")
3304 1.1 christos (attrs)
3305 1.1 christos (type h-sint)
3306 1.1 christos (index f-s16)
3307 1.1 christos (handlers (parse "uslo16") (print "lo"))
3308 1.1 christos )
3309 1.1 christos
3310 1.1 christos (define-operand
3311 1.1 christos (name uhi16)
3312 1.1 christos (comment "16 bit unsigned immediate, for #hi()")
3313 1.1 christos (attrs)
3314 1.1 christos (type h-uint)
3315 1.1 christos (index f-u16)
3316 1.1 christos (handlers (parse "uhi16") (print "hi"))
3317 1.1 christos )
3318 1.1 christos
3319 1.1 christos (define-operand
3320 1.1 christos (name label24)
3321 1.1 christos (comment "26 bit pc relative address")
3322 1.1 christos (attrs)
3323 1.1 christos (type h-iaddr)
3324 1.1 christos (index f-label24)
3325 1.1 christos (mode SI)
3326 1.1 christos (handlers (parse "call_label"))
3327 1.1 christos )
3328 1.1 christos
3329 1.1 christos ; operands representing hardware
3330 1.1 christos ;
3331 1.1 christos (dnop psr_esr "PSR.ESR bit" (SEM-ONLY) h-psr_esr f-nil)
3332 1.1 christos (dnop psr_s "PSR.S bit" (SEM-ONLY) h-psr_s f-nil)
3333 1.1 christos (dnop psr_ps "PSR.PS bit" (SEM-ONLY) h-psr_ps f-nil)
3334 1.1 christos (dnop psr_et "PSR.ET bit" (SEM-ONLY) h-psr_et f-nil)
3335 1.1 christos
3336 1.1 christos (dnop bpsr_bs "BPSR.BS bit" (SEM-ONLY) h-bpsr_bs f-nil)
3337 1.1 christos (dnop bpsr_bet "BPSR.BET bit" (SEM-ONLY) h-bpsr_bet f-nil)
3338 1.1 christos
3339 1.1 christos (dnop tbr_tba "TBR.TBA" (SEM-ONLY) h-tbr_tba f-nil)
3340 1.1 christos (dnop tbr_tt "TBR.TT" (SEM-ONLY) h-tbr_tt f-nil)
3341 1.1 christos
3342 1.1 christos ; Null operands
3343 1.1 christos ;
3344 1.1 christos (define-pmacro (ICCi_1-null) (f-ICCi_1-null 0))
3345 1.1 christos (define-pmacro (ICCi_2-null) (f-ICCi_2-null 0))
3346 1.1 christos (define-pmacro (ICCi_3-null) (f-ICCi_3-null 0))
3347 1.1 christos (define-pmacro (FCCi_1-null) (f-FCCi_1-null 0))
3348 1.1 christos (define-pmacro (FCCi_2-null) (f-FCCi_2-null 0))
3349 1.1 christos (define-pmacro (FCCi_3-null) (f-FCCi_3-null 0))
3350 1.1 christos (define-pmacro (rs-null) (f-rs-null 0))
3351 1.1 christos (define-pmacro (GRi-null) (f-GRi-null 0))
3352 1.1 christos (define-pmacro (GRj-null) (f-GRj-null 0))
3353 1.1 christos (define-pmacro (GRk-null) (f-GRk-null 0))
3354 1.1 christos (define-pmacro (FRi-null) (f-FRi-null 0))
3355 1.1 christos (define-pmacro (FRj-null) (f-FRj-null 0))
3356 1.1 christos (define-pmacro (ACCj-null) (f-ACCj-null 0))
3357 1.1 christos (define-pmacro (rd-null) (f-rd-null 0))
3358 1.1 christos (define-pmacro (cond-null) (f-cond-null 0))
3359 1.1 christos (define-pmacro (ccond-null) (f-ccond-null 0))
3360 1.1 christos (define-pmacro (s12-null) (f-s12-null 0))
3361 1.1 christos (define-pmacro (label16-null) (f-label16-null 0))
3362 1.1 christos (define-pmacro (misc-null-1) (f-misc-null-1 0))
3363 1.1 christos (define-pmacro (misc-null-2) (f-misc-null-2 0))
3364 1.1 christos (define-pmacro (misc-null-3) (f-misc-null-3 0))
3365 1.1 christos (define-pmacro (misc-null-4) (f-misc-null-4 0))
3366 1.1 christos (define-pmacro (misc-null-5) (f-misc-null-5 0))
3367 1.1 christos (define-pmacro (misc-null-6) (f-misc-null-6 0))
3368 1.1 christos (define-pmacro (misc-null-7) (f-misc-null-7 0))
3369 1.1 christos (define-pmacro (misc-null-8) (f-misc-null-8 0))
3370 1.1 christos (define-pmacro (misc-null-9) (f-misc-null-9 0))
3371 1.1 christos (define-pmacro (misc-null-10) (f-misc-null-10 0))
3372 1.1 christos (define-pmacro (misc-null-11) (f-misc-null-11 0))
3373 1.1 christos
3374 1.1 christos (define-pmacro (LRA-null) (f-LRA-null 0))
3375 1.1 christos (define-pmacro (TLBPR-null) (f-TLBPR-null 0))
3376 1.1 christos
3377 1.1 christos (define-pmacro (LI-on) (f-LI-on 1))
3378 1.1 christos (define-pmacro (LI-off) (f-LI-off 0))
3379 1.1 christos
3381 1.1 christos ; Instruction definitions.
3382 1.1 christos ;
3383 1.1 christos ; Notes:
3384 1.1 christos ; - dni is short for "define-normal-instruction"
3385 1.1 christos ; - Macros are used to represent each insn format. These should be used as much
3386 1.1 christos ; as possible unless an insn has exceptional behaviour
3387 1.1 christos ;
3388 1.1 christos
3389 1.1 christos ; Commonly used Macros
3390 1.1 christos ;
3391 1.1 christos ; Specific registers
3392 1.1 christos ;
3393 1.1 christos
3394 1.1 christos ; Integer condition code manipulation
3395 1.1 christos ;
3396 1.1 christos (define-pmacro (set-z-and-n icc x)
3397 1.1 christos (if (eq x 0)
3398 1.1 christos (set icc (or (and icc #x7) #x4))
3399 1.1 christos (if (lt x 0)
3400 1.1 christos (set icc (or (and icc #xb) #x8))
3401 1.1 christos (set icc (and icc #x3))))
3402 1.1 christos )
3403 1.1 christos
3404 1.1 christos (define-pmacro (set-n icc val)
3405 1.1 christos (if (eq val 0)
3406 1.1 christos (set icc (and icc #x7))
3407 1.1 christos (set icc (or icc #x8)))
3408 1.1 christos )
3409 1.1 christos
3410 1.1 christos (define-pmacro (set-z icc val)
3411 1.1 christos (if (eq val 0)
3412 1.1 christos (set icc (and icc #xb))
3413 1.1 christos (set icc (or icc #x4)))
3414 1.1 christos )
3415 1.1 christos
3416 1.1 christos (define-pmacro (set-v icc val)
3417 1.1 christos (if (eq val 0)
3418 1.1 christos (set icc (and icc #xd))
3419 1.1 christos (set icc (or icc #x2)))
3420 1.1 christos )
3421 1.1 christos
3422 1.1 christos (define-pmacro (set-c icc val)
3423 1.1 christos (if (eq val 0)
3424 1.1 christos (set icc (and icc #xe))
3425 1.1 christos (set icc (or icc #x1)))
3426 1.1 christos )
3427 1.1 christos
3428 1.1 christos (define-pmacro (nbit icc)
3429 1.1 christos (trunc BI (srl (and icc #x8) 3))
3430 1.1 christos )
3431 1.1 christos
3432 1.1 christos (define-pmacro (zbit icc)
3433 1.1 christos (trunc BI (srl (and icc #x4) 2))
3434 1.1 christos )
3435 1.1 christos
3436 1.1 christos (define-pmacro (vbit icc)
3437 1.1 christos (trunc BI (srl (and icc #x2) 1))
3438 1.1 christos )
3439 1.1 christos
3440 1.1 christos (define-pmacro (cbit icc)
3441 1.1 christos (trunc BI (and icc #x1))
3442 1.1 christos )
3443 1.1 christos
3444 1.1 christos (define-pmacro (ebit icc)
3445 1.1 christos (trunc BI (srl (and icc #x8) 3))
3446 1.1 christos )
3447 1.1 christos
3448 1.1 christos (define-pmacro (lbit icc)
3449 1.1 christos (trunc BI (srl (and icc #x4) 2))
3450 1.1 christos )
3451 1.1 christos
3452 1.1 christos (define-pmacro (gbit icc)
3453 1.1 christos (trunc BI (srl (and icc #x2) 1))
3454 1.1 christos )
3455 1.1 christos
3456 1.1 christos (define-pmacro (ubit icc)
3457 1.1 christos (trunc BI (and icc #x1))
3458 1.1 christos )
3459 1.1 christos
3460 1.1 christos ; FRV insns
3461 1.1 christos ;
3462 1.1 christos ;
3463 1.1 christos ; Format: INT, Logic, Shift r-r
3464 1.1 christos ;
3465 1.1 christos (define-pmacro (int-logic-r-r name operation op ope comment)
3466 1.1 christos (dni name
3467 1.1 christos (comment)
3468 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3469 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3470 1.1 christos (.str name "$pack $GRi,$GRj,$GRk")
3471 1.1 christos (+ pack GRk op GRi (ICCi_1-null) ope GRj)
3472 1.1 christos (set GRk (operation GRi GRj))
3473 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3474 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3475 1.1 christos )
3476 1.1 christos )
3477 1.1 christos
3478 1.1 christos (int-logic-r-r add add OP_00 OPE2_00 "add reg/reg")
3479 1.1 christos (int-logic-r-r sub sub OP_00 OPE2_04 "sub reg/reg")
3480 1.1 christos (int-logic-r-r and and OP_01 OPE2_00 "and reg/reg")
3481 1.1 christos (int-logic-r-r or or OP_01 OPE2_02 "or reg/reg")
3482 1.1 christos (int-logic-r-r xor xor OP_01 OPE2_04 "xor reg/reg")
3483 1.1 christos
3484 1.1 christos (dni not
3485 1.1 christos ("not")
3486 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3487 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3488 1.1 christos ("not$pack $GRj,$GRk")
3489 1.1 christos (+ pack GRk OP_01 (rs-null) (ICCi_1-null) OPE2_06 GRj)
3490 1.1 christos (set GRk (inv GRj))
3491 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3492 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3493 1.1 christos )
3494 1.1 christos
3495 1.1 christos (dni sdiv
3496 1.1 christos "signed division"
3497 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3498 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3499 1.1 christos "sdiv$pack $GRi,$GRj,$GRk"
3500 1.1 christos (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0E GRj)
3501 1.1 christos (sequence ()
3502 1.1 christos (c-call VOID "@cpu@_signed_integer_divide"
3503 1.1 christos GRi GRj (index-of GRk) 0)
3504 1.1 christos (clobber GRk))
3505 1.1 christos ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3506 1.1 christos (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3507 1.1 christos )
3508 1.1 christos
3509 1.1 christos (dni nsdiv
3510 1.1 christos "non excepting signed division"
3511 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
3512 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
3513 1.1 christos "nsdiv$pack $GRi,$GRj,$GRk"
3514 1.1 christos (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0E GRj)
3515 1.1 christos (sequence ()
3516 1.1 christos (c-call VOID "@cpu@_signed_integer_divide"
3517 1.1 christos GRi GRj (index-of GRk) 1)
3518 1.1 christos (clobber GRk))
3519 1.1 christos ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3520 1.1 christos )
3521 1.1 christos
3522 1.1 christos (dni udiv
3523 1.1 christos "unsigned division reg/reg"
3524 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3525 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3526 1.1 christos "udiv$pack $GRi,$GRj,$GRk"
3527 1.1 christos (+ pack GRk OP_00 GRi (ICCi_1-null) OPE2_0F GRj)
3528 1.1 christos (sequence ()
3529 1.1 christos (c-call VOID "@cpu@_unsigned_integer_divide"
3530 1.1 christos GRi GRj (index-of GRk) 0)
3531 1.1 christos (clobber GRk))
3532 1.1 christos ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3533 1.1 christos (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3534 1.1 christos )
3535 1.1 christos
3536 1.1 christos (dni nudiv
3537 1.1 christos "non excepting unsigned division"
3538 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
3539 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
3540 1.1 christos "nudiv$pack $GRi,$GRj,$GRk"
3541 1.1 christos (+ pack GRk OP_01 GRi (ICCi_1-null) OPE2_0F GRj)
3542 1.1 christos (sequence ()
3543 1.1 christos (c-call VOID "@cpu@_unsigned_integer_divide"
3544 1.1 christos GRi GRj (index-of GRk) 1)
3545 1.1 christos (clobber GRk))
3546 1.1 christos ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3547 1.1 christos )
3548 1.1 christos
3549 1.1 christos ; Multiplication
3550 1.1 christos ;
3551 1.1 christos (define-pmacro (multiply-r-r name signop op ope comment)
3552 1.1 christos (dni name
3553 1.1 christos (comment)
3554 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3555 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3556 1.1 christos (.str name "$pack $GRi,$GRj,$GRdoublek")
3557 1.1 christos (+ pack GRdoublek op GRi (ICCi_1-null) ope GRj)
3558 1.1 christos (set GRdoublek (mul DI (signop DI GRi) (signop DI GRj)))
3559 1.1 christos ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3560 1.1 christos (fr500 (unit u-imul)) (fr550 (unit u-imul)))
3561 1.1 christos )
3562 1.1 christos )
3563 1.1 christos
3564 1.1 christos (multiply-r-r smul ext OP_00 OPE2_08 "signed multiply reg/reg")
3565 1.1 christos (multiply-r-r umul zext OP_00 OPE2_0A "unsigned multiply reg/reg")
3566 1.1 christos
3567 1.1 christos ; Multiplication with integer accumulator IACC
3568 1.1 christos ;
3569 1.1 christos
3570 1.1 christos (define-pmacro (iacc-set value)
3571 1.1 christos (set (reg h-iacc0 0) value))
3572 1.1 christos
3573 1.1 christos (define-pmacro (iacc-add value)
3574 1.1 christos (set (reg h-iacc0 0)
3575 1.1 christos (cond DI
3576 1.1 christos ((andif (andif (gt value 0) (gt (reg h-iacc0 0) 0))
3577 1.1 christos (lt (sub DI #x7fffffffffffffff value) (reg h-iacc0 0)))
3578 1.1 christos ; Positive overflow
3579 1.1 christos (const DI #x7fffffffffffffff))
3580 1.1 christos ((andif (andif (lt value 0) (lt (reg h-iacc0 0) 0))
3581 1.1 christos (gt (sub DI #x8000000000000000 value) (reg h-iacc0 0)))
3582 1.1 christos ; Negative overflow
3583 1.1 christos (const DI #x8000000000000000))
3584 1.1 christos (else
3585 1.1 christos (add DI (reg h-iacc0 0) value))))
3586 1.1 christos )
3587 1.1 christos
3588 1.1 christos (define-pmacro (iacc-sub value)
3589 1.1 christos (set (reg h-iacc0 0)
3590 1.1 christos (cond DI
3591 1.1 christos ((andif (andif (lt value 0) (gt (reg h-iacc0 0) 0))
3592 1.1 christos (lt (add DI #x7fffffffffffffff value) (reg h-iacc0 0)))
3593 1.1 christos ; Positive overflow
3594 1.1 christos (const DI #x7fffffffffffffff))
3595 1.1 christos ((andif (andif (gt value 0) (lt (reg h-iacc0 0) 0))
3596 1.1 christos (gt (add DI #x8000000000000000 value) (reg h-iacc0 0)))
3597 1.1 christos ; Negative overflow
3598 1.1 christos (const DI #x8000000000000000))
3599 1.1 christos (else
3600 1.1 christos (sub DI (reg h-iacc0 0) value))))
3601 1.1 christos )
3602 1.1 christos
3603 1.1 christos (define-pmacro (iacc-multiply-r-r name operation op ope comment)
3604 1.1 christos (dni name
3605 1.1 christos (comment)
3606 1.1 christos ((UNIT IACC) (MACH fr400,fr450)
3607 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
3608 1.1 christos (.str name "$pack $GRi,$GRj")
3609 1.1 christos (+ pack (rd-null) op GRi ope GRj)
3610 1.1 christos ((.sym iacc- operation) (mul DI (ext DI GRi) (ext DI GRj)))
3611 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer)))
3612 1.1 christos )
3613 1.1 christos )
3614 1.1 christos
3615 1.1 christos (iacc-multiply-r-r smu set OP_46 OPE1_05 "Signed multiply reg/reg/iacc")
3616 1.1 christos (iacc-multiply-r-r smass add OP_46 OPE1_06 "Signed multiply/add reg/reg/iacc")
3617 1.1 christos (iacc-multiply-r-r smsss sub OP_46 OPE1_07 "Signed multiply/sub reg/reg/iacc")
3618 1.1 christos
3619 1.1 christos (define-pmacro (int-shift-r-r name op ope comment)
3620 1.1 christos (dni name
3621 1.1 christos (comment)
3622 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3623 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3624 1.1 christos (.str name "$pack $GRi,$GRj,$GRk")
3625 1.1 christos (+ pack GRk op GRi (ICCi_1-null) ope GRj)
3626 1.1 christos (set GRk (name GRi (and GRj #x1f)))
3627 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3628 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3629 1.1 christos )
3630 1.1 christos )
3631 1.1 christos
3632 1.1 christos (int-shift-r-r sll OP_01 OPE2_08 "shift left logical reg/reg")
3633 1.1 christos (int-shift-r-r srl OP_01 OPE2_0A "shift right logical reg/reg")
3634 1.1 christos (int-shift-r-r sra OP_01 OPE2_0C "shift right arith reg/reg")
3635 1.1 christos
3636 1.1 christos (dni slass
3637 1.1 christos "shift left arith reg/reg with saturation"
3638 1.1 christos ((UNIT IALL) (MACH fr400,fr450)
3639 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
3640 1.1 christos "slass$pack $GRi,$GRj,$GRk"
3641 1.1 christos (+ pack GRk OP_46 GRi OPE1_02 GRj)
3642 1.1 christos (set GRk (c-call SI "@cpu@_shift_left_arith_saturate" GRi GRj))
3643 1.1 christos ()
3644 1.1 christos )
3645 1.1 christos
3646 1.1 christos (dni scutss
3647 1.1 christos "Integer accumulator cut with saturation"
3648 1.1 christos ((UNIT I0) (MACH fr400,fr450)
3649 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
3650 1.1 christos "scutss$pack $GRj,$GRk"
3651 1.1 christos (+ pack GRk OP_46 (rs-null) OPE1_04 GRj)
3652 1.1 christos (set GRk (c-call SI "@cpu@_iacc_cut" (reg h-iacc0 0) GRj))
3653 1.1 christos ()
3654 1.1 christos )
3655 1.1 christos
3656 1.1 christos (define-pmacro (scan-semantics arg1 arg2 targ)
3657 1.1 christos (sequence ((WI tmp1) (WI tmp2))
3658 1.1 christos (set tmp1 arg1)
3659 1.1 christos (set tmp2 (sra arg2 1))
3660 1.1 christos (set targ (c-call WI "@cpu@_scan_result" (xor tmp1 tmp2))))
3661 1.1 christos )
3662 1.1 christos
3663 1.1 christos (dni scan
3664 1.1 christos "scan"
3665 1.1 christos ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3666 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3667 1.1 christos "scan$pack $GRi,$GRj,$GRk"
3668 1.1 christos (+ pack GRk OP_0B GRi (ICCi_1-null) OPE2_00 GRj)
3669 1.1 christos (scan-semantics GRi GRj GRk)
3670 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3671 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3672 1.1 christos )
3673 1.1 christos
3674 1.1 christos ; Format: conditional INT, Logic, Shift r-r
3675 1.1 christos ;
3676 1.1 christos (define-pmacro (conditional-int-logic name operation op ope comment)
3677 1.1 christos (dni name
3678 1.1 christos (comment)
3679 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3680 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3681 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
3682 1.1 christos (+ pack GRk op GRi CCi cond ope GRj)
3683 1.1 christos (if (eq CCi (or cond 2))
3684 1.1 christos (set GRk (operation GRi GRj)))
3685 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3686 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3687 1.1 christos )
3688 1.1 christos )
3689 1.1 christos
3690 1.1 christos (conditional-int-logic cadd add OP_58 OPE4_0 "conditional add")
3691 1.1 christos (conditional-int-logic csub sub OP_58 OPE4_1 "conditional sub")
3692 1.1 christos (conditional-int-logic cand and OP_5A OPE4_0 "conditional and")
3693 1.1 christos (conditional-int-logic cor or OP_5A OPE4_1 "conditional or")
3694 1.1 christos (conditional-int-logic cxor xor OP_5A OPE4_2 "conditional xor")
3695 1.1 christos
3696 1.1 christos (dni cnot
3697 1.1 christos "conditional not"
3698 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3699 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3700 1.1 christos "cnot$pack $GRj,$GRk,$CCi,$cond"
3701 1.1 christos (+ pack GRk OP_5A (rs-null) CCi cond OPE4_3 GRj)
3702 1.1 christos (if (eq CCi (or cond 2))
3703 1.1 christos (set GRk (inv GRj)))
3704 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3705 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3706 1.1 christos )
3707 1.1 christos
3708 1.1 christos (dni csmul
3709 1.1 christos "conditional signed multiply"
3710 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3711 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3712 1.1 christos "csmul$pack $GRi,$GRj,$GRdoublek,$CCi,$cond"
3713 1.1 christos (+ pack GRdoublek OP_58 GRi CCi cond OPE4_2 GRj)
3714 1.1 christos (if (eq CCi (or cond 2))
3715 1.1 christos (set GRdoublek (mul DI (ext DI GRi) (ext DI GRj))))
3716 1.1 christos ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3717 1.1 christos (fr500 (unit u-imul)) (fr550 (unit u-imul)))
3718 1.1 christos )
3719 1.1 christos
3720 1.1 christos (dni csdiv
3721 1.1 christos "conditional signed division"
3722 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3723 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3724 1.1 christos "csdiv$pack $GRi,$GRj,$GRk,$CCi,$cond"
3725 1.1 christos (+ pack GRk OP_58 GRi CCi cond OPE4_3 GRj)
3726 1.1 christos (if (eq CCi (or cond 2))
3727 1.1 christos (sequence ()
3728 1.1 christos (c-call VOID "@cpu@_signed_integer_divide"
3729 1.1 christos GRi GRj (index-of GRk) 0)
3730 1.1 christos (clobber GRk)))
3731 1.1 christos ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3732 1.1 christos (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3733 1.1 christos )
3734 1.1 christos
3735 1.1 christos (dni cudiv
3736 1.1 christos "conditional unsigned division"
3737 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3738 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3739 1.1 christos "cudiv$pack $GRi,$GRj,$GRk,$CCi,$cond"
3740 1.1 christos (+ pack GRk OP_59 GRi CCi cond OPE4_3 GRj)
3741 1.1 christos (if (eq CCi (or cond 2))
3742 1.1 christos (sequence ()
3743 1.1 christos (c-call VOID "@cpu@_unsigned_integer_divide"
3744 1.1 christos GRi GRj (index-of GRk) 0)
3745 1.1 christos (clobber GRk)))
3746 1.1 christos ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
3747 1.1 christos (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
3748 1.1 christos )
3749 1.1 christos
3750 1.1 christos (define-pmacro (conditional-shift name operation op ope comment)
3751 1.1 christos (dni name
3752 1.1 christos (comment)
3753 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3754 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3755 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
3756 1.1 christos (+ pack GRk op GRi CCi cond ope GRj)
3757 1.1 christos (if (eq CCi (or cond 2))
3758 1.1 christos (set GRk (operation GRi (and GRj #x1f))))
3759 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3760 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3761 1.1 christos )
3762 1.1 christos )
3763 1.1 christos
3764 1.1 christos (conditional-shift csll sll OP_5C OPE4_0 "conditional shift left logical")
3765 1.1 christos (conditional-shift csrl srl OP_5C OPE4_1 "conditional shift right logical")
3766 1.1 christos (conditional-shift csra sra OP_5C OPE4_2 "conditional shift right arith")
3767 1.1 christos
3768 1.1 christos (dni cscan
3769 1.1 christos "conditional scan"
3770 1.1 christos ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3771 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3772 1.1 christos "cscan$pack $GRi,$GRj,$GRk,$CCi,$cond"
3773 1.1 christos (+ pack GRk OP_65 GRi CCi cond OPE4_3 GRj)
3774 1.1 christos (if (eq CCi (or cond 2))
3775 1.1 christos (scan-semantics GRi GRj GRk))
3776 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3777 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3778 1.1 christos )
3779 1.1 christos
3780 1.1 christos ; Format: INT, Logic, Shift, cc r-r
3781 1.1 christos ;
3782 1.1 christos (define-pmacro (int-arith-cc-semantics operation icc)
3783 1.1 christos (sequence ((BI tmp) (QI cc) (SI result))
3784 1.1 christos (set cc icc)
3785 1.1 christos (set tmp ((.sym operation -oflag) GRi GRj (const 0)))
3786 1.1 christos (set-v cc tmp)
3787 1.1 christos (set tmp ((.sym operation -cflag) GRi GRj (const 0)))
3788 1.1 christos (set-c cc tmp)
3789 1.1 christos (set result (operation GRi GRj))
3790 1.1 christos (set-z-and-n cc result)
3791 1.1 christos (set GRk result)
3792 1.1 christos (set icc cc))
3793 1.1 christos )
3794 1.1 christos
3795 1.1 christos (define-pmacro (int-arith-cc-r-r name operation op ope comment)
3796 1.1 christos (dni name
3797 1.1 christos (comment)
3798 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3799 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3800 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
3801 1.1 christos (+ pack GRk op GRi ICCi_1 ope GRj)
3802 1.1 christos (int-arith-cc-semantics operation ICCi_1)
3803 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3804 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3805 1.1 christos )
3806 1.1 christos )
3807 1.1 christos
3808 1.1 christos (int-arith-cc-r-r addcc add OP_00 OPE2_01 "add reg/reg, set icc")
3809 1.1 christos (int-arith-cc-r-r subcc sub OP_00 OPE2_05 "sub reg/reg, set icc")
3810 1.1 christos
3811 1.1 christos (define-pmacro (int-logic-cc-semantics op icc)
3812 1.1 christos (sequence ((SI tmp))
3813 1.1 christos (set tmp (op GRi GRj))
3814 1.1 christos (set GRk tmp)
3815 1.1 christos (set-z-and-n icc tmp))
3816 1.1 christos )
3817 1.1 christos
3818 1.1 christos (define-pmacro (int-logic-cc-r-r name op ope comment)
3819 1.1 christos (dni (.sym name cc)
3820 1.1 christos (comment)
3821 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3822 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3823 1.1 christos (.str (.sym name cc) "$pack $GRi,$GRj,$GRk,$ICCi_1")
3824 1.1 christos (+ pack GRk op GRi ICCi_1 ope GRj)
3825 1.1 christos (int-logic-cc-semantics name ICCi_1)
3826 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3827 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3828 1.1 christos )
3829 1.1 christos )
3830 1.1 christos
3831 1.1 christos (int-logic-cc-r-r and OP_01 OPE2_01 "and reg/reg, set icc")
3832 1.1 christos (int-logic-cc-r-r or OP_01 OPE2_03 "or reg/reg, set icc")
3833 1.1 christos (int-logic-cc-r-r xor OP_01 OPE2_05 "xor reg/reg, set icc")
3834 1.1 christos
3835 1.1 christos (define-pmacro (int-shift-cc-semantics op l-r icc)
3836 1.1 christos (sequence ((WI shift) (SI tmp) (QI cc))
3837 1.1 christos (set shift (and GRj #x1f))
3838 1.1 christos (set cc (c-call QI (.str "@cpu@_set_icc_for_shift_" l-r)
3839 1.1 christos GRi shift icc))
3840 1.1 christos (set tmp (op GRi shift))
3841 1.1 christos (set GRk tmp)
3842 1.1 christos (set-z-and-n cc tmp)
3843 1.1 christos (set icc cc))
3844 1.1 christos )
3845 1.1 christos
3846 1.1 christos (define-pmacro (int-shift-cc-r-r name l-r op ope comment)
3847 1.1 christos (dni (.sym name cc)
3848 1.1 christos (comment)
3849 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3850 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3851 1.1 christos (.str (.sym name cc) "$pack $GRi,$GRj,$GRk,$ICCi_1")
3852 1.1 christos (+ pack GRk op GRi ICCi_1 ope GRj)
3853 1.1 christos (int-shift-cc-semantics name l-r ICCi_1)
3854 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3855 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3856 1.1 christos )
3857 1.1 christos )
3858 1.1 christos
3859 1.1 christos (int-shift-cc-r-r sll left OP_01 OPE2_09 "shift left logical reg/reg,set icc")
3860 1.1 christos (int-shift-cc-r-r srl right OP_01 OPE2_0B "shift right logical reg/reg,set icc")
3861 1.1 christos (int-shift-cc-r-r sra right OP_01 OPE2_0D "shift right arith reg/reg,set icc")
3862 1.1 christos
3863 1.1 christos (define-pmacro (multiply-cc-semantics signop arg1 arg2 targ icc)
3864 1.1 christos (sequence ((DI tmp) (QI cc))
3865 1.1 christos (set cc icc)
3866 1.1 christos (set tmp (mul DI (signop DI arg1) (signop DI arg2)))
3867 1.1 christos (set-n cc (srl DI tmp 63))
3868 1.1 christos (set-z cc (eq tmp 0))
3869 1.1 christos (set targ tmp)
3870 1.1 christos (set icc cc))
3871 1.1 christos )
3872 1.1 christos
3873 1.1 christos (define-pmacro (multiply-cc-r-r name signop op ope comment)
3874 1.1 christos (dni name
3875 1.1 christos (comment)
3876 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3877 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3878 1.1 christos (.str name "$pack $GRi,$GRj,$GRdoublek,$ICCi_1")
3879 1.1 christos (+ pack GRdoublek op GRi ICCi_1 ope GRj)
3880 1.1 christos (multiply-cc-semantics signop GRi GRj GRdoublek ICCi_1)
3881 1.1 christos ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3882 1.1 christos (fr500 (unit u-imul)) (fr550 (unit u-imul)))
3883 1.1 christos )
3884 1.1 christos )
3885 1.1 christos
3886 1.1 christos (multiply-cc-r-r smulcc ext OP_00 OPE2_09 "signed multiply reg/reg")
3887 1.1 christos (multiply-cc-r-r umulcc zext OP_00 OPE2_0B "unsigned multiply reg/reg")
3888 1.1 christos
3889 1.1 christos
3890 1.1 christos ; Format: conditional INT, Logic, Shift, cc r-r
3891 1.1 christos ;
3892 1.1 christos (define-pmacro (conditional-int-arith-cc name operation op ope comment)
3893 1.1 christos (dni name
3894 1.1 christos (comment)
3895 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3896 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3897 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
3898 1.1 christos (+ pack GRk op GRi CCi cond ope GRj)
3899 1.1 christos (if (eq CCi (or cond 2))
3900 1.1 christos (int-arith-cc-semantics operation
3901 1.1 christos (reg h-iccr (and (index-of CCi) 3))))
3902 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3903 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3904 1.1 christos )
3905 1.1 christos )
3906 1.1 christos
3907 1.1 christos (conditional-int-arith-cc caddcc add OP_59 OPE4_0 "add, set icc")
3908 1.1 christos (conditional-int-arith-cc csubcc sub OP_59 OPE4_1 "sub, set icc")
3909 1.1 christos
3910 1.1 christos (dni csmulcc
3911 1.1 christos "conditional signed multiply and set condition code"
3912 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
3913 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3914 1.1 christos "csmulcc$pack $GRi,$GRj,$GRdoublek,$CCi,$cond"
3915 1.1 christos (+ pack GRdoublek OP_59 GRi CCi cond OPE4_2 GRj)
3916 1.1 christos (if (eq CCi (or cond 2))
3917 1.1 christos (multiply-cc-semantics ext GRi GRj GRdoublek
3918 1.1 christos (reg h-iccr (and (index-of CCi) 3))))
3919 1.1 christos ((fr400 (unit u-imul)) (fr450 (unit u-imul))
3920 1.1 christos (fr500 (unit u-imul)) (fr550 (unit u-imul)))
3921 1.1 christos )
3922 1.1 christos
3923 1.1 christos (define-pmacro (conditional-int-logic-cc name operation op ope comment)
3924 1.1 christos (dni name
3925 1.1 christos (comment)
3926 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3927 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3928 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$CCi,$cond")
3929 1.1 christos (+ pack GRk op GRi CCi cond ope GRj)
3930 1.1 christos (if (eq CCi (or cond 2))
3931 1.1 christos (int-logic-cc-semantics operation
3932 1.1 christos (reg h-iccr (and (index-of CCi) 3))))
3933 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3934 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3935 1.1 christos )
3936 1.1 christos )
3937 1.1 christos
3938 1.1 christos (conditional-int-logic-cc candcc and OP_5B OPE4_0 "conditional and, set icc")
3939 1.1 christos (conditional-int-logic-cc corcc or OP_5B OPE4_1 "conditional or , set icc")
3940 1.1 christos (conditional-int-logic-cc cxorcc xor OP_5B OPE4_2 "conditional xor, set icc")
3941 1.1 christos
3942 1.1 christos (define-pmacro (conditional-int-shift-cc name l-r op ope comment)
3943 1.1 christos (dni (.sym c name cc)
3944 1.1 christos (comment)
3945 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3946 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
3947 1.1 christos (.str (.sym c name cc) "$pack $GRi,$GRj,$GRk,$CCi,$cond")
3948 1.1 christos (+ pack GRk op GRi CCi cond ope GRj)
3949 1.1 christos (if (eq CCi (or cond 2))
3950 1.1 christos (int-shift-cc-semantics name l-r
3951 1.1 christos (reg h-iccr (and (index-of CCi) 3))))
3952 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3953 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3954 1.1 christos )
3955 1.1 christos )
3956 1.1 christos
3957 1.1 christos (conditional-int-shift-cc sll left OP_5D OPE4_0 "shift left logical, set icc")
3958 1.1 christos (conditional-int-shift-cc srl right OP_5D OPE4_1 "shift right logical, set icc")
3959 1.1 christos (conditional-int-shift-cc sra right OP_5D OPE4_2 "shift right arith , set icc")
3960 1.1 christos
3961 1.1 christos ; Add and subtract with carry
3962 1.1 christos ;
3963 1.1 christos (define-pmacro (int-arith-x-r-r name operation op ope comment)
3964 1.1 christos (dni name
3965 1.1 christos (comment)
3966 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3967 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3968 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
3969 1.1 christos (+ pack GRk op GRi ICCi_1 ope GRj)
3970 1.1 christos (set GRk ((.sym operation c) GRi GRj (cbit ICCi_1)))
3971 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3972 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3973 1.1 christos )
3974 1.1 christos )
3975 1.1 christos
3976 1.1 christos (int-arith-x-r-r addx add OP_00 OPE2_02 "Add reg/reg, with carry")
3977 1.1 christos (int-arith-x-r-r subx sub OP_00 OPE2_06 "Sub reg/reg, with carry")
3978 1.1 christos
3979 1.1 christos (define-pmacro (int-arith-x-cc-r-r name operation op ope comment)
3980 1.1 christos (dni name
3981 1.1 christos (comment)
3982 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
3983 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
3984 1.1 christos (.str name "$pack $GRi,$GRj,$GRk,$ICCi_1")
3985 1.1 christos (+ pack GRk op GRi ICCi_1 ope GRj)
3986 1.1 christos (sequence ((WI tmp) (QI cc))
3987 1.1 christos (set cc ICCi_1)
3988 1.1 christos (set tmp ((.sym operation c) GRi GRj (cbit cc)))
3989 1.1 christos (set-v cc ((.sym operation -oflag) GRi GRj (cbit cc)))
3990 1.1 christos (set-c cc ((.sym operation -cflag) GRi GRj (cbit cc)))
3991 1.1 christos (set-z-and-n cc tmp)
3992 1.1 christos (set GRk tmp)
3993 1.1 christos (set ICCi_1 cc))
3994 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
3995 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
3996 1.1 christos )
3997 1.1 christos )
3998 1.1 christos
3999 1.1 christos (int-arith-x-cc-r-r addxcc add OP_00 OPE2_03 "Add reg/reg, use/set carry")
4000 1.1 christos (int-arith-x-cc-r-r subxcc sub OP_00 OPE2_07 "Sub reg/reg, use/set carry")
4001 1.1 christos ; Add and subtract with saturation
4002 1.1 christos ;
4003 1.1 christos (define-pmacro (int-arith-ss-r-r name operation op ope comment)
4004 1.1 christos (dni name
4005 1.1 christos (comment)
4006 1.1 christos ((UNIT IALL) (MACH fr400,fr450)
4007 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) AUDIO)
4008 1.1 christos (.str name "$pack $GRi,$GRj,$GRk")
4009 1.1 christos (+ pack GRk op GRi ope GRj)
4010 1.1 christos (sequence ()
4011 1.1 christos (set GRk (operation GRi GRj))
4012 1.1 christos (if ((.sym operation -oflag) GRi GRj (const 0))
4013 1.1 christos ; Overflow, saturate.
4014 1.1 christos ; Sign of result will be
4015 1.1 christos ; same as sign of first operand.
4016 1.1 christos (set GRk
4017 1.1 christos (cond SI
4018 1.1 christos ((gt GRi 0) (const #x7fffffff))
4019 1.1 christos ((lt GRi 0) (const #x80000000))
4020 1.1 christos (else (const 0)))))
4021 1.1 christos )
4022 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer)))
4023 1.1 christos )
4024 1.1 christos )
4025 1.1 christos
4026 1.1 christos (int-arith-ss-r-r addss add OP_46 OPE1_00 "add reg/reg, with saturation")
4027 1.1 christos (int-arith-ss-r-r subss sub OP_46 OPE1_01 "sub reg/reg, with saturation")
4028 1.1 christos
4029 1.1 christos ; Format: INT, Logic, Shift r-simm
4030 1.1 christos ;
4031 1.1 christos (define-pmacro (int-logic-r-simm name operation op comment)
4032 1.1 christos (dni name
4033 1.1 christos (comment)
4034 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4035 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4036 1.1 christos (.str name "$pack $GRi,$s12,$GRk")
4037 1.1 christos (+ pack GRk op GRi s12)
4038 1.1 christos (set GRk (operation GRi s12))
4039 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4040 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4041 1.1 christos )
4042 1.1 christos )
4043 1.1 christos
4044 1.1 christos (int-logic-r-simm addi add OP_10 "add reg/immed")
4045 1.1 christos (int-logic-r-simm subi sub OP_14 "sub reg/immed")
4046 1.1 christos (int-logic-r-simm andi and OP_20 "and reg/immed")
4047 1.1 christos (int-logic-r-simm ori or OP_22 "or reg/immed")
4048 1.1 christos (int-logic-r-simm xori xor OP_24 "xor reg/immed")
4049 1.1 christos
4050 1.1 christos (dni sdivi
4051 1.1 christos "signed division reg/immed"
4052 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4053 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4054 1.1 christos "sdivi$pack $GRi,$s12,$GRk"
4055 1.1 christos (+ pack GRk OP_1E GRi s12)
4056 1.1 christos (sequence ()
4057 1.1 christos (c-call VOID "@cpu@_signed_integer_divide"
4058 1.1 christos GRi s12 (index-of GRk) 0)
4059 1.1 christos (clobber GRk))
4060 1.1 christos ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
4061 1.1 christos (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4062 1.1 christos )
4063 1.1 christos
4064 1.1 christos (dni nsdivi
4065 1.1 christos "non excepting signed division reg/immed"
4066 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
4067 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4068 1.1 christos "nsdivi$pack $GRi,$s12,$GRk"
4069 1.1 christos (+ pack GRk OP_2E GRi s12)
4070 1.1 christos (sequence ()
4071 1.1 christos (c-call VOID "@cpu@_signed_integer_divide"
4072 1.1 christos GRi s12 (index-of GRk) 1)
4073 1.1 christos (clobber GRk))
4074 1.1 christos ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4075 1.1 christos )
4076 1.1 christos
4077 1.1 christos (dni udivi
4078 1.1 christos "unsigned division reg/immed"
4079 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4080 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4081 1.1 christos "udivi$pack $GRi,$s12,$GRk"
4082 1.1 christos (+ pack GRk OP_1F GRi s12)
4083 1.1 christos (sequence ()
4084 1.1 christos (c-call VOID "@cpu@_unsigned_integer_divide"
4085 1.1 christos GRi s12 (index-of GRk) 0)
4086 1.1 christos (clobber GRk))
4087 1.1 christos ((fr400 (unit u-idiv)) (fr450 (unit u-idiv))
4088 1.1 christos (fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4089 1.1 christos )
4090 1.1 christos
4091 1.1 christos (dni nudivi
4092 1.1 christos "non excepting unsigned division reg/immed"
4093 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2) NON-EXCEPTING
4094 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4095 1.1 christos "nudivi$pack $GRi,$s12,$GRk"
4096 1.1 christos (+ pack GRk OP_2F GRi s12)
4097 1.1 christos (sequence ()
4098 1.1 christos (c-call VOID "@cpu@_unsigned_integer_divide"
4099 1.1 christos GRi s12 (index-of GRk) 1)
4100 1.1 christos (clobber GRk))
4101 1.1 christos ((fr500 (unit u-idiv)) (fr550 (unit u-idiv)))
4102 1.1 christos )
4103 1.1 christos
4104 1.1 christos (define-pmacro (multiply-r-simm name signop op comment)
4105 1.1 christos (dni name
4106 1.1 christos (comment)
4107 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4108 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4109 1.1 christos (.str name "$pack $GRi,$s12,$GRdoublek")
4110 1.1 christos (+ pack GRdoublek op GRi s12)
4111 1.1 christos (set GRdoublek (mul DI (signop DI GRi) (signop DI s12)))
4112 1.1 christos ((fr400 (unit u-imul)) (fr450 (unit u-imul))
4113 1.1 christos (fr500 (unit u-imul)) (fr550 (unit u-imul)))
4114 1.1 christos )
4115 1.1 christos )
4116 1.1 christos
4117 1.1 christos (multiply-r-simm smuli ext OP_18 "signed multiply reg/immed")
4118 1.1 christos (multiply-r-simm umuli zext OP_1A "unsigned multiply reg/immed")
4119 1.1 christos
4120 1.1 christos (define-pmacro (int-shift-r-simm name op comment)
4121 1.1 christos (dni (.sym name i)
4122 1.1 christos (comment)
4123 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4124 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4125 1.1 christos (.str (.sym name i) "$pack $GRi,$s12,$GRk")
4126 1.1 christos (+ pack GRk op GRi s12)
4127 1.1 christos (set GRk (name GRi (and s12 #x1f)))
4128 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4129 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4130 1.1 christos )
4131 1.1 christos )
4132 1.1 christos
4133 1.1 christos (int-shift-r-simm sll OP_28 "shift left logical reg/immed")
4134 1.1 christos (int-shift-r-simm srl OP_2A "shift right logical reg/immed")
4135 1.1 christos (int-shift-r-simm sra OP_2C "shift right arith reg/immed")
4136 1.1 christos
4137 1.1 christos (dni scani
4138 1.1 christos "scan immediate"
4139 1.1 christos ((UNIT SCAN) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4140 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4141 1.1 christos "scani$pack $GRi,$s12,$GRk"
4142 1.1 christos (+ pack GRk OP_47 GRi s12)
4143 1.1 christos (scan-semantics GRi s12 GRk)
4144 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4145 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4146 1.1 christos )
4147 1.1 christos
4148 1.1 christos ; Format: INT, Logic, Shift cc r-simm
4149 1.1 christos ;
4150 1.1 christos (define-pmacro (int-arith-cc-r-simm name operation op comment)
4151 1.1 christos (dni name
4152 1.1 christos (comment)
4153 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4154 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4155 1.1 christos (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
4156 1.1 christos (+ pack GRk op GRi ICCi_1 s10)
4157 1.1 christos (sequence ((BI tmp) (QI cc) (SI result))
4158 1.1 christos (set cc ICCi_1)
4159 1.1 christos (set tmp ((.sym operation -oflag) GRi s10 (const 0)))
4160 1.1 christos (set-v cc tmp)
4161 1.1 christos (set tmp ((.sym operation -cflag) GRi s10 (const 0)))
4162 1.1 christos (set-c cc tmp)
4163 1.1 christos (set result (operation GRi s10))
4164 1.1 christos (set-z-and-n cc result)
4165 1.1 christos (set GRk result)
4166 1.1 christos (set ICCi_1 cc))
4167 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4168 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4169 1.1 christos )
4170 1.1 christos )
4171 1.1 christos
4172 1.1 christos (int-arith-cc-r-simm addicc add OP_11 "add reg/immed, set icc")
4173 1.1 christos (int-arith-cc-r-simm subicc sub OP_15 "sub reg/immed, set icc")
4174 1.1 christos
4175 1.1 christos (define-pmacro (int-logic-cc-r-simm name op comment)
4176 1.1 christos (dni (.sym name icc)
4177 1.1 christos (comment)
4178 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4179 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4180 1.1 christos (.str (.sym name icc) "$pack $GRi,$s10,$GRk,$ICCi_1")
4181 1.1 christos (+ pack GRk op GRi ICCi_1 s10)
4182 1.1 christos (sequence ((SI tmp))
4183 1.1 christos (set tmp (name GRi s10))
4184 1.1 christos (set GRk tmp)
4185 1.1 christos (set-z-and-n ICCi_1 tmp))
4186 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4187 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4188 1.1 christos )
4189 1.1 christos )
4190 1.1 christos
4191 1.1 christos (int-logic-cc-r-simm and OP_21 "and reg/immed, set icc")
4192 1.1 christos (int-logic-cc-r-simm or OP_23 "or reg/immed, set icc")
4193 1.1 christos (int-logic-cc-r-simm xor OP_25 "xor reg/immed, set icc")
4194 1.1 christos
4195 1.1 christos (define-pmacro (multiply-cc-r-simm name signop op comment)
4196 1.1 christos (dni name
4197 1.1 christos (comment)
4198 1.1 christos ((UNIT MULT-DIV) (FR500-MAJOR I-1) (FR550-MAJOR I-2)
4199 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4200 1.1 christos (.str name "$pack $GRi,$s10,$GRdoublek,$ICCi_1")
4201 1.1 christos (+ pack GRdoublek op GRi ICCi_1 s10)
4202 1.1 christos (multiply-cc-semantics signop GRi s10 GRdoublek ICCi_1)
4203 1.1 christos ((fr400 (unit u-imul)) (fr450 (unit u-imul))
4204 1.1 christos (fr500 (unit u-imul)) (fr550 (unit u-imul)))
4205 1.1 christos )
4206 1.1 christos )
4207 1.1 christos
4208 1.1 christos (multiply-cc-r-simm smulicc ext OP_19 "signed multiply reg/immed")
4209 1.1 christos (multiply-cc-r-simm umulicc zext OP_1B "unsigned multiply reg/immed")
4210 1.1 christos
4211 1.1 christos (define-pmacro (int-shift-cc-r-simm name l-r op comment)
4212 1.1 christos (dni (.sym name icc)
4213 1.1 christos (comment)
4214 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4215 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4216 1.1 christos (.str (.sym name icc) "$pack $GRi,$s10,$GRk,$ICCi_1")
4217 1.1 christos (+ pack GRk op GRi ICCi_1 s10)
4218 1.1 christos (sequence ((WI shift) (SI tmp) (QI cc))
4219 1.1 christos (set shift (and s10 #x1f))
4220 1.1 christos (set cc (c-call QI (.str "@cpu@_set_icc_for_shift_" l-r)
4221 1.1 christos GRi shift ICCi_1))
4222 1.1 christos (set tmp (name GRi shift))
4223 1.1 christos (set GRk tmp)
4224 1.1 christos (set-z-and-n cc tmp)
4225 1.1 christos (set ICCi_1 cc))
4226 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4227 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4228 1.1 christos )
4229 1.1 christos )
4230 1.1 christos
4231 1.1 christos (int-shift-cc-r-simm sll left OP_29 "shift left logical reg/immed, set icc")
4232 1.1 christos (int-shift-cc-r-simm srl right OP_2B "shift right logical reg/immed, set icc")
4233 1.1 christos (int-shift-cc-r-simm sra right OP_2D "shift right arith reg/immed, set icc")
4234 1.1 christos
4235 1.1 christos (define-pmacro (int-arith-x-r-simm name operation op comment)
4236 1.1 christos (dni name
4237 1.1 christos (comment)
4238 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4239 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4240 1.1 christos (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
4241 1.1 christos (+ pack GRk op GRi ICCi_1 s10)
4242 1.1 christos (set GRk ((.sym operation c) GRi s10 (cbit ICCi_1)))
4243 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4244 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4245 1.1 christos )
4246 1.1 christos )
4247 1.1 christos
4248 1.1 christos (int-arith-x-r-simm addxi add OP_12 "Add reg/immed, with carry")
4249 1.1 christos (int-arith-x-r-simm subxi sub OP_16 "Sub reg/immed, with carry")
4250 1.1 christos
4251 1.1 christos (define-pmacro (int-arith-x-cc-r-simm name operation op comment)
4252 1.1 christos (dni name
4253 1.1 christos (comment)
4254 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4255 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4256 1.1 christos (.str name "$pack $GRi,$s10,$GRk,$ICCi_1")
4257 1.1 christos (+ pack GRk op GRi ICCi_1 s10)
4258 1.1 christos (sequence ((WI tmp) (QI cc))
4259 1.1 christos (set cc ICCi_1)
4260 1.1 christos (set tmp ((.sym operation c) GRi s10 (cbit cc)))
4261 1.1 christos (set-v cc ((.sym operation -oflag) GRi s10 (cbit cc)))
4262 1.1 christos (set-c cc ((.sym operation -cflag) GRi s10 (cbit cc)))
4263 1.1 christos (set-z-and-n cc tmp)
4264 1.1 christos (set GRk tmp)
4265 1.1 christos (set ICCi_1 cc))
4266 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4267 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4268 1.1 christos )
4269 1.1 christos )
4270 1.1 christos
4271 1.1 christos (int-arith-x-cc-r-simm addxicc add OP_13 "Add reg/immed, with carry")
4272 1.1 christos (int-arith-x-cc-r-simm subxicc sub OP_17 "Sub reg/immed, with carry")
4273 1.1 christos
4274 1.1 christos ; Byte compare insns
4275 1.1 christos
4276 1.1 christos (dni cmpb
4277 1.1 christos "Compare bytes"
4278 1.1 christos ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1)
4279 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4280 1.1 christos "cmpb$pack $GRi,$GRj,$ICCi_1"
4281 1.1 christos (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0C GRj)
4282 1.1 christos (sequence ((QI cc))
4283 1.1 christos (set-n cc (eq (and GRi #xff000000) (and GRj #xff000000)))
4284 1.1 christos (set-z cc (eq (and GRi #x00ff0000) (and GRj #x00ff0000)))
4285 1.1 christos (set-v cc (eq (and GRi #x0000ff00) (and GRj #x0000ff00)))
4286 1.1 christos (set-c cc (eq (and GRi #x000000ff) (and GRj #x000000ff)))
4287 1.1 christos (set ICCi_1 cc))
4288 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4289 1.1 christos (fr550 (unit u-integer)))
4290 1.1 christos )
4291 1.1 christos
4292 1.1 christos (dni cmpba
4293 1.1 christos "OR of Compare bytes"
4294 1.1 christos ((UNIT IALL) (MACH fr400,fr450,fr550) (FR550-MAJOR I-1)
4295 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4296 1.1 christos "cmpba$pack $GRi,$GRj,$ICCi_1"
4297 1.1 christos (+ pack (GRk-null) OP_00 GRi ICCi_1 OPE2_0D GRj)
4298 1.1 christos (sequence ((QI cc))
4299 1.1 christos (set cc 0)
4300 1.1 christos (set-c cc
4301 1.1 christos (orif (eq (and GRi #xff000000) (and GRj #xff000000))
4302 1.1 christos (orif (eq (and GRi #x00ff0000) (and GRj #x00ff0000))
4303 1.1 christos (orif (eq (and GRi #x0000ff00)
4304 1.1 christos (and GRj #x0000ff00))
4305 1.1 christos (eq (and GRi #x000000ff)
4306 1.1 christos (and GRj #x000000ff))))))
4307 1.1 christos (set ICCi_1 cc))
4308 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4309 1.1 christos (fr550 (unit u-integer)))
4310 1.1 christos )
4311 1.1 christos
4312 1.1 christos ; Format: Load immediate
4313 1.1 christos ;
4314 1.1 christos (dni setlo
4315 1.1 christos "set low order bits"
4316 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4317 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4318 1.1 christos "setlo$pack $ulo16,$GRklo"
4319 1.1 christos (+ pack GRk OP_3D (misc-null-4) u16)
4320 1.1 christos (set GRklo u16)
4321 1.1 christos ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo))
4322 1.1 christos (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo)))
4323 1.1 christos )
4324 1.1 christos
4325 1.1 christos (dni sethi
4326 1.1 christos "set high order bits"
4327 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4328 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4329 1.1 christos "sethi$pack $uhi16,$GRkhi"
4330 1.1 christos (+ pack GRkhi OP_3E (misc-null-4) u16)
4331 1.1 christos (set GRkhi u16)
4332 1.1 christos ((fr400 (unit u-set-hilo)) (fr450 (unit u-set-hilo))
4333 1.1 christos (fr500 (unit u-set-hilo)) (fr550 (unit u-set-hilo)))
4334 1.1 christos )
4335 1.1 christos
4336 1.1 christos (dni setlos
4337 1.1 christos "set low order bits and extend sign"
4338 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR550-MAJOR I-1)
4339 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
4340 1.1 christos "setlos$pack $slo16,$GRk"
4341 1.1 christos (+ pack GRk OP_3F (misc-null-4) s16)
4342 1.1 christos (set GRk s16)
4343 1.1 christos ((fr400 (unit u-integer)) (fr450 (unit u-integer))
4344 1.1 christos (fr500 (unit u-integer)) (fr550 (unit u-integer)))
4345 1.1 christos )
4346 1.1 christos
4347 1.1 christos (define-pmacro (load-gr-r name mode op ope comment ann)
4348 1.1 christos (dni name
4349 1.1 christos (comment)
4350 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4351 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2))
4352 1.1 christos (.str name "$pack " ann "($GRi,$GRj),$GRk")
4353 1.1 christos (+ pack GRk op GRi ope GRj)
4354 1.1 christos (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
4355 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4356 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4357 1.1 christos )
4358 1.1 christos )
4359 1.1 christos
4360 1.1 christos (dann ldann "ld annotation" SI "ld_annotation" "at")
4361 1.1 christos
4362 1.1 christos (load-gr-r ldsb QI OP_02 OPE1_00 "Load signed byte" "@")
4363 1.1 christos (load-gr-r ldub UQI OP_02 OPE1_01 "Load unsigned byte" "@")
4364 1.1 christos (load-gr-r ldsh HI OP_02 OPE1_02 "Load signed half" "@")
4365 1.1 christos (load-gr-r lduh UHI OP_02 OPE1_03 "Load unsigned half" "@")
4366 1.1 christos (load-gr-r ld SI OP_02 OPE1_04 "Load word" "$ldann")
4367 1.1 christos
4368 1.1 christos (define-pmacro (load-fr-r name mode op ope comment)
4369 1.1 christos (dni name
4370 1.1 christos (comment)
4371 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4372 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS)
4373 1.1 christos (.str name "$pack @($GRi,$GRj),$FRintk")
4374 1.1 christos (+ pack FRintk op GRi ope GRj)
4375 1.1 christos (set FRintk (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
4376 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4377 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4378 1.1 christos )
4379 1.1 christos )
4380 1.1 christos
4381 1.1 christos (load-fr-r ldbf UQI OP_02 OPE1_08 "Load byte float")
4382 1.1 christos (load-fr-r ldhf UHI OP_02 OPE1_09 "Load half float")
4383 1.1 christos (load-fr-r ldf SI OP_02 OPE1_0A "Load word float")
4384 1.1 christos
4385 1.1 christos (define-pmacro (load-cpr-r name mode op ope reg attr comment)
4386 1.1 christos (dni name
4387 1.1 christos (comment)
4388 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) attr)
4389 1.1 christos (.str name "$pack @($GRi,$GRj),$" reg "k")
4390 1.1 christos (+ pack (.sym reg k) op GRi ope GRj)
4391 1.1 christos (set (.sym reg k)
4392 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj)))
4393 1.1 christos ()
4394 1.1 christos )
4395 1.1 christos )
4396 1.1 christos
4397 1.1 christos (load-cpr-r ldc SI OP_02 OPE1_0D CPR (MACH frv) "Load coprocessor word")
4398 1.1 christos
4399 1.1 christos ; These correspond to enumerators in frv-sim.h
4400 1.1 christos (define-pmacro (ne-UQI-size) 0)
4401 1.1 christos (define-pmacro (ne-QI-size) 1)
4402 1.1 christos (define-pmacro (ne-UHI-size) 2)
4403 1.1 christos (define-pmacro (ne-HI-size) 3)
4404 1.1 christos (define-pmacro (ne-SI-size) 4)
4405 1.1 christos (define-pmacro (ne-DI-size) 5)
4406 1.1 christos (define-pmacro (ne-XI-size) 6)
4407 1.1 christos
4408 1.1 christos (define-pmacro (ne-load-semantics base dispix targ idisp size is_float action)
4409 1.1 christos (sequence ((BI do_op))
4410 1.1 christos (set do_op
4411 1.1 christos (c-call BI "@cpu@_check_non_excepting_load"
4412 1.1 christos (index-of base) dispix (index-of targ)
4413 1.1 christos idisp size is_float))
4414 1.1 christos (if do_op action))
4415 1.1 christos )
4416 1.1 christos
4417 1.1 christos (define-pmacro (ne-load-gr-r name mode op ope size comment)
4418 1.1 christos (dni name
4419 1.1 christos (comment)
4420 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
4421 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4422 1.1 christos (.str name "$pack @($GRi,$GRj),$GRk")
4423 1.1 christos (+ pack GRk op GRi ope GRj)
4424 1.1 christos (ne-load-semantics GRi (index-of GRj) GRk 0 size 0
4425 1.1 christos (set GRk
4426 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode)
4427 1.1 christos pc (add GRi GRj))))
4428 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4429 1.1 christos )
4430 1.1 christos )
4431 1.1 christos
4432 1.1 christos (ne-load-gr-r nldsb QI OP_02 OPE1_20 (ne-QI-size) "Load signed byte")
4433 1.1 christos (ne-load-gr-r nldub UQI OP_02 OPE1_21 (ne-UQI-size) "Load unsigned byte")
4434 1.1 christos (ne-load-gr-r nldsh HI OP_02 OPE1_22 (ne-HI-size) "Load signed half")
4435 1.1 christos (ne-load-gr-r nlduh UHI OP_02 OPE1_23 (ne-UHI-size) "Load unsigned half")
4436 1.1 christos (ne-load-gr-r nld SI OP_02 OPE1_24 (ne-SI-size) "Load word")
4437 1.1 christos
4438 1.1 christos (define-pmacro (ne-load-fr-r name mode op ope size comment)
4439 1.1 christos (dni name
4440 1.1 christos (comment)
4441 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
4442 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4443 1.1 christos (.str name "$pack @($GRi,$GRj),$FRintk")
4444 1.1 christos (+ pack FRintk op GRi ope GRj)
4445 1.1 christos (ne-load-semantics GRi (index-of GRj) FRintk 0 size 1
4446 1.1 christos (set FRintk
4447 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode)
4448 1.1 christos pc (add GRi GRj))))
4449 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4450 1.1 christos )
4451 1.1 christos )
4452 1.1 christos
4453 1.1 christos (ne-load-fr-r nldbf UQI OP_02 OPE1_28 (ne-UQI-size) "Load byte float")
4454 1.1 christos (ne-load-fr-r nldhf UHI OP_02 OPE1_29 (ne-UHI-size) "Load half float")
4455 1.1 christos (ne-load-fr-r nldf SI OP_02 OPE1_2A (ne-SI-size) "Load word float")
4456 1.1 christos
4457 1.1 christos ; Semantics for a load-double insn
4458 1.1 christos ;
4459 1.1 christos (define-pmacro (load-double-semantics not_gr mode regtype address arg)
4460 1.1 christos (if (orif not_gr (ne (index-of (.sym regtype doublek)) 0))
4461 1.1 christos (sequence ()
4462 1.1 christos (set address (add GRi arg))
4463 1.1 christos (set (.sym regtype doublek)
4464 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode) pc address))))
4465 1.1 christos )
4466 1.1 christos
4467 1.1 christos (define-pmacro (load-double-r-r
4468 1.1 christos name not_gr mode op ope regtype attr profile comment ann)
4469 1.1 christos (dni name
4470 1.1 christos (comment)
4471 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4472 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4473 1.1 christos (.str name "$pack " ann "($GRi,$GRj),$" regtype "doublek")
4474 1.1 christos (+ pack (.sym regtype doublek) op GRi ope GRj)
4475 1.1 christos (sequence ((WI address))
4476 1.1 christos (load-double-semantics not_gr mode regtype address GRj))
4477 1.1 christos profile
4478 1.1 christos )
4479 1.1 christos )
4480 1.1 christos
4481 1.1 christos (dann lddann "ldd annotation" SI "ldd_annotation" "at")
4482 1.1 christos
4483 1.1 christos (load-double-r-r ldd 0 DI OP_02 OPE1_05 GR NA
4484 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4485 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4486 1.1 christos "Load double word" "$lddann")
4487 1.1 christos (load-double-r-r lddf 1 DF OP_02 OPE1_0B FR FR-ACCESS
4488 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4489 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4490 1.1 christos "Load double float" "@")
4491 1.1 christos (load-double-r-r lddc 1 DI OP_02 OPE1_0E CPR (MACH frv) ()
4492 1.1 christos "Load coprocessor double" "@")
4493 1.1 christos
4494 1.1 christos (define-pmacro (ne-load-double-r-r
4495 1.1 christos name not_gr mode op ope regtype size is_float attr profile
4496 1.1 christos comment)
4497 1.1 christos (dni name
4498 1.1 christos (comment)
4499 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
4500 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4501 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
4502 1.1 christos (+ pack (.sym regtype doublek) op GRi ope GRj)
4503 1.1 christos (sequence ((WI address))
4504 1.1 christos (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek)
4505 1.1 christos 0 size is_float
4506 1.1 christos (load-double-semantics not_gr mode
4507 1.1 christos regtype
4508 1.1 christos address GRj)))
4509 1.1 christos profile
4510 1.1 christos )
4511 1.1 christos )
4512 1.1 christos
4513 1.1 christos (ne-load-double-r-r nldd 0 DI OP_02 OPE1_25 GR (ne-DI-size) 0 NA
4514 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word")
4515 1.1 christos (ne-load-double-r-r nlddf 1 DF OP_02 OPE1_2B FR (ne-DI-size) 1 FR-ACCESS
4516 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float")
4517 1.1 christos
4518 1.1 christos ; Semantics for a load-quad insn
4519 1.1 christos ;
4520 1.1 christos (define-pmacro (load-quad-semantics regtype address arg)
4521 1.1 christos (sequence ()
4522 1.1 christos (set address (add GRi arg))
4523 1.1 christos (c-call VOID (.str "@cpu@_load_quad_" regtype)
4524 1.1 christos pc address (index-of (.sym regtype k))))
4525 1.1 christos )
4526 1.1 christos
4527 1.1 christos (define-pmacro (load-quad-r-r name op ope regtype attr profile comment)
4528 1.1 christos (dni name
4529 1.1 christos (comment)
4530 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
4531 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k")
4532 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
4533 1.1 christos (sequence ((WI address))
4534 1.1 christos (load-quad-semantics regtype address GRj))
4535 1.1 christos ; TODO regtype-k not referenced for profiling
4536 1.1 christos profile
4537 1.1 christos )
4538 1.1 christos )
4539 1.1 christos
4540 1.1 christos (load-quad-r-r ldq OP_02 OPE1_06 GR NA ((fr500 (unit u-gr-load)))
4541 1.1 christos "Load quad word")
4542 1.1 christos (load-quad-r-r ldqf OP_02 OPE1_0C FRint FR-ACCESS ((fr500 (unit u-fr-load)))
4543 1.1 christos "Load quad float")
4544 1.1 christos (load-quad-r-r ldqc OP_02 OPE1_0F CPR NA () "Load coprocessor quad")
4545 1.1 christos
4546 1.1 christos (define-pmacro (ne-load-quad-r-r
4547 1.1 christos name op ope regtype size is_float attr profile comment)
4548 1.1 christos (dni name
4549 1.1 christos (comment)
4550 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr)
4551 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k")
4552 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
4553 1.1 christos (sequence ((WI address))
4554 1.1 christos (ne-load-semantics GRi (index-of GRj) (.sym regtype k)
4555 1.1 christos 0 size is_float
4556 1.1 christos (load-quad-semantics regtype address GRj)))
4557 1.1 christos ; TODO regtype-k not referenced for profiling
4558 1.1 christos profile
4559 1.1 christos )
4560 1.1 christos )
4561 1.1 christos
4562 1.1 christos (ne-load-quad-r-r nldq OP_02 OPE1_26 GR (ne-XI-size) 0 NA
4563 1.1 christos ((fr500 (unit u-gr-load))) "Load quad word")
4564 1.1 christos (ne-load-quad-r-r nldqf OP_02 OPE1_2C FRint (ne-XI-size) 1 FR-ACCESS
4565 1.1 christos ((fr500 (unit u-fr-load))) "Load quad float")
4566 1.1 christos
4567 1.1 christos (define-pmacro (load-gr-u-semantics mode)
4568 1.1 christos (sequence ((UWI address))
4569 1.1 christos (set address (add GRi GRj))
4570 1.1 christos (set GRk (c-call mode (.str "@cpu@_read_mem_" mode) pc address))
4571 1.1 christos (if (ne (index-of GRi) (index-of GRk))
4572 1.1 christos (sequence ()
4573 1.1 christos (set GRi address)
4574 1.1 christos (c-call VOID "@cpu@_force_update"))))
4575 1.1 christos )
4576 1.1 christos
4577 1.1 christos (define-pmacro (load-gr-u name mode op ope comment)
4578 1.1 christos (dni name
4579 1.1 christos (comment)
4580 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4581 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2))
4582 1.1 christos (.str name "$pack @($GRi,$GRj),$GRk")
4583 1.1 christos (+ pack GRk op GRi ope GRj)
4584 1.1 christos (load-gr-u-semantics mode)
4585 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4586 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4587 1.1 christos )
4588 1.1 christos )
4589 1.1 christos
4590 1.1 christos (load-gr-u ldsbu QI OP_02 OPE1_10 "Load signed byte, update index")
4591 1.1 christos (load-gr-u ldubu UQI OP_02 OPE1_11 "Load unsigned byte, update index")
4592 1.1 christos (load-gr-u ldshu HI OP_02 OPE1_12 "Load signed half, update index")
4593 1.1 christos (load-gr-u lduhu UHI OP_02 OPE1_13 "Load unsigned half, update index")
4594 1.1 christos (load-gr-u ldu SI OP_02 OPE1_14 "Load word, update index")
4595 1.1 christos
4596 1.1 christos (define-pmacro (ne-load-gr-u name mode op ope size comment)
4597 1.1 christos (dni name
4598 1.1 christos (comment)
4599 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
4600 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4601 1.1 christos (.str name "$pack @($GRi,$GRj),$GRk")
4602 1.1 christos (+ pack GRk op GRi ope GRj)
4603 1.1 christos (ne-load-semantics GRi (index-of GRj) GRk 0 size 0 (load-gr-u-semantics mode))
4604 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4605 1.1 christos )
4606 1.1 christos )
4607 1.1 christos
4608 1.1 christos (ne-load-gr-u nldsbu QI OP_02 OPE1_30 (ne-QI-size) "Load signed byte, update index")
4609 1.1 christos (ne-load-gr-u nldubu UQI OP_02 OPE1_31 (ne-UQI-size) "Load unsigned byte, update index")
4610 1.1 christos (ne-load-gr-u nldshu HI OP_02 OPE1_32 (ne-HI-size) "Load signed half, update index")
4611 1.1 christos (ne-load-gr-u nlduhu UHI OP_02 OPE1_33 (ne-UHI-size) "Load unsigned half, update index")
4612 1.1 christos (ne-load-gr-u nldu SI OP_02 OPE1_34 (ne-SI-size) "Load word, update index")
4613 1.1 christos
4614 1.1 christos (define-pmacro (load-non-gr-u-semantics mode regtype)
4615 1.1 christos (sequence ((UWI address))
4616 1.1 christos (set address (add GRi GRj))
4617 1.1 christos (set (.sym regtype k)
4618 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode) pc address))
4619 1.1 christos (set GRi address)
4620 1.1 christos (c-call VOID "@cpu@_force_update"))
4621 1.1 christos )
4622 1.1 christos
4623 1.1 christos (define-pmacro (load-fr-u name mode op ope comment)
4624 1.1 christos (dni name
4625 1.1 christos (comment)
4626 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4627 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) FR-ACCESS)
4628 1.1 christos (.str name "$pack @($GRi,$GRj),$FRintk")
4629 1.1 christos (+ pack FRintk op GRi ope GRj)
4630 1.1 christos (load-non-gr-u-semantics mode FRint)
4631 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4632 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4633 1.1 christos )
4634 1.1 christos )
4635 1.1 christos
4636 1.1 christos (load-fr-u ldbfu UQI OP_02 OPE1_18 "Load byte float, update index")
4637 1.1 christos (load-fr-u ldhfu UHI OP_02 OPE1_19 "Load half float, update index")
4638 1.1 christos (load-fr-u ldfu SI OP_02 OPE1_1A "Load word float, update index")
4639 1.1 christos
4640 1.1 christos (define-pmacro (load-cpr-u name mode op ope comment)
4641 1.1 christos (dni name
4642 1.1 christos (comment)
4643 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv))
4644 1.1 christos (.str name "$pack @($GRi,$GRj),$CPRk")
4645 1.1 christos (+ pack CPRk op GRi ope GRj)
4646 1.1 christos (load-non-gr-u-semantics mode CPR)
4647 1.1 christos ()
4648 1.1 christos )
4649 1.1 christos )
4650 1.1 christos
4651 1.1 christos (load-cpr-u ldcu SI OP_02 OPE1_1D "Load coprocessor word float,update index")
4652 1.1 christos
4653 1.1 christos (define-pmacro (ne-load-non-gr-u name mode op ope regtype size comment)
4654 1.1 christos (dni name
4655 1.1 christos (comment)
4656 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
4657 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4658 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k")
4659 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
4660 1.1 christos (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1
4661 1.1 christos (load-non-gr-u-semantics mode regtype))
4662 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4663 1.1 christos )
4664 1.1 christos )
4665 1.1 christos
4666 1.1 christos (ne-load-non-gr-u nldbfu UQI OP_02 OPE1_38 FRint (ne-UQI-size) "Load byte float, update index")
4667 1.1 christos (ne-load-non-gr-u nldhfu UHI OP_02 OPE1_39 FRint (ne-UHI-size) "Load half float, update index")
4668 1.1 christos (ne-load-non-gr-u nldfu SI OP_02 OPE1_3A FRint (ne-SI-size) "Load word float, update index")
4669 1.1 christos
4670 1.1 christos (define-pmacro (load-double-gr-u-semantics)
4671 1.1 christos (sequence ((WI address))
4672 1.1 christos (load-double-semantics 0 DI GR address GRj)
4673 1.1 christos (if (ne (index-of GRi) (index-of GRdoublek))
4674 1.1 christos (sequence ()
4675 1.1 christos (set GRi address)
4676 1.1 christos (c-call VOID "@cpu@_force_update"))))
4677 1.1 christos )
4678 1.1 christos
4679 1.1 christos (define-pmacro (load-double-gr-u name op ope comment)
4680 1.1 christos (dni name
4681 1.1 christos (comment)
4682 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4683 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2))
4684 1.1 christos (.str name "$pack @($GRi,$GRj),$GRdoublek")
4685 1.1 christos (+ pack GRdoublek op GRi ope GRj)
4686 1.1 christos (load-double-gr-u-semantics)
4687 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4688 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4689 1.1 christos )
4690 1.1 christos )
4691 1.1 christos
4692 1.1 christos (load-double-gr-u lddu OP_02 OPE1_15 "Load double word, update index")
4693 1.1 christos
4694 1.1 christos (define-pmacro (ne-load-double-gr-u name op ope size comment)
4695 1.1 christos (dni name
4696 1.1 christos (comment)
4697 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING
4698 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4699 1.1 christos (.str name "$pack @($GRi,$GRj),$GRdoublek")
4700 1.1 christos (+ pack GRdoublek op GRi ope GRj)
4701 1.1 christos (ne-load-semantics GRi (index-of GRj) GRdoublek 0 size 0
4702 1.1 christos (load-double-gr-u-semantics))
4703 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4704 1.1 christos
4705 1.1 christos )
4706 1.1 christos )
4707 1.1 christos
4708 1.1 christos (ne-load-double-gr-u nlddu OP_02 OPE1_35 (ne-DI-size) "Load double word, update index")
4709 1.1 christos
4710 1.1 christos (define-pmacro (load-double-non-gr-u-semantics mode regtype)
4711 1.1 christos (sequence ((WI address))
4712 1.1 christos (load-double-semantics 1 mode regtype address GRj)
4713 1.1 christos (set GRi address)
4714 1.1 christos (c-call VOID "@cpu@_force_update"))
4715 1.1 christos )
4716 1.1 christos
4717 1.1 christos (define-pmacro (load-double-non-gr-u
4718 1.1 christos name mode op ope regtype attr profile comment)
4719 1.1 christos (dni name
4720 1.1 christos (comment)
4721 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4722 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4723 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
4724 1.1 christos (+ pack (.sym regtype doublek) op GRi ope GRj)
4725 1.1 christos (load-double-non-gr-u-semantics mode regtype)
4726 1.1 christos profile
4727 1.1 christos )
4728 1.1 christos )
4729 1.1 christos
4730 1.1 christos (load-double-non-gr-u lddfu DF OP_02 OPE1_1B FR FR-ACCESS
4731 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4732 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4733 1.1 christos "Load double float, update index")
4734 1.1 christos (load-double-non-gr-u lddcu DI OP_02 OPE1_1E CPR (MACH frv)
4735 1.1 christos () "Load coprocessor double float, update index")
4736 1.1 christos
4737 1.1 christos (define-pmacro (ne-load-double-non-gr-u name mode op ope regtype size comment)
4738 1.1 christos (dni name
4739 1.1 christos (comment)
4740 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING FR-ACCESS
4741 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4742 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "doublek")
4743 1.1 christos (+ pack (.sym regtype doublek) op GRi ope GRj)
4744 1.1 christos (ne-load-semantics GRi (index-of GRj) (.sym regtype doublek) 0 size 1
4745 1.1 christos (load-double-non-gr-u-semantics mode regtype))
4746 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4747 1.1 christos )
4748 1.1 christos )
4749 1.1 christos
4750 1.1 christos (ne-load-double-non-gr-u nlddfu DF OP_02 OPE1_3B FR (ne-DI-size) "Load double float, update index")
4751 1.1 christos
4752 1.1 christos (define-pmacro (load-quad-gr-u-semantics)
4753 1.1 christos (sequence ((WI address))
4754 1.1 christos (load-quad-semantics GR address GRj)
4755 1.1 christos (if (ne (index-of GRi) (index-of GRk))
4756 1.1 christos (sequence ()
4757 1.1 christos (set GRi address)
4758 1.1 christos (c-call VOID "@cpu@_force_update"))))
4759 1.1 christos )
4760 1.1 christos
4761 1.1 christos (define-pmacro (load-quad-gr-u name op ope comment)
4762 1.1 christos (dni name
4763 1.1 christos (comment)
4764 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv))
4765 1.1 christos (.str name "$pack @($GRi,$GRj),$GRk")
4766 1.1 christos (+ pack GRk op GRi ope GRj)
4767 1.1 christos (load-quad-gr-u-semantics)
4768 1.1 christos ; TODO - GRk not referenced here for profiling
4769 1.1 christos ((fr500 (unit u-gr-load)))
4770 1.1 christos )
4771 1.1 christos )
4772 1.1 christos
4773 1.1 christos (load-quad-gr-u ldqu OP_02 OPE1_16 "Load quad word, update index")
4774 1.1 christos
4775 1.1 christos (define-pmacro (ne-load-quad-gr-u name op ope size comment)
4776 1.1 christos (dni name
4777 1.1 christos (comment)
4778 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING)
4779 1.1 christos (.str name "$pack @($GRi,$GRj),$GRk")
4780 1.1 christos (+ pack GRk op GRi ope GRj)
4781 1.1 christos (ne-load-semantics GRi (index-of GRj) GRk 0 size 0
4782 1.1 christos (load-quad-gr-u-semantics))
4783 1.1 christos ; TODO - GRk not referenced here for profiling
4784 1.1 christos ((fr500 (unit u-gr-load)))
4785 1.1 christos )
4786 1.1 christos )
4787 1.1 christos
4788 1.1 christos (ne-load-quad-gr-u nldqu OP_02 OPE1_36 (ne-XI-size) "Load quad word, update index")
4789 1.1 christos
4790 1.1 christos (define-pmacro (load-quad-non-gr-u-semantics regtype)
4791 1.1 christos (sequence ((WI address))
4792 1.1 christos (load-quad-semantics regtype address GRj)
4793 1.1 christos (set GRi address)
4794 1.1 christos (c-call VOID "@cpu@_force_update"))
4795 1.1 christos )
4796 1.1 christos
4797 1.1 christos (define-pmacro (load-quad-non-gr-u name op ope regtype attr profile comment)
4798 1.1 christos (dni name
4799 1.1 christos (comment)
4800 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
4801 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k")
4802 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
4803 1.1 christos (load-quad-non-gr-u-semantics regtype)
4804 1.1 christos profile
4805 1.1 christos )
4806 1.1 christos )
4807 1.1 christos
4808 1.1 christos (load-quad-non-gr-u ldqfu OP_02 OPE1_1C FRint FR-ACCESS
4809 1.1 christos ((fr500 (unit u-fr-load))) "Load quad float, update index")
4810 1.1 christos (load-quad-non-gr-u ldqcu OP_02 OPE1_1F CPR NA
4811 1.1 christos () "Load coprocessor quad word, update index")
4812 1.1 christos
4813 1.1 christos (define-pmacro (ne-load-quad-non-gr-u name op ope regtype size comment)
4814 1.1 christos (dni name
4815 1.1 christos (comment)
4816 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING FR-ACCESS)
4817 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k")
4818 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
4819 1.1 christos (ne-load-semantics GRi (index-of GRj) (.sym regtype k) 0 size 1
4820 1.1 christos (load-quad-non-gr-u-semantics regtype))
4821 1.1 christos ((fr500 (unit u-fr-load)))
4822 1.1 christos )
4823 1.1 christos )
4824 1.1 christos
4825 1.1 christos (ne-load-quad-non-gr-u nldqfu OP_02 OPE1_3C FRint (ne-XI-size) "Load quad float,update index")
4826 1.1 christos
4827 1.1 christos (define-pmacro (load-r-simm name mode op regtype attr profile comment)
4828 1.1 christos (dni name
4829 1.1 christos (comment)
4830 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4831 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4832 1.1 christos (.str name "$pack @($GRi,$d12),$" regtype "k")
4833 1.1 christos (+ pack (.sym regtype k) op GRi d12)
4834 1.1 christos (set (.sym regtype k)
4835 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi d12)))
4836 1.1 christos profile
4837 1.1 christos )
4838 1.1 christos )
4839 1.1 christos
4840 1.1 christos (load-r-simm ldsbi QI OP_30 GR NA
4841 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4842 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4843 1.1 christos "Load signed byte")
4844 1.1 christos (load-r-simm ldshi HI OP_31 GR NA
4845 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4846 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4847 1.1 christos "Load signed half")
4848 1.1 christos (load-r-simm ldi SI OP_32 GR NA
4849 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4850 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4851 1.1 christos "Load word")
4852 1.1 christos (load-r-simm ldubi UQI OP_35 GR NA
4853 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4854 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4855 1.1 christos "Load unsigned byte")
4856 1.1 christos (load-r-simm lduhi UHI OP_36 GR NA
4857 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4858 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4859 1.1 christos "Load unsigned half")
4860 1.1 christos
4861 1.1 christos (load-r-simm ldbfi UQI OP_38 FRint FR-ACCESS
4862 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4863 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4864 1.1 christos "Load byte float")
4865 1.1 christos (load-r-simm ldhfi UHI OP_39 FRint FR-ACCESS
4866 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4867 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4868 1.1 christos "Load half float")
4869 1.1 christos (load-r-simm ldfi SI OP_3A FRint FR-ACCESS
4870 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4871 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4872 1.1 christos "Load word float")
4873 1.1 christos
4874 1.1 christos (define-pmacro (ne-load-r-simm
4875 1.1 christos name mode op regtype size is_float attr profile comment)
4876 1.1 christos (dni name
4877 1.1 christos (comment)
4878 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
4879 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4880 1.1 christos (.str name "$pack @($GRi,$d12),$" regtype "k")
4881 1.1 christos (+ pack (.sym regtype k) op GRi d12)
4882 1.1 christos (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float
4883 1.1 christos (set (.sym regtype k)
4884 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode)
4885 1.1 christos pc (add GRi d12))))
4886 1.1 christos profile
4887 1.1 christos )
4888 1.1 christos )
4889 1.1 christos
4890 1.1 christos (ne-load-r-simm nldsbi QI OP_40 GR (ne-QI-size) 0 NA
4891 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed byte")
4892 1.1 christos (ne-load-r-simm nldubi UQI OP_41 GR (ne-UQI-size) 0 NA
4893 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned byte")
4894 1.1 christos (ne-load-r-simm nldshi HI OP_42 GR (ne-HI-size) 0 NA
4895 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load signed half")
4896 1.1 christos (ne-load-r-simm nlduhi UHI OP_43 GR (ne-UHI-size) 0 NA
4897 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load unsigned half")
4898 1.1 christos (ne-load-r-simm nldi SI OP_44 GR (ne-SI-size) 0 NA
4899 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load word")
4900 1.1 christos
4901 1.1 christos (ne-load-r-simm nldbfi UQI OP_48 FRint (ne-UQI-size) 1 FR-ACCESS
4902 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load byte float")
4903 1.1 christos (ne-load-r-simm nldhfi UHI OP_49 FRint (ne-UHI-size) 1 FR-ACCESS
4904 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load half float")
4905 1.1 christos (ne-load-r-simm nldfi SI OP_4A FRint (ne-SI-size) 1 FR-ACCESS
4906 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load word float")
4907 1.1 christos
4908 1.1 christos (define-pmacro (load-double-r-simm
4909 1.1 christos name not_gr mode op regtype attr profile comment)
4910 1.1 christos (dni name
4911 1.1 christos (comment)
4912 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
4913 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) attr)
4914 1.1 christos (.str name "$pack @($GRi,$d12),$" regtype "doublek")
4915 1.1 christos (+ pack (.sym regtype doublek) op GRi d12)
4916 1.1 christos (sequence ((WI address))
4917 1.1 christos (load-double-semantics not_gr mode regtype address d12))
4918 1.1 christos profile
4919 1.1 christos )
4920 1.1 christos )
4921 1.1 christos
4922 1.1 christos (load-double-r-simm lddi 0 DI OP_33 GR NA
4923 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
4924 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
4925 1.1 christos "Load double word")
4926 1.1 christos (load-double-r-simm lddfi 1 DF OP_3B FR FR-ACCESS
4927 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
4928 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
4929 1.1 christos "Load double float")
4930 1.1 christos
4931 1.1 christos (define-pmacro (ne-load-double-r-simm
4932 1.1 christos name not_gr mode op regtype size is_float attr profile comment)
4933 1.1 christos (dni name
4934 1.1 christos (comment)
4935 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2) NON-EXCEPTING attr
4936 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
4937 1.1 christos (.str name "$pack @($GRi,$d12),$" regtype "doublek")
4938 1.1 christos (+ pack (.sym regtype doublek) op GRi d12)
4939 1.1 christos (sequence ((WI address))
4940 1.1 christos (ne-load-semantics GRi -1 (.sym regtype doublek)
4941 1.1 christos d12 size is_float
4942 1.1 christos (load-double-semantics not_gr mode
4943 1.1 christos regtype
4944 1.1 christos address d12)))
4945 1.1 christos profile
4946 1.1 christos )
4947 1.1 christos )
4948 1.1 christos
4949 1.1 christos (ne-load-double-r-simm nlddi 0 DI OP_45 GR (ne-DI-size) 0 NA
4950 1.1 christos ((fr500 (unit u-gr-load)) (fr550 (unit u-gr-load))) "Load double word")
4951 1.1 christos (ne-load-double-r-simm nlddfi 1 DF OP_4B FR (ne-DI-size) 1 FR-ACCESS
4952 1.1 christos ((fr500 (unit u-fr-load)) (fr550 (unit u-fr-load))) "Load double float")
4953 1.1 christos
4954 1.1 christos (define-pmacro (load-quad-r-simm name op regtype attr profile comment)
4955 1.1 christos (dni name
4956 1.1 christos (comment)
4957 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) attr)
4958 1.1 christos (.str name "$pack @($GRi,$d12),$" regtype "k")
4959 1.1 christos (+ pack (.sym regtype k) op GRi d12)
4960 1.1 christos (sequence ((WI address))
4961 1.1 christos (load-quad-semantics regtype address d12))
4962 1.1 christos profile
4963 1.1 christos )
4964 1.1 christos )
4965 1.1 christos
4966 1.1 christos (load-quad-r-simm ldqi OP_34 GR NA
4967 1.1 christos ((fr500 (unit u-gr-load))) "Load quad word")
4968 1.1 christos (load-quad-r-simm ldqfi OP_3C FRint FR-ACCESS
4969 1.1 christos ((fr500 (unit u-fr-load))) "Load quad float")
4970 1.1 christos
4971 1.1 christos (define-pmacro (ne-load-quad-r-simm
4972 1.1 christos name op regtype size is_float attr profile comment)
4973 1.1 christos (dni name
4974 1.1 christos (comment)
4975 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) NON-EXCEPTING attr)
4976 1.1 christos (.str name "$pack @($GRi,$d12),$" regtype "k")
4977 1.1 christos (+ pack (.sym regtype k) op GRi d12)
4978 1.1 christos (sequence ((WI address))
4979 1.1 christos (ne-load-semantics GRi -1 (.sym regtype k) d12 size is_float
4980 1.1 christos (load-quad-semantics regtype address d12)))
4981 1.1 christos profile
4982 1.1 christos )
4983 1.1 christos )
4984 1.1 christos
4985 1.1 christos (ne-load-quad-r-simm nldqfi OP_4C FRint (ne-XI-size) 1 FR-ACCESS
4986 1.1 christos ((fr500 (unit u-fr-load))) "Load quad float")
4987 1.1 christos
4988 1.1 christos (define-pmacro (store-r-r name mode op ope reg attr profile comment)
4989 1.1 christos (dni name
4990 1.1 christos (comment)
4991 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
4992 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
4993 1.1 christos (.str name "$pack $" reg "k,@($GRi,$GRj)")
4994 1.1 christos (+ pack (.sym reg k) op GRi ope GRj)
4995 1.1 christos (c-call VOID (.str "@cpu@_write_mem_" mode)
4996 1.1 christos pc (add GRi GRj) (.sym reg k))
4997 1.1 christos profile
4998 1.1 christos )
4999 1.1 christos )
5000 1.1 christos
5001 1.1 christos (store-r-r stb QI OP_03 OPE1_00 GR NA
5002 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5003 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5004 1.1 christos "Store unsigned byte")
5005 1.1 christos (store-r-r sth HI OP_03 OPE1_01 GR NA
5006 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5007 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5008 1.1 christos "Store unsigned half")
5009 1.1 christos (store-r-r st SI OP_03 OPE1_02 GR NA
5010 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5011 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5012 1.1 christos "Store word")
5013 1.1 christos
5014 1.1 christos (store-r-r stbf QI OP_03 OPE1_08 FRint FR-ACCESS
5015 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5016 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5017 1.1 christos "Store byte float")
5018 1.1 christos (store-r-r sthf HI OP_03 OPE1_09 FRint FR-ACCESS
5019 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5020 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5021 1.1 christos "Store half float")
5022 1.1 christos (store-r-r stf SI OP_03 OPE1_0A FRint FR-ACCESS
5023 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5024 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5025 1.1 christos "Store word float")
5026 1.1 christos
5027 1.1 christos (store-r-r stc SI OP_03 OPE1_25 CPR (MACH frv) () "Store coprocessor word")
5028 1.1 christos
5029 1.1 christos ; Semantics for a store-double insn
5030 1.1 christos ;
5031 1.1 christos (define-pmacro (store-double-semantics mode regtype address arg)
5032 1.1 christos (sequence ()
5033 1.1 christos (set address (add GRi arg))
5034 1.1 christos (c-call VOID (.str "@cpu@_write_mem_" mode)
5035 1.1 christos pc address (.sym regtype doublek)))
5036 1.1 christos )
5037 1.1 christos
5038 1.1 christos (define-pmacro (store-double-r-r name mode op ope regtype attr profile comment)
5039 1.1 christos (dni name
5040 1.1 christos (comment)
5041 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5042 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5043 1.1 christos (.str name "$pack $" regtype "doublek,@($GRi,$GRj)")
5044 1.1 christos (+ pack (.sym regtype doublek) op GRi ope GRj)
5045 1.1 christos (sequence ((WI address))
5046 1.1 christos (store-double-semantics mode regtype address GRj))
5047 1.1 christos profile
5048 1.1 christos )
5049 1.1 christos )
5050 1.1 christos
5051 1.1 christos (store-double-r-r std DI OP_03 OPE1_03 GR NA
5052 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5053 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5054 1.1 christos "Store double word")
5055 1.1 christos (store-double-r-r stdf DF OP_03 OPE1_0B FR FR-ACCESS
5056 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5057 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5058 1.1 christos "Store double float")
5059 1.1 christos
5060 1.1 christos (store-double-r-r stdc DI OP_03 OPE1_26 CPR (MACH frv)
5061 1.1 christos () "Store coprocessor double word")
5062 1.1 christos
5063 1.1 christos ; Semantics for a store-quad insn
5064 1.1 christos ;
5065 1.1 christos (define-pmacro (store-quad-semantics regtype address arg)
5066 1.1 christos (sequence ()
5067 1.1 christos (set address (add GRi arg))
5068 1.1 christos (c-call VOID (.str "@cpu@_store_quad_" regtype)
5069 1.1 christos pc address (index-of (.sym regtype k))))
5070 1.1 christos )
5071 1.1 christos
5072 1.1 christos (define-pmacro (store-quad-r-r name op ope regtype attr profile comment)
5073 1.1 christos (dni name
5074 1.1 christos (comment)
5075 1.1 christos ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
5076 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$GRj)")
5077 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
5078 1.1 christos (sequence ((WI address))
5079 1.1 christos (store-quad-semantics regtype address GRj))
5080 1.1 christos profile
5081 1.1 christos )
5082 1.1 christos )
5083 1.1 christos
5084 1.1 christos (store-quad-r-r stq OP_03 OPE1_04 GR NA
5085 1.1 christos ((fr500 (unit u-gr-store))) "Store quad word")
5086 1.1 christos (store-quad-r-r stqf OP_03 OPE1_0C FRint FR-ACCESS
5087 1.1 christos ((fr500 (unit u-fr-store)))
5088 1.1 christos "Store quad float")
5089 1.1 christos (store-quad-r-r stqc OP_03 OPE1_27 CPR NA
5090 1.1 christos () "Store coprocessor quad word")
5091 1.1 christos
5092 1.1 christos (define-pmacro (store-r-r-u name mode op ope regtype attr profile comment)
5093 1.1 christos (dni name
5094 1.1 christos (comment)
5095 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5096 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5097 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$GRj)")
5098 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
5099 1.1 christos (sequence ((UWI address))
5100 1.1 christos (set address (add GRi GRj))
5101 1.1 christos (c-call VOID (.str "@cpu@_write_mem_" mode)
5102 1.1 christos pc address (.sym regtype k))
5103 1.1 christos (set GRi address))
5104 1.1 christos profile
5105 1.1 christos )
5106 1.1 christos )
5107 1.1 christos
5108 1.1 christos (store-r-r-u stbu QI OP_03 OPE1_10 GR NA
5109 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5110 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5111 1.1 christos "Store unsigned byte, update index")
5112 1.1 christos (store-r-r-u sthu HI OP_03 OPE1_11 GR NA
5113 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5114 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5115 1.1 christos "Store unsigned half, update index")
5116 1.1 christos (store-r-r-u stu WI OP_03 OPE1_12 GR NA
5117 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5118 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5119 1.1 christos "Store word, update index")
5120 1.1 christos
5121 1.1 christos (store-r-r-u stbfu QI OP_03 OPE1_18 FRint FR-ACCESS
5122 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5123 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5124 1.1 christos "Store byte float, update index")
5125 1.1 christos (store-r-r-u sthfu HI OP_03 OPE1_19 FRint FR-ACCESS
5126 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5127 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5128 1.1 christos "Store half float, update index")
5129 1.1 christos (store-r-r-u stfu SI OP_03 OPE1_1A FRint FR-ACCESS
5130 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5131 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5132 1.1 christos "Store word float, update index")
5133 1.1 christos
5134 1.1 christos (store-r-r-u stcu SI OP_03 OPE1_2D CPR (MACH frv) ()
5135 1.1 christos "Store coprocessor word, update index")
5136 1.1 christos
5137 1.1 christos (define-pmacro (store-double-r-r-u
5138 1.1 christos name mode op ope regtype attr profile comment)
5139 1.1 christos (dni name
5140 1.1 christos (comment)
5141 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5142 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5143 1.1 christos (.str name "$pack $" regtype "doublek,@($GRi,$GRj)")
5144 1.1 christos (+ pack (.sym regtype doublek) op GRi ope GRj)
5145 1.1 christos (sequence ((WI address))
5146 1.1 christos (store-double-semantics mode regtype address GRj)
5147 1.1 christos (set GRi address))
5148 1.1 christos profile
5149 1.1 christos )
5150 1.1 christos )
5151 1.1 christos
5152 1.1 christos (store-double-r-r-u stdu DI OP_03 OPE1_13 GR NA
5153 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5154 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5155 1.1 christos "Store double word, update index")
5156 1.1 christos (store-double-r-r-u stdfu DF OP_03 OPE1_1B FR FR-ACCESS
5157 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5158 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5159 1.1 christos "Store double float,update index")
5160 1.1 christos (store-double-r-r-u stdcu DI OP_03 OPE1_2E CPR (MACH frv) ()
5161 1.1 christos "Store coprocessor double word, update index")
5162 1.1 christos
5163 1.1 christos (define-pmacro (store-quad-r-r-u name op ope regtype attr profile comment)
5164 1.1 christos (dni name
5165 1.1 christos (comment)
5166 1.1 christos ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
5167 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$GRj)")
5168 1.1 christos (+ pack (.sym regtype k) op GRi ope GRj)
5169 1.1 christos (sequence ((WI address))
5170 1.1 christos (store-quad-semantics regtype address GRj)
5171 1.1 christos (set GRi address))
5172 1.1 christos profile
5173 1.1 christos )
5174 1.1 christos )
5175 1.1 christos
5176 1.1 christos (store-quad-r-r-u stqu OP_03 OPE1_14 GR NA
5177 1.1 christos ((fr500 (unit u-gr-store)))
5178 1.1 christos "Store quad word, update index")
5179 1.1 christos (store-quad-r-r-u stqfu OP_03 OPE1_1C FRint FR-ACCESS
5180 1.1 christos ((fr500 (unit u-fr-store)))
5181 1.1 christos "Store quad float, update index")
5182 1.1 christos (store-quad-r-r-u stqcu OP_03 OPE1_2F CPR NA ()
5183 1.1 christos "Store coprocessor quad word, update index")
5184 1.1 christos
5185 1.1 christos (define-pmacro (conditional-load name mode op ope regtype profile comment)
5186 1.1 christos (dni name
5187 1.1 christos (comment)
5188 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5189 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
5190 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond")
5191 1.1 christos (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5192 1.1 christos (if (eq CCi (or cond 2))
5193 1.1 christos (set (.sym regtype k)
5194 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode) pc (add GRi GRj))))
5195 1.1 christos profile
5196 1.1 christos )
5197 1.1 christos )
5198 1.1 christos
5199 1.1 christos (conditional-load cldsb QI OP_5E OPE4_0 GR
5200 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5201 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5202 1.1 christos "Load signed byte")
5203 1.1 christos (conditional-load cldub UQI OP_5E OPE4_1 GR
5204 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5205 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5206 1.1 christos "Load unsigned byte")
5207 1.1 christos (conditional-load cldsh HI OP_5E OPE4_2 GR
5208 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5209 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5210 1.1 christos "Load signed half")
5211 1.1 christos (conditional-load clduh UHI OP_5E OPE4_3 GR
5212 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5213 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5214 1.1 christos "Load unsigned half")
5215 1.1 christos (conditional-load cld SI OP_5F OPE4_0 GR
5216 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5217 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5218 1.1 christos "Load word")
5219 1.1 christos
5220 1.1 christos (conditional-load cldbf UQI OP_60 OPE4_0 FRint
5221 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5222 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5223 1.1 christos "Load byte float")
5224 1.1 christos (conditional-load cldhf UHI OP_60 OPE4_1 FRint
5225 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5226 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5227 1.1 christos "Load half float")
5228 1.1 christos (conditional-load cldf SI OP_60 OPE4_2 FRint
5229 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5230 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5231 1.1 christos "Load word float")
5232 1.1 christos
5233 1.1 christos (define-pmacro (conditional-load-double
5234 1.1 christos name not_gr mode op ope regtype attr profile comment)
5235 1.1 christos (dni name
5236 1.1 christos (comment)
5237 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5238 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL attr)
5239 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "doublek,$CCi,$cond")
5240 1.1 christos (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
5241 1.1 christos (if (eq CCi (or cond 2))
5242 1.1 christos (sequence ((WI address))
5243 1.1 christos (load-double-semantics not_gr mode regtype address GRj)))
5244 1.1 christos profile
5245 1.1 christos )
5246 1.1 christos )
5247 1.1 christos
5248 1.1 christos (conditional-load-double cldd 0 DI OP_5F OPE4_1 GR NA
5249 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5250 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5251 1.1 christos "Load double word")
5252 1.1 christos (conditional-load-double clddf 1 DF OP_60 OPE4_3 FR FR-ACCESS
5253 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5254 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-fr-load)))
5255 1.1 christos "Load double float")
5256 1.1 christos
5257 1.1 christos (dni cldq
5258 1.1 christos "conditional load quad integer"
5259 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL)
5260 1.1 christos "cldq$pack @($GRi,$GRj),$GRk,$CCi,$cond"
5261 1.1 christos (+ pack GRk OP_5F GRi CCi cond OPE4_2 GRj)
5262 1.1 christos (if (eq CCi (or cond 2))
5263 1.1 christos (sequence ((WI address))
5264 1.1 christos (load-quad-semantics GR address GRj)))
5265 1.1 christos ((fr500 (unit u-gr-load)))
5266 1.1 christos )
5267 1.1 christos
5268 1.1 christos (define-pmacro (conditional-load-gr-u name mode op ope comment)
5269 1.1 christos (dni name
5270 1.1 christos (comment)
5271 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5272 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
5273 1.1 christos (.str name "$pack @($GRi,$GRj),$GRk,$CCi,$cond")
5274 1.1 christos (+ pack GRk op GRi CCi cond ope GRj)
5275 1.1 christos (if (eq CCi (or cond 2))
5276 1.1 christos (sequence ((WI address))
5277 1.1 christos (set address (add GRi GRj))
5278 1.1 christos (set GRk
5279 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode)
5280 1.1 christos pc address))
5281 1.1 christos (if (ne (index-of GRi) (index-of GRk))
5282 1.1 christos (set GRi address))))
5283 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5284 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5285 1.1 christos )
5286 1.1 christos )
5287 1.1 christos
5288 1.1 christos (conditional-load-gr-u cldsbu QI OP_61 OPE4_0 "Load signed byte, update")
5289 1.1 christos (conditional-load-gr-u cldubu UQI OP_61 OPE4_1 "Load unsigned byte, update")
5290 1.1 christos (conditional-load-gr-u cldshu HI OP_61 OPE4_2 "Load signed half, update")
5291 1.1 christos (conditional-load-gr-u clduhu UHI OP_61 OPE4_3 "Load unsigned half, update")
5292 1.1 christos (conditional-load-gr-u cldu SI OP_62 OPE4_0 "Load word, update")
5293 1.1 christos
5294 1.1 christos (define-pmacro (conditional-load-non-gr-u name mode op ope regtype comment)
5295 1.1 christos (dni name
5296 1.1 christos (comment)
5297 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5298 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS)
5299 1.1 christos (.str name "$pack @($GRi,$GRj),$" regtype "k,$CCi,$cond")
5300 1.1 christos (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5301 1.1 christos (if (eq CCi (or cond 2))
5302 1.1 christos (sequence ((WI address))
5303 1.1 christos (set address (add GRi GRj))
5304 1.1 christos (set (.sym regtype k)
5305 1.1 christos (c-call mode (.str "@cpu@_read_mem_" mode)
5306 1.1 christos pc address))
5307 1.1 christos (set GRi address)))
5308 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5309 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5310 1.1 christos )
5311 1.1 christos )
5312 1.1 christos
5313 1.1 christos (conditional-load-non-gr-u cldbfu UQI OP_63 OPE4_0 FRint "Load byte float, update")
5314 1.1 christos (conditional-load-non-gr-u cldhfu UHI OP_63 OPE4_1 FRint "Load half float, update")
5315 1.1 christos (conditional-load-non-gr-u cldfu SI OP_63 OPE4_2 FRint "Load word float, update")
5316 1.1 christos
5317 1.1 christos
5318 1.1 christos (dni clddu
5319 1.1 christos "Load double word, update"
5320 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5321 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL)
5322 1.1 christos "clddu$pack @($GRi,$GRj),$GRdoublek,$CCi,$cond"
5323 1.1 christos (+ pack GRdoublek OP_62 GRi CCi cond OPE4_1 GRj)
5324 1.1 christos (if (eq CCi (or cond 2))
5325 1.1 christos (sequence ((WI address))
5326 1.1 christos (load-double-semantics 0 DI GR address GRj)
5327 1.1 christos (if (ne (index-of GRi) (index-of GRdoublek))
5328 1.1 christos (set GRi address))))
5329 1.1 christos ((fr400 (unit u-gr-load)) (fr450 (unit u-gr-load))
5330 1.1 christos (fr500 (unit u-gr-load)) (fr550 (unit u-gr-load)))
5331 1.1 christos )
5332 1.1 christos
5333 1.1 christos (dni clddfu
5334 1.1 christos "Load double float, update"
5335 1.1 christos ((UNIT LOAD) (FR550-MAJOR I-3) (FR500-MAJOR I-2)
5336 1.1 christos (FR400-MAJOR I-2) (FR450-MAJOR I-2) CONDITIONAL FR-ACCESS)
5337 1.1 christos "clddfu$pack @($GRi,$GRj),$FRdoublek,$CCi,$cond"
5338 1.1 christos (+ pack FRdoublek OP_63 GRi CCi cond OPE4_3 GRj)
5339 1.1 christos (if (eq CCi (or cond 2))
5340 1.1 christos (sequence ((WI address))
5341 1.1 christos (load-double-semantics 1 DF FR address GRj)
5342 1.1 christos (set GRi address)))
5343 1.1 christos ((fr400 (unit u-fr-load)) (fr450 (unit u-fr-load))
5344 1.1 christos (fr500 (unit u-fr-load)) (fr550 (unit u-fr-load)))
5345 1.1 christos )
5346 1.1 christos
5347 1.1 christos (dni cldqu
5348 1.1 christos "conditional load quad integer and update index"
5349 1.1 christos ((UNIT LOAD) (FR500-MAJOR I-2) (MACH frv) CONDITIONAL)
5350 1.1 christos "cldqu$pack @($GRi,$GRj),$GRk,$CCi,$cond"
5351 1.1 christos (+ pack GRk OP_62 GRi CCi cond OPE4_2 GRj)
5352 1.1 christos (if (eq CCi (or cond 2))
5353 1.1 christos (sequence ((WI address))
5354 1.1 christos (load-quad-semantics GR address GRj)
5355 1.1 christos (if (ne (index-of GRi) (index-of GRk))
5356 1.1 christos (set GRi address))))
5357 1.1 christos ((fr500 (unit u-gr-load)))
5358 1.1 christos )
5359 1.1 christos
5360 1.1 christos (define-pmacro (conditional-store name mode op ope regtype profile comment)
5361 1.1 christos (dni name
5362 1.1 christos (comment)
5363 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5364 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL)
5365 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond")
5366 1.1 christos (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5367 1.1 christos (if (eq CCi (or cond 2))
5368 1.1 christos (c-call VOID (.str "@cpu@_write_mem_" mode)
5369 1.1 christos pc (add GRi GRj) (.sym regtype k)))
5370 1.1 christos profile
5371 1.1 christos )
5372 1.1 christos )
5373 1.1 christos
5374 1.1 christos (conditional-store cstb QI OP_64 OPE4_0 GR
5375 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5376 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5377 1.1 christos "Store unsigned byte")
5378 1.1 christos (conditional-store csth HI OP_64 OPE4_1 GR
5379 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5380 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5381 1.1 christos "Store unsigned half")
5382 1.1 christos (conditional-store cst SI OP_64 OPE4_2 GR
5383 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5384 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5385 1.1 christos "Store word")
5386 1.1 christos
5387 1.1 christos (conditional-store cstbf QI OP_66 OPE4_0 FRint
5388 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5389 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5390 1.1 christos "Store byte float")
5391 1.1 christos (conditional-store csthf HI OP_66 OPE4_1 FRint
5392 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5393 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5394 1.1 christos "Store half float")
5395 1.1 christos (conditional-store cstf SI OP_66 OPE4_2 FRint
5396 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5397 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5398 1.1 christos "Store word float")
5399 1.1 christos
5400 1.1 christos (define-pmacro (conditional-store-double
5401 1.1 christos name mode op ope regtype attr profile comment)
5402 1.1 christos (dni name
5403 1.1 christos (comment)
5404 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5405 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
5406 1.1 christos (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond")
5407 1.1 christos (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
5408 1.1 christos (if (eq CCi (or cond 2))
5409 1.1 christos (sequence ((WI address))
5410 1.1 christos (store-double-semantics mode regtype address GRj)))
5411 1.1 christos profile
5412 1.1 christos )
5413 1.1 christos )
5414 1.1 christos
5415 1.1 christos (conditional-store-double cstd DI OP_64 OPE4_3 GR NA
5416 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5417 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5418 1.1 christos "Store double word")
5419 1.1 christos (conditional-store-double cstdf DF OP_66 OPE4_3 FR FR-ACCESS
5420 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5421 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5422 1.1 christos "Store double float")
5423 1.1 christos
5424 1.1 christos (dni cstq
5425 1.1 christos "conditionally store quad word"
5426 1.1 christos ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) CONDITIONAL)
5427 1.1 christos "cstq$pack $GRk,@($GRi,$GRj),$CCi,$cond"
5428 1.1 christos (+ pack GRk OP_65 GRi CCi cond OPE4_0 GRj)
5429 1.1 christos (if (eq CCi (or cond 2))
5430 1.1 christos (sequence ((WI address))
5431 1.1 christos (store-quad-semantics GR address GRj)))
5432 1.1 christos ((fr500 (unit u-gr-store)))
5433 1.1 christos )
5434 1.1 christos
5435 1.1 christos (define-pmacro (conditional-store-u
5436 1.1 christos name mode op ope regtype attr profile comment)
5437 1.1 christos (dni name
5438 1.1 christos (comment)
5439 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5440 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
5441 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$GRj),$CCi,$cond")
5442 1.1 christos (+ pack (.sym regtype k) op GRi CCi cond ope GRj)
5443 1.1 christos (if (eq CCi (or cond 2))
5444 1.1 christos (sequence ((WI address))
5445 1.1 christos (set address (add GRi GRj))
5446 1.1 christos (c-call VOID (.str "@cpu@_write_mem_" mode)
5447 1.1 christos pc address (.sym regtype k))
5448 1.1 christos (set GRi address)))
5449 1.1 christos profile
5450 1.1 christos )
5451 1.1 christos )
5452 1.1 christos
5453 1.1 christos (conditional-store-u cstbu QI OP_67 OPE4_0 GR NA
5454 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5455 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5456 1.1 christos "Store unsigned byte, update index")
5457 1.1 christos (conditional-store-u csthu HI OP_67 OPE4_1 GR NA
5458 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5459 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5460 1.1 christos "Store unsigned half, update index")
5461 1.1 christos (conditional-store-u cstu SI OP_67 OPE4_2 GR NA
5462 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5463 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5464 1.1 christos "Store word, update index")
5465 1.1 christos
5466 1.1 christos (conditional-store-u cstbfu QI OP_68 OPE4_0 FRint FR-ACCESS
5467 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5468 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5469 1.1 christos "Store byte float, update index")
5470 1.1 christos (conditional-store-u csthfu HI OP_68 OPE4_1 FRint FR-ACCESS
5471 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5472 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5473 1.1 christos "Store half float, update index")
5474 1.1 christos (conditional-store-u cstfu SI OP_68 OPE4_2 FRint FR-ACCESS
5475 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5476 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5477 1.1 christos "Store word float, update index")
5478 1.1 christos
5479 1.1 christos (define-pmacro (conditional-store-double-u
5480 1.1 christos name mode op ope regtype attr profile comment)
5481 1.1 christos (dni name
5482 1.1 christos (comment)
5483 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5484 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) CONDITIONAL attr)
5485 1.1 christos (.str name "$pack $" regtype "doublek,@($GRi,$GRj),$CCi,$cond")
5486 1.1 christos (+ pack (.sym regtype doublek) op GRi CCi cond ope GRj)
5487 1.1 christos (if (eq CCi (or cond 2))
5488 1.1 christos (sequence ((WI address))
5489 1.1 christos (store-double-semantics mode regtype address GRj)
5490 1.1 christos (set GRi address)))
5491 1.1 christos profile
5492 1.1 christos )
5493 1.1 christos )
5494 1.1 christos
5495 1.1 christos (conditional-store-double-u cstdu DI OP_67 OPE4_3 GR NA
5496 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5497 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5498 1.1 christos "Store double word, update index")
5499 1.1 christos (conditional-store-double-u cstdfu DF OP_68 OPE4_3 FR FR-ACCESS
5500 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5501 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5502 1.1 christos "Store double float, update index")
5503 1.1 christos
5504 1.1 christos (define-pmacro (store-r-simm name mode op regtype attr profile comment)
5505 1.1 christos (dni name
5506 1.1 christos (comment)
5507 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5508 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5509 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$d12)")
5510 1.1 christos (+ pack (.sym regtype k) op GRi d12)
5511 1.1 christos (c-call VOID (.str "@cpu@_write_mem_" mode)
5512 1.1 christos pc (add GRi d12) (.sym regtype k))
5513 1.1 christos profile
5514 1.1 christos )
5515 1.1 christos )
5516 1.1 christos
5517 1.1 christos (store-r-simm stbi QI OP_50 GR NA
5518 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5519 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5520 1.1 christos "Store unsigned byte")
5521 1.1 christos (store-r-simm sthi HI OP_51 GR NA
5522 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5523 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5524 1.1 christos "Store unsigned half")
5525 1.1 christos (store-r-simm sti SI OP_52 GR NA
5526 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5527 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5528 1.1 christos "Store word")
5529 1.1 christos
5530 1.1 christos (store-r-simm stbfi QI OP_4E FRint FR-ACCESS
5531 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5532 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5533 1.1 christos "Store byte float")
5534 1.1 christos (store-r-simm sthfi HI OP_4F FRint FR-ACCESS
5535 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5536 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5537 1.1 christos "Store half float")
5538 1.1 christos (store-r-simm stfi SI OP_55 FRint FR-ACCESS
5539 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5540 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5541 1.1 christos "Store word float")
5542 1.1 christos
5543 1.1 christos (define-pmacro (store-double-r-simm name mode op regtype attr profile comment)
5544 1.1 christos (dni name
5545 1.1 christos (comment)
5546 1.1 christos ((UNIT STORE) (FR550-MAJOR I-4) (FR500-MAJOR I-3)
5547 1.1 christos (FR400-MAJOR I-3) (FR450-MAJOR I-3) attr)
5548 1.1 christos (.str name "$pack $" regtype "doublek,@($GRi,$d12)")
5549 1.1 christos (+ pack (.sym regtype doublek) op GRi d12)
5550 1.1 christos (sequence ((WI address))
5551 1.1 christos (store-double-semantics mode regtype address d12))
5552 1.1 christos profile
5553 1.1 christos )
5554 1.1 christos )
5555 1.1 christos
5556 1.1 christos (store-double-r-simm stdi DI OP_53 GR NA
5557 1.1 christos ((fr400 (unit u-gr-store)) (fr450 (unit u-gr-store))
5558 1.1 christos (fr500 (unit u-gr-store)) (fr550 (unit u-gr-store)))
5559 1.1 christos "Store double word")
5560 1.1 christos (store-double-r-simm stdfi DF OP_56 FR FR-ACCESS
5561 1.1 christos ((fr400 (unit u-fr-store)) (fr450 (unit u-fr-store))
5562 1.1 christos (fr500 (unit u-fr-store)) (fr550 (unit u-fr-store)))
5563 1.1 christos "Store double float")
5564 1.1 christos
5565 1.1 christos (define-pmacro (store-quad-r-simm name op regtype attr profile comment)
5566 1.1 christos (dni name
5567 1.1 christos (comment)
5568 1.1 christos ((UNIT STORE) (FR500-MAJOR I-3) (MACH frv) attr)
5569 1.1 christos (.str name "$pack $" regtype "k,@($GRi,$d12)")
5570 1.1 christos (+ pack (.sym regtype k) op GRi d12)
5571 1.1 christos (sequence ((WI address))
5572 1.1 christos (store-quad-semantics regtype address d12))
5573 1.1 christos profile
5574 1.1 christos )
5575 1.1 christos )
5576 1.1 christos
5577 1.1 christos (store-quad-r-simm stqi OP_54 GR NA ((fr500 (unit u-gr-store)))
5578 1.1 christos "Store quad word")
5579 1.1 christos (store-quad-r-simm stqfi OP_57 FRint FR-ACCESS ()
5580 1.1 christos "Store quad float")
5581 1.1 christos
5582 1.1 christos (define-pmacro (swap-semantics base offset arg)
5583 1.1 christos (sequence ((WI tmp) (WI address))
5584 1.1 christos (set tmp arg)
5585 1.1 christos (set address (add base offset))
5586 1.1 christos (c-call VOID "@cpu@_check_swap_address" address)
5587 1.1 christos (set arg (c-call WI "@cpu@_read_mem_WI" pc address))
5588 1.1 christos (c-call VOID "@cpu@_write_mem_WI" pc address tmp))
5589 1.1 christos )
5590 1.1 christos
5591 1.1 christos (dni swap
5592 1.1 christos "Swap contents of memory with GR"
5593 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5594 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
5595 1.1 christos "swap$pack @($GRi,$GRj),$GRk"
5596 1.1 christos (+ pack GRk OP_03 GRi OPE1_05 GRj)
5597 1.1 christos (swap-semantics GRi GRj GRk)
5598 1.1 christos ((fr400 (unit u-swap)) (fr450 (unit u-swap))
5599 1.1 christos (fr500 (unit u-swap)) (fr550 (unit u-swap)))
5600 1.1 christos )
5601 1.1 christos
5602 1.1 christos (dni "swapi"
5603 1.1 christos "Swap contents of memory with GR"
5604 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5605 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
5606 1.1 christos ("swapi$pack @($GRi,$d12),$GRk")
5607 1.1 christos (+ pack GRk OP_4D GRi d12)
5608 1.1 christos (swap-semantics GRi d12 GRk)
5609 1.1 christos ((fr400 (unit u-swap)) (fr450 (unit u-swap))
5610 1.1 christos (fr500 (unit u-swap)) (fr550 (unit u-swap)))
5611 1.1 christos )
5612 1.1 christos
5613 1.1 christos (dni cswap
5614 1.1 christos "Conditionally swap contents of memory with GR"
5615 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5616 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2) CONDITIONAL)
5617 1.1 christos "cswap$pack @($GRi,$GRj),$GRk,$CCi,$cond"
5618 1.1 christos (+ pack GRk OP_65 GRi CCi cond OPE4_2 GRj)
5619 1.1 christos (if (eq CCi (or cond 2))
5620 1.1 christos (swap-semantics GRi GRj GRk))
5621 1.1 christos ((fr400 (unit u-swap)) (fr450 (unit u-swap))
5622 1.1 christos (fr500 (unit u-swap)) (fr550 (unit u-swap)))
5623 1.1 christos )
5624 1.1 christos
5625 1.1 christos (define-pmacro (register-transfer
5626 1.1 christos name op ope reg_src reg_targ pipe attrs profile comment)
5627 1.1 christos (dni name
5628 1.1 christos (comment)
5629 1.1 christos (.splice (UNIT pipe) (.unsplice attrs))
5630 1.1 christos (.str name "$pack $" reg_src ",$" reg_targ)
5631 1.1 christos (+ pack reg_targ op (rs-null) ope reg_src)
5632 1.1 christos (set reg_targ reg_src)
5633 1.1 christos profile
5634 1.1 christos )
5635 1.1 christos )
5636 1.1 christos
5637 1.1 christos (register-transfer movgf OP_03 OPE1_15
5638 1.1 christos GRj FRintk I0
5639 1.1 christos ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5640 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5641 1.1 christos ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5642 1.1 christos (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5643 1.1 christos "transfer gr to fr")
5644 1.1 christos (register-transfer movfg OP_03 OPE1_0D
5645 1.1 christos FRintk GRj I0
5646 1.1 christos ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5647 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5648 1.1 christos ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5649 1.1 christos (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5650 1.1 christos "transfer fr to gr")
5651 1.1 christos
5652 1.1 christos (define-pmacro (nextreg hw r offset) (reg hw (add (index-of r) offset)))
5653 1.1 christos
5654 1.1 christos (define-pmacro (register-transfer-double-from-gr-semantics cond)
5655 1.1 christos (if cond
5656 1.1 christos (if (eq (index-of GRj) 0)
5657 1.1 christos (sequence ()
5658 1.1 christos (set FRintk 0)
5659 1.1 christos (set (nextreg h-fr_int FRintk 1) 0))
5660 1.1 christos (sequence ()
5661 1.1 christos (set FRintk GRj)
5662 1.1 christos (set (nextreg h-fr_int FRintk 1) (nextreg h-gr GRj 1)))))
5663 1.1 christos )
5664 1.1 christos
5665 1.1 christos (dni movgfd
5666 1.1 christos "move GR for FR double"
5667 1.1 christos ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5668 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5669 1.1 christos "movgfd$pack $GRj,$FRintk"
5670 1.1 christos (+ pack FRintk OP_03 (rs-null) OPE1_16 GRj)
5671 1.1 christos (register-transfer-double-from-gr-semantics 1)
5672 1.1 christos ; TODO -- doesn't handle second register in the pair
5673 1.1 christos ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5674 1.1 christos (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5675 1.1 christos )
5676 1.1 christos
5677 1.1 christos (define-pmacro (register-transfer-double-to-gr-semantics cond)
5678 1.1 christos (if (andif (ne (index-of GRj) 0) cond)
5679 1.1 christos (sequence ()
5680 1.1 christos (set GRj FRintk)
5681 1.1 christos (set (nextreg h-gr GRj 1) (nextreg h-fr_int FRintk 1))))
5682 1.1 christos )
5683 1.1 christos
5684 1.1 christos (dni movfgd
5685 1.1 christos "move FR for GR double"
5686 1.1 christos ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5687 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4) FR-ACCESS)
5688 1.1 christos "movfgd$pack $FRintk,$GRj"
5689 1.1 christos (+ pack FRintk OP_03 (rs-null) OPE1_0E GRj)
5690 1.1 christos (register-transfer-double-to-gr-semantics 1)
5691 1.1 christos ; TODO -- doesn't handle second register in the pair
5692 1.1 christos ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5693 1.1 christos (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5694 1.1 christos )
5695 1.1 christos
5696 1.1 christos (dni movgfq
5697 1.1 christos "move GR for FR quad"
5698 1.1 christos ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS)
5699 1.1 christos "movgfq$pack $GRj,$FRintk"
5700 1.1 christos (+ pack FRintk OP_03 (rs-null) OPE1_17 GRj)
5701 1.1 christos (if (eq (index-of GRj) 0)
5702 1.1 christos (sequence ()
5703 1.1 christos (set FRintk 0)
5704 1.1 christos (set (reg h-fr_int (add (index-of FRintk) 1)) 0)
5705 1.1 christos (set (reg h-fr_int (add (index-of FRintk) 2)) 0)
5706 1.1 christos (set (reg h-fr_int (add (index-of FRintk) 3)) 0))
5707 1.1 christos (sequence ()
5708 1.1 christos (set FRintk GRj)
5709 1.1 christos (set (reg h-fr_int (add (index-of FRintk) 1))
5710 1.1 christos (reg h-gr (add (index-of GRj) 1)))
5711 1.1 christos (set (reg h-fr_int (add (index-of FRintk) 2))
5712 1.1 christos (reg h-gr (add (index-of GRj) 2)))
5713 1.1 christos (set (reg h-fr_int (add (index-of FRintk) 3))
5714 1.1 christos (reg h-gr (add (index-of GRj) 3)))))
5715 1.1 christos ()
5716 1.1 christos )
5717 1.1 christos
5718 1.1 christos (dni movfgq
5719 1.1 christos "move FR for GR quad"
5720 1.1 christos ((UNIT I0) (FR500-MAJOR I-4) (MACH frv) FR-ACCESS)
5721 1.1 christos "movfgq$pack $FRintk,$GRj"
5722 1.1 christos (+ pack FRintk OP_03 (rs-null) OPE1_0F GRj)
5723 1.1 christos (if (ne (index-of GRj) 0)
5724 1.1 christos (sequence ()
5725 1.1 christos (set GRj FRintk)
5726 1.1 christos (set (reg h-gr (add (index-of GRj) 1))
5727 1.1 christos (reg h-fr_int (add (index-of FRintk) 1)))
5728 1.1 christos (set (reg h-gr (add (index-of GRj) 2))
5729 1.1 christos (reg h-fr_int (add (index-of FRintk) 2)))
5730 1.1 christos (set (reg h-gr (add (index-of GRj) 3))
5731 1.1 christos (reg h-fr_int (add (index-of FRintk) 3)))))
5732 1.1 christos ()
5733 1.1 christos )
5734 1.1 christos
5735 1.1 christos (define-pmacro (conditional-register-transfer
5736 1.1 christos name op ope reg_src reg_targ pipe attrs profile comment)
5737 1.1 christos (dni name
5738 1.1 christos (comment)
5739 1.1 christos (.splice (UNIT pipe) CONDITIONAL FR-ACCESS (.unsplice attrs))
5740 1.1 christos (.str name "$pack $" reg_src ",$" reg_targ ",$CCi,$cond")
5741 1.1 christos (+ pack reg_targ op (rs-null) CCi cond ope reg_src)
5742 1.1 christos (if (eq CCi (or cond 2))
5743 1.1 christos (set reg_targ reg_src))
5744 1.1 christos profile
5745 1.1 christos )
5746 1.1 christos )
5747 1.1 christos
5748 1.1 christos (conditional-register-transfer cmovgf OP_69 OPE4_0 GRj FRintk I0
5749 1.1 christos ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5750 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4))
5751 1.1 christos ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5752 1.1 christos (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5753 1.1 christos "transfer gr to fr")
5754 1.1 christos (conditional-register-transfer cmovfg OP_69 OPE4_2 FRintk GRj I0
5755 1.1 christos ((FR500-MAJOR I-4) (FR550-MAJOR I-5)
5756 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4))
5757 1.1 christos ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5758 1.1 christos (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5759 1.1 christos "transfer fr to gr")
5760 1.1 christos
5761 1.1 christos
5762 1.1 christos (dni cmovgfd
5763 1.1 christos "Conditional move GR to FR double"
5764 1.1 christos ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5765 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS)
5766 1.1 christos "cmovgfd$pack $GRj,$FRintk,$CCi,$cond"
5767 1.1 christos (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_1 GRj)
5768 1.1 christos (register-transfer-double-from-gr-semantics (eq CCi (or cond 2)))
5769 1.1 christos ; TODO -- doesn't handle extra registers in double
5770 1.1 christos ((fr400 (unit u-gr2fr)) (fr450 (unit u-gr2fr))
5771 1.1 christos (fr500 (unit u-gr2fr)) (fr550 (unit u-gr2fr)))
5772 1.1 christos )
5773 1.1 christos
5774 1.1 christos (dni cmovfgd
5775 1.1 christos "Conditional move FR to GR double"
5776 1.1 christos ((UNIT I0) (FR500-MAJOR I-4) (FR550-MAJOR I-5)
5777 1.1 christos (FR400-MAJOR I-4) (FR450-MAJOR I-4) CONDITIONAL FR-ACCESS)
5778 1.1 christos "cmovfgd$pack $FRintk,$GRj,$CCi,$cond"
5779 1.1 christos (+ pack FRintk OP_69 (rs-null) CCi cond OPE4_3 GRj)
5780 1.1 christos (register-transfer-double-to-gr-semantics (eq CCi (or cond 2)))
5781 1.1 christos ; TODO -- doesn't handle second register in the pair
5782 1.1 christos ((fr400 (unit u-fr2gr)) (fr450 (unit u-fr2gr))
5783 1.1 christos (fr500 (unit u-fr2gr)) (fr550 (unit u-fr2gr)))
5784 1.1 christos )
5785 1.1 christos
5786 1.1 christos (define-pmacro (register-transfer-spr
5787 1.1 christos name op ope reg_src reg_targ unitname comment)
5788 1.1 christos (dni name
5789 1.1 christos (comment)
5790 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
5791 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
5792 1.1 christos (.str name "$pack $" reg_src ",$" reg_targ)
5793 1.1 christos (+ pack reg_targ op ope reg_src)
5794 1.1 christos (set reg_targ reg_src)
5795 1.1 christos ((fr400 (unit unitname)) (fr450 (unit unitname))
5796 1.1 christos (fr500 (unit unitname)) (fr550 (unit unitname)))
5797 1.1 christos )
5798 1.1 christos )
5799 1.1 christos
5800 1.1 christos (register-transfer-spr movgs OP_03 OPE1_06 GRj spr u-gr2spr "transfer gr->spr")
5801 1.1 christos (register-transfer-spr movsg OP_03 OPE1_07 spr GRj u-spr2gr "transfer spr->gr")
5802 1.1 christos
5803 1.1 christos ; Integer Branch Conditions
5804 1.1 christos (define-pmacro (Inev cc) (const BI 0))
5805 1.1 christos (define-pmacro (Ira cc) (const BI 1))
5806 1.1 christos (define-pmacro (Ieq cc) ( zbit cc))
5807 1.1 christos (define-pmacro (Ine cc) (not (zbit cc)))
5808 1.1 christos (define-pmacro (Ile cc) ( orif (zbit cc) (xor (nbit cc) (vbit cc))))
5809 1.1 christos (define-pmacro (Igt cc) (not (orif (zbit cc) (xor (nbit cc) (vbit cc)))))
5810 1.1 christos (define-pmacro (Ilt cc) ( xor (nbit cc) (vbit cc)))
5811 1.1 christos (define-pmacro (Ige cc) (not (xor (nbit cc) (vbit cc))))
5812 1.1 christos (define-pmacro (Ils cc) ( orif (cbit cc) (zbit cc)))
5813 1.1 christos (define-pmacro (Ihi cc) (not (orif (cbit cc) (zbit cc))))
5814 1.1 christos (define-pmacro (Ic cc) ( cbit cc))
5815 1.1 christos (define-pmacro (Inc cc) (not (cbit cc)))
5816 1.1 christos (define-pmacro (In cc) ( nbit cc))
5817 1.1 christos (define-pmacro (Ip cc) (not (nbit cc)))
5818 1.1 christos (define-pmacro (Iv cc) ( vbit cc))
5819 1.1 christos (define-pmacro (Inv cc) (not (vbit cc)))
5820 1.1 christos
5821 1.1 christos ; Float Branch Conditions
5822 1.1 christos (define-pmacro (Fnev cc) (const BI 0))
5823 1.1 christos (define-pmacro (Fra cc) (const BI 1))
5824 1.1 christos (define-pmacro (Fne cc) (orif (lbit cc) (orif (gbit cc) (ubit cc))))
5825 1.1 christos (define-pmacro (Feq cc) (ebit cc))
5826 1.1 christos (define-pmacro (Flg cc) (orif (lbit cc) (gbit cc)))
5827 1.1 christos (define-pmacro (Fue cc) (orif (ebit cc) (ubit cc)))
5828 1.1 christos (define-pmacro (Ful cc) (orif (lbit cc) (ubit cc)))
5829 1.1 christos (define-pmacro (Fge cc) (orif (ebit cc) (gbit cc)))
5830 1.1 christos (define-pmacro (Flt cc) (lbit cc))
5831 1.1 christos (define-pmacro (Fuge cc) (orif (ebit cc) (orif (gbit cc) (ubit cc))))
5832 1.1 christos (define-pmacro (Fug cc) (orif (gbit cc) (ubit cc)))
5833 1.1 christos (define-pmacro (Fle cc) (orif (ebit cc) (lbit cc)))
5834 1.1 christos (define-pmacro (Fgt cc) (gbit cc))
5835 1.1 christos (define-pmacro (Fule cc) (orif (ebit cc) (orif (lbit cc) (ubit cc))))
5836 1.1 christos (define-pmacro (Fu cc) (ubit cc))
5837 1.1 christos (define-pmacro (Fo cc) (orif (ebit cc) (orif (lbit cc) (gbit cc))))
5838 1.1 christos
5839 1.1 christos (define-pmacro (conditional-branch-i prefix cc op cond comment)
5840 1.1 christos (dni (.sym prefix cc)
5841 1.1 christos (comment)
5842 1.1 christos ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5843 1.1 christos (FR400-MAJOR B-1) (FR450-MAJOR B-1))
5844 1.1 christos (.str (.sym prefix cc) "$pack $ICCi_2,$hint,$label16")
5845 1.1 christos (+ pack (.sym ICC_ cc) ICCi_2 op hint label16)
5846 1.1 christos (sequence ()
5847 1.1 christos (c-call VOID "@cpu@_model_branch" label16 hint)
5848 1.1 christos (if (cond ICCi_2)
5849 1.1 christos (set pc label16)))
5850 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5851 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5852 1.1 christos )
5853 1.1 christos )
5854 1.1 christos
5855 1.1 christos (dni bra
5856 1.1 christos "integer branch equal"
5857 1.1 christos ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5858 1.1 christos (FR400-MAJOR B-1) (FR450-MAJOR B-1))
5859 1.1 christos "bra$pack $hint_taken$label16"
5860 1.1 christos (+ pack ICC_ra (ICCi_2-null) OP_06 hint_taken label16)
5861 1.1 christos (sequence ()
5862 1.1 christos (c-call VOID "@cpu@_model_branch" label16 hint_taken)
5863 1.1 christos (set pc label16))
5864 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5865 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5866 1.1 christos )
5867 1.1 christos
5868 1.1 christos (dni bno
5869 1.1 christos "integer branch never"
5870 1.1 christos ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5871 1.1 christos (FR400-MAJOR B-1) (FR450-MAJOR B-1))
5872 1.1 christos "bno$pack$hint_not_taken"
5873 1.1 christos (+ pack ICC_nev (ICCi_2-null) OP_06 hint_not_taken (label16-null))
5874 1.1 christos (c-call VOID "@cpu@_model_branch" label16 hint_not_taken)
5875 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5876 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5877 1.1 christos )
5878 1.1 christos
5879 1.1 christos (conditional-branch-i b eq OP_06 Ieq "integer branch equal")
5880 1.1 christos (conditional-branch-i b ne OP_06 Ine "integer branch not equal")
5881 1.1 christos (conditional-branch-i b le OP_06 Ile "integer branch less or equal")
5882 1.1 christos (conditional-branch-i b gt OP_06 Igt "integer branch greater")
5883 1.1 christos (conditional-branch-i b lt OP_06 Ilt "integer branch less")
5884 1.1 christos (conditional-branch-i b ge OP_06 Ige "integer branch greater or equal")
5885 1.1 christos (conditional-branch-i b ls OP_06 Ils "integer branch less or equal unsigned")
5886 1.1 christos (conditional-branch-i b hi OP_06 Ihi "integer branch greater unsigned")
5887 1.1 christos (conditional-branch-i b c OP_06 Ic "integer branch carry set")
5888 1.1 christos (conditional-branch-i b nc OP_06 Inc "integer branch carry clear")
5889 1.1 christos (conditional-branch-i b n OP_06 In "integer branch negative")
5890 1.1 christos (conditional-branch-i b p OP_06 Ip "integer branch positive")
5891 1.1 christos (conditional-branch-i b v OP_06 Iv "integer branch overflow set")
5892 1.1 christos (conditional-branch-i b nv OP_06 Inv "integer branch overflow clear")
5893 1.1 christos
5894 1.1 christos (define-pmacro (conditional-branch-f prefix cc op cond comment)
5895 1.1 christos (dni (.sym prefix cc)
5896 1.1 christos (comment)
5897 1.1 christos ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5898 1.1 christos (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
5899 1.1 christos (.str (.sym prefix cc) "$pack $FCCi_2,$hint,$label16")
5900 1.1 christos (+ pack (.sym FCC_ cc) FCCi_2 op hint label16)
5901 1.1 christos (sequence ()
5902 1.1 christos (c-call VOID "@cpu@_model_branch" label16 hint)
5903 1.1 christos (if (cond FCCi_2) (set pc label16)))
5904 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5905 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5906 1.1 christos )
5907 1.1 christos )
5908 1.1 christos
5909 1.1 christos (dni fbra
5910 1.1 christos "float branch equal"
5911 1.1 christos ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5912 1.1 christos (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
5913 1.1 christos "fbra$pack $hint_taken$label16"
5914 1.1 christos (+ pack FCC_ra (FCCi_2-null) OP_07 hint_taken label16)
5915 1.1 christos (sequence ()
5916 1.1 christos (c-call VOID "@cpu@_model_branch" label16 hint_taken)
5917 1.1 christos (set pc label16))
5918 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5919 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5920 1.1 christos )
5921 1.1 christos
5922 1.1 christos (dni fbno
5923 1.1 christos "float branch never"
5924 1.1 christos ((UNIT B01) (FR500-MAJOR B-1) (FR550-MAJOR B-1)
5925 1.1 christos (FR400-MAJOR B-1) (FR450-MAJOR B-1) FR-ACCESS)
5926 1.1 christos "fbno$pack$hint_not_taken"
5927 1.1 christos (+ pack FCC_nev (FCCi_2-null) OP_07 hint_not_taken (label16-null))
5928 1.1 christos (c-call VOID "@cpu@_model_branch" label16 hint_not_taken)
5929 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5930 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5931 1.1 christos )
5932 1.1 christos
5933 1.1 christos (conditional-branch-f fb ne OP_07 Fne "float branch not equal")
5934 1.1 christos (conditional-branch-f fb eq OP_07 Feq "float branch equal")
5935 1.1 christos (conditional-branch-f fb lg OP_07 Flg "float branch less or greater")
5936 1.1 christos (conditional-branch-f fb ue OP_07 Fue "float branch unordered or equal")
5937 1.1 christos (conditional-branch-f fb ul OP_07 Ful "float branch unordered or less")
5938 1.1 christos (conditional-branch-f fb ge OP_07 Fge "float branch greater or equal")
5939 1.1 christos (conditional-branch-f fb lt OP_07 Flt "float branch less")
5940 1.1 christos (conditional-branch-f fb uge OP_07 Fuge "float branch unordered, greater,equal")
5941 1.1 christos (conditional-branch-f fb ug OP_07 Fug "float branch unordered or greater")
5942 1.1 christos (conditional-branch-f fb le OP_07 Fle "float branch less or equal")
5943 1.1 christos (conditional-branch-f fb gt OP_07 Fgt "float branch greater")
5944 1.1 christos (conditional-branch-f fb ule OP_07 Fule "float branch unordered, less or equal")
5945 1.1 christos (conditional-branch-f fb u OP_07 Fu "float branch unordered")
5946 1.1 christos (conditional-branch-f fb o OP_07 Fo "float branch ordered")
5947 1.1 christos
5948 1.1 christos (define-pmacro (ctrlr-branch-semantics cond ccond)
5949 1.1 christos (sequence ((SI tmp))
5950 1.1 christos (set tmp (sub (spr-lcr) 1))
5951 1.1 christos (set (spr-lcr) tmp)
5952 1.1 christos (if cond
5953 1.1 christos (if (eq ccond 0)
5954 1.1 christos (if (ne tmp 0)
5955 1.1 christos (set pc (spr-lr)))
5956 1.1 christos (if (eq tmp 0)
5957 1.1 christos (set pc (spr-lr))))))
5958 1.1 christos )
5959 1.1 christos
5960 1.1 christos (dni bctrlr
5961 1.1 christos "LCR conditional branch to lr"
5962 1.1 christos ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
5963 1.1 christos (FR400-MAJOR B-2) (FR450-MAJOR B-2))
5964 1.1 christos ("bctrlr$pack $ccond,$hint")
5965 1.1 christos (+ pack (cond-null) (ICCi_2-null) OP_0E hint OPE3_01 ccond (s12-null))
5966 1.1 christos (sequence ()
5967 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
5968 1.1 christos (ctrlr-branch-semantics (const BI 1) ccond))
5969 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5970 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5971 1.1 christos )
5972 1.1 christos
5973 1.1 christos (define-pmacro (conditional-branch-cclr prefix cc i-f op ope cond attr comment)
5974 1.1 christos (dni (.sym prefix cc lr)
5975 1.1 christos (comment)
5976 1.1 christos ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
5977 1.1 christos (FR400-MAJOR B-3) (FR450-MAJOR B-3) attr)
5978 1.1 christos (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$hint")
5979 1.1 christos (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope
5980 1.1 christos (ccond-null) (s12-null))
5981 1.1 christos (sequence ()
5982 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
5983 1.1 christos (if (cond (.sym i-f CCi_2)) (set pc (spr-lr))))
5984 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5985 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
5986 1.1 christos )
5987 1.1 christos )
5988 1.1 christos
5989 1.1 christos (dni bralr
5990 1.1 christos "integer cclr branch always"
5991 1.1 christos ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
5992 1.1 christos (FR400-MAJOR B-3) (FR450-MAJOR B-3))
5993 1.1 christos "bralr$pack$hint_taken"
5994 1.1 christos (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_02 (ccond-null) (s12-null))
5995 1.1 christos (sequence ()
5996 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
5997 1.1 christos (set pc (spr-lr)))
5998 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
5999 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6000 1.1 christos )
6001 1.1 christos
6002 1.1 christos (dni bnolr
6003 1.1 christos "integer cclr branch never"
6004 1.1 christos ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
6005 1.1 christos (FR400-MAJOR B-3) (FR450-MAJOR B-3))
6006 1.1 christos "bnolr$pack$hint_not_taken"
6007 1.1 christos (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_02 (ccond-null) (s12-null))
6008 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6009 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6010 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6011 1.1 christos )
6012 1.1 christos
6013 1.1 christos (conditional-branch-cclr b eq I OP_0E OPE3_02 Ieq NA "integer cclr branch equal")
6014 1.1 christos (conditional-branch-cclr b ne I OP_0E OPE3_02 Ine NA "integer cclr branch not equal")
6015 1.1 christos (conditional-branch-cclr b le I OP_0E OPE3_02 Ile NA "integer cclr branch less or equal")
6016 1.1 christos (conditional-branch-cclr b gt I OP_0E OPE3_02 Igt NA "integer cclr branch greater")
6017 1.1 christos (conditional-branch-cclr b lt I OP_0E OPE3_02 Ilt NA "integer cclr branch less")
6018 1.1 christos (conditional-branch-cclr b ge I OP_0E OPE3_02 Ige NA "integer cclr branch greater or equal")
6019 1.1 christos (conditional-branch-cclr b ls I OP_0E OPE3_02 Ils NA "integer cclr branch less or equal unsigned")
6020 1.1 christos (conditional-branch-cclr b hi I OP_0E OPE3_02 Ihi NA "integer cclr branch greater unsigned")
6021 1.1 christos (conditional-branch-cclr b c I OP_0E OPE3_02 Ic NA "integer cclr branch carry set")
6022 1.1 christos (conditional-branch-cclr b nc I OP_0E OPE3_02 Inc NA "integer cclr branch carry clear")
6023 1.1 christos (conditional-branch-cclr b n I OP_0E OPE3_02 In NA "integer cclr branch negative")
6024 1.1 christos (conditional-branch-cclr b p I OP_0E OPE3_02 Ip NA "integer cclr branch positive")
6025 1.1 christos (conditional-branch-cclr b v I OP_0E OPE3_02 Iv NA "integer cclr branch overflow set")
6026 1.1 christos (conditional-branch-cclr b nv I OP_0E OPE3_02 Inv NA "integer cclr branch overflow clear")
6027 1.1 christos
6028 1.1 christos (dni fbralr
6029 1.1 christos "float cclr branch always"
6030 1.1 christos ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
6031 1.1 christos (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS)
6032 1.1 christos "fbralr$pack$hint_taken"
6033 1.1 christos (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_06 (ccond-null) (s12-null))
6034 1.1 christos (sequence ()
6035 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
6036 1.1 christos (set pc (spr-lr)))
6037 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6038 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6039 1.1 christos )
6040 1.1 christos
6041 1.1 christos (dni fbnolr
6042 1.1 christos "float cclr branch never"
6043 1.1 christos ((UNIT B01) (FR500-MAJOR B-3) (FR550-MAJOR B-3)
6044 1.1 christos (FR400-MAJOR B-3) (FR450-MAJOR B-3) FR-ACCESS)
6045 1.1 christos "fbnolr$pack$hint_not_taken"
6046 1.1 christos (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_06 (ccond-null) (s12-null))
6047 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6048 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6049 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6050 1.1 christos )
6051 1.1 christos
6052 1.1 christos (conditional-branch-cclr fb eq F OP_0E OPE3_06 Feq FR-ACCESS "float cclr branch equal")
6053 1.1 christos (conditional-branch-cclr fb ne F OP_0E OPE3_06 Fne FR-ACCESS "float cclr branch not equal")
6054 1.1 christos (conditional-branch-cclr fb lg F OP_0E OPE3_06 Flg FR-ACCESS "float branch less or greater")
6055 1.1 christos (conditional-branch-cclr fb ue F OP_0E OPE3_06 Fue FR-ACCESS "float branch unordered or equal")
6056 1.1 christos (conditional-branch-cclr fb ul F OP_0E OPE3_06 Ful FR-ACCESS "float branch unordered or less")
6057 1.1 christos (conditional-branch-cclr fb ge F OP_0E OPE3_06 Fge FR-ACCESS "float branch greater or equal")
6058 1.1 christos (conditional-branch-cclr fb lt F OP_0E OPE3_06 Flt FR-ACCESS "float branch less")
6059 1.1 christos (conditional-branch-cclr fb uge F OP_0E OPE3_06 Fuge FR-ACCESS "float branch unordered, greater, equal")
6060 1.1 christos (conditional-branch-cclr fb ug F OP_0E OPE3_06 Fug FR-ACCESS "float branch unordered or greater")
6061 1.1 christos (conditional-branch-cclr fb le F OP_0E OPE3_06 Fle FR-ACCESS "float branch less or equal")
6062 1.1 christos (conditional-branch-cclr fb gt F OP_0E OPE3_06 Fgt FR-ACCESS "float branch greater")
6063 1.1 christos (conditional-branch-cclr fb ule F OP_0E OPE3_06 Fule FR-ACCESS "float branch unordered, less or equal")
6064 1.1 christos (conditional-branch-cclr fb u F OP_0E OPE3_06 Fu FR-ACCESS "float branch unordered")
6065 1.1 christos (conditional-branch-cclr fb o F OP_0E OPE3_06 Fo FR-ACCESS "float branch ordered")
6066 1.1 christos
6067 1.1 christos (define-pmacro (conditional-branch-ctrlr prefix cc i-f op ope cond attr comment)
6068 1.1 christos (dni (.sym prefix cc lr)
6069 1.1 christos (comment)
6070 1.1 christos ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6071 1.1 christos (FR400-MAJOR B-2) (FR450-MAJOR B-2) attr)
6072 1.1 christos (.str (.sym prefix cc lr) "$pack $" i-f "CCi_2,$ccond,$hint")
6073 1.1 christos (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op hint ope ccond (s12-null))
6074 1.1 christos (sequence ()
6075 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint)
6076 1.1 christos (ctrlr-branch-semantics (cond (.sym i-f CCi_2)) ccond))
6077 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6078 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6079 1.1 christos )
6080 1.1 christos )
6081 1.1 christos
6082 1.1 christos (dni bcralr
6083 1.1 christos "integer ctrlr branch always"
6084 1.1 christos ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6085 1.1 christos (FR400-MAJOR B-2) (FR450-MAJOR B-2))
6086 1.1 christos "bcralr$pack $ccond$hint_taken"
6087 1.1 christos (+ pack ICC_ra (ICCi_2-null) OP_0E hint_taken OPE3_03 ccond (s12-null))
6088 1.1 christos (sequence ()
6089 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
6090 1.1 christos (ctrlr-branch-semantics (const BI 1) ccond))
6091 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6092 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6093 1.1 christos )
6094 1.1 christos
6095 1.1 christos (dni bcnolr
6096 1.1 christos "integer ctrlr branch never"
6097 1.1 christos ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6098 1.1 christos (FR400-MAJOR B-2) (FR450-MAJOR B-2))
6099 1.1 christos "bcnolr$pack$hint_not_taken"
6100 1.1 christos (+ pack ICC_nev (ICCi_2-null) OP_0E hint_not_taken OPE3_03 (ccond-null) (s12-null))
6101 1.1 christos (sequence ()
6102 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6103 1.1 christos (ctrlr-branch-semantics (const BI 0) ccond))
6104 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6105 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6106 1.1 christos )
6107 1.1 christos
6108 1.1 christos (conditional-branch-ctrlr bc eq I OP_0E OPE3_03 Ieq NA "integer ctrlr branch equal")
6109 1.1 christos (conditional-branch-ctrlr bc ne I OP_0E OPE3_03 Ine NA "integer ctrlr branch not equal")
6110 1.1 christos (conditional-branch-ctrlr bc le I OP_0E OPE3_03 Ile NA "integer ctrlr branch less equal")
6111 1.1 christos (conditional-branch-ctrlr bc gt I OP_0E OPE3_03 Igt NA "integer ctrlr branch greater")
6112 1.1 christos (conditional-branch-ctrlr bc lt I OP_0E OPE3_03 Ilt NA "integer ctrlr branch less")
6113 1.1 christos (conditional-branch-ctrlr bc ge I OP_0E OPE3_03 Ige NA "integer ctrlr branch greater equal")
6114 1.1 christos (conditional-branch-ctrlr bc ls I OP_0E OPE3_03 Ils NA "integer ctrlr branch less equal unsigned")
6115 1.1 christos (conditional-branch-ctrlr bc hi I OP_0E OPE3_03 Ihi NA "integer ctrlr branch greater unsigned")
6116 1.1 christos (conditional-branch-ctrlr bc c I OP_0E OPE3_03 Ic NA "integer ctrlr branch carry set")
6117 1.1 christos (conditional-branch-ctrlr bc nc I OP_0E OPE3_03 Inc NA "integer ctrlr branch carry clear")
6118 1.1 christos (conditional-branch-ctrlr bc n I OP_0E OPE3_03 In NA "integer ctrlr branch negative")
6119 1.1 christos (conditional-branch-ctrlr bc p I OP_0E OPE3_03 Ip NA "integer ctrlr branch positive")
6120 1.1 christos (conditional-branch-ctrlr bc v I OP_0E OPE3_03 Iv NA "integer ctrlr branch overflow set")
6121 1.1 christos (conditional-branch-ctrlr bc nv I OP_0E OPE3_03 Inv NA "integer ctrlr branch overflow clear")
6122 1.1 christos
6123 1.1 christos (dni fcbralr
6124 1.1 christos "float ctrlr branch always"
6125 1.1 christos ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6126 1.1 christos (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS)
6127 1.1 christos "fcbralr$pack $ccond$hint_taken"
6128 1.1 christos (+ pack FCC_ra (FCCi_2-null) OP_0E hint_taken OPE3_07 ccond (s12-null))
6129 1.1 christos (sequence ()
6130 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_taken)
6131 1.1 christos (ctrlr-branch-semantics (const BI 1) ccond))
6132 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6133 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6134 1.1 christos )
6135 1.1 christos
6136 1.1 christos (dni fcbnolr
6137 1.1 christos "float ctrlr branch never"
6138 1.1 christos ((UNIT B0) (FR500-MAJOR B-2) (FR550-MAJOR B-2)
6139 1.1 christos (FR400-MAJOR B-2) (FR450-MAJOR B-2) FR-ACCESS)
6140 1.1 christos "fcbnolr$pack$hint_not_taken"
6141 1.1 christos (+ pack FCC_nev (FCCi_2-null) OP_0E hint_not_taken OPE3_07 (ccond-null) (s12-null))
6142 1.1 christos (sequence ()
6143 1.1 christos (c-call VOID "@cpu@_model_branch" (spr-lr) hint_not_taken)
6144 1.1 christos (ctrlr-branch-semantics (const BI 0) ccond))
6145 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6146 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6147 1.1 christos )
6148 1.1 christos
6149 1.1 christos (conditional-branch-ctrlr fcb eq F OP_0E OPE3_07 Feq FR-ACCESS "float cclr branch equal")
6150 1.1 christos (conditional-branch-ctrlr fcb ne F OP_0E OPE3_07 Fne FR-ACCESS "float cclr branch not equal")
6151 1.1 christos (conditional-branch-ctrlr fcb lg F OP_0E OPE3_07 Flg FR-ACCESS "float branch less or greater")
6152 1.1 christos (conditional-branch-ctrlr fcb ue F OP_0E OPE3_07 Fue FR-ACCESS "float branch unordered or equal")
6153 1.1 christos (conditional-branch-ctrlr fcb ul F OP_0E OPE3_07 Ful FR-ACCESS "float branch unordered or less")
6154 1.1 christos (conditional-branch-ctrlr fcb ge F OP_0E OPE3_07 Fge FR-ACCESS "float branch greater or equal")
6155 1.1 christos (conditional-branch-ctrlr fcb lt F OP_0E OPE3_07 Flt FR-ACCESS "float branch less")
6156 1.1 christos (conditional-branch-ctrlr fcb uge F OP_0E OPE3_07 Fuge FR-ACCESS "float branch unordered, greater, equal")
6157 1.1 christos (conditional-branch-ctrlr fcb ug F OP_0E OPE3_07 Fug FR-ACCESS "float branch unordered or greater")
6158 1.1 christos (conditional-branch-ctrlr fcb le F OP_0E OPE3_07 Fle FR-ACCESS "float branch less or equal")
6159 1.1 christos (conditional-branch-ctrlr fcb gt F OP_0E OPE3_07 Fgt FR-ACCESS "float branch greater")
6160 1.1 christos (conditional-branch-ctrlr fcb ule F OP_0E OPE3_07 Fule FR-ACCESS "float branch unordered, less or equal")
6161 1.1 christos (conditional-branch-ctrlr fcb u F OP_0E OPE3_07 Fu FR-ACCESS "float branch unordered")
6162 1.1 christos (conditional-branch-ctrlr fcb o F OP_0E OPE3_07 Fo FR-ACCESS "float branch ordered")
6163 1.1 christos
6164 1.1 christos (define-pmacro (jump-and-link-semantics base offset LI)
6165 1.1 christos (sequence ()
6166 1.1 christos (if (eq LI 1)
6167 1.1 christos (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1))
6168 1.1 christos ; Target address gets aligned here
6169 1.1 christos (set pc (and (add base offset) #xfffffffc))
6170 1.1 christos (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
6171 1.1 christos )
6172 1.1 christos
6173 1.1 christos (dni jmpl
6174 1.1 christos "jump and link"
6175 1.1 christos ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6176 1.1 christos (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6177 1.1 christos "jmpl$pack @($GRi,$GRj)"
6178 1.1 christos (+ pack (misc-null-1) (LI-off) OP_0C GRi (misc-null-2) GRj)
6179 1.1 christos (jump-and-link-semantics GRi GRj LI)
6180 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6181 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6182 1.1 christos )
6183 1.1 christos
6184 1.1 christos (dann callann "call annotation" SI "call_annotation" "at")
6185 1.1 christos
6186 1.1 christos (dni calll
6187 1.1 christos "call and link"
6188 1.1 christos ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6189 1.1 christos (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6190 1.1 christos "calll$pack $callann($GRi,$GRj)"
6191 1.1 christos (+ pack (misc-null-1) (LI-on) OP_0C GRi (misc-null-2) GRj)
6192 1.1 christos (jump-and-link-semantics GRi GRj LI)
6193 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6194 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6195 1.1 christos )
6196 1.1 christos
6197 1.1 christos (dni jmpil
6198 1.1 christos "jump immediate and link"
6199 1.1 christos ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6200 1.1 christos (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6201 1.1 christos "jmpil$pack @($GRi,$s12)"
6202 1.1 christos (+ pack (misc-null-1) (LI-off) OP_0D GRi s12)
6203 1.1 christos (jump-and-link-semantics GRi s12 LI)
6204 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6205 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6206 1.1 christos )
6207 1.1 christos
6208 1.1 christos (dni callil
6209 1.1 christos "call immediate and link"
6210 1.1 christos ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6211 1.1 christos (FR400-MAJOR I-5) (FR450-MAJOR I-5))
6212 1.1 christos "callil$pack @($GRi,$s12)"
6213 1.1 christos (+ pack (misc-null-1) (LI-on) OP_0D GRi s12)
6214 1.1 christos (jump-and-link-semantics GRi s12 LI)
6215 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6216 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6217 1.1 christos )
6218 1.1 christos
6219 1.1 christos (dni call
6220 1.1 christos "call and link"
6221 1.1 christos ((UNIT B0) (FR500-MAJOR B-4) (FR550-MAJOR B-4)
6222 1.1 christos (FR400-MAJOR B-4) (FR450-MAJOR B-4))
6223 1.1 christos "call$pack $label24"
6224 1.1 christos (+ pack OP_0F label24)
6225 1.1 christos (sequence ()
6226 1.1 christos (c-call VOID "@cpu@_set_write_next_vliw_addr_to_LR" 1)
6227 1.1 christos (set pc label24)
6228 1.1 christos (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
6229 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6230 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6231 1.1 christos )
6232 1.1 christos
6233 1.1 christos (dni rett
6234 1.1 christos "return from trap"
6235 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6236 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2) PRIVILEGED)
6237 1.1 christos "rett$pack $debug"
6238 1.1 christos (+ pack (misc-null-1) debug OP_05 (rs-null) (s12-null))
6239 1.1 christos ; frv_rett handles operating vs user mode
6240 1.1 christos (sequence ()
6241 1.1 christos (set pc (c-call UWI "frv_rett" pc debug))
6242 1.1 christos (c-call VOID "@cpu@_model_branch" pc #x2)) ; hint branch taken
6243 1.1 christos ()
6244 1.1 christos )
6245 1.1 christos
6246 1.1 christos (dni rei
6247 1.1 christos "run exception instruction"
6248 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (MACH frv) PRIVILEGED)
6249 1.1 christos "rei$pack $eir"
6250 1.1 christos (+ pack (rd-null) OP_37 eir (s12-null))
6251 1.1 christos (nop) ; for now
6252 1.1 christos ()
6253 1.1 christos )
6254 1.1 christos
6255 1.1 christos (define-pmacro (trap-semantics cond base offset)
6256 1.1 christos (if cond
6257 1.1 christos (sequence ()
6258 1.1 christos ; This is defered to frv_itrap because for the breakpoint
6259 1.1 christos ; case we want to change as little of the machine state as
6260 1.1 christos ; possible.
6261 1.1 christos ;
6262 1.1 christos ; PCSR=PC
6263 1.1 christos ; PSR.PS=PSR.S
6264 1.1 christos ; PSR.ET=0
6265 1.1 christos ; if PSR.ESR==1
6266 1.1 christos ; SR0 through SR3=GR4 through GR7
6267 1.1 christos ; TBR.TT=0x80 + ((GRi + s12) & 0x7f)
6268 1.1 christos ; PC=TBR
6269 1.1 christos ; We still should indicate what is modified by this insn.
6270 1.1 christos (clobber (spr-pcsr))
6271 1.1 christos (clobber psr_ps)
6272 1.1 christos (clobber psr_et)
6273 1.1 christos (clobber tbr_tt)
6274 1.1 christos (if (ne psr_esr (const 0))
6275 1.1 christos (sequence ()
6276 1.1 christos (clobber (spr-sr0))
6277 1.1 christos (clobber (spr-sr1))
6278 1.1 christos (clobber (spr-sr2))
6279 1.1 christos (clobber (spr-sr3))))
6280 1.1 christos ; frv_itrap handles operating vs user mode
6281 1.1 christos (c-call VOID "frv_itrap" pc base offset)))
6282 1.1 christos )
6283 1.1 christos
6284 1.1 christos (define-pmacro (trap-r prefix cc i-f op ope cond attr comment)
6285 1.1 christos (dni (.sym prefix cc)
6286 1.1 christos (comment)
6287 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6288 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr)
6289 1.1 christos (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$GRj")
6290 1.1 christos (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi (misc-null-3) ope GRj)
6291 1.1 christos (trap-semantics (cond (.sym i-f CCi_2)) GRi GRj)
6292 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6293 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6294 1.1 christos )
6295 1.1 christos )
6296 1.1 christos
6297 1.1 christos (dni tra
6298 1.1 christos "integer trap always"
6299 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6300 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6301 1.1 christos "tra$pack $GRi,$GRj"
6302 1.1 christos (+ pack ICC_ra (ICCi_2-null) OP_04 GRi (misc-null-3) OPE4_0 GRj)
6303 1.1 christos (trap-semantics (const BI 1) GRi GRj)
6304 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6305 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6306 1.1 christos )
6307 1.1 christos
6308 1.1 christos (dni tno
6309 1.1 christos "integer trap never"
6310 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6311 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6312 1.1 christos "tno$pack"
6313 1.1 christos (+ pack ICC_nev (ICCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_0 (GRj-null))
6314 1.1 christos (trap-semantics (const BI 0) GRi GRj)
6315 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6316 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6317 1.1 christos )
6318 1.1 christos
6319 1.1 christos (trap-r t eq I OP_04 OPE4_0 Ieq NA "integer trap equal")
6320 1.1 christos (trap-r t ne I OP_04 OPE4_0 Ine NA "integer trap not equal")
6321 1.1 christos (trap-r t le I OP_04 OPE4_0 Ile NA "integer trap less or equal")
6322 1.1 christos (trap-r t gt I OP_04 OPE4_0 Igt NA "integer trap greater")
6323 1.1 christos (trap-r t lt I OP_04 OPE4_0 Ilt NA "integer trap less")
6324 1.1 christos (trap-r t ge I OP_04 OPE4_0 Ige NA "integer trap greater or equal")
6325 1.1 christos (trap-r t ls I OP_04 OPE4_0 Ils NA "integer trap less or equal unsigned")
6326 1.1 christos (trap-r t hi I OP_04 OPE4_0 Ihi NA "integer trap greater unsigned")
6327 1.1 christos (trap-r t c I OP_04 OPE4_0 Ic NA "integer trap carry set")
6328 1.1 christos (trap-r t nc I OP_04 OPE4_0 Inc NA "integer trap carry clear")
6329 1.1 christos (trap-r t n I OP_04 OPE4_0 In NA "integer trap negative")
6330 1.1 christos (trap-r t p I OP_04 OPE4_0 Ip NA "integer trap positive")
6331 1.1 christos (trap-r t v I OP_04 OPE4_0 Iv NA "integer trap overflow set")
6332 1.1 christos (trap-r t nv I OP_04 OPE4_0 Inv NA "integer trap overflow clear")
6333 1.1 christos
6334 1.1 christos (dni ftra
6335 1.1 christos "float trap always"
6336 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6337 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6338 1.1 christos "ftra$pack $GRi,$GRj"
6339 1.1 christos (+ pack FCC_ra (FCCi_2-null) OP_04 GRi (misc-null-3) OPE4_1 GRj)
6340 1.1 christos (trap-semantics (const BI 1) GRi GRj)
6341 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6342 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6343 1.1 christos )
6344 1.1 christos
6345 1.1 christos (dni ftno
6346 1.1 christos "flost trap never"
6347 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6348 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6349 1.1 christos "ftno$pack"
6350 1.1 christos (+ pack FCC_nev (FCCi_2-null) OP_04 (GRi-null) (misc-null-3) OPE4_1 (GRj-null))
6351 1.1 christos (trap-semantics (const BI 0) GRi GRj)
6352 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6353 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6354 1.1 christos )
6355 1.1 christos
6356 1.1 christos (trap-r ft ne F OP_04 OPE4_1 Fne FR-ACCESS "float trap not equal")
6357 1.1 christos (trap-r ft eq F OP_04 OPE4_1 Feq FR-ACCESS "float trap equal")
6358 1.1 christos (trap-r ft lg F OP_04 OPE4_1 Flg FR-ACCESS "float trap greater or less")
6359 1.1 christos (trap-r ft ue F OP_04 OPE4_1 Fue FR-ACCESS "float trap unordered or equal")
6360 1.1 christos (trap-r ft ul F OP_04 OPE4_1 Ful FR-ACCESS "float trap unordered or less")
6361 1.1 christos (trap-r ft ge F OP_04 OPE4_1 Fge FR-ACCESS "float trap greater or equal")
6362 1.1 christos (trap-r ft lt F OP_04 OPE4_1 Flt FR-ACCESS "float trap less")
6363 1.1 christos (trap-r ft uge F OP_04 OPE4_1 Fuge FR-ACCESS "float trap unordered greater or equal")
6364 1.1 christos (trap-r ft ug F OP_04 OPE4_1 Fug FR-ACCESS "float trap unordered or greater")
6365 1.1 christos (trap-r ft le F OP_04 OPE4_1 Fle FR-ACCESS "float trap less or equal")
6366 1.1 christos (trap-r ft gt F OP_04 OPE4_1 Fgt FR-ACCESS "float trap greater")
6367 1.1 christos (trap-r ft ule F OP_04 OPE4_1 Fule FR-ACCESS "float trap unordered less or equal")
6368 1.1 christos (trap-r ft u F OP_04 OPE4_1 Fu FR-ACCESS "float trap unordered")
6369 1.1 christos (trap-r ft o F OP_04 OPE4_1 Fo FR-ACCESS "float trap ordered")
6370 1.1 christos
6371 1.1 christos (define-pmacro (trap-immed prefix cc i-f op cond attr comment)
6372 1.1 christos (dni (.sym prefix cc)
6373 1.1 christos (comment)
6374 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6375 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) attr)
6376 1.1 christos (.str (.sym prefix cc) "$pack $" i-f "CCi_2,$GRi,$s12")
6377 1.1 christos (+ pack (.sym i-f CC_ cc) (.sym i-f CCi_2) op GRi s12)
6378 1.1 christos (trap-semantics (cond (.sym i-f CCi_2)) GRi s12)
6379 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6380 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6381 1.1 christos )
6382 1.1 christos )
6383 1.1 christos
6384 1.1 christos (dni tira
6385 1.1 christos "integer trap always"
6386 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6387 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6388 1.1 christos "tira$pack $GRi,$s12"
6389 1.1 christos (+ pack ICC_ra (ICCi_2-null) OP_1C GRi s12)
6390 1.1 christos (trap-semantics (const BI 1) GRi s12)
6391 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6392 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6393 1.1 christos )
6394 1.1 christos
6395 1.1 christos (dni tino
6396 1.1 christos "integer trap never"
6397 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6398 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6399 1.1 christos "tino$pack"
6400 1.1 christos (+ pack ICC_nev (ICCi_2-null) OP_1C (GRi-null) (s12-null))
6401 1.1 christos (trap-semantics (const BI 0) GRi s12)
6402 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6403 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6404 1.1 christos )
6405 1.1 christos
6406 1.1 christos (trap-immed ti eq I OP_1C Ieq NA "integer trap equal")
6407 1.1 christos (trap-immed ti ne I OP_1C Ine NA "integer trap not equal")
6408 1.1 christos (trap-immed ti le I OP_1C Ile NA "integer trap less or equal")
6409 1.1 christos (trap-immed ti gt I OP_1C Igt NA "integer trap greater")
6410 1.1 christos (trap-immed ti lt I OP_1C Ilt NA "integer trap less")
6411 1.1 christos (trap-immed ti ge I OP_1C Ige NA "integer trap greater or equal")
6412 1.1 christos (trap-immed ti ls I OP_1C Ils NA "integer trap less or equal unsigned")
6413 1.1 christos (trap-immed ti hi I OP_1C Ihi NA "integer trap greater unsigned")
6414 1.1 christos (trap-immed ti c I OP_1C Ic NA "integer trap carry set")
6415 1.1 christos (trap-immed ti nc I OP_1C Inc NA "integer trap carry clear")
6416 1.1 christos (trap-immed ti n I OP_1C In NA "integer trap negative")
6417 1.1 christos (trap-immed ti p I OP_1C Ip NA "integer trap positive")
6418 1.1 christos (trap-immed ti v I OP_1C Iv NA "integer trap overflow set")
6419 1.1 christos (trap-immed ti nv I OP_1C Inv NA "integer trap overflow clear")
6420 1.1 christos
6421 1.1 christos (dni ftira
6422 1.1 christos "float trap always"
6423 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6424 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6425 1.1 christos "ftira$pack $GRi,$s12"
6426 1.1 christos (+ pack FCC_ra (ICCi_2-null) OP_1D GRi s12)
6427 1.1 christos (trap-semantics (const BI 1) GRi s12)
6428 1.1 christos ((fr400 (unit u-trap))
6429 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6430 1.1 christos )
6431 1.1 christos
6432 1.1 christos (dni ftino
6433 1.1 christos "float trap never"
6434 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6435 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6436 1.1 christos "ftino$pack"
6437 1.1 christos (+ pack FCC_nev (FCCi_2-null) OP_1D (GRi-null) (s12-null))
6438 1.1 christos (trap-semantics (const BI 0) GRi s12)
6439 1.1 christos ((fr400 (unit u-trap)) (fr450 (unit u-trap))
6440 1.1 christos (fr500 (unit u-trap)) (fr550 (unit u-trap)))
6441 1.1 christos )
6442 1.1 christos
6443 1.1 christos (trap-immed fti ne F OP_1D Fne FR-ACCESS "float trap not equal")
6444 1.1 christos (trap-immed fti eq F OP_1D Feq FR-ACCESS "float trap equal")
6445 1.1 christos (trap-immed fti lg F OP_1D Flg FR-ACCESS "float trap greater or less")
6446 1.1 christos (trap-immed fti ue F OP_1D Fue FR-ACCESS "float trap unordered or equal")
6447 1.1 christos (trap-immed fti ul F OP_1D Ful FR-ACCESS "float trap unordered or less")
6448 1.1 christos (trap-immed fti ge F OP_1D Fge FR-ACCESS "float trap greater or equal")
6449 1.1 christos (trap-immed fti lt F OP_1D Flt FR-ACCESS "float trap less")
6450 1.1 christos (trap-immed fti uge F OP_1D Fuge FR-ACCESS "float trap unordered greater or equal")
6451 1.1 christos (trap-immed fti ug F OP_1D Fug FR-ACCESS "float trap unordered or greater")
6452 1.1 christos (trap-immed fti le F OP_1D Fle FR-ACCESS "float trap less or equal")
6453 1.1 christos (trap-immed fti gt F OP_1D Fgt FR-ACCESS "float trap greater")
6454 1.1 christos (trap-immed fti ule F OP_1D Fule FR-ACCESS "float trap unordered less or equal")
6455 1.1 christos (trap-immed fti u F OP_1D Fu FR-ACCESS "float trap unordered")
6456 1.1 christos (trap-immed fti o F OP_1D Fo FR-ACCESS "float trap ordered")
6457 1.1 christos
6458 1.1 christos (dni break
6459 1.1 christos "break trap"
6460 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6461 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1))
6462 1.1 christos "break$pack"
6463 1.1 christos (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_3 (GRj-null))
6464 1.1 christos (sequence ()
6465 1.1 christos ; This is defered to frv_break because for the breakpoint
6466 1.1 christos ; case we want to change as little of the machine state as
6467 1.1 christos ; possible.
6468 1.1 christos ;
6469 1.1 christos ; BPCSR=PC
6470 1.1 christos ; BPSR.BS=PSR.S
6471 1.1 christos ; BPSR.BET=PSR.ET
6472 1.1 christos ; PSR.S=1
6473 1.1 christos ; PSR.ET=0
6474 1.1 christos ; TBR.TT=0xff
6475 1.1 christos ; PC=TBR
6476 1.1 christos ; We still should indicate what is modified by this insn.
6477 1.1 christos (clobber (spr-bpcsr))
6478 1.1 christos (clobber bpsr_bs)
6479 1.1 christos (clobber bpsr_bet)
6480 1.1 christos (clobber psr_s)
6481 1.1 christos (clobber psr_et)
6482 1.1 christos (clobber tbr_tt)
6483 1.1 christos (c-call VOID "frv_break"))
6484 1.1 christos ()
6485 1.1 christos )
6486 1.1 christos
6487 1.1 christos (dni mtrap
6488 1.1 christos "media trap"
6489 1.1 christos ((UNIT C) (FR500-MAJOR C-1) (FR550-MAJOR C-1)
6490 1.1 christos (FR400-MAJOR C-1) (FR450-MAJOR C-1) FR-ACCESS)
6491 1.1 christos "mtrap$pack"
6492 1.1 christos (+ pack (rd-null) OP_04 (rs-null) (misc-null-3) OPE4_2 (GRj-null))
6493 1.1 christos (c-call VOID "frv_mtrap")
6494 1.1 christos ()
6495 1.1 christos )
6496 1.1 christos
6497 1.1 christos (define-pmacro (condition-code-logic name operation ope comment)
6498 1.1 christos (dni name
6499 1.1 christos (comment)
6500 1.1 christos ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6)
6501 1.1 christos (FR400-MAJOR B-6) (FR450-MAJOR B-6))
6502 1.1 christos (.str name "$pack $CRi,$CRj,$CRk")
6503 1.1 christos (+ pack (misc-null-6) CRk OP_0A (misc-null-7) CRi ope (misc-null-8) CRj)
6504 1.1 christos (set CRk (c-call UQI "@cpu@_cr_logic" operation CRi CRj))
6505 1.1 christos ()
6506 1.1 christos )
6507 1.1 christos )
6508 1.1 christos (define-pmacro (op-andcr) 0)
6509 1.1 christos (define-pmacro (op-orcr) 1)
6510 1.1 christos (define-pmacro (op-xorcr) 2)
6511 1.1 christos (define-pmacro (op-nandcr) 3)
6512 1.1 christos (define-pmacro (op-norcr) 4)
6513 1.1 christos (define-pmacro (op-andncr) 5)
6514 1.1 christos (define-pmacro (op-orncr) 6)
6515 1.1 christos (define-pmacro (op-nandncr) 7)
6516 1.1 christos (define-pmacro (op-norncr) 8)
6517 1.1 christos
6518 1.1 christos (define-pmacro (cr-true) 3)
6519 1.1 christos (define-pmacro (cr-false) 2)
6520 1.1 christos (define-pmacro (cr-undefined) 0)
6521 1.1 christos
6522 1.1 christos (condition-code-logic andcr (op-andcr) OPE1_08 "and condition code regs")
6523 1.1 christos (condition-code-logic orcr (op-orcr) OPE1_09 "or condition code regs")
6524 1.1 christos (condition-code-logic xorcr (op-xorcr) OPE1_0A "xor condition code regs")
6525 1.1 christos (condition-code-logic nandcr (op-nandcr) OPE1_0C "nand condition code regs")
6526 1.1 christos (condition-code-logic norcr (op-norcr) OPE1_0D "nor condition code regs")
6527 1.1 christos (condition-code-logic andncr (op-andncr) OPE1_10 "andn condition code regs")
6528 1.1 christos (condition-code-logic orncr (op-orncr) OPE1_11 "orn condition code regs")
6529 1.1 christos (condition-code-logic nandncr (op-nandncr) OPE1_14 "nandn condition code regs")
6530 1.1 christos (condition-code-logic norncr (op-norncr) OPE1_15 "norn condition code regs")
6531 1.1 christos
6532 1.1 christos (dni notcr
6533 1.1 christos ("not cccr register")
6534 1.1 christos ((UNIT B01) (FR500-MAJOR B-6) (FR550-MAJOR B-6)
6535 1.1 christos (FR400-MAJOR B-6) (FR450-MAJOR B-6))
6536 1.1 christos (.str notcr "$pack $CRj,$CRk")
6537 1.1 christos (+ pack (misc-null-6) CRk OP_0A (rs-null) OPE1_0B (misc-null-8) CRj)
6538 1.1 christos (set CRk (xor CRj 1))
6539 1.1 christos ()
6540 1.1 christos )
6541 1.1 christos
6542 1.1 christos (define-pmacro (check-semantics cond cr)
6543 1.1 christos (if cond (set cr (cr-true)) (set cr (cr-false)))
6544 1.1 christos )
6545 1.1 christos
6546 1.1 christos (define-pmacro (check-int-condition-code prefix cc op cond comment)
6547 1.1 christos (dni (.sym prefix cc)
6548 1.1 christos (comment)
6549 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6550 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5))
6551 1.1 christos (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int")
6552 1.1 christos (+ pack (.sym ICC_ cc) CRj_int op (misc-null-5) ICCi_3)
6553 1.1 christos (check-semantics (cond ICCi_3) CRj_int)
6554 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6555 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6556 1.1 christos )
6557 1.1 christos )
6558 1.1 christos
6559 1.1 christos (dni ckra
6560 1.1 christos "check integer cc always"
6561 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6562 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5))
6563 1.1 christos "ckra$pack $CRj_int"
6564 1.1 christos (+ pack ICC_ra CRj_int OP_08 (misc-null-5) (ICCi_3-null))
6565 1.1 christos (check-semantics (const BI 1) CRj_int)
6566 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6567 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6568 1.1 christos )
6569 1.1 christos
6570 1.1 christos (dni ckno
6571 1.1 christos "check integer cc never"
6572 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6573 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5))
6574 1.1 christos "ckno$pack $CRj_int"
6575 1.1 christos (+ pack ICC_nev CRj_int OP_08 (misc-null-5) (ICCi_3-null))
6576 1.1 christos (check-semantics (const BI 0) CRj_int)
6577 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6578 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6579 1.1 christos )
6580 1.1 christos
6581 1.1 christos (check-int-condition-code ck eq OP_08 Ieq "check integer cc equal")
6582 1.1 christos (check-int-condition-code ck ne OP_08 Ine "check integer cc not equal")
6583 1.1 christos (check-int-condition-code ck le OP_08 Ile "check integer cc less or equal")
6584 1.1 christos (check-int-condition-code ck gt OP_08 Igt "check integer cc greater")
6585 1.1 christos (check-int-condition-code ck lt OP_08 Ilt "check integer cc less")
6586 1.1 christos (check-int-condition-code ck ge OP_08 Ige "check integer cc greater or equal")
6587 1.1 christos (check-int-condition-code ck ls OP_08 Ils "check integer cc less or equal unsigned")
6588 1.1 christos (check-int-condition-code ck hi OP_08 Ihi "check integer cc greater unsigned")
6589 1.1 christos (check-int-condition-code ck c OP_08 Ic "check integer cc carry set")
6590 1.1 christos (check-int-condition-code ck nc OP_08 Inc "check integer cc carry clear")
6591 1.1 christos (check-int-condition-code ck n OP_08 In "check integer cc negative")
6592 1.1 christos (check-int-condition-code ck p OP_08 Ip "check integer cc positive")
6593 1.1 christos (check-int-condition-code ck v OP_08 Iv "check integer cc overflow set")
6594 1.1 christos (check-int-condition-code ck nv OP_08 Inv "check integer cc overflow clear")
6595 1.1 christos
6596 1.1 christos (define-pmacro (check-float-condition-code prefix cc op cond comment)
6597 1.1 christos (dni (.sym prefix cc)
6598 1.1 christos (comment)
6599 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6600 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
6601 1.1 christos (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float")
6602 1.1 christos (+ pack (.sym FCC_ cc) CRj_float op (misc-null-5) FCCi_3)
6603 1.1 christos (check-semantics (cond FCCi_3) CRj_float)
6604 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6605 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6606 1.1 christos )
6607 1.1 christos )
6608 1.1 christos
6609 1.1 christos (dni fckra
6610 1.1 christos "check float cc always"
6611 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6612 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
6613 1.1 christos "fckra$pack $CRj_float"
6614 1.1 christos (+ pack FCC_ra CRj_float OP_09 (misc-null-5) FCCi_3)
6615 1.1 christos (check-semantics (const BI 1) CRj_float)
6616 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6617 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6618 1.1 christos )
6619 1.1 christos
6620 1.1 christos (dni fckno
6621 1.1 christos "check float cc never"
6622 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6623 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) FR-ACCESS)
6624 1.1 christos "fckno$pack $CRj_float"
6625 1.1 christos (+ pack FCC_nev CRj_float OP_09 (misc-null-5) FCCi_3)
6626 1.1 christos (check-semantics (const BI 0) CRj_float)
6627 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6628 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6629 1.1 christos )
6630 1.1 christos
6631 1.1 christos (check-float-condition-code fck ne OP_09 Fne "check float cc not equal")
6632 1.1 christos (check-float-condition-code fck eq OP_09 Feq "check float cc equal")
6633 1.1 christos (check-float-condition-code fck lg OP_09 Flg "check float cc greater or less")
6634 1.1 christos (check-float-condition-code fck ue OP_09 Fue "check float cc unordered or equal")
6635 1.1 christos (check-float-condition-code fck ul OP_09 Ful "check float cc unordered or less")
6636 1.1 christos (check-float-condition-code fck ge OP_09 Fge "check float cc greater or equal")
6637 1.1 christos (check-float-condition-code fck lt OP_09 Flt "check float cc less")
6638 1.1 christos (check-float-condition-code fck uge OP_09 Fuge "check float cc unordered greater or equal")
6639 1.1 christos (check-float-condition-code fck ug OP_09 Fug "check float cc unordered or greater")
6640 1.1 christos (check-float-condition-code fck le OP_09 Fle "check float cc less or equal")
6641 1.1 christos (check-float-condition-code fck gt OP_09 Fgt "check float cc greater")
6642 1.1 christos (check-float-condition-code fck ule OP_09 Fule "check float cc unordered less or equal")
6643 1.1 christos (check-float-condition-code fck u OP_09 Fu "check float cc unordered")
6644 1.1 christos (check-float-condition-code fck o OP_09 Fo "check float cc ordered")
6645 1.1 christos
6646 1.1 christos (define-pmacro (conditional-check-int-condition-code prefix cc op ope test comment)
6647 1.1 christos (dni (.sym prefix cc)
6648 1.1 christos (comment)
6649 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6650 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
6651 1.1 christos (.str (.sym prefix cc) "$pack $ICCi_3,$CRj_int,$CCi,$cond")
6652 1.1 christos (+ pack (.sym ICC_ cc) CRj_int op (rs-null) CCi cond ope
6653 1.1 christos (misc-null-9) ICCi_3)
6654 1.1 christos (if (eq CCi (or cond 2))
6655 1.1 christos (check-semantics (test ICCi_3) CRj_int)
6656 1.1 christos (set CRj_int (cr-undefined)))
6657 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6658 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6659 1.1 christos )
6660 1.1 christos )
6661 1.1 christos
6662 1.1 christos (dni cckra
6663 1.1 christos "conditional check integer cc always"
6664 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6665 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
6666 1.1 christos "cckra$pack $CRj_int,$CCi,$cond"
6667 1.1 christos (+ pack ICC_ra CRj_int OP_6A (rs-null) CCi cond OPE4_0
6668 1.1 christos (misc-null-9) (ICCi_3-null))
6669 1.1 christos (if (eq CCi (or cond 2))
6670 1.1 christos (check-semantics (const BI 1) CRj_int)
6671 1.1 christos (set CRj_int (cr-undefined)))
6672 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6673 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6674 1.1 christos )
6675 1.1 christos
6676 1.1 christos (dni cckno
6677 1.1 christos "conditional check integer cc never"
6678 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6679 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL)
6680 1.1 christos "cckno$pack $CRj_int,$CCi,$cond"
6681 1.1 christos (+ pack ICC_nev CRj_int OP_6A (rs-null) CCi cond OPE4_0
6682 1.1 christos (misc-null-9) (ICCi_3-null))
6683 1.1 christos (if (eq CCi (or cond 2))
6684 1.1 christos (check-semantics (const BI 0) CRj_int)
6685 1.1 christos (set CRj_int (cr-undefined)))
6686 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6687 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6688 1.1 christos )
6689 1.1 christos
6690 1.1 christos (conditional-check-int-condition-code cck eq OP_6A OPE4_0 Ieq "check integer cc equal")
6691 1.1 christos (conditional-check-int-condition-code cck ne OP_6A OPE4_0 Ine "check integer cc not equal")
6692 1.1 christos (conditional-check-int-condition-code cck le OP_6A OPE4_0 Ile "check integer cc less or equal")
6693 1.1 christos (conditional-check-int-condition-code cck gt OP_6A OPE4_0 Igt "check integer cc greater")
6694 1.1 christos (conditional-check-int-condition-code cck lt OP_6A OPE4_0 Ilt "check integer cc less")
6695 1.1 christos (conditional-check-int-condition-code cck ge OP_6A OPE4_0 Ige "check integer cc greater or equal")
6696 1.1 christos (conditional-check-int-condition-code cck ls OP_6A OPE4_0 Ils "check integer cc less or equal unsigned")
6697 1.1 christos (conditional-check-int-condition-code cck hi OP_6A OPE4_0 Ihi "check integer cc greater unsigned")
6698 1.1 christos (conditional-check-int-condition-code cck c OP_6A OPE4_0 Ic "check integer cc carry set")
6699 1.1 christos (conditional-check-int-condition-code cck nc OP_6A OPE4_0 Inc "check integer cc carry clear")
6700 1.1 christos (conditional-check-int-condition-code cck n OP_6A OPE4_0 In "check integer cc negative")
6701 1.1 christos (conditional-check-int-condition-code cck p OP_6A OPE4_0 Ip "check integer cc positive")
6702 1.1 christos (conditional-check-int-condition-code cck v OP_6A OPE4_0 Iv "check integer cc overflow set")
6703 1.1 christos (conditional-check-int-condition-code cck nv OP_6A OPE4_0 Inv "check integer cc overflow clear")
6704 1.1 christos
6705 1.1 christos (define-pmacro (conditional-check-float-condition-code prefix cc op ope test comment)
6706 1.1 christos (dni (.sym prefix cc)
6707 1.1 christos (comment)
6708 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6709 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
6710 1.1 christos (.str (.sym prefix cc) "$pack $FCCi_3,$CRj_float,$CCi,$cond")
6711 1.1 christos (+ pack (.sym FCC_ cc) CRj_float op (rs-null) CCi cond ope
6712 1.1 christos (misc-null-9) FCCi_3)
6713 1.1 christos (if (eq CCi (or cond 2))
6714 1.1 christos (check-semantics (test FCCi_3) CRj_float)
6715 1.1 christos (set CRj_float (cr-undefined)))
6716 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6717 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6718 1.1 christos )
6719 1.1 christos )
6720 1.1 christos
6721 1.1 christos (dni cfckra
6722 1.1 christos "conditional check float cc always"
6723 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6724 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
6725 1.1 christos "cfckra$pack $CRj_float,$CCi,$cond"
6726 1.1 christos (+ pack FCC_ra CRj_float OP_6A (rs-null) CCi cond OPE4_1
6727 1.1 christos (misc-null-9) (FCCi_3-null))
6728 1.1 christos (if (eq CCi (or cond 2))
6729 1.1 christos (check-semantics (const BI 1) CRj_float)
6730 1.1 christos (set CRj_float (cr-undefined)))
6731 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6732 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6733 1.1 christos )
6734 1.1 christos
6735 1.1 christos (dni cfckno
6736 1.1 christos "conditional check float cc never"
6737 1.1 christos ((UNIT B01) (FR500-MAJOR B-5) (FR550-MAJOR B-5)
6738 1.1 christos (FR400-MAJOR B-5) (FR450-MAJOR B-5) CONDITIONAL FR-ACCESS)
6739 1.1 christos "cfckno$pack $CRj_float,$CCi,$cond"
6740 1.1 christos (+ pack FCC_nev CRj_float OP_6A (rs-null) CCi cond OPE4_1
6741 1.1 christos (misc-null-9) (FCCi_3-null))
6742 1.1 christos (if (eq CCi (or cond 2))
6743 1.1 christos (check-semantics (const BI 0) CRj_float)
6744 1.1 christos (set CRj_float (cr-undefined)))
6745 1.1 christos ((fr400 (unit u-check)) (fr450 (unit u-check))
6746 1.1 christos (fr500 (unit u-check)) (fr550 (unit u-check)))
6747 1.1 christos )
6748 1.1 christos
6749 1.1 christos (conditional-check-float-condition-code cfck ne OP_6A OPE4_1 Fne "check float cc not equal")
6750 1.1 christos (conditional-check-float-condition-code cfck eq OP_6A OPE4_1 Feq "check float cc equal")
6751 1.1 christos (conditional-check-float-condition-code cfck lg OP_6A OPE4_1 Flg "check float cc greater or less")
6752 1.1 christos (conditional-check-float-condition-code cfck ue OP_6A OPE4_1 Fue "check float cc unordered or equal")
6753 1.1 christos (conditional-check-float-condition-code cfck ul OP_6A OPE4_1 Ful "check float cc unordered or less")
6754 1.1 christos (conditional-check-float-condition-code cfck ge OP_6A OPE4_1 Fge "check float cc greater or equal")
6755 1.1 christos (conditional-check-float-condition-code cfck lt OP_6A OPE4_1 Flt "check float cc less")
6756 1.1 christos (conditional-check-float-condition-code cfck uge OP_6A OPE4_1 Fuge "check float cc unordered greater or equal")
6757 1.1 christos (conditional-check-float-condition-code cfck ug OP_6A OPE4_1 Fug "check float cc unordered or greater")
6758 1.1 christos (conditional-check-float-condition-code cfck le OP_6A OPE4_1 Fle "check float cc less or equal")
6759 1.1 christos (conditional-check-float-condition-code cfck gt OP_6A OPE4_1 Fgt "check float cc greater")
6760 1.1 christos (conditional-check-float-condition-code cfck ule OP_6A OPE4_1 Fule "check float cc unordered less or equal")
6761 1.1 christos (conditional-check-float-condition-code cfck u OP_6A OPE4_1 Fu "check float cc unordered")
6762 1.1 christos (conditional-check-float-condition-code cfck o OP_6A OPE4_1 Fo "check float cc ordered")
6763 1.1 christos
6764 1.1 christos (dni cjmpl
6765 1.1 christos "conditional jump and link"
6766 1.1 christos ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6767 1.1 christos (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL)
6768 1.1 christos "cjmpl$pack @($GRi,$GRj),$CCi,$cond"
6769 1.1 christos (+ pack (misc-null-1) (LI-off) OP_6A GRi CCi cond OPE4_2 GRj)
6770 1.1 christos (if (eq CCi (or cond 2))
6771 1.1 christos (jump-and-link-semantics GRi GRj LI))
6772 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6773 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6774 1.1 christos )
6775 1.1 christos
6776 1.1 christos (dni ccalll
6777 1.1 christos "conditional call and link"
6778 1.1 christos ((UNIT I0) (FR500-MAJOR I-5) (FR550-MAJOR I-6)
6779 1.1 christos (FR400-MAJOR I-5) (FR450-MAJOR I-5) CONDITIONAL)
6780 1.1 christos "ccalll$pack @($GRi,$GRj),$CCi,$cond"
6781 1.1 christos (+ pack (misc-null-1) (LI-on) OP_6A GRi CCi cond OPE4_2 GRj)
6782 1.1 christos (if (eq CCi (or cond 2))
6783 1.1 christos (jump-and-link-semantics GRi GRj LI))
6784 1.1 christos ((fr400 (unit u-branch)) (fr450 (unit u-branch))
6785 1.1 christos (fr500 (unit u-branch)) (fr550 (unit u-branch)))
6786 1.1 christos )
6787 1.1 christos
6788 1.1 christos (define-pmacro (cache-invalidate name cache all op ope profile comment)
6789 1.1 christos (dni name
6790 1.1 christos (comment)
6791 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6792 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6793 1.1 christos (.str name "$pack @($GRi,$GRj)")
6794 1.1 christos (+ pack (rd-null) op GRi ope GRj)
6795 1.1 christos (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) all)
6796 1.1 christos profile
6797 1.1 christos )
6798 1.1 christos )
6799 1.1 christos
6800 1.1 christos (cache-invalidate ici insn 0 OP_03 OPE1_38
6801 1.1 christos ((fr400 (unit u-ici)) (fr450 (unit u-ici))
6802 1.1 christos (fr500 (unit u-ici)) (fr550 (unit u-ici)))
6803 1.1 christos "invalidate insn cache")
6804 1.1 christos (cache-invalidate dci data 0 OP_03 OPE1_3C
6805 1.1 christos ((fr400 (unit u-dci)) (fr450 (unit u-dci))
6806 1.1 christos (fr500 (unit u-dci)) (fr550 (unit u-dci)))
6807 1.1 christos "invalidate data cache")
6808 1.1 christos
6809 1.1 christos (define-pmacro (cache-invalidate-entry name cache op ope profile comment)
6810 1.1 christos (dni name
6811 1.1 christos (comment)
6812 1.1 christos ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2)
6813 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6814 1.1 christos (.str name "$pack @($GRi,$GRj),$ae")
6815 1.1 christos (+ pack (misc-null-1) ae op GRi ope GRj)
6816 1.1 christos (if (eq ae 0)
6817 1.1 christos (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) -1) ; Invalid ae setting for this insn
6818 1.1 christos (c-call VOID (.str "@cpu@_" cache "_cache_invalidate") (add GRi GRj) ae))
6819 1.1 christos profile
6820 1.1 christos )
6821 1.1 christos )
6822 1.1 christos
6823 1.1 christos (cache-invalidate-entry icei insn OP_03 OPE1_39
6824 1.1 christos ((fr400 (unit u-ici)) (fr450 (unit u-ici))
6825 1.1 christos (fr550 (unit u-ici)))
6826 1.1 christos "invalidate insn cache entry")
6827 1.1 christos (cache-invalidate-entry dcei data OP_03 OPE1_3A
6828 1.1 christos ((fr400 (unit u-dci)) (fr450 (unit u-dci))
6829 1.1 christos (fr550 (unit u-dci)))
6830 1.1 christos "invalidate data cache entry")
6831 1.1 christos
6832 1.1 christos (dni dcf
6833 1.1 christos "Data cache flush"
6834 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6835 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6836 1.1 christos "dcf$pack @($GRi,$GRj)"
6837 1.1 christos (+ pack (rd-null) OP_03 GRi OPE1_3D GRj)
6838 1.1 christos (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) 0)
6839 1.1 christos ((fr400 (unit u-dcf)) (fr450 (unit u-dcf))
6840 1.1 christos (fr500 (unit u-dcf)) (fr550 (unit u-dcf)))
6841 1.1 christos )
6842 1.1 christos
6843 1.1 christos (dni dcef
6844 1.1 christos "Data cache entry flush"
6845 1.1 christos ((UNIT C) (MACH fr400,fr450,fr550) (FR550-MAJOR C-2)
6846 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6847 1.1 christos "dcef$pack @($GRi,$GRj),$ae"
6848 1.1 christos (+ pack (misc-null-1) ae OP_03 GRi OPE1_3B GRj)
6849 1.1 christos (if (eq ae 0)
6850 1.1 christos (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) -1)
6851 1.1 christos (c-call VOID "@cpu@_data_cache_flush" (add GRi GRj) ae))
6852 1.1 christos ((fr400 (unit u-dcf)) (fr450 (unit u-dcf)) (fr550 (unit u-dcf)))
6853 1.1 christos )
6854 1.1 christos
6855 1.1 christos (define-pmacro (write-TLB name insn op ope comment)
6856 1.1 christos (dni name
6857 1.1 christos (comment)
6858 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED)
6859 1.1 christos (.str insn "$pack $GRk,@($GRi,$GRj)")
6860 1.1 christos (+ pack GRk op GRi ope GRj)
6861 1.1 christos (nop) ; for now
6862 1.1 christos ()
6863 1.1 christos )
6864 1.1 christos )
6865 1.1 christos
6866 1.1 christos (write-TLB witlb witlb OP_03 OPE1_32 "write for insn TLB")
6867 1.1 christos (write-TLB wdtlb wdtlb OP_03 OPE1_36 "write for data TLB")
6868 1.1 christos
6869 1.1 christos (define-pmacro (invalidate-TLB name insn op ope comment)
6870 1.1 christos (dni name
6871 1.1 christos (comment)
6872 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (MACH frv) PRIVILEGED)
6873 1.1 christos (.str insn "$pack @($GRi,$GRj)")
6874 1.1 christos (+ pack (rd-null) op GRi ope GRj)
6875 1.1 christos (nop) ; for now
6876 1.1 christos ()
6877 1.1 christos )
6878 1.1 christos )
6879 1.1 christos
6880 1.1 christos (invalidate-TLB itlbi itlbi OP_03 OPE1_33 "invalidate insn TLB")
6881 1.1 christos (invalidate-TLB dtlbi dtlbi OP_03 OPE1_37 "invalidate data TLB")
6882 1.1 christos
6883 1.1 christos (define-pmacro (cache-preload name cache pipe attrs op ope profile comment)
6884 1.1 christos (dni name
6885 1.1 christos (comment)
6886 1.1 christos (.splice (UNIT pipe) (FR500-MAJOR C-2)
6887 1.1 christos (FR400-MAJOR C-2) (.unsplice attrs))
6888 1.1 christos (.str name "$pack $GRi,$GRj,$lock")
6889 1.1 christos (+ pack (misc-null-1) lock op GRi ope GRj)
6890 1.1 christos (c-call VOID (.str "@cpu@_" cache "_cache_preload") GRi GRj lock)
6891 1.1 christos profile
6892 1.1 christos )
6893 1.1 christos )
6894 1.1 christos
6895 1.1 christos (cache-preload icpl insn C ((FR550-MAJOR C-2) (FR450-MAJOR C-2)) OP_03 OPE1_30
6896 1.1 christos ((fr400 (unit u-icpl)) (fr450 (unit u-icpl))
6897 1.1 christos (fr500 (unit u-icpl)) (fr550 (unit u-icpl)))
6898 1.1 christos "preload insn cache")
6899 1.1 christos (cache-preload dcpl data DCPL ((FR550-MAJOR I-8) (FR450-MAJOR I-2)) OP_03 OPE1_34
6900 1.1 christos ((fr400 (unit u-dcpl)) (fr450 (unit u-dcpl))
6901 1.1 christos (fr500 (unit u-dcpl)) (fr550 (unit u-dcpl)))
6902 1.1 christos "preload data cache")
6903 1.1 christos
6904 1.1 christos (define-pmacro (cache-unlock name cache op ope profile comment)
6905 1.1 christos (dni name
6906 1.1 christos (comment)
6907 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6908 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6909 1.1 christos (.str name "$pack $GRi")
6910 1.1 christos (+ pack (rd-null) op GRi ope (GRj-null))
6911 1.1 christos (c-call VOID (.str "@cpu@_" cache "_cache_unlock") GRi)
6912 1.1 christos profile
6913 1.1 christos )
6914 1.1 christos )
6915 1.1 christos
6916 1.1 christos (cache-unlock icul insn OP_03 OPE1_31
6917 1.1 christos ((fr400 (unit u-icul)) (fr450 (unit u-icul))
6918 1.1 christos (fr500 (unit u-icul)) (fr550 (unit u-icul)))
6919 1.1 christos "unlock insn cache")
6920 1.1 christos (cache-unlock dcul data OP_03 OPE1_35
6921 1.1 christos ((fr400 (unit u-dcul)) (fr450 (unit u-dcul))
6922 1.1 christos (fr500 (unit u-dcul)) (fr550 (unit u-dcul)))
6923 1.1 christos "unlock data cache")
6924 1.1 christos
6925 1.1 christos (define-pmacro (barrier name insn op ope profile comment)
6926 1.1 christos (dni name
6927 1.1 christos (comment)
6928 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (FR550-MAJOR C-2)
6929 1.1 christos (FR400-MAJOR C-2) (FR450-MAJOR C-2))
6930 1.1 christos (.str insn "$pack")
6931 1.1 christos (+ pack (rd-null) op (rs-null) ope (GRj-null))
6932 1.1 christos (nop) ; sufficient implementation
6933 1.1 christos profile
6934 1.1 christos )
6935 1.1 christos )
6936 1.1 christos
6937 1.1 christos (barrier bar bar OP_03 OPE1_3E
6938 1.1 christos ((fr400 (unit u-barrier)) (fr450 (unit u-barrier))
6939 1.1 christos (fr500 (unit u-barrier)))
6940 1.1 christos "barrier")
6941 1.1 christos (barrier membar membar OP_03 OPE1_3F
6942 1.1 christos ((fr400 (unit u-membar)) (fr450 (unit u-membar))
6943 1.1 christos (fr500 (unit u-membar)))
6944 1.1 christos "memory barrier")
6945 1.1 christos
6946 1.1 christos ; Load real address instructions
6947 1.1 christos (define-pmacro (load-real-address name insn what op ope)
6948 1.1 christos (dni name
6949 1.1 christos (.str "Load real address of " what)
6950 1.1 christos ((UNIT C) (FR450-MAJOR C-2) (MACH fr450))
6951 1.1 christos (.str insn "$pack $GRi,$GRk,$LRAE,$LRAD,$LRAS")
6952 1.1 christos (+ pack GRk op GRi ope LRAE LRAD LRAS (LRA-null))
6953 1.1 christos (nop) ; not simulated
6954 1.1 christos ()
6955 1.1 christos )
6956 1.1 christos )
6957 1.1 christos
6958 1.1 christos (load-real-address lrai "lrai" "instruction" OP_03 OPE1_20)
6959 1.1 christos (load-real-address lrad "lrad" "data" OP_03 OPE1_21)
6960 1.1 christos
6961 1.1 christos (dni tlbpr
6962 1.1 christos "TLB Probe"
6963 1.1 christos ((UNIT C) (FR450-MAJOR C-2) (MACH fr450))
6964 1.1 christos "tlbpr$pack $GRi,$GRj,$TLBPRopx,$TLBPRL"
6965 1.1 christos (+ pack (TLBPR-null) TLBPRopx TLBPRL OP_03 GRi OPE1_24 GRj)
6966 1.1 christos (nop) ; not simulated
6967 1.1 christos ()
6968 1.1 christos )
6969 1.1 christos
6970 1.1 christos ; Coprocessor operations
6971 1.1 christos (define-pmacro (cop-op num op)
6972 1.1 christos (dni (.sym cop num)
6973 1.1 christos "Coprocessor operation"
6974 1.1 christos ((UNIT C) (FR500-MAJOR C-2) (MACH frv))
6975 1.1 christos (.str "cop" num "$pack $s6_1,$CPRi,$CPRj,$CPRk")
6976 1.1 christos (+ pack CPRk op CPRi s6_1 CPRj)
6977 1.1 christos (nop) ; sufficient implementation
6978 1.1 christos ()
6979 1.1 christos )
6980 1.1 christos )
6981 1.1 christos
6982 1.1 christos (cop-op 1 OP_7E)
6983 1.1 christos (cop-op 2 OP_7F)
6984 1.1 christos
6985 1.1 christos (define-pmacro (clear-ne-flag-semantics target_index is_float)
6986 1.1 christos (c-call VOID "@cpu@_clear_ne_flags" target_index is_float)
6987 1.1 christos )
6988 1.1 christos
6989 1.1 christos (define-pmacro (clear-ne-flag-r name op ope reg is_float attr profile comment)
6990 1.1 christos (dni name
6991 1.1 christos (comment)
6992 1.1 christos ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr)
6993 1.1 christos (.str name "$pack $" reg "k")
6994 1.1 christos (+ pack (.sym reg k) op (rs-null) ope (GRj-null))
6995 1.1 christos (sequence ()
6996 1.1 christos ; hack to get this referenced for profiling
6997 1.1 christos (c-raw-call VOID "frv_ref_SI" (.sym reg k))
6998 1.1 christos (clear-ne-flag-semantics (index-of (.sym reg k)) is_float))
6999 1.1 christos profile
7000 1.1 christos )
7001 1.1 christos )
7002 1.1 christos
7003 1.1 christos (clear-ne-flag-r clrgr OP_0A OPE1_00 GR 0 NA
7004 1.1 christos ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr)))
7005 1.1 christos "Clear GR NE flag")
7006 1.1 christos (clear-ne-flag-r clrfr OP_0A OPE1_02 FR 1 FR-ACCESS
7007 1.1 christos ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr)))
7008 1.1 christos "Clear FR NE flag")
7009 1.1 christos
7010 1.1 christos (define-pmacro (clear-ne-flag-all name op ope is_float attr profile comment)
7011 1.1 christos (dni name
7012 1.1 christos (comment)
7013 1.1 christos ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH simple,tomcat,fr500,fr550,frv) attr)
7014 1.1 christos (.str name "$pack")
7015 1.1 christos (+ pack (rd-null) op (rs-null) ope (GRj-null))
7016 1.1 christos (clear-ne-flag-semantics -1 is_float)
7017 1.1 christos profile
7018 1.1 christos )
7019 1.1 christos )
7020 1.1 christos
7021 1.1 christos (clear-ne-flag-all clrga OP_0A OPE1_01 0 NA
7022 1.1 christos ((fr500 (unit u-clrgr)) (fr550 (unit u-clrgr)))
7023 1.1 christos "Clear GR NE flag ALL")
7024 1.1 christos (clear-ne-flag-all clrfa OP_0A OPE1_03 1 FR-ACCESS
7025 1.1 christos ((fr500 (unit u-clrfr)) (fr550 (unit u-clrfr)))
7026 1.1 christos "Clear FR NE flag ALL")
7027 1.1 christos
7028 1.1 christos (define-pmacro (commit-semantics target_index is_float)
7029 1.1 christos (c-call VOID "@cpu@_commit" target_index is_float)
7030 1.1 christos )
7031 1.1 christos
7032 1.1 christos (define-pmacro (commit-r name op ope reg is_float attr comment)
7033 1.1 christos (dni name
7034 1.1 christos (comment)
7035 1.1 christos ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr)
7036 1.1 christos (.str name "$pack $" reg "k")
7037 1.1 christos (+ pack (.sym reg k) op (rs-null) ope (GRj-null))
7038 1.1 christos (commit-semantics (index-of (.sym reg k)) is_float)
7039 1.1 christos ((fr500 (unit u-commit)) (fr550 (unit u-commit)))
7040 1.1 christos )
7041 1.1 christos )
7042 1.1 christos
7043 1.1 christos (commit-r commitgr OP_0A OPE1_04 GR 0 NA "commit exceptions, specific GR")
7044 1.1 christos (commit-r commitfr OP_0A OPE1_06 FR 1 FR-ACCESS "commit exceptions, specific FR")
7045 1.1 christos
7046 1.1 christos (define-pmacro (commit name op ope is_float attr comment)
7047 1.1 christos (dni name
7048 1.1 christos (comment)
7049 1.1 christos ((UNIT I01) (FR500-MAJOR I-6) (FR550-MAJOR I-7) (MACH frv,fr500,fr550) attr)
7050 1.1 christos (.str name "$pack")
7051 1.1 christos (+ pack (rd-null) op (rs-null) ope (GRj-null))
7052 1.1 christos (commit-semantics -1 is_float)
7053 1.1 christos ((fr500 (unit u-commit)) (fr550 (unit u-commit)))
7054 1.1 christos )
7055 1.1 christos )
7056 1.1 christos
7057 1.1 christos (commit commitga OP_0A OPE1_05 0 NA "commit exceptions, any GR")
7058 1.1 christos (commit commitfa OP_0A OPE1_07 1 FR-ACCESS "commit exceptions, any FR")
7059 1.1 christos
7060 1.1 christos (define-pmacro (floating-point-conversion
7061 1.1 christos name op ope conv mode src targ attr comment)
7062 1.1 christos (dni name
7063 1.1 christos (comment)
7064 1.1 christos (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
7065 1.1 christos (.str name "$pack $" src ",$" targ)
7066 1.1 christos (+ pack targ op (rs-null) ope src)
7067 1.1 christos (set targ (conv mode FPCONV-DEFAULT src))
7068 1.1 christos ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
7069 1.1 christos )
7070 1.1 christos )
7071 1.1 christos
7072 1.1 christos (floating-point-conversion fitos OP_79 OPE1_00 float SF FRintj FRk
7073 1.1 christos ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7074 1.1 christos "Convert Integer to Single")
7075 1.1 christos (floating-point-conversion fstoi OP_79 OPE1_01 fix SI FRj FRintk
7076 1.1 christos ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7077 1.1 christos "Convert Single to Integer")
7078 1.1 christos (floating-point-conversion fitod OP_7A OPE1_00 float DF FRintj FRdoublek
7079 1.1 christos ((MACH frv))
7080 1.1 christos "Convert Integer to Double")
7081 1.1 christos (floating-point-conversion fdtoi OP_7A OPE1_01 fix SI FRdoublej FRintk
7082 1.1 christos ((MACH frv))
7083 1.1 christos "Convert Double to Integer")
7084 1.1 christos
7085 1.1 christos (define-pmacro (floating-point-dual-conversion
7086 1.1 christos name op ope conv mode src src_hw targ targ_hw attr comment)
7087 1.1 christos (dni name
7088 1.1 christos (comment)
7089 1.1 christos ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) attr)
7090 1.1 christos (.str name "$pack $" src ",$" targ)
7091 1.1 christos (+ pack targ op (rs-null) ope src)
7092 1.1 christos (sequence ()
7093 1.1 christos (set targ (conv mode FPCONV-DEFAULT src))
7094 1.1 christos (set (nextreg targ_hw targ 1)
7095 1.1 christos (conv mode FPCONV-DEFAULT (nextreg src_hw src 1))))
7096 1.1 christos ((fr500 (unit u-float-dual-convert)))
7097 1.1 christos )
7098 1.1 christos )
7099 1.1 christos
7100 1.1 christos (floating-point-dual-conversion fditos OP_79 OPE1_10 float SF FRintj h-fr_int FRk h-fr NA "Dual Convert Integer to Single")
7101 1.1 christos (floating-point-dual-conversion fdstoi OP_79 OPE1_11 fix SI FRj h-fr FRintk h-fr_int NA "Dual Convert Single to Integer")
7102 1.1 christos
7103 1.1 christos (define-pmacro (ne-floating-point-dual-conversion
7104 1.1 christos name op ope conv mode src src_hw targ targ_hw attr comment)
7105 1.1 christos (dni name
7106 1.1 christos (comment)
7107 1.1 christos ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1) NON-EXCEPTING attr)
7108 1.1 christos (.str name "$pack $" src ",$" targ)
7109 1.1 christos (+ pack targ op (rs-null) ope src)
7110 1.1 christos (sequence ()
7111 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7112 1.1 christos (set targ (conv mode FPCONV-DEFAULT src))
7113 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1))
7114 1.1 christos (set (nextreg targ_hw targ 1)
7115 1.1 christos (conv mode FPCONV-DEFAULT (nextreg src_hw src 1))))
7116 1.1 christos ((fr500 (unit u-float-dual-convert)))
7117 1.1 christos )
7118 1.1 christos )
7119 1.1 christos
7120 1.1 christos (ne-floating-point-dual-conversion nfditos OP_79 OPE1_30 float SF FRintj h-fr_int FRk h-fr NA "Non excepting dual Convert Integer to Single")
7121 1.1 christos (ne-floating-point-dual-conversion nfdstoi OP_79 OPE1_31 fix SI FRj h-fr FRintk h-fr_int NA "Non excepting dual Convert Single to Integer")
7122 1.1 christos
7123 1.1 christos (define-pmacro (conditional-floating-point-conversion
7124 1.1 christos name op ope conv mode src targ comment)
7125 1.1 christos (dni name
7126 1.1 christos (comment)
7127 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7128 1.1 christos (.str name "$pack $" src ",$" targ ",$CCi,$cond")
7129 1.1 christos (+ pack targ op (rs-null) CCi cond ope src)
7130 1.1 christos (if (eq CCi (or cond 2))
7131 1.1 christos (set targ (conv mode FPCONV-DEFAULT src)))
7132 1.1 christos ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
7133 1.1 christos )
7134 1.1 christos )
7135 1.1 christos
7136 1.1 christos (conditional-floating-point-conversion cfitos OP_6B OPE4_0 float SF FRintj FRk "Conditional convert Integer to Single")
7137 1.1 christos (conditional-floating-point-conversion cfstoi OP_6B OPE4_1 fix SI FRj FRintk "Conditional convert Single to Integer")
7138 1.1 christos
7139 1.1 christos (define-pmacro (ne-floating-point-conversion
7140 1.1 christos name op ope conv mode src targ comment)
7141 1.1 christos (dni name
7142 1.1 christos (comment)
7143 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7144 1.1 christos (.str name "$pack $" src ",$" targ)
7145 1.1 christos (+ pack targ op (rs-null) ope src)
7146 1.1 christos (sequence ()
7147 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7148 1.1 christos (set targ (conv mode FPCONV-DEFAULT src)))
7149 1.1 christos ((fr500 (unit u-float-convert)) (fr550 (unit u-float-convert)))
7150 1.1 christos )
7151 1.1 christos )
7152 1.1 christos
7153 1.1 christos (ne-floating-point-conversion nfitos OP_79 OPE1_20 float SF FRintj FRk "NE convert Integer to Single")
7154 1.1 christos (ne-floating-point-conversion nfstoi OP_79 OPE1_21 fix SI FRj FRintk "NE convert Single to Integer")
7155 1.1 christos
7156 1.1 christos (register-transfer fmovs OP_79 OPE1_02
7157 1.1 christos FRj FRk FMALL
7158 1.1 christos ((FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7159 1.1 christos ((fr500 (unit u-fr2fr)))
7160 1.1 christos "Move Single Float")
7161 1.1 christos (register-transfer fmovd OP_7A OPE1_02
7162 1.1 christos ; TODO -- unit doesn't handle extra register
7163 1.1 christos FRdoublej FRdoublek FM01
7164 1.1 christos ((FR500-MAJOR F-1) (MACH frv))
7165 1.1 christos ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr)))
7166 1.1 christos "Move Double Float")
7167 1.1 christos
7168 1.1 christos (dni fdmovs
7169 1.1 christos "Dual move single float"
7170 1.1 christos ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
7171 1.1 christos "fdmovs$pack $FRj,$FRk"
7172 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_12 FRj)
7173 1.1 christos (sequence ()
7174 1.1 christos (set FRk FRj)
7175 1.1 christos (set (nextreg h-fr FRk 1) (nextreg h-fr FRj 1)))
7176 1.1 christos ; TODO -- unit doesn't handle extra register
7177 1.1 christos ((fr500 (unit u-fr2fr)))
7178 1.1 christos )
7179 1.1 christos
7180 1.1 christos (conditional-register-transfer cfmovs OP_6C OPE4_0 FRj FRk FMALL
7181 1.1 christos ((FR500-MAJOR F-1) (FR550-MAJOR F-2)
7182 1.1 christos (MACH simple,tomcat,fr500,fr550,frv))
7183 1.1 christos ((fr500 (unit u-fr2fr)) (fr550 (unit u-fr2fr)))
7184 1.1 christos "Conditional move Single Float")
7185 1.1 christos
7186 1.1 christos (define-pmacro (floating-point-neg name src targ op ope attr comment)
7187 1.1 christos (dni name
7188 1.1 christos (comment)
7189 1.1 christos (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
7190 1.1 christos (.str name "$pack $" src ",$" targ)
7191 1.1 christos (+ pack src op (rs-null) ope targ)
7192 1.1 christos (set targ (neg src))
7193 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7194 1.1 christos )
7195 1.1 christos )
7196 1.1 christos
7197 1.1 christos (floating-point-neg fnegs FRj FRk OP_79 OPE1_03 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Floating point negate, single")
7198 1.1 christos (floating-point-neg fnegd FRdoublej FRdoublek OP_7A OPE1_03 ((MACH frv)) "Floating point negate, double")
7199 1.1 christos
7200 1.1 christos (dni fdnegs
7201 1.1 christos "Floating point dual negate, single"
7202 1.1 christos ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
7203 1.1 christos "fdnegs$pack $FRj,$FRk"
7204 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_13 FRj)
7205 1.1 christos (sequence ()
7206 1.1 christos (set FRk (neg FRj))
7207 1.1 christos (set (nextreg h-fr FRk 1) (neg (nextreg h-fr FRj 1))))
7208 1.1 christos ((fr500 (unit u-float-dual-arith)))
7209 1.1 christos )
7210 1.1 christos
7211 1.1 christos (dni cfnegs
7212 1.1 christos "Conditional floating point negate, single"
7213 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7214 1.1 christos "cfnegs$pack $FRj,$FRk,$CCi,$cond"
7215 1.1 christos (+ pack FRj OP_6C (rs-null) CCi cond OPE4_1 FRk)
7216 1.1 christos (if (eq CCi (or cond 2))
7217 1.1 christos (set FRk (neg FRj)))
7218 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7219 1.1 christos )
7220 1.1 christos
7221 1.1 christos (define-pmacro (float-abs name src targ op ope attr comment)
7222 1.1 christos (dni name
7223 1.1 christos (comment)
7224 1.1 christos (.splice (UNIT FMALL) (FR500-MAJOR F-1) (.unsplice attr))
7225 1.1 christos (.str name "$pack $" src ",$" targ )
7226 1.1 christos (+ pack targ op (rs-null) ope src)
7227 1.1 christos (set targ (abs src))
7228 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7229 1.1 christos )
7230 1.1 christos )
7231 1.1 christos
7232 1.1 christos (float-abs fabss FRj FRk OP_79 OPE1_04 ((FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv)) "Float absolute value, single")
7233 1.1 christos (float-abs fabsd FRdoublej FRdoublek OP_7A OPE1_04 ((MACH frv)) "Float absolute value, double")
7234 1.1 christos
7235 1.1 christos (dni fdabss
7236 1.1 christos "Floating point dual absolute value, single"
7237 1.1 christos ((MACH frv) (UNIT FMALL) (FR500-MAJOR F-1))
7238 1.1 christos "fdabss$pack $FRj,$FRk"
7239 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_14 FRj)
7240 1.1 christos (sequence ()
7241 1.1 christos (set FRk (abs FRj))
7242 1.1 christos (set (nextreg h-fr FRk 1) (abs (nextreg h-fr FRj 1))))
7243 1.1 christos ((fr500 (unit u-float-dual-arith)))
7244 1.1 christos )
7245 1.1 christos
7246 1.1 christos (dni cfabss
7247 1.1 christos "Conditional floating point absolute value, single"
7248 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-1) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7249 1.1 christos "cfabss$pack $FRj,$FRk,$CCi,$cond"
7250 1.1 christos (+ pack FRj OP_6C (rs-null) CCi cond OPE4_2 FRk)
7251 1.1 christos (if (eq CCi (or cond 2))
7252 1.1 christos (set FRk (abs FRj)))
7253 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7254 1.1 christos )
7255 1.1 christos
7256 1.1 christos (dni fsqrts
7257 1.1 christos "Square root single"
7258 1.1 christos ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7259 1.1 christos "fsqrts$pack $FRj,$FRk"
7260 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_05 FRj)
7261 1.1 christos (set FRk (sqrt SF FRj))
7262 1.1 christos ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
7263 1.1 christos )
7264 1.1 christos
7265 1.1 christos (dni fdsqrts
7266 1.1 christos "Dual square root single"
7267 1.1 christos ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4))
7268 1.1 christos "fdsqrts$pack $FRj,$FRk"
7269 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_15 FRj)
7270 1.1 christos (sequence ()
7271 1.1 christos (set FRk (sqrt SF FRj))
7272 1.1 christos (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1))))
7273 1.1 christos ((fr500 (unit u-float-dual-sqrt)))
7274 1.1 christos )
7275 1.1 christos
7276 1.1 christos (dni nfdsqrts
7277 1.1 christos "Non excepting Dual square root single"
7278 1.1 christos ((MACH frv) (UNIT FM01) (FR500-MAJOR F-4) NON-EXCEPTING)
7279 1.1 christos "nfdsqrts$pack $FRj,$FRk"
7280 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_35 FRj)
7281 1.1 christos (sequence ()
7282 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7283 1.1 christos (set FRk (sqrt SF FRj))
7284 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7285 1.1 christos (set (nextreg h-fr FRk 1) (sqrt (nextreg h-fr FRj 1))))
7286 1.1 christos ((fr500 (unit u-float-dual-sqrt)))
7287 1.1 christos )
7288 1.1 christos
7289 1.1 christos (dni fsqrtd
7290 1.1 christos "Square root double"
7291 1.1 christos ((UNIT FM01) (FR500-MAJOR F-4) (MACH frv))
7292 1.1 christos "fsqrtd$pack $FRdoublej,$FRdoublek"
7293 1.1 christos (+ pack FRdoublek OP_7A (rs-null) OPE1_05 FRdoublej)
7294 1.1 christos (set FRdoublek (sqrt DF FRdoublej))
7295 1.1 christos ((fr500 (unit u-float-sqrt)))
7296 1.1 christos )
7297 1.1 christos
7298 1.1 christos (dni cfsqrts
7299 1.1 christos "Conditional square root single"
7300 1.1 christos ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7301 1.1 christos "cfsqrts$pack $FRj,$FRk,$CCi,$cond"
7302 1.1 christos (+ pack FRk OP_6E (rs-null) CCi cond OPE4_2 FRj)
7303 1.1 christos (if (eq CCi (or cond 2))
7304 1.1 christos (set FRk (sqrt SF FRj)))
7305 1.1 christos ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
7306 1.1 christos )
7307 1.1 christos
7308 1.1 christos (dni nfsqrts
7309 1.1 christos "Non exception square root, single"
7310 1.1 christos ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7311 1.1 christos "nfsqrts$pack $FRj,$FRk"
7312 1.1 christos (+ pack FRk OP_79 (rs-null) OPE1_25 FRj)
7313 1.1 christos (sequence ()
7314 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7315 1.1 christos (set FRk (sqrt SF FRj)))
7316 1.1 christos ((fr500 (unit u-float-sqrt)) (fr550 (unit u-float-sqrt)))
7317 1.1 christos )
7318 1.1 christos
7319 1.1 christos (define-pmacro (float-binary-op-s name pipe attr operation op ope comment)
7320 1.1 christos (dni name
7321 1.1 christos (comment)
7322 1.1 christos (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv) (.unsplice attr))
7323 1.1 christos (.str name "$pack $FRi,$FRj,$FRk")
7324 1.1 christos (+ pack FRk op FRi ope FRj)
7325 1.1 christos (set FRk (operation FRi FRj))
7326 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7327 1.1 christos )
7328 1.1 christos )
7329 1.1 christos
7330 1.1 christos (float-binary-op-s fadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_06 "add single float")
7331 1.1 christos (float-binary-op-s fsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_07 "sub single float")
7332 1.1 christos (float-binary-op-s fmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_08 "mul single float")
7333 1.1 christos
7334 1.1 christos (dni fdivs
7335 1.1 christos "div single float"
7336 1.1 christos ((UNIT FM01) (FR500-MAJOR F-4) (FR550-MAJOR F-3) (MACH simple,tomcat,fr500,fr550,frv))
7337 1.1 christos "fdivs$pack $FRi,$FRj,$FRk"
7338 1.1 christos (+ pack FRk OP_79 FRi OPE1_09 FRj)
7339 1.1 christos (set FRk (div FRi FRj))
7340 1.1 christos ((fr500 (unit u-float-div))
7341 1.1 christos (fr550 (unit u-float-div)))
7342 1.1 christos )
7343 1.1 christos
7344 1.1 christos (define-pmacro (float-binary-op-d name operation op ope major comment)
7345 1.1 christos (dni name
7346 1.1 christos (comment)
7347 1.1 christos ((UNIT FMALL) (FR500-MAJOR major) (MACH frv))
7348 1.1 christos (.str name "$pack $FRdoublei,$FRdoublej,$FRdoublek")
7349 1.1 christos (+ pack FRdoublek op FRdoublei ope FRdoublej)
7350 1.1 christos (set FRdoublek (operation FRdoublei FRdoublej))
7351 1.1 christos ((fr500 (unit u-float-arith)))
7352 1.1 christos )
7353 1.1 christos )
7354 1.1 christos
7355 1.1 christos (float-binary-op-d faddd add OP_7A OPE1_06 F-2 "add double float")
7356 1.1 christos (float-binary-op-d fsubd sub OP_7A OPE1_07 F-2 "sub double float")
7357 1.1 christos (float-binary-op-d fmuld mul OP_7A OPE1_08 F-3 "mul double float")
7358 1.1 christos (float-binary-op-d fdivd div OP_7A OPE1_09 F-4 "div double float")
7359 1.1 christos
7360 1.1 christos (define-pmacro (conditional-float-binary-op name pipe attr operation op ope profile comment)
7361 1.1 christos (dni name
7362 1.1 christos (comment)
7363 1.1 christos (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv)
7364 1.1 christos (.unsplice attr))
7365 1.1 christos (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
7366 1.1 christos (+ pack FRk op FRi CCi cond ope FRj)
7367 1.1 christos (if (eq CCi (or cond 2))
7368 1.1 christos (set FRk (operation FRi FRj)))
7369 1.1 christos profile
7370 1.1 christos )
7371 1.1 christos )
7372 1.1 christos
7373 1.1 christos (conditional-float-binary-op cfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_6D OPE4_0
7374 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7375 1.1 christos "cond add single")
7376 1.1 christos (conditional-float-binary-op cfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_6D OPE4_1
7377 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7378 1.1 christos "cond sub single")
7379 1.1 christos (conditional-float-binary-op cfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_6E OPE4_0
7380 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7381 1.1 christos "cond mul single")
7382 1.1 christos (conditional-float-binary-op cfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_6E OPE4_1
7383 1.1 christos ((fr500 (unit u-float-div)) (fr550 (unit u-float-div)))
7384 1.1 christos "cond div single")
7385 1.1 christos
7386 1.1 christos (define-pmacro (ne-float-binary-op name pipe attr operation op ope profile comment)
7387 1.1 christos (dni name
7388 1.1 christos (comment)
7389 1.1 christos (.splice (UNIT pipe) (MACH simple,tomcat,fr500,fr550,frv)
7390 1.1 christos (.unsplice attr))
7391 1.1 christos (.str name "$pack $FRi,$FRj,$FRk")
7392 1.1 christos (+ pack FRk op FRi ope FRj)
7393 1.1 christos (sequence ()
7394 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7395 1.1 christos (set FRk (operation FRi FRj)))
7396 1.1 christos profile
7397 1.1 christos )
7398 1.1 christos )
7399 1.1 christos
7400 1.1 christos (ne-float-binary-op nfadds FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) add OP_79 OPE1_26
7401 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7402 1.1 christos "ne add single")
7403 1.1 christos (ne-float-binary-op nfsubs FMALL ((FR500-MAJOR F-2) (FR550-MAJOR F-2)) sub OP_79 OPE1_27
7404 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7405 1.1 christos "ne sub single")
7406 1.1 christos (ne-float-binary-op nfmuls FM01 ((FR500-MAJOR F-3) (FR550-MAJOR F-3)) mul OP_79 OPE1_28
7407 1.1 christos ((fr500 (unit u-float-arith)) (fr550 (unit u-float-arith)))
7408 1.1 christos "ne mul single")
7409 1.1 christos (ne-float-binary-op nfdivs FM01 ((FR500-MAJOR F-4) (FR550-MAJOR F-3)) div OP_79 OPE1_29
7410 1.1 christos ((fr500 (unit u-float-div)) (fr550 (unit u-float-div)))
7411 1.1 christos "ne div single")
7412 1.1 christos
7413 1.1 christos (define-pmacro (fcc-eq) 8)
7414 1.1 christos (define-pmacro (fcc-lt) 4)
7415 1.1 christos (define-pmacro (fcc-gt) 2)
7416 1.1 christos (define-pmacro (fcc-uo) 1)
7417 1.1 christos
7418 1.1 christos (define-pmacro (compare-and-set-fcc arg1 arg2 fcc)
7419 1.1 christos (if (gt arg1 arg2)
7420 1.1 christos (set fcc (fcc-gt))
7421 1.1 christos (if (eq arg1 arg2)
7422 1.1 christos (set fcc (fcc-eq))
7423 1.1 christos (if (lt arg1 arg2)
7424 1.1 christos (set fcc (fcc-lt))
7425 1.1 christos (set fcc (fcc-uo)))))
7426 1.1 christos )
7427 1.1 christos
7428 1.1 christos (dni fcmps
7429 1.1 christos "compare single float"
7430 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7431 1.1 christos "fcmps$pack $FRi,$FRj,$FCCi_2"
7432 1.1 christos (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_0A FRj)
7433 1.1 christos (compare-and-set-fcc FRi FRj FCCi_2)
7434 1.1 christos ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare)))
7435 1.1 christos )
7436 1.1 christos
7437 1.1 christos (dni fcmpd
7438 1.1 christos "compare double float"
7439 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-2) (MACH frv))
7440 1.1 christos "fcmpd$pack $FRdoublei,$FRdoublej,$FCCi_2"
7441 1.1 christos (+ pack (cond-null) FCCi_2 OP_7A FRdoublei OPE1_0A FRdoublej)
7442 1.1 christos (compare-and-set-fcc FRdoublei FRdoublej FCCi_2)
7443 1.1 christos ((fr500 (unit u-float-compare)))
7444 1.1 christos )
7445 1.1 christos
7446 1.1 christos (dni cfcmps
7447 1.1 christos "Conditional compare single, float"
7448 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-2) (FR550-MAJOR F-2) (MACH simple,tomcat,fr500,fr550,frv))
7449 1.1 christos "cfcmps$pack $FRi,$FRj,$FCCi_2,$CCi,$cond"
7450 1.1 christos (+ pack (cond-null) FCCi_2 OP_6D FRi CCi cond OPE4_2 FRj)
7451 1.1 christos (if (eq CCi (or cond 2))
7452 1.1 christos (compare-and-set-fcc FRi FRj FCCi_2))
7453 1.1 christos ((fr500 (unit u-float-compare)) (fr550 (unit u-float-compare)))
7454 1.1 christos )
7455 1.1 christos
7456 1.1 christos (dni fdcmps
7457 1.1 christos "float dual compare single"
7458 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7459 1.1 christos "fdcmps$pack $FRi,$FRj,$FCCi_2"
7460 1.1 christos (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_1A FRj)
7461 1.1 christos (sequence ()
7462 1.1 christos (compare-and-set-fcc FRi FRj FCCi_2)
7463 1.1 christos (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)
7464 1.1 christos (nextreg h-fccr FCCi_2 1)))
7465 1.1 christos ((fr500 (unit u-float-dual-compare)) (fr550 (unit u-float-dual-compare)))
7466 1.1 christos )
7467 1.1 christos
7468 1.1 christos (define-pmacro (float-mul-with-add name add_sub arg1 arg2 targ op ope comment)
7469 1.1 christos (dni name
7470 1.1 christos (comment)
7471 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
7472 1.1 christos (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7473 1.1 christos (+ pack targ op arg1 ope arg2)
7474 1.1 christos (set targ (add_sub (mul arg1 arg2) targ))
7475 1.1 christos ((fr500 (unit u-float-dual-arith)))
7476 1.1 christos )
7477 1.1 christos )
7478 1.1 christos
7479 1.1 christos (float-mul-with-add fmadds add FRi FRj FRk OP_79 OPE1_0B "mul with add, single")
7480 1.1 christos (float-mul-with-add fmsubs sub FRi FRj FRk OP_79 OPE1_0C "mul with sub, single")
7481 1.1 christos
7482 1.1 christos (float-mul-with-add fmaddd add FRdoublei FRdoublej FRdoublek OP_7A OPE1_0B "mul with add, double")
7483 1.1 christos (float-mul-with-add fmsubd sub FRdoublei FRdoublej FRdoublek OP_7A OPE1_0C "mul with sub, double")
7484 1.1 christos
7485 1.1 christos (dni fdmadds
7486 1.1 christos "Float dual multiply with add"
7487 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
7488 1.1 christos "fdmadds$pack $FRi,$FRj,$FRk"
7489 1.1 christos (+ pack FRk OP_79 FRi OPE1_1B FRj)
7490 1.1 christos (sequence ()
7491 1.1 christos (set FRk (add (mul FRi FRj) FRk))
7492 1.1 christos (set (nextreg h-fr FRk 1)
7493 1.1 christos (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))
7494 1.1 christos (nextreg h-fr FRk 1))))
7495 1.1 christos ; TODO dual registers not referenced for profiling
7496 1.1 christos ((fr500 (unit u-float-dual-arith)))
7497 1.1 christos )
7498 1.1 christos
7499 1.1 christos (dni nfdmadds
7500 1.1 christos "Non excepting float dual multiply with add"
7501 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv))
7502 1.1 christos "nfdmadds$pack $FRi,$FRj,$FRk"
7503 1.1 christos (+ pack FRk OP_79 FRi OPE1_3B FRj)
7504 1.1 christos (sequence ()
7505 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7506 1.1 christos (set FRk (add (mul FRi FRj) FRk))
7507 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7508 1.1 christos (set (nextreg h-fr FRk 1)
7509 1.1 christos (add (mul (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))
7510 1.1 christos (nextreg h-fr FRk 1))))
7511 1.1 christos ; TODO dual registers not referenced for profiling
7512 1.1 christos ((fr500 (unit u-float-dual-arith)))
7513 1.1 christos )
7514 1.1 christos
7515 1.1 christos (define-pmacro (conditional-float-mul-with-add
7516 1.1 christos name add_sub arg1 arg2 targ op ope comment)
7517 1.1 christos (dni name
7518 1.1 christos (comment)
7519 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) CONDITIONAL)
7520 1.1 christos (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
7521 1.1 christos (+ pack FRk op FRi CCi cond ope FRj)
7522 1.1 christos (if (eq CCi (or cond 2))
7523 1.1 christos (set targ (add_sub (mul arg1 arg2) targ)))
7524 1.1 christos ((fr500 (unit u-float-dual-arith)))
7525 1.1 christos )
7526 1.1 christos )
7527 1.1 christos
7528 1.1 christos (conditional-float-mul-with-add cfmadds add FRi FRj FRk OP_6F OPE4_0 "conditional mul with add, single")
7529 1.1 christos (conditional-float-mul-with-add cfmsubs sub FRi FRj FRk OP_6F OPE4_1 "conditional mul with sub, single")
7530 1.1 christos
7531 1.1 christos (define-pmacro (ne-float-mul-with-add name add_sub arg1 arg2 targ op ope comment)
7532 1.1 christos (dni name
7533 1.1 christos (comment)
7534 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-5) (MACH frv) NON-EXCEPTING)
7535 1.1 christos (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7536 1.1 christos (+ pack targ op arg1 ope arg2)
7537 1.1 christos (sequence ()
7538 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7539 1.1 christos (set targ (add_sub (mul arg1 arg2) targ)))
7540 1.1 christos ((fr500 (unit u-float-dual-arith)))
7541 1.1 christos )
7542 1.1 christos )
7543 1.1 christos
7544 1.1 christos (ne-float-mul-with-add nfmadds add FRi FRj FRk OP_79 OPE1_2B "non excepting mul with add, single")
7545 1.1 christos (ne-float-mul-with-add nfmsubs sub FRi FRj FRk OP_79 OPE1_2C "non excepting mul with sub, single")
7546 1.1 christos
7547 1.1 christos (define-pmacro (float-parallel-mul-add-semantics cond add_sub arg1 arg2 targ)
7548 1.1 christos (if cond
7549 1.1 christos (sequence ()
7550 1.1 christos (set targ (mul arg1 arg2))
7551 1.1 christos (set (nextreg h-fr targ 1)
7552 1.1 christos (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))))
7553 1.1 christos )
7554 1.1 christos
7555 1.1 christos (define-pmacro (float-parallel-mul-add
7556 1.1 christos name add_sub arg1 arg2 targ op ope comment)
7557 1.1 christos (dni name
7558 1.1 christos (comment)
7559 1.1 christos ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7560 1.1 christos (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7561 1.1 christos (+ pack targ op arg1 ope arg2)
7562 1.1 christos (float-parallel-mul-add-semantics 1 add_sub arg1 arg2 targ)
7563 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7564 1.1 christos )
7565 1.1 christos )
7566 1.1 christos
7567 1.1 christos (float-parallel-mul-add fmas add FRi FRj FRk OP_79 OPE1_0E "parallel mul/add, single")
7568 1.1 christos (float-parallel-mul-add fmss sub FRi FRj FRk OP_79 OPE1_0F "parallel mul/sub, single")
7569 1.1 christos
7570 1.1 christos (define-pmacro (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7571 1.1 christos (sequence ()
7572 1.1 christos (set targ (mul arg1 arg2))
7573 1.1 christos (set (nextreg h-fr targ 1)
7574 1.1 christos (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))
7575 1.1 christos (set (nextreg h-fr targ 2)
7576 1.1 christos (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2)))
7577 1.1 christos (set (nextreg h-fr targ 3)
7578 1.1 christos (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3))))
7579 1.1 christos )
7580 1.1 christos
7581 1.1 christos (define-pmacro (float-dual-parallel-mul-add
7582 1.1 christos name add_sub arg1 arg2 targ op ope comment)
7583 1.1 christos (dni name
7584 1.1 christos (comment)
7585 1.1 christos ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
7586 1.1 christos (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7587 1.1 christos (+ pack targ op arg1 ope arg2)
7588 1.1 christos (float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7589 1.1 christos ()
7590 1.1 christos )
7591 1.1 christos )
7592 1.1 christos
7593 1.1 christos (float-dual-parallel-mul-add fdmas add FRi FRj FRk OP_79 OPE1_1C "dual parallel mul/add, single")
7594 1.1 christos (float-dual-parallel-mul-add fdmss sub FRi FRj FRk OP_79 OPE1_1D "dual parallel mul/sub, single")
7595 1.1 christos
7596 1.1 christos (define-pmacro (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7597 1.1 christos (sequence ()
7598 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of targ))
7599 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 1))
7600 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 2))
7601 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of targ) 3))
7602 1.1 christos (set targ (mul arg1 arg2))
7603 1.1 christos (set (nextreg h-fr targ 1)
7604 1.1 christos (add_sub (nextreg h-fr arg1 1) (nextreg h-fr arg2 1)))
7605 1.1 christos (set (nextreg h-fr targ 2)
7606 1.1 christos (mul (nextreg h-fr arg1 2) (nextreg h-fr arg2 2)))
7607 1.1 christos (set (nextreg h-fr targ 3)
7608 1.1 christos (add_sub (nextreg h-fr arg1 3) (nextreg h-fr arg2 3))))
7609 1.1 christos )
7610 1.1 christos
7611 1.1 christos (define-pmacro (ne-float-dual-parallel-mul-add
7612 1.1 christos name add_sub arg1 arg2 targ op ope comment)
7613 1.1 christos (dni name
7614 1.1 christos (comment)
7615 1.1 christos ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
7616 1.1 christos (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7617 1.1 christos (+ pack targ op arg1 ope arg2)
7618 1.1 christos (ne-float-dual-parallel-mul-add-semantics add_sub arg1 arg2 targ)
7619 1.1 christos ()
7620 1.1 christos )
7621 1.1 christos )
7622 1.1 christos
7623 1.1 christos (ne-float-dual-parallel-mul-add nfdmas add FRi FRj FRk OP_79 OPE1_3C "non excepting dual parallel mul/add, single")
7624 1.1 christos (ne-float-dual-parallel-mul-add nfdmss sub FRi FRj FRk OP_79 OPE1_3D "non excepting dual parallel mul/sub, single")
7625 1.1 christos
7626 1.1 christos (define-pmacro (conditional-float-parallel-mul-add name add_sub op ope comment)
7627 1.1 christos (dni name
7628 1.1 christos (comment)
7629 1.1 christos ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) CONDITIONAL (MACH simple,tomcat,fr500,fr550,frv))
7630 1.1 christos (.str name "$pack $FRi,$FRj,$FRk,$CCi,$cond")
7631 1.1 christos (+ pack FRk op FRi CCi cond ope FRj)
7632 1.1 christos (float-parallel-mul-add-semantics (eq CCi (or cond 2))
7633 1.1 christos add_sub FRi FRj FRk)
7634 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7635 1.1 christos )
7636 1.1 christos )
7637 1.1 christos
7638 1.1 christos (conditional-float-parallel-mul-add cfmas add OP_6F OPE4_2 "conditional parallel mul/add, single")
7639 1.1 christos (conditional-float-parallel-mul-add cfmss sub OP_6F OPE4_3 "conditional parallel mul/sub, single")
7640 1.1 christos
7641 1.1 christos (define-pmacro (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ)
7642 1.1 christos (sequence ()
7643 1.1 christos (set targ (ftrunc SF FPCONV-DEFAULT
7644 1.1 christos (mul DF
7645 1.1 christos (fext DF FPCONV-DEFAULT arg1)
7646 1.1 christos (fext DF FPCONV-DEFAULT arg2))))
7647 1.1 christos (set (nextreg h-fr targ 1)
7648 1.1 christos (ftrunc SF FPCONV-DEFAULT
7649 1.1 christos (add_sub DF
7650 1.1 christos (fext DF FPCONV-DEFAULT (nextreg h-fr arg1 1))
7651 1.1 christos (fext DF FPCONV-DEFAULT (nextreg h-fr arg2 1))))))
7652 1.1 christos )
7653 1.1 christos
7654 1.1 christos (define-pmacro (float-parallel-mul-add-double
7655 1.1 christos name add_sub arg1 arg2 targ op ope comment)
7656 1.1 christos (dni name
7657 1.1 christos (comment)
7658 1.1 christos ((UNIT FM01) (FR500-MAJOR F-5) (MACH frv))
7659 1.1 christos (.str name "$pack $" arg1 ",$" arg2 ",$" targ)
7660 1.1 christos (+ pack targ op arg1 ope arg2)
7661 1.1 christos (float-parallel-mul-add-double-semantics add_sub arg1 arg2 targ)
7662 1.1 christos ()
7663 1.1 christos )
7664 1.1 christos )
7665 1.1 christos
7666 1.1 christos (float-parallel-mul-add-double fmad add FRi FRj FRk OP_7A OPE1_0E "parallel mul/add, double")
7667 1.1 christos (float-parallel-mul-add-double fmsd sub FRi FRj FRk OP_7A OPE1_0F "parallel mul/sub, double")
7668 1.1 christos
7669 1.1 christos (define-pmacro (ne-float-parallel-mul-add name add_sub op ope comment)
7670 1.1 christos (dni name
7671 1.1 christos (comment)
7672 1.1 christos ((UNIT FM01) (FR500-MAJOR F-5) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7673 1.1 christos (.str name "$pack $FRi,$FRj,$FRk")
7674 1.1 christos (+ pack FRk op FRi ope FRj)
7675 1.1 christos (sequence ()
7676 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7677 1.1 christos (set FRk (mul FRi FRj))
7678 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7679 1.1 christos (set (nextreg h-fr FRk 1)
7680 1.1 christos (add_sub (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
7681 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7682 1.1 christos )
7683 1.1 christos )
7684 1.1 christos
7685 1.1 christos (ne-float-parallel-mul-add nfmas add OP_79 OPE1_2E "ne parallel mul/add,single")
7686 1.1 christos (ne-float-parallel-mul-add nfmss sub OP_79 OPE1_2F "ne parallel mul/sub,single")
7687 1.1 christos
7688 1.1 christos (define-pmacro (float-dual-arith name attr oper1 oper2 op ope comment)
7689 1.1 christos (dni name
7690 1.1 christos (comment)
7691 1.1 christos (.splice (UNIT FM01) (.unsplice attr))
7692 1.1 christos (.str name "$pack $FRi,$FRj,$FRk")
7693 1.1 christos (+ pack FRk op FRi ope FRj)
7694 1.1 christos (sequence ()
7695 1.1 christos (set FRk (oper1 FRi FRj))
7696 1.1 christos (set (nextreg h-fr FRk 1)
7697 1.1 christos (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
7698 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7699 1.1 christos )
7700 1.1 christos )
7701 1.1 christos
7702 1.1 christos (float-dual-arith fdadds ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add add OP_79 OPE1_16 "dual add, single")
7703 1.1 christos (float-dual-arith fdsubs ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) sub sub OP_79 OPE1_17 "dual sub, single")
7704 1.1 christos (float-dual-arith fdmuls ((FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) mul mul OP_79 OPE1_18 "dual mul, single")
7705 1.1 christos (float-dual-arith fddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_19 "dual div,single")
7706 1.1 christos (float-dual-arith fdsads ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add sub OP_79 OPE1_1E "dual add/sub, single")
7707 1.1 christos
7708 1.1 christos (dni fdmulcs
7709 1.1 christos "Float dual cross multiply single"
7710 1.1 christos ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7711 1.1 christos "fdmulcs$pack $FRi,$FRj,$FRk"
7712 1.1 christos (+ pack FRk OP_79 FRi OPE1_1F FRj)
7713 1.1 christos (sequence ()
7714 1.1 christos (set FRk (mul FRi (nextreg h-fr FRj 1)))
7715 1.1 christos (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj)))
7716 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7717 1.1 christos )
7718 1.1 christos
7719 1.1 christos (dni nfdmulcs
7720 1.1 christos "NE float dual cross multiply single"
7721 1.1 christos ((UNIT FM01) (FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv))
7722 1.1 christos "nfdmulcs$pack $FRi,$FRj,$FRk"
7723 1.1 christos (+ pack FRk OP_79 FRi OPE1_3F FRj)
7724 1.1 christos (sequence ()
7725 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7726 1.1 christos (set FRk (mul FRi (nextreg h-fr FRj 1)))
7727 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7728 1.1 christos (set (nextreg h-fr FRk 1) (mul (nextreg h-fr FRi 1) FRj)))
7729 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7730 1.1 christos )
7731 1.1 christos
7732 1.1 christos (define-pmacro (ne-float-dual-arith name attr oper1 oper2 op ope comment)
7733 1.1 christos (dni name
7734 1.1 christos (comment)
7735 1.1 christos (.splice (UNIT FM01) (.unsplice attr))
7736 1.1 christos (.str name "$pack $FRi,$FRj,$FRk")
7737 1.1 christos (+ pack FRk op FRi ope FRj)
7738 1.1 christos (sequence ()
7739 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7740 1.1 christos (set FRk (oper1 FRi FRj))
7741 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7742 1.1 christos (set (nextreg h-fr FRk 1)
7743 1.1 christos (oper2 (nextreg h-fr FRi 1) (nextreg h-fr FRj 1))))
7744 1.1 christos ((fr500 (unit u-float-dual-arith)) (fr550 (unit u-float-dual-arith)))
7745 1.1 christos )
7746 1.1 christos )
7747 1.1 christos
7748 1.1 christos (ne-float-dual-arith nfdadds ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add add OP_79 OPE1_36 "ne dual add, single")
7749 1.1 christos (ne-float-dual-arith nfdsubs ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) sub sub OP_79 OPE1_37 "ne dual sub, single")
7750 1.1 christos (ne-float-dual-arith nfdmuls ((FR500-MAJOR F-7) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) mul mul OP_79 OPE1_38 "ne dual mul, single")
7751 1.1 christos (ne-float-dual-arith nfddivs ((FR500-MAJOR F-7) (MACH frv)) div div OP_79 OPE1_39 "ne dual div,single")
7752 1.1 christos (ne-float-dual-arith nfdsads ((FR500-MAJOR F-6) (FR550-MAJOR F-4) (MACH simple,tomcat,fr500,fr550,frv)) add sub OP_79 OPE1_3E "ne dual add/sub, single")
7753 1.1 christos
7754 1.1 christos (dni nfdcmps
7755 1.1 christos "non-excepting dual float compare"
7756 1.1 christos ((UNIT FM01) (FR500-MAJOR F-6) (MACH simple,tomcat,frv))
7757 1.1 christos "nfdcmps$pack $FRi,$FRj,$FCCi_2"
7758 1.1 christos (+ pack (cond-null) FCCi_2 OP_79 FRi OPE1_3A FRj)
7759 1.1 christos (sequence ()
7760 1.1 christos (c-call VOID "@cpu@_set_ne_index" (index-of FRk))
7761 1.1 christos (compare-and-set-fcc FRi FRj FCCi_2)
7762 1.1 christos (c-call VOID "@cpu@_set_ne_index" (add (index-of FRk) 1))
7763 1.1 christos (compare-and-set-fcc (nextreg h-fr FRi 1) (nextreg h-fr FRj 1)
7764 1.1 christos (nextreg h-fccr FCCi_2 1)))
7765 1.1 christos ((fr500 (unit u-float-dual-compare)))
7766 1.1 christos )
7767 1.1 christos
7768 1.1 christos ; Media Instructions
7769 1.1 christos ;
7770 1.1 christos (define-pmacro (halfword hilo arg offset)
7771 1.1 christos (reg (.sym h-fr_ hilo) (add (index-of arg) offset)))
7772 1.1 christos
7773 1.1 christos (dni mhsetlos
7774 1.1 christos "Media set lower signed 12 bits"
7775 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7776 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7777 1.1 christos "mhsetlos$pack $u12,$FRklo"
7778 1.1 christos (+ pack FRklo OP_78 OPE1_20 u12)
7779 1.1 christos (set FRklo u12)
7780 1.1 christos ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
7781 1.1 christos (fr550 (unit u-media-set (out FRintk FRklo))))
7782 1.1 christos )
7783 1.1 christos
7784 1.1 christos (dni mhsethis
7785 1.1 christos "Media set upper signed 12 bits"
7786 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7787 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7788 1.1 christos "mhsethis$pack $u12,$FRkhi"
7789 1.1 christos (+ pack FRkhi OP_78 OPE1_22 u12)
7790 1.1 christos (set FRkhi u12)
7791 1.1 christos ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
7792 1.1 christos (fr550 (unit u-media-set (out FRintk FRkhi))))
7793 1.1 christos )
7794 1.1 christos
7795 1.1 christos (dni mhdsets
7796 1.1 christos "Media dual set halfword signed 12 bits"
7797 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7798 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7799 1.1 christos "mhdsets$pack $u12,$FRintk"
7800 1.1 christos (+ pack FRintk OP_78 OPE1_24 u12)
7801 1.1 christos (sequence ()
7802 1.1 christos ; hack to get FRintk passed to modelling functions
7803 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
7804 1.1 christos (set (halfword hi FRintk 0) u12)
7805 1.1 christos (set (halfword lo FRintk 0) u12))
7806 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7807 1.1 christos (fr550 (unit u-media-set)))
7808 1.1 christos )
7809 1.1 christos
7810 1.1 christos (define-pmacro (set-5-semantics target value)
7811 1.1 christos (sequence ((HI tmp))
7812 1.1 christos (set tmp target)
7813 1.1 christos (set tmp (and tmp #x07ff))
7814 1.1 christos (set tmp (or tmp (sll (and s5 #x1f) 11)))
7815 1.1 christos (set target tmp))
7816 1.1 christos )
7817 1.1 christos
7818 1.1 christos (define-pmacro (media-set-5 name hilo op ope comment)
7819 1.1 christos (dni name
7820 1.1 christos (comment)
7821 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7822 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7823 1.1 christos (.str name "$pack $s5,$FRk" hilo)
7824 1.1 christos (+ pack (.sym FRk hilo) op (FRi-null) ope (misc-null-11) s5)
7825 1.1 christos (set-5-semantics (.sym FRk hilo) s5)
7826 1.1 christos ((fr400 (unit u-media-hilo)) (fr450 (unit u-media-hilo))
7827 1.1 christos (fr550 (unit u-media-set (out FRintk (.sym FRk hilo)))))
7828 1.1 christos )
7829 1.1 christos )
7830 1.1 christos
7831 1.1 christos (media-set-5 mhsetloh lo OP_78 OPE1_21 "Media set upper 5 bits lo")
7832 1.1 christos (media-set-5 mhsethih hi OP_78 OPE1_23 "Media set upper 5 bits hi")
7833 1.1 christos
7834 1.1 christos (dni mhdseth
7835 1.1 christos "Media dual set halfword upper 5 bits"
7836 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-5)
7837 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7838 1.1 christos "mhdseth$pack $s5,$FRintk"
7839 1.1 christos (+ pack FRintk OP_78 (FRi-null) OPE1_25 (misc-null-11) s5)
7840 1.1 christos (sequence ()
7841 1.1 christos ; hack to get FRintk passed to modelling functions
7842 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
7843 1.1 christos (set-5-semantics (halfword hi FRintk 0) s5)
7844 1.1 christos (set-5-semantics (halfword lo FRintk 0) s5))
7845 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7846 1.1 christos (fr550 (unit u-media-set)))
7847 1.1 christos )
7848 1.1 christos
7849 1.1 christos (define-pmacro (media-logic-r-r name operation op ope comment)
7850 1.1 christos (dni name
7851 1.1 christos (comment)
7852 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7853 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7854 1.1 christos (.str name "$pack $FRinti,$FRintj,$FRintk")
7855 1.1 christos (+ pack FRintk op FRinti ope FRintj)
7856 1.1 christos (set FRintk (operation FRinti FRintj))
7857 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7858 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
7859 1.1 christos )
7860 1.1 christos )
7861 1.1 christos
7862 1.1 christos (media-logic-r-r mand and OP_7B OPE1_00 "and reg/reg")
7863 1.1 christos (media-logic-r-r mor or OP_7B OPE1_01 "or reg/reg")
7864 1.1 christos (media-logic-r-r mxor xor OP_7B OPE1_02 "xor reg/reg")
7865 1.1 christos
7866 1.1 christos (define-pmacro (conditional-media-logic name operation op ope comment)
7867 1.1 christos (dni name
7868 1.1 christos (comment)
7869 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7870 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
7871 1.1 christos (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
7872 1.1 christos (+ pack FRintk op FRinti CCi cond ope FRintj)
7873 1.1 christos (if (eq CCi (or cond 2))
7874 1.1 christos (set FRintk (operation FRinti FRintj)))
7875 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7876 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
7877 1.1 christos )
7878 1.1 christos )
7879 1.1 christos
7880 1.1 christos (conditional-media-logic cmand and OP_70 OPE4_0 "conditional and reg/reg")
7881 1.1 christos (conditional-media-logic cmor or OP_70 OPE4_1 "conditional or reg/reg")
7882 1.1 christos (conditional-media-logic cmxor xor OP_70 OPE4_2 "conditional xor reg/reg")
7883 1.1 christos
7884 1.1 christos (dni mnot
7885 1.1 christos ("mnot")
7886 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7887 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7888 1.1 christos ("mnot$pack $FRintj,$FRintk")
7889 1.1 christos (+ pack FRintk OP_7B (rs-null) OPE1_03 FRintj)
7890 1.1 christos (set FRintk (inv FRintj))
7891 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7892 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
7893 1.1 christos )
7894 1.1 christos
7895 1.1 christos (dni cmnot
7896 1.1 christos ("cmnot")
7897 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
7898 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
7899 1.1 christos ("cmnot$pack $FRintj,$FRintk,$CCi,$cond")
7900 1.1 christos (+ pack FRintk OP_70 (rs-null) CCi cond OPE4_3 FRintj)
7901 1.1 christos (if (eq CCi (or cond 2))
7902 1.1 christos (set FRintk (inv FRintj)))
7903 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
7904 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
7905 1.1 christos )
7906 1.1 christos
7907 1.1 christos (define-pmacro (media-rotate-r-r name operation op ope comment)
7908 1.1 christos (dni name
7909 1.1 christos (comment)
7910 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7911 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
7912 1.1 christos (.str name "$pack $FRinti,$u6,$FRintk")
7913 1.1 christos (+ pack FRintk op FRinti ope u6)
7914 1.1 christos (set FRintk (operation FRinti (and u6 #x1f)))
7915 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
7916 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
7917 1.1 christos )
7918 1.1 christos )
7919 1.1 christos
7920 1.1 christos (media-rotate-r-r mrotli rol OP_7B OPE1_04 "rotate left reg/reg")
7921 1.1 christos (media-rotate-r-r mrotri ror OP_7B OPE1_05 "rotate right reg/reg")
7922 1.1 christos
7923 1.1 christos (define-pmacro (media-cut-r-r name arg op ope comment)
7924 1.1 christos (dni name
7925 1.1 christos (comment)
7926 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7927 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
7928 1.1 christos (.str name "$pack $FRinti,$" arg ",$FRintk")
7929 1.1 christos (+ pack FRintk op FRinti ope arg)
7930 1.1 christos (set FRintk (c-call SI "@cpu@_cut" FRinti (nextreg h-fr_int FRinti 1) arg))
7931 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
7932 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
7933 1.1 christos )
7934 1.1 christos )
7935 1.1 christos
7936 1.1 christos (media-cut-r-r mwcut FRintj OP_7B OPE1_06 "media cut")
7937 1.1 christos (media-cut-r-r mwcuti u6 OP_7B OPE1_07 "media cut")
7938 1.1 christos
7939 1.1 christos (define-pmacro (media-cut-acc name arg op ope fr450-major comment)
7940 1.1 christos (dni name
7941 1.1 christos (comment)
7942 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7943 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR fr450-major))
7944 1.1 christos (.str name "$pack $ACC40Si,$" arg ",$FRintk")
7945 1.1 christos (+ pack FRintk op ACC40Si ope arg)
7946 1.1 christos (set FRintk (c-call SI "@cpu@_media_cut" ACC40Si arg))
7947 1.1 christos ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
7948 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
7949 1.1 christos )
7950 1.1 christos )
7951 1.1 christos
7952 1.1 christos (media-cut-acc mcut FRintj OP_7B OPE1_2C M-1 "media accumulator cut reg")
7953 1.1 christos (media-cut-acc mcuti s6 OP_7B OPE1_2E M-5 "media accumulator cut immed")
7954 1.1 christos
7955 1.1 christos (define-pmacro (media-cut-acc-ss name arg op ope fr450-major comment)
7956 1.1 christos (dni name
7957 1.1 christos (comment)
7958 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
7959 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR fr450-major))
7960 1.1 christos (.str name "$pack $ACC40Si,$" arg ",$FRintk")
7961 1.1 christos (+ pack FRintk op ACC40Si ope arg)
7962 1.1 christos (set FRintk (c-call SI "@cpu@_media_cut_ss" ACC40Si arg))
7963 1.1 christos ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
7964 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
7965 1.1 christos )
7966 1.1 christos )
7967 1.1 christos
7968 1.1 christos (media-cut-acc-ss mcutss FRintj OP_7B OPE1_2D M-1 "media accumulator cut reg with saturation")
7969 1.1 christos (media-cut-acc-ss mcutssi s6 OP_7B OPE1_2F M-5 "media accumulator cut immed with saturation")
7970 1.1 christos
7971 1.1 christos ; Dual Media Instructions
7972 1.1 christos ;
7973 1.1 christos (define-pmacro (register-unaligned register alignment)
7974 1.1 christos (and (index-of register) (sub alignment 1))
7975 1.1 christos )
7976 1.1 christos
7977 1.1 christos (dni mdcutssi
7978 1.1 christos "Media dual cut with signed saturation"
7979 1.1 christos ((UNIT MDCUTSSI) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
7980 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-6))
7981 1.1 christos "mdcutssi$pack $ACC40Si,$s6,$FRintkeven"
7982 1.1 christos (+ pack FRintkeven OP_78 ACC40Si OPE1_0E s6)
7983 1.1 christos (if (register-unaligned ACC40Si 2)
7984 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
7985 1.1 christos (if (register-unaligned FRintkeven 2)
7986 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
7987 1.1 christos (sequence ()
7988 1.1 christos (set FRintkeven (c-call SI "@cpu@_media_cut_ss" ACC40Si s6))
7989 1.1 christos (set (nextreg h-fr_int FRintkeven 1)
7990 1.1 christos (c-call SI "@cpu@_media_cut_ss"
7991 1.1 christos (nextreg h-acc40S ACC40Si 1) s6)))))
7992 1.1 christos ((fr400 (unit u-media-4-acc-dual
7993 1.1 christos (out FRintk FRintkeven)))
7994 1.1 christos (fr450 (unit u-media-4-acc-dual
7995 1.1 christos (out FRintk FRintkeven)))
7996 1.1 christos (fr550 (unit u-media-3-acc-dual)))
7997 1.1 christos )
7998 1.1 christos
7999 1.1 christos ; The (add (xxxx) (mul arg 0)) is a hack to get a reference to arg generated
8000 1.1 christos ; so it will be passed to the unit modelers. YUCK!!!!!
8001 1.1 christos (define-pmacro (extract-hilo reg1 off1 reg2 off2 arg1hi arg1lo arg2hi arg2lo)
8002 1.1 christos (sequence ()
8003 1.1 christos (set arg1hi (add (halfword hi reg1 off1) (mul reg1 0)))
8004 1.1 christos (set arg1lo (add (halfword lo reg1 off1) (mul reg1 0)))
8005 1.1 christos (set arg2hi (add (halfword hi reg2 off2) (mul reg2 0)))
8006 1.1 christos (set arg2lo (add (halfword lo reg2 off2) (mul reg2 0))))
8007 1.1 christos )
8008 1.1 christos
8009 1.1 christos (dni maveh
8010 1.1 christos "Media dual average"
8011 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8012 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8013 1.1 christos "maveh$pack $FRinti,$FRintj,$FRintk"
8014 1.1 christos (+ pack FRintk OP_7B FRinti OPE1_08 FRintj)
8015 1.1 christos (set FRintk (c-call SI "@cpu@_media_average" FRinti FRintj))
8016 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8017 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8018 1.1 christos )
8019 1.1 christos
8020 1.1 christos (define-pmacro (media-dual-shift name operation op ope profile comment)
8021 1.1 christos (dni name
8022 1.1 christos (comment)
8023 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
8024 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8025 1.1 christos (.str name "$pack $FRinti,$u6,$FRintk")
8026 1.1 christos (+ pack FRintk op FRinti ope u6)
8027 1.1 christos (sequence ()
8028 1.1 christos ; hack to get these referenced for profiling
8029 1.1 christos (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
8030 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
8031 1.1 christos (set (halfword hi FRintk 0)
8032 1.1 christos (operation (halfword hi FRinti 0) (and u6 #xf)))
8033 1.1 christos (set (halfword lo FRintk 0)
8034 1.1 christos (operation (halfword lo FRinti 0) (and u6 #xf))))
8035 1.1 christos profile
8036 1.1 christos )
8037 1.1 christos )
8038 1.1 christos
8039 1.1 christos (media-dual-shift msllhi sll OP_7B OPE1_09
8040 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
8041 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8042 1.1 christos "Media dual shift left logical")
8043 1.1 christos (media-dual-shift msrlhi srl OP_7B OPE1_0A
8044 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
8045 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8046 1.1 christos "Media dual shift right logical")
8047 1.1 christos (media-dual-shift msrahi sra OP_7B OPE1_0B
8048 1.1 christos ((fr400 (unit u-media-6)) (fr450 (unit u-media-6))
8049 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8050 1.1 christos "Media dual shift right arithmetic")
8051 1.1 christos
8052 1.1 christos (define-pmacro (media-dual-word-rotate-r-r name operation op ope comment)
8053 1.1 christos (dni name
8054 1.1 christos (comment)
8055 1.1 christos ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
8056 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8057 1.1 christos (.str name "$pack $FRintieven,$s6,$FRintkeven")
8058 1.1 christos (+ pack FRintkeven op FRintieven ope s6)
8059 1.1 christos (if (orif (register-unaligned FRintieven 2)
8060 1.1 christos (register-unaligned FRintkeven 2))
8061 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8062 1.1 christos (sequence ()
8063 1.1 christos (set FRintkeven (operation FRintieven (and s6 #x1f)))
8064 1.1 christos (set (nextreg h-fr_int FRintkeven 1)
8065 1.1 christos (operation (nextreg h-fr_int FRintieven 1)
8066 1.1 christos (and s6 #x1f)))))
8067 1.1 christos ((fr400 (unit u-media-3-quad
8068 1.1 christos (in FRinti FRintieven)
8069 1.1 christos (out FRintk FRintkeven)))
8070 1.1 christos (fr450 (unit u-media-3-quad
8071 1.1 christos (in FRinti FRintieven)
8072 1.1 christos (out FRintk FRintkeven)))
8073 1.1 christos (fr550 (unit u-media-quad)))
8074 1.1 christos )
8075 1.1 christos )
8076 1.1 christos
8077 1.1 christos (media-dual-word-rotate-r-r mdrotli rol OP_78 OPE1_0B "rotate left reg/reg")
8078 1.1 christos
8079 1.1 christos (dni mcplhi
8080 1.1 christos "Media bit concatenate, halfword"
8081 1.1 christos ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
8082 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8083 1.1 christos "mcplhi$pack $FRinti,$u6,$FRintk"
8084 1.1 christos (+ pack FRintk OP_78 FRinti OPE1_0C u6)
8085 1.1 christos (sequence ((HI arg1) (HI arg2) (HI shift))
8086 1.1 christos (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
8087 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
8088 1.1 christos (set shift (and u6 #xf))
8089 1.1 christos (set arg1 (sll (halfword hi FRinti 0) shift))
8090 1.1 christos (if (ne shift 0)
8091 1.1 christos (sequence ()
8092 1.1 christos (set arg2 (halfword hi FRinti 1))
8093 1.1 christos (set arg2 (srl HI (sll HI arg2 (sub 15 shift))
8094 1.1 christos (sub 15 shift)))
8095 1.1 christos (set arg1 (or HI arg1 arg2))))
8096 1.1 christos (set (halfword hi FRintk 0) arg1))
8097 1.1 christos ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual))
8098 1.1 christos (fr550 (unit u-media-3-dual)))
8099 1.1 christos )
8100 1.1 christos
8101 1.1 christos (dni mcpli
8102 1.1 christos "Media bit concatenate, word"
8103 1.1 christos ((UNIT FMLOW) (MACH fr400,fr450,fr550) (FR550-MAJOR M-3)
8104 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8105 1.1 christos "mcpli$pack $FRinti,$u6,$FRintk"
8106 1.1 christos (+ pack FRintk OP_78 FRinti OPE1_0D u6)
8107 1.1 christos (sequence ((SI tmp) (SI shift))
8108 1.1 christos (set shift (and u6 #x1f))
8109 1.1 christos (set tmp (sll FRinti shift))
8110 1.1 christos (if (ne shift 0)
8111 1.1 christos (sequence ((SI tmp1))
8112 1.1 christos (set tmp1 (srl (sll (nextreg h-fr_int FRinti 1)
8113 1.1 christos (sub 31 shift))
8114 1.1 christos (sub 31 shift)))
8115 1.1 christos (set tmp (or tmp tmp1))))
8116 1.1 christos (set FRintk tmp))
8117 1.1 christos ((fr400 (unit u-media-3-dual)) (fr450 (unit u-media-3-dual))
8118 1.1 christos (fr550 (unit u-media-3-dual)))
8119 1.1 christos )
8120 1.1 christos
8121 1.1 christos (define-pmacro (saturate arg max min result)
8122 1.1 christos (if (gt arg max)
8123 1.1 christos (set result max)
8124 1.1 christos (if (lt arg min)
8125 1.1 christos (set result min)
8126 1.1 christos (set result arg)))
8127 1.1 christos )
8128 1.1 christos
8129 1.1 christos (dni msaths
8130 1.1 christos "Media dual saturation signed"
8131 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8132 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8133 1.1 christos "msaths$pack $FRinti,$FRintj,$FRintk"
8134 1.1 christos (+ pack FRintk OP_7B FRinti OPE1_0C FRintj)
8135 1.1 christos (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
8136 1.1 christos (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
8137 1.1 christos (saturate argihi argjhi (inv argjhi) (halfword hi FRintk 0))
8138 1.1 christos (saturate argilo argjlo (inv argjlo) (halfword lo FRintk 0)))
8139 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8140 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8141 1.1 christos )
8142 1.1 christos
8143 1.1 christos (dni mqsaths
8144 1.1 christos "Media quad saturation signed"
8145 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2)
8146 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8147 1.1 christos "mqsaths$pack $FRintieven,$FRintjeven,$FRintkeven"
8148 1.1 christos (+ pack FRintkeven OP_78 FRintieven OPE1_0F FRintjeven)
8149 1.1 christos (if (orif (register-unaligned FRintieven 2)
8150 1.1 christos (orif (register-unaligned FRintjeven 2)
8151 1.1 christos (register-unaligned FRintkeven 2)))
8152 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8153 1.1 christos (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
8154 1.1 christos ; hack to get FRintkeven referenced as a target for profiling
8155 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8156 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0 argihi argilo argjhi argjlo)
8157 1.1 christos (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 0))
8158 1.1 christos (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 0))
8159 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1 argihi argilo argjhi argjlo)
8160 1.1 christos (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 1))
8161 1.1 christos (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 1))))
8162 1.1 christos ((fr400 (unit u-media-1-quad
8163 1.1 christos (in FRinti FRintieven)
8164 1.1 christos (in FRintj FRintjeven)
8165 1.1 christos (out FRintk FRintkeven)))
8166 1.1 christos (fr450 (unit u-media-1-quad
8167 1.1 christos (in FRinti FRintieven)
8168 1.1 christos (in FRintj FRintjeven)
8169 1.1 christos (out FRintk FRintkeven)))
8170 1.1 christos (fr550 (unit u-media-quad)))
8171 1.1 christos )
8172 1.1 christos
8173 1.1 christos (define-pmacro (saturate-unsigned arg max result)
8174 1.1 christos (if (gt arg max)
8175 1.1 christos (set result max)
8176 1.1 christos (set result arg))
8177 1.1 christos )
8178 1.1 christos
8179 1.1 christos (dni msathu
8180 1.1 christos "Media dual saturation unsigned"
8181 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8182 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8183 1.1 christos "msathu$pack $FRinti,$FRintj,$FRintk"
8184 1.1 christos (+ pack FRintk OP_7B FRinti OPE1_0D FRintj)
8185 1.1 christos (sequence ((UHI argihi) (UHI argilo) (UHI argjhi) (UHI argjlo))
8186 1.1 christos (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
8187 1.1 christos (saturate-unsigned argihi argjhi (halfword hi FRintk 0))
8188 1.1 christos (saturate-unsigned argilo argjlo (halfword lo FRintk 0)))
8189 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8190 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8191 1.1 christos )
8192 1.1 christos
8193 1.1 christos (define-pmacro (media-dual-compare name mode op ope comment)
8194 1.1 christos (dni name
8195 1.1 christos (comment)
8196 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8197 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8198 1.1 christos (.str name "$pack $FRinti,$FRintj,$FCCk")
8199 1.1 christos (+ pack (cond-null) FCCk op FRinti ope FRintj)
8200 1.1 christos (if (register-unaligned FCCk 2)
8201 1.1 christos (c-call VOID "@cpu@_media_cr_not_aligned")
8202 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8203 1.1 christos (extract-hilo FRinti 0 FRintj 0
8204 1.1 christos argihi argilo argjhi argjlo)
8205 1.1 christos (compare-and-set-fcc argihi argjhi FCCk)
8206 1.1 christos (compare-and-set-fcc argilo argjlo (nextreg h-fccr FCCk 1))))
8207 1.1 christos ; TODO - doesn't handle second FCC
8208 1.1 christos ((fr400 (unit u-media-7)) (fr450 (unit u-media-7))
8209 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8210 1.1 christos )
8211 1.1 christos )
8212 1.1 christos
8213 1.1 christos (media-dual-compare mcmpsh HI OP_7B OPE1_0E "Media dual compare signed")
8214 1.1 christos (media-dual-compare mcmpuh UHI OP_7B OPE1_0F "Media dual compare unsigned")
8215 1.1 christos
8216 1.1 christos ; Bits for the MSR.SIE field
8217 1.1 christos (define-pmacro (msr-sie-nil) 0)
8218 1.1 christos (define-pmacro (msr-sie-fri-hi) 8)
8219 1.1 christos (define-pmacro (msr-sie-fri-lo) 4)
8220 1.1 christos (define-pmacro (msr-sie-fri-1-hi) 2)
8221 1.1 christos (define-pmacro (msr-sie-fri-1-lo) 1)
8222 1.1 christos (define-pmacro (msr-sie-acci) 8)
8223 1.1 christos (define-pmacro (msr-sie-acci-1) 4)
8224 1.1 christos (define-pmacro (msr-sie-acci-2) 2)
8225 1.1 christos (define-pmacro (msr-sie-acci-3) 1)
8226 1.1 christos
8227 1.1 christos (define-pmacro (saturate-v arg max min sie result)
8228 1.1 christos (if (gt DI arg max)
8229 1.1 christos (sequence ()
8230 1.1 christos (set result max)
8231 1.1 christos (c-call VOID "@cpu@_media_overflow" sie))
8232 1.1 christos (if (lt DI arg min)
8233 1.1 christos (sequence ()
8234 1.1 christos (set result min)
8235 1.1 christos (c-call VOID "@cpu@_media_overflow" sie))
8236 1.1 christos (set result arg)))
8237 1.1 christos )
8238 1.1 christos
8239 1.1 christos (dni mabshs
8240 1.1 christos "Media dual absolute value, halfword"
8241 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-2)
8242 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8243 1.1 christos "mabshs$pack $FRintj,$FRintk"
8244 1.1 christos (+ pack FRintk OP_78 (FRi-null) OPE1_0A FRintj)
8245 1.1 christos (sequence ((HI arghi) (HI arglo))
8246 1.1 christos (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
8247 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
8248 1.1 christos (set arghi (halfword hi FRintj 0))
8249 1.1 christos (set arglo (halfword lo FRintj 0))
8250 1.1 christos ; We extend the argument before the abs operation so we can
8251 1.1 christos ; notice -32768 overflowing as 32768.
8252 1.1 christos (saturate-v (abs (ext DI arghi)) 32767 -32768 (msr-sie-fri-hi)
8253 1.1 christos (halfword hi FRintk 0))
8254 1.1 christos (saturate-v (abs (ext DI arglo)) 32767 -32768 (msr-sie-fri-lo)
8255 1.1 christos (halfword lo FRintk 0)))
8256 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8257 1.1 christos (fr550 (unit u-media)))
8258 1.1 christos )
8259 1.1 christos
8260 1.1 christos ; How to extend from a mode to get the intended signedness.
8261 1.1 christos (define-pmacro (DI-ext-HI x) (ext DI x))
8262 1.1 christos (define-pmacro (DI-ext-UHI x) (zext DI x))
8263 1.1 christos (define-pmacro (DI-ext-DI x) x)
8264 1.1 christos
8265 1.1 christos (define-pmacro (media-arith-sat-semantics
8266 1.1 christos operation arg1 arg2 res mode max min sie)
8267 1.1 christos (sequence ((DI tmp))
8268 1.1 christos ; Make sure we saturate at max/min against a value that is
8269 1.1 christos ; sign- or zero-extended appropriately from "mode".
8270 1.1 christos (set tmp (operation DI
8271 1.1 christos ((.sym DI-ext- mode) arg1) ((.sym DI-ext- mode) arg2)))
8272 1.1 christos (saturate-v tmp max min sie res))
8273 1.1 christos )
8274 1.1 christos
8275 1.1 christos (define-pmacro (media-dual-arith-sat-semantics operation mode max min)
8276 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8277 1.1 christos (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
8278 1.1 christos (media-arith-sat-semantics operation argihi argjhi
8279 1.1 christos (halfword hi FRintk 0) mode max min
8280 1.1 christos (msr-sie-fri-hi))
8281 1.1 christos (media-arith-sat-semantics operation argilo argjlo
8282 1.1 christos (halfword lo FRintk 0) mode max min
8283 1.1 christos (msr-sie-fri-lo)))
8284 1.1 christos )
8285 1.1 christos
8286 1.1 christos (define-pmacro (media-dual-arith-sat name operation mode max min op ope comment)
8287 1.1 christos (dni name
8288 1.1 christos (comment)
8289 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8290 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
8291 1.1 christos (.str name "$pack $FRinti,$FRintj,$FRintk")
8292 1.1 christos (+ pack FRintk op FRinti ope FRintj)
8293 1.1 christos (media-dual-arith-sat-semantics operation mode max min)
8294 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8295 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8296 1.1 christos )
8297 1.1 christos )
8298 1.1 christos
8299 1.1 christos (media-dual-arith-sat maddhss add HI 32767 -32768 OP_7B OPE1_10 "Media dual add signed with saturation")
8300 1.1 christos (media-dual-arith-sat maddhus add UHI 65535 0 OP_7B OPE1_11 "Media dual add unsigned with saturation")
8301 1.1 christos
8302 1.1 christos (media-dual-arith-sat msubhss sub HI 32767 -32768 OP_7B OPE1_12 "Media dual sub signed with saturation")
8303 1.1 christos (media-dual-arith-sat msubhus sub UHI 65535 0 OP_7B OPE1_13 "Media dual sub unsigned with saturation")
8304 1.1 christos
8305 1.1 christos (define-pmacro (conditional-media-dual-arith-sat
8306 1.1 christos name operation mode max min op ope comment)
8307 1.1 christos (dni name
8308 1.1 christos (comment)
8309 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8310 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
8311 1.1 christos (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
8312 1.1 christos (+ pack FRintk op FRinti CCi cond ope FRintj)
8313 1.1 christos (if (eq CCi (or cond 2))
8314 1.1 christos (media-dual-arith-sat-semantics operation mode max min))
8315 1.1 christos ((fr400 (unit u-media-1)) (fr450 (unit u-media-1))
8316 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
8317 1.1 christos )
8318 1.1 christos )
8319 1.1 christos
8320 1.1 christos (conditional-media-dual-arith-sat cmaddhss add HI 32767 -32768 OP_71 OPE4_0 "Conditional Media dual add signed with saturation")
8321 1.1 christos (conditional-media-dual-arith-sat cmaddhus add UHI 65535 0 OP_71 OPE4_1 "Conditional Media dual add unsigned with saturation")
8322 1.1 christos
8323 1.1 christos (conditional-media-dual-arith-sat cmsubhss sub HI 32767 -32768 OP_71 OPE4_2 "Conditional Media dual sub signed with saturation")
8324 1.1 christos (conditional-media-dual-arith-sat cmsubhus sub UHI 65535 0 OP_71 OPE4_3 "Conditional Media dual sub unsigned with saturation")
8325 1.1 christos
8326 1.1 christos (define-pmacro (media-quad-arith-sat-semantics cond operation mode max min)
8327 1.1 christos (if (orif (register-unaligned FRintieven 2)
8328 1.1 christos (orif (register-unaligned FRintjeven 2)
8329 1.1 christos (register-unaligned FRintkeven 2)))
8330 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8331 1.1 christos (if cond
8332 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8333 1.1 christos ; hack to get FRintkeven referenced as a target for profiling
8334 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8335 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
8336 1.1 christos argihi argilo argjhi argjlo)
8337 1.1 christos (media-arith-sat-semantics operation argihi argjhi
8338 1.1 christos (halfword hi FRintkeven 0) mode
8339 1.1 christos max min (msr-sie-fri-hi))
8340 1.1 christos (media-arith-sat-semantics operation argilo argjlo
8341 1.1 christos (halfword lo FRintkeven 0) mode
8342 1.1 christos max min (msr-sie-fri-lo))
8343 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
8344 1.1 christos argihi argilo argjhi argjlo)
8345 1.1 christos (media-arith-sat-semantics operation argihi argjhi
8346 1.1 christos (halfword hi FRintkeven 1) mode
8347 1.1 christos max min (msr-sie-fri-1-hi))
8348 1.1 christos (media-arith-sat-semantics operation argilo argjlo
8349 1.1 christos (halfword lo FRintkeven 1) mode
8350 1.1 christos max min (msr-sie-fri-1-lo)))))
8351 1.1 christos )
8352 1.1 christos
8353 1.1 christos (define-pmacro (media-quad-arith-sat name operation mode max min op ope comment)
8354 1.1 christos (dni name
8355 1.1 christos (comment)
8356 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8357 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
8358 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
8359 1.1 christos (+ pack FRintkeven op FRintieven ope FRintjeven)
8360 1.1 christos (media-quad-arith-sat-semantics 1 operation mode max min)
8361 1.1 christos ((fr400 (unit u-media-1-quad
8362 1.1 christos (in FRinti FRintieven)
8363 1.1 christos (in FRintj FRintjeven)
8364 1.1 christos (out FRintk FRintkeven)))
8365 1.1 christos (fr450 (unit u-media-1-quad
8366 1.1 christos (in FRinti FRintieven)
8367 1.1 christos (in FRintj FRintjeven)
8368 1.1 christos (out FRintk FRintkeven)))
8369 1.1 christos (fr500 (unit u-media-quad-arith
8370 1.1 christos (in FRinti FRintieven)
8371 1.1 christos (in FRintj FRintjeven)
8372 1.1 christos (out FRintk FRintkeven))) (fr550 (unit u-media-quad)))
8373 1.1 christos )
8374 1.1 christos )
8375 1.1 christos
8376 1.1 christos (media-quad-arith-sat mqaddhss add HI 32767 -32768 OP_7B OPE1_18 "Media quad add signed with saturation")
8377 1.1 christos (media-quad-arith-sat mqaddhus add UHI 65535 0 OP_7B OPE1_19 "Media quad add unsigned with saturation")
8378 1.1 christos
8379 1.1 christos (media-quad-arith-sat mqsubhss sub HI 32767 -32768 OP_7B OPE1_1A "Media quad sub signed with saturation")
8380 1.1 christos (media-quad-arith-sat mqsubhus sub UHI 65535 0 OP_7B OPE1_1B "Media quad sub unsigned with saturation")
8381 1.1 christos
8382 1.1 christos (define-pmacro (conditional-media-quad-arith-sat
8383 1.1 christos name operation mode max min op ope comment)
8384 1.1 christos (dni name
8385 1.1 christos (comment)
8386 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-2)
8387 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
8388 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond")
8389 1.1 christos (+ pack FRintkeven op FRintieven CCi cond ope FRintjeven)
8390 1.1 christos (media-quad-arith-sat-semantics (eq CCi (or cond 2))
8391 1.1 christos operation mode max min)
8392 1.1 christos ((fr400 (unit u-media-1-quad
8393 1.1 christos (in FRinti FRintieven)
8394 1.1 christos (in FRintj FRintjeven)
8395 1.1 christos (out FRintk FRintkeven)))
8396 1.1 christos (fr450 (unit u-media-1-quad
8397 1.1 christos (in FRinti FRintieven)
8398 1.1 christos (in FRintj FRintjeven)
8399 1.1 christos (out FRintk FRintkeven)))
8400 1.1 christos (fr500 (unit u-media-quad-arith
8401 1.1 christos (in FRinti FRintieven)
8402 1.1 christos (in FRintj FRintjeven)
8403 1.1 christos (out FRintk FRintkeven))) (fr550 (unit u-media-quad)))
8404 1.1 christos )
8405 1.1 christos )
8406 1.1 christos
8407 1.1 christos (conditional-media-quad-arith-sat cmqaddhss add HI 32767 -32768 OP_73 OPE4_0 "Conditional Media quad add signed with saturation")
8408 1.1 christos (conditional-media-quad-arith-sat cmqaddhus add UHI 65535 0 OP_73 OPE4_1 "Conditional Media quad add unsigned with saturation")
8409 1.1 christos
8410 1.1 christos (conditional-media-quad-arith-sat cmqsubhss sub HI 32767 -32768 OP_73 OPE4_2 "Conditional Media quad sub signed with saturation")
8411 1.1 christos (conditional-media-quad-arith-sat cmqsubhus sub UHI 65535 0 OP_73 OPE4_3 "Conditional Media quad sub unsigned with saturation")
8412 1.1 christos
8413 1.1 christos ;; Return A if |A| > |B| and B is positive. Return -A if |A| > |B| and
8414 1.1 christos ;; B is negative, saturating 0x8000 as 0x7fff. Return 0 otherwise.
8415 1.1 christos (define-pmacro (media-low-clear-semantics a b)
8416 1.1 christos (cond HI
8417 1.1 christos ((le UHI (abs a) (abs b)) 0)
8418 1.1 christos ((le HI 0 b) a)
8419 1.1 christos ((eq HI a -32768) 32767)
8420 1.1 christos (else (neg a))))
8421 1.1 christos
8422 1.1 christos ;; Return A if -|B| < A < |B|. Return -B if A <= -|B|, saturating 0x8000
8423 1.1 christos ;; as 0x7fff. Return B if A >= |B|.
8424 1.1 christos (define-pmacro (media-scope-limit-semantics a b)
8425 1.1 christos (cond HI
8426 1.1 christos ((andif (gt HI b -32768)
8427 1.1 christos (ge HI a (abs b))) b)
8428 1.1 christos ((gt HI a (neg (abs b))) a)
8429 1.1 christos ((eq HI b -32768) 32767)
8430 1.1 christos (else (neg b))))
8431 1.1 christos
8432 1.1 christos (define-pmacro (media-quad-limit name operation op ope comment)
8433 1.1 christos (dni name
8434 1.1 christos comment
8435 1.1 christos ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2))
8436 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
8437 1.1 christos (+ pack FRintkeven op FRintieven ope FRintjeven)
8438 1.1 christos (if (orif (register-unaligned FRintieven 2)
8439 1.1 christos (orif (register-unaligned FRintjeven 2)
8440 1.1 christos (register-unaligned FRintkeven 2)))
8441 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8442 1.1 christos (sequence ((HI a1) (HI a2) (HI a3) (HI a4)
8443 1.1 christos (HI b1) (HI b2) (HI b3) (HI b4))
8444 1.1 christos ; hack to get FRintkeven referenced as a target
8445 1.1 christos ; for profiling
8446 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8447 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0 a1 a2 b1 b2)
8448 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1 a3 a4 b3 b4)
8449 1.1 christos (set (halfword hi FRintkeven 0) (operation a1 b1))
8450 1.1 christos (set (halfword lo FRintkeven 0) (operation a2 b2))
8451 1.1 christos (set (halfword hi FRintkeven 1) (operation a3 b3))
8452 1.1 christos (set (halfword lo FRintkeven 1) (operation a4 b4))))
8453 1.1 christos ((fr450 (unit u-media-1-quad
8454 1.1 christos (in FRinti FRintieven)
8455 1.1 christos (in FRintj FRintjeven)
8456 1.1 christos (out FRintk FRintkeven))))
8457 1.1 christos )
8458 1.1 christos )
8459 1.1 christos
8460 1.1 christos (media-quad-limit mqlclrhs media-low-clear-semantics OP_78 OPE1_10
8461 1.1 christos "Media quad low clear")
8462 1.1 christos (media-quad-limit mqlmths media-scope-limit-semantics OP_78 OPE1_14
8463 1.1 christos "Media quad scope limitation")
8464 1.1 christos
8465 1.1 christos (define-pmacro (media-quad-shift name operation op ope comment)
8466 1.1 christos (dni name
8467 1.1 christos (comment)
8468 1.1 christos ((UNIT FM0) (MACH fr450) (FR450-MAJOR M-2))
8469 1.1 christos (.str name "$pack $FRintieven,$u6,$FRintkeven")
8470 1.1 christos (+ pack FRintkeven op FRintieven ope u6)
8471 1.1 christos (if (orif (register-unaligned FRintieven 2)
8472 1.1 christos (register-unaligned FRintkeven 2))
8473 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8474 1.1 christos (sequence ()
8475 1.1 christos ; hack to get these referenced for profiling
8476 1.1 christos (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
8477 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
8478 1.1 christos (set (halfword hi FRintkeven 0)
8479 1.1 christos (operation HI (halfword hi FRintieven 0)
8480 1.1 christos (and u6 #xf)))
8481 1.1 christos (set (halfword lo FRintkeven 0)
8482 1.1 christos (operation HI (halfword lo FRintieven 0)
8483 1.1 christos (and u6 #xf)))
8484 1.1 christos (set (halfword hi FRintkeven 1)
8485 1.1 christos (operation HI (halfword hi FRintieven 1)
8486 1.1 christos (and u6 #xf)))
8487 1.1 christos (set (halfword lo FRintkeven 1)
8488 1.1 christos (operation HI (halfword lo FRintieven 1)
8489 1.1 christos (and u6 #xf)))))
8490 1.1 christos ((fr450 (unit u-media-3-quad
8491 1.1 christos (in FRinti FRintieven)
8492 1.1 christos (in FRintj FRintieven)
8493 1.1 christos (out FRintk FRintkeven))))
8494 1.1 christos )
8495 1.1 christos )
8496 1.1 christos
8497 1.1 christos (media-quad-shift mqsllhi sll OP_78 OPE1_11 "Media quad left shift")
8498 1.1 christos (media-quad-shift mqsrahi sra OP_78 OPE1_13 "Media quad right shift")
8499 1.1 christos
8500 1.1 christos (define-pmacro (media-acc-arith-sat name operation mode max min op ope comment)
8501 1.1 christos (dni name
8502 1.1 christos (comment)
8503 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8504 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
8505 1.1 christos (.str name "$pack $ACC40Si,$ACC40Sk")
8506 1.1 christos (+ pack ACC40Sk op ACC40Si ope (ACCj-null))
8507 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8508 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8509 1.1 christos (if (register-unaligned ACC40Si 2)
8510 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8511 1.1 christos (media-arith-sat-semantics operation ACC40Si
8512 1.1 christos (nextreg h-acc40S ACC40Si 1)
8513 1.1 christos ACC40Sk mode max min (msr-sie-acci)))))
8514 1.1 christos ((fr400 (unit u-media-2-acc)) (fr450 (unit u-media-2-acc))
8515 1.1 christos (fr550 (unit u-media-4-acc)))
8516 1.1 christos )
8517 1.1 christos )
8518 1.1 christos
8519 1.1 christos (media-acc-arith-sat maddaccs add DI #x7fffffffff (inv DI #x7fffffffff)
8520 1.1 christos OP_78 OPE1_04 "Media accumulator addition")
8521 1.1 christos (media-acc-arith-sat msubaccs sub DI #x7fffffffff (inv DI #x7fffffffff)
8522 1.1 christos OP_78 OPE1_05 "Media accumulator subtraction")
8523 1.1 christos
8524 1.1 christos (define-pmacro (media-dual-acc-arith-sat name operation mode max min op ope
8525 1.1 christos comment)
8526 1.1 christos (dni name
8527 1.1 christos (comment)
8528 1.1 christos ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8529 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8530 1.1 christos (.str name "$pack $ACC40Si,$ACC40Sk")
8531 1.1 christos (+ pack ACC40Sk op ACC40Si ope (ACCj-null))
8532 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8533 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8534 1.1 christos (if (register-unaligned ACC40Si 4)
8535 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8536 1.1 christos (if (register-unaligned ACC40Sk 2)
8537 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8538 1.1 christos (sequence ()
8539 1.1 christos (media-arith-sat-semantics operation ACC40Si
8540 1.1 christos (nextreg h-acc40S ACC40Si 1)
8541 1.1 christos ACC40Sk mode max min
8542 1.1 christos (msr-sie-acci))
8543 1.1 christos (media-arith-sat-semantics operation
8544 1.1 christos (nextreg h-acc40S ACC40Si 2)
8545 1.1 christos (nextreg h-acc40S ACC40Si 3)
8546 1.1 christos (nextreg h-acc40S ACC40Sk 1)
8547 1.1 christos mode max min
8548 1.1 christos (msr-sie-acci-1)))))))
8549 1.1 christos ((fr400 (unit u-media-2-acc-dual)) (fr450 (unit u-media-2-acc-dual))
8550 1.1 christos (fr550 (unit u-media-4-acc-dual)))
8551 1.1 christos )
8552 1.1 christos )
8553 1.1 christos
8554 1.1 christos (media-dual-acc-arith-sat mdaddaccs add DI #x7fffffffff (inv DI #x7fffffffff)
8555 1.1 christos OP_78 OPE1_06 "Media accumulator addition")
8556 1.1 christos (media-dual-acc-arith-sat mdsubaccs sub DI #x7fffffffff (inv DI #x7fffffffff)
8557 1.1 christos OP_78 OPE1_07 "Media accumulator subtraction")
8558 1.1 christos
8559 1.1 christos (dni masaccs
8560 1.1 christos "Media add and subtract signed accumulator with saturation"
8561 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8562 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
8563 1.1 christos "masaccs$pack $ACC40Si,$ACC40Sk"
8564 1.1 christos (+ pack ACC40Sk OP_78 ACC40Si OPE1_08 (ACCj-null))
8565 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8566 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8567 1.1 christos (if (register-unaligned ACC40Si 2)
8568 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8569 1.1 christos (if (register-unaligned ACC40Sk 2)
8570 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8571 1.1 christos (sequence ()
8572 1.1 christos (media-arith-sat-semantics add ACC40Si
8573 1.1 christos (nextreg h-acc40S ACC40Si 1)
8574 1.1 christos ACC40Sk DI
8575 1.1 christos #x7fffffffff
8576 1.1 christos (inv DI #x7fffffffff)
8577 1.1 christos (msr-sie-acci))
8578 1.1 christos (media-arith-sat-semantics sub ACC40Si
8579 1.1 christos (nextreg h-acc40S ACC40Si 1)
8580 1.1 christos (nextreg h-acc40S ACC40Sk 1)
8581 1.1 christos DI
8582 1.1 christos #x7fffffffff
8583 1.1 christos (inv DI #x7fffffffff)
8584 1.1 christos (msr-sie-acci-1)))))))
8585 1.1 christos ((fr400 (unit u-media-2-add-sub)) (fr450 (unit u-media-2-add-sub))
8586 1.1 christos (fr550 (unit u-media-4-add-sub)))
8587 1.1 christos )
8588 1.1 christos
8589 1.1 christos (dni mdasaccs
8590 1.1 christos "Media add and subtract signed accumulator with saturation"
8591 1.1 christos ((UNIT MDUALACC) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8592 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8593 1.1 christos "mdasaccs$pack $ACC40Si,$ACC40Sk"
8594 1.1 christos (+ pack ACC40Sk OP_78 ACC40Si OPE1_09 (ACCj-null))
8595 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Si))
8596 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8597 1.1 christos (if (register-unaligned ACC40Si 4)
8598 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8599 1.1 christos (if (register-unaligned ACC40Sk 4)
8600 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8601 1.1 christos (sequence ()
8602 1.1 christos (media-arith-sat-semantics add ACC40Si
8603 1.1 christos (nextreg h-acc40S ACC40Si 1)
8604 1.1 christos ACC40Sk DI
8605 1.1 christos #x7fffffffff
8606 1.1 christos (inv DI #x7fffffffff)
8607 1.1 christos (msr-sie-acci))
8608 1.1 christos (media-arith-sat-semantics sub ACC40Si
8609 1.1 christos (nextreg h-acc40S ACC40Si 1)
8610 1.1 christos (nextreg h-acc40S ACC40Sk 1)
8611 1.1 christos DI
8612 1.1 christos #x7fffffffff
8613 1.1 christos (inv DI #x7fffffffff)
8614 1.1 christos (msr-sie-acci-1))
8615 1.1 christos (media-arith-sat-semantics add
8616 1.1 christos (nextreg h-acc40S ACC40Si 2)
8617 1.1 christos (nextreg h-acc40S ACC40Si 3)
8618 1.1 christos (nextreg h-acc40S ACC40Sk 2)
8619 1.1 christos DI
8620 1.1 christos #x7fffffffff
8621 1.1 christos (inv DI #x7fffffffff)
8622 1.1 christos (msr-sie-acci-2))
8623 1.1 christos (media-arith-sat-semantics sub
8624 1.1 christos (nextreg h-acc40S ACC40Si 2)
8625 1.1 christos (nextreg h-acc40S ACC40Si 3)
8626 1.1 christos (nextreg h-acc40S ACC40Sk 3)
8627 1.1 christos DI
8628 1.1 christos #x7fffffffff
8629 1.1 christos (inv DI #x7fffffffff)
8630 1.1 christos (msr-sie-acci-3)))))))
8631 1.1 christos ((fr400 (unit u-media-2-add-sub-dual))
8632 1.1 christos (fr450 (unit u-media-2-add-sub-dual))
8633 1.1 christos (fr550 (unit u-media-4-add-sub-dual)))
8634 1.1 christos )
8635 1.1 christos
8636 1.1 christos (define-pmacro (media-multiply-semantics conv arg1 arg2 res)
8637 1.1 christos (set res (mul DI (conv DI arg1) (conv DI arg2)))
8638 1.1 christos )
8639 1.1 christos
8640 1.1 christos (define-pmacro (media-dual-multiply-semantics cond mode conv rhs1 rhs2)
8641 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8642 1.1 christos (if (register-unaligned ACC40Sk 2)
8643 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8644 1.1 christos (if cond
8645 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8646 1.1 christos (extract-hilo FRinti 0 FRintj 0
8647 1.1 christos argihi argilo argjhi argjlo)
8648 1.1 christos (media-multiply-semantics conv argihi rhs1 ACC40Sk)
8649 1.1 christos (media-multiply-semantics conv argilo rhs2
8650 1.1 christos (nextreg h-acc40S ACC40Sk 1))))))
8651 1.1 christos )
8652 1.1 christos
8653 1.1 christos (define-pmacro (media-dual-multiply name mode conv rhs1 rhs2 op ope comment)
8654 1.1 christos (dni name
8655 1.1 christos (comment)
8656 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8657 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3) PRESERVE-OVF)
8658 1.1 christos (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
8659 1.1 christos (+ pack ACC40Sk op FRinti ope FRintj)
8660 1.1 christos (media-dual-multiply-semantics 1 mode conv rhs1 rhs2)
8661 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8662 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8663 1.1 christos )
8664 1.1 christos )
8665 1.1 christos
8666 1.1 christos (media-dual-multiply mmulhs HI ext argjhi argjlo OP_7B OPE1_14 "Media dual multiply signed")
8667 1.1 christos (media-dual-multiply mmulhu UHI zext argjhi argjlo OP_7B OPE1_15 "Media dual multiply unsigned")
8668 1.1 christos
8669 1.1 christos (media-dual-multiply mmulxhs HI ext argjlo argjhi OP_7B OPE1_28 "Media dual cross multiply signed")
8670 1.1 christos (media-dual-multiply mmulxhu UHI zext argjlo argjhi OP_7B OPE1_29 "Media dual cross multiply unsigned")
8671 1.1 christos
8672 1.1 christos (define-pmacro (conditional-media-dual-multiply
8673 1.1 christos name mode conv rhs1 rhs2 op ope comment)
8674 1.1 christos (dni name
8675 1.1 christos (comment)
8676 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8677 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3)
8678 1.1 christos PRESERVE-OVF CONDITIONAL)
8679 1.1 christos (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
8680 1.1 christos (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
8681 1.1 christos (media-dual-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
8682 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8683 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8684 1.1 christos )
8685 1.1 christos )
8686 1.1 christos
8687 1.1 christos (conditional-media-dual-multiply cmmulhs HI ext argjhi argjlo OP_72 OPE4_0 "Conditional Media dual multiply signed")
8688 1.1 christos (conditional-media-dual-multiply cmmulhu UHI zext argjhi argjlo OP_72 OPE4_1 "Conditional Media dual multiply unsigned")
8689 1.1 christos
8690 1.1 christos (define-pmacro (media-quad-multiply-semantics cond mode conv rhs1 rhs2)
8691 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
8692 1.1 christos (if (register-unaligned ACC40Sk 4)
8693 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8694 1.1 christos (if (orif (register-unaligned FRintieven 2)
8695 1.1 christos (register-unaligned FRintjeven 2))
8696 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8697 1.1 christos (if cond
8698 1.1 christos (sequence ((mode argihi) (mode argilo)
8699 1.1 christos (mode argjhi) (mode argjlo))
8700 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
8701 1.1 christos argihi argilo argjhi argjlo)
8702 1.1 christos (media-multiply-semantics conv argihi rhs1 ACC40Sk)
8703 1.1 christos (media-multiply-semantics conv argilo rhs2
8704 1.1 christos (nextreg h-acc40S ACC40Sk 1))
8705 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
8706 1.1 christos argihi argilo argjhi argjlo)
8707 1.1 christos (media-multiply-semantics conv argihi rhs1
8708 1.1 christos (nextreg h-acc40S ACC40Sk 2))
8709 1.1 christos (media-multiply-semantics conv argilo rhs2
8710 1.1 christos (nextreg h-acc40S ACC40Sk 3)))))))
8711 1.1 christos )
8712 1.1 christos
8713 1.1 christos (define-pmacro (media-quad-multiply name mode conv rhs1 rhs2 op ope comment)
8714 1.1 christos (dni name
8715 1.1 christos (comment)
8716 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8717 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4) PRESERVE-OVF)
8718 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
8719 1.1 christos (+ pack ACC40Sk op FRintieven ope FRintjeven)
8720 1.1 christos (media-quad-multiply-semantics 1 mode conv rhs1 rhs2)
8721 1.1 christos ((fr400 (unit u-media-2-quad
8722 1.1 christos (in FRinti FRintieven)
8723 1.1 christos (in FRintj FRintjeven)))
8724 1.1 christos (fr450 (unit u-media-2-quad
8725 1.1 christos (in FRinti FRintieven)
8726 1.1 christos (in FRintj FRintjeven)))
8727 1.1 christos (fr500 (unit u-media-quad-mul
8728 1.1 christos (in FRinti FRintieven)
8729 1.1 christos (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8730 1.1 christos )
8731 1.1 christos )
8732 1.1 christos
8733 1.1 christos (media-quad-multiply mqmulhs HI ext argjhi argjlo OP_7B OPE1_1C "Media quad multiply signed")
8734 1.1 christos (media-quad-multiply mqmulhu UHI zext argjhi argjlo OP_7B OPE1_1D "Media quad multiply unsigned")
8735 1.1 christos
8736 1.1 christos (media-quad-multiply mqmulxhs HI ext argjlo argjhi OP_7B OPE1_2A "Media quad cross multiply signed")
8737 1.1 christos (media-quad-multiply mqmulxhu UHI zext argjlo argjhi OP_7B OPE1_2B "Media quad cross multiply unsigned")
8738 1.1 christos
8739 1.1 christos (define-pmacro (conditional-media-quad-multiply
8740 1.1 christos name mode conv rhs1 rhs2 op ope comment)
8741 1.1 christos (dni name
8742 1.1 christos (comment)
8743 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8744 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4)
8745 1.1 christos PRESERVE-OVF CONDITIONAL)
8746 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond")
8747 1.1 christos (+ pack ACC40Sk op FRintieven CCi cond ope FRintjeven)
8748 1.1 christos (media-quad-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
8749 1.1 christos ((fr400 (unit u-media-2-quad
8750 1.1 christos (in FRinti FRintieven)
8751 1.1 christos (in FRintj FRintjeven)))
8752 1.1 christos (fr450 (unit u-media-2-quad
8753 1.1 christos (in FRinti FRintieven)
8754 1.1 christos (in FRintj FRintjeven)))
8755 1.1 christos (fr500 (unit u-media-quad-mul
8756 1.1 christos (in FRinti FRintieven)
8757 1.1 christos (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8758 1.1 christos )
8759 1.1 christos )
8760 1.1 christos
8761 1.1 christos (conditional-media-quad-multiply cmqmulhs HI ext argjhi argjlo OP_74 OPE4_0 "Conditional Media quad multiply signed")
8762 1.1 christos (conditional-media-quad-multiply cmqmulhu UHI zext argjhi argjlo OP_74 OPE4_1 "Conditional Media quad multiply unsigned")
8763 1.1 christos
8764 1.1 christos (define-pmacro (media-multiply-acc-semantics
8765 1.1 christos conv arg1 addop arg2 res max min sie)
8766 1.1 christos (sequence ((DI tmp))
8767 1.1 christos (set tmp (addop res (mul DI (conv DI arg1) (conv DI arg2))))
8768 1.1 christos (saturate-v tmp max min sie res))
8769 1.1 christos )
8770 1.1 christos
8771 1.1 christos (define-pmacro (media-dual-multiply-acc-semantics
8772 1.1 christos cond mode conv addop rhw res max min)
8773 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8774 1.1 christos (if (register-unaligned res 2)
8775 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8776 1.1 christos (if cond
8777 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
8778 1.1 christos (extract-hilo FRinti 0 FRintj 0
8779 1.1 christos argihi argilo argjhi argjlo)
8780 1.1 christos (media-multiply-acc-semantics conv argihi addop argjhi
8781 1.1 christos res
8782 1.1 christos max min (msr-sie-acci))
8783 1.1 christos (media-multiply-acc-semantics conv argilo addop argjlo
8784 1.1 christos (nextreg rhw res 1)
8785 1.1 christos max min (msr-sie-acci-1))))))
8786 1.1 christos )
8787 1.1 christos
8788 1.1 christos (define-pmacro (media-dual-multiply-acc
8789 1.1 christos name mode conv addop rhw res max min op ope comment)
8790 1.1 christos (dni name
8791 1.1 christos (comment)
8792 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8793 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
8794 1.1 christos (.str name "$pack $FRinti,$FRintj,$" res)
8795 1.1 christos (+ pack res op FRinti ope FRintj)
8796 1.1 christos (media-dual-multiply-acc-semantics 1 mode conv addop rhw res max min)
8797 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8798 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8799 1.1 christos )
8800 1.1 christos )
8801 1.1 christos
8802 1.1 christos (media-dual-multiply-acc mmachs HI ext add h-acc40S ACC40Sk
8803 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
8804 1.1 christos OP_7B OPE1_16
8805 1.1 christos "Media dual multiply and accumulate signed")
8806 1.1 christos
8807 1.1 christos (media-dual-multiply-acc mmachu UHI zext add h-acc40U ACC40Uk
8808 1.1 christos (const DI #xffffffffff) (const DI 0)
8809 1.1 christos OP_7B OPE1_17
8810 1.1 christos "Media dual multiply and accumulate unsigned")
8811 1.1 christos
8812 1.1 christos (media-dual-multiply-acc mmrdhs HI ext sub h-acc40S ACC40Sk
8813 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
8814 1.1 christos OP_7B OPE1_30
8815 1.1 christos "Media dual multiply and reduce signed")
8816 1.1 christos
8817 1.1 christos (media-dual-multiply-acc mmrdhu UHI zext sub h-acc40U ACC40Uk
8818 1.1 christos (const DI #xffffffffff) (const DI 0)
8819 1.1 christos OP_7B OPE1_31
8820 1.1 christos "Media dual multiply and reduce unsigned")
8821 1.1 christos
8822 1.1 christos (define-pmacro (conditional-media-dual-multiply-acc
8823 1.1 christos name mode conv addop rhw res max min op ope comment)
8824 1.1 christos (dni name
8825 1.1 christos (comment)
8826 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8827 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
8828 1.1 christos (.str name "$pack $FRinti,$FRintj,$" res ",$CCi,$cond")
8829 1.1 christos (+ pack res op FRinti CCi cond ope FRintj)
8830 1.1 christos (media-dual-multiply-acc-semantics (eq CCi (or cond 2))
8831 1.1 christos mode conv addop rhw res max min)
8832 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
8833 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
8834 1.1 christos )
8835 1.1 christos )
8836 1.1 christos
8837 1.1 christos (conditional-media-dual-multiply-acc cmmachs HI ext add h-acc40S ACC40Sk
8838 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
8839 1.1 christos OP_72 OPE4_2
8840 1.1 christos "Conditional Media dual multiply and accumulate signed")
8841 1.1 christos
8842 1.1 christos (conditional-media-dual-multiply-acc cmmachu UHI zext add h-acc40U ACC40Uk
8843 1.1 christos (const DI #xffffffffff) (const DI 0)
8844 1.1 christos OP_72 OPE4_3
8845 1.1 christos "Conditional Media dual multiply and accumulate unsigned")
8846 1.1 christos
8847 1.1 christos (define-pmacro (media-quad-multiply-acc-semantics
8848 1.1 christos cond mode conv addop rhw res max min)
8849 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8850 1.1 christos (if (register-unaligned res 4)
8851 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8852 1.1 christos (if (orif (register-unaligned FRintieven 2)
8853 1.1 christos (register-unaligned FRintjeven 2))
8854 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8855 1.1 christos (if cond
8856 1.1 christos (sequence ((mode argihi) (mode argilo)
8857 1.1 christos (mode argjhi) (mode argjlo))
8858 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
8859 1.1 christos argihi argilo argjhi argjlo)
8860 1.1 christos (media-multiply-acc-semantics conv argihi addop argjhi
8861 1.1 christos res
8862 1.1 christos max min (msr-sie-acci))
8863 1.1 christos (media-multiply-acc-semantics conv argilo addop argjlo
8864 1.1 christos (nextreg rhw res 1)
8865 1.1 christos max min (msr-sie-acci-1))
8866 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
8867 1.1 christos argihi argilo argjhi argjlo)
8868 1.1 christos (media-multiply-acc-semantics conv argihi addop argjhi
8869 1.1 christos (nextreg rhw res 2)
8870 1.1 christos max min (msr-sie-acci-2))
8871 1.1 christos (media-multiply-acc-semantics conv argilo addop argjlo
8872 1.1 christos (nextreg rhw res 3)
8873 1.1 christos max min
8874 1.1 christos (msr-sie-acci-3)))))))
8875 1.1 christos )
8876 1.1 christos
8877 1.1 christos (define-pmacro (media-quad-multiply-acc
8878 1.1 christos name mode conv addop rhw res max min op ope comment)
8879 1.1 christos (dni name
8880 1.1 christos (comment)
8881 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8882 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8883 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$" res)
8884 1.1 christos (+ pack res op FRintieven ope FRintjeven)
8885 1.1 christos (media-quad-multiply-acc-semantics 1 mode conv addop rhw res max min)
8886 1.1 christos ((fr400 (unit u-media-2-quad
8887 1.1 christos (in FRinti FRintieven)
8888 1.1 christos (in FRintj FRintjeven)))
8889 1.1 christos (fr450 (unit u-media-2-quad
8890 1.1 christos (in FRinti FRintieven)
8891 1.1 christos (in FRintj FRintjeven)))
8892 1.1 christos (fr500 (unit u-media-quad-mul
8893 1.1 christos (in FRinti FRintieven)
8894 1.1 christos (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8895 1.1 christos )
8896 1.1 christos )
8897 1.1 christos
8898 1.1 christos (media-quad-multiply-acc mqmachs HI ext add h-acc40S ACC40Sk
8899 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
8900 1.1 christos OP_7B OPE1_1E
8901 1.1 christos "Media quad multiply and accumulate signed")
8902 1.1 christos
8903 1.1 christos (media-quad-multiply-acc mqmachu UHI zext add h-acc40U ACC40Uk
8904 1.1 christos (const DI #xffffffffff) (const DI 0)
8905 1.1 christos OP_7B OPE1_1F
8906 1.1 christos "Media quad multiply and accumulate unsigned")
8907 1.1 christos
8908 1.1 christos (define-pmacro (conditional-media-quad-multiply-acc
8909 1.1 christos name mode conv addop rhw res max min op ope comment)
8910 1.1 christos (dni name
8911 1.1 christos (comment)
8912 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
8913 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4) CONDITIONAL)
8914 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$" res ",$CCi,$cond")
8915 1.1 christos (+ pack res op FRintieven CCi cond ope FRintjeven)
8916 1.1 christos (media-quad-multiply-acc-semantics (eq CCi (or cond 2))
8917 1.1 christos mode conv addop rhw res max min)
8918 1.1 christos ((fr400 (unit u-media-2-quad
8919 1.1 christos (in FRinti FRintieven)
8920 1.1 christos (in FRintj FRintjeven)))
8921 1.1 christos (fr450 (unit u-media-2-quad
8922 1.1 christos (in FRinti FRintieven)
8923 1.1 christos (in FRintj FRintjeven)))
8924 1.1 christos (fr500 (unit u-media-quad-mul
8925 1.1 christos (in FRinti FRintieven)
8926 1.1 christos (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
8927 1.1 christos )
8928 1.1 christos )
8929 1.1 christos
8930 1.1 christos (conditional-media-quad-multiply-acc cmqmachs HI ext add h-acc40S ACC40Sk
8931 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
8932 1.1 christos OP_74 OPE4_2
8933 1.1 christos "Conditional Media quad multiply and accumulate signed")
8934 1.1 christos
8935 1.1 christos (conditional-media-quad-multiply-acc cmqmachu UHI zext add h-acc40U ACC40Uk
8936 1.1 christos (const DI #xffffffffff) (const DI 0)
8937 1.1 christos OP_74 OPE4_3
8938 1.1 christos "Conditional media quad multiply and accumulate unsigned")
8939 1.1 christos
8940 1.1 christos (define-pmacro (media-quad-multiply-cross-acc-semantics
8941 1.1 christos cond mode conv addop rhw res max min)
8942 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8943 1.1 christos (if (register-unaligned res 4)
8944 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
8945 1.1 christos (if (orif (register-unaligned FRintieven 2)
8946 1.1 christos (register-unaligned FRintjeven 2))
8947 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
8948 1.1 christos (if cond
8949 1.1 christos (sequence ((mode argihi) (mode argilo)
8950 1.1 christos (mode argjhi) (mode argjlo))
8951 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
8952 1.1 christos argihi argilo argjhi argjlo)
8953 1.1 christos (media-multiply-acc-semantics conv argihi addop argjhi
8954 1.1 christos (nextreg rhw res 2)
8955 1.1 christos max min (msr-sie-acci-2))
8956 1.1 christos (media-multiply-acc-semantics conv argilo addop argjlo
8957 1.1 christos (nextreg rhw res 3)
8958 1.1 christos max min (msr-sie-acci-3))
8959 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
8960 1.1 christos argihi argilo argjhi argjlo)
8961 1.1 christos (media-multiply-acc-semantics conv argihi addop argjhi
8962 1.1 christos res
8963 1.1 christos max min (msr-sie-acci))
8964 1.1 christos (media-multiply-acc-semantics conv argilo addop argjlo
8965 1.1 christos (nextreg rhw res 1)
8966 1.1 christos max min
8967 1.1 christos (msr-sie-acci-1)))))))
8968 1.1 christos )
8969 1.1 christos
8970 1.1 christos (define-pmacro (media-quad-multiply-cross-acc
8971 1.1 christos name mode conv addop rhw res max min op ope comment)
8972 1.1 christos (dni name
8973 1.1 christos (comment)
8974 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
8975 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
8976 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$" res)
8977 1.1 christos (+ pack res op FRintieven ope FRintjeven)
8978 1.1 christos (media-quad-multiply-cross-acc-semantics 1 mode conv addop rhw res
8979 1.1 christos max min)
8980 1.1 christos ((fr400 (unit u-media-2-quad
8981 1.1 christos (in FRinti FRintieven)
8982 1.1 christos (in FRintj FRintjeven)))
8983 1.1 christos (fr450 (unit u-media-2-quad
8984 1.1 christos (in FRinti FRintieven)
8985 1.1 christos (in FRintj FRintjeven)))
8986 1.1 christos (fr550 (unit u-media-4-quad)))
8987 1.1 christos )
8988 1.1 christos )
8989 1.1 christos
8990 1.1 christos (media-quad-multiply-cross-acc mqxmachs HI ext add h-acc40S ACC40Sk
8991 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
8992 1.1 christos OP_78 OPE1_00
8993 1.1 christos "Media quad multiply and cross accumulate signed")
8994 1.1 christos
8995 1.1 christos (define-pmacro (media-quad-cross-multiply-cross-acc-semantics
8996 1.1 christos cond mode conv addop rhw res max min)
8997 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of res))
8998 1.1 christos (if (register-unaligned res 4)
8999 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
9000 1.1 christos (if (orif (register-unaligned FRintieven 2)
9001 1.1 christos (register-unaligned FRintjeven 2))
9002 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9003 1.1 christos (if cond
9004 1.1 christos (sequence ((mode argihi) (mode argilo)
9005 1.1 christos (mode argjhi) (mode argjlo))
9006 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
9007 1.1 christos argihi argilo argjhi argjlo)
9008 1.1 christos (media-multiply-acc-semantics conv argihi addop argjlo
9009 1.1 christos (nextreg rhw res 2)
9010 1.1 christos max min (msr-sie-acci-2))
9011 1.1 christos (media-multiply-acc-semantics conv argilo addop argjhi
9012 1.1 christos (nextreg rhw res 3)
9013 1.1 christos max min (msr-sie-acci-3))
9014 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
9015 1.1 christos argihi argilo argjhi argjlo)
9016 1.1 christos (media-multiply-acc-semantics conv argihi addop argjlo
9017 1.1 christos res
9018 1.1 christos max min (msr-sie-acci))
9019 1.1 christos (media-multiply-acc-semantics conv argilo addop argjhi
9020 1.1 christos (nextreg rhw res 1)
9021 1.1 christos max min
9022 1.1 christos (msr-sie-acci-1)))))))
9023 1.1 christos )
9024 1.1 christos
9025 1.1 christos (define-pmacro (media-quad-cross-multiply-cross-acc
9026 1.1 christos name mode conv addop rhw res max min op ope comment)
9027 1.1 christos (dni name
9028 1.1 christos (comment)
9029 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
9030 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9031 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$" res)
9032 1.1 christos (+ pack res op FRintieven ope FRintjeven)
9033 1.1 christos (media-quad-cross-multiply-cross-acc-semantics 1 mode conv addop rhw res
9034 1.1 christos max min)
9035 1.1 christos ((fr400 (unit u-media-2-quad
9036 1.1 christos (in FRinti FRintieven)
9037 1.1 christos (in FRintj FRintjeven)))
9038 1.1 christos (fr450 (unit u-media-2-quad
9039 1.1 christos (in FRinti FRintieven)
9040 1.1 christos (in FRintj FRintjeven)))
9041 1.1 christos (fr550 (unit u-media-4-quad)))
9042 1.1 christos )
9043 1.1 christos )
9044 1.1 christos
9045 1.1 christos (media-quad-cross-multiply-cross-acc mqxmacxhs HI ext add h-acc40S ACC40Sk
9046 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9047 1.1 christos OP_78 OPE1_01
9048 1.1 christos "Media quad cross multiply and cross accumulate signed")
9049 1.1 christos
9050 1.1 christos (define-pmacro (media-quad-cross-multiply-acc-semantics
9051 1.1 christos cond mode conv addop rhw res max min)
9052 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of res))
9053 1.1 christos (if (register-unaligned res 4)
9054 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
9055 1.1 christos (if (orif (register-unaligned FRintieven 2)
9056 1.1 christos (register-unaligned FRintjeven 2))
9057 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9058 1.1 christos (if cond
9059 1.1 christos (sequence ((mode argihi) (mode argilo)
9060 1.1 christos (mode argjhi) (mode argjlo))
9061 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
9062 1.1 christos argihi argilo argjhi argjlo)
9063 1.1 christos (media-multiply-acc-semantics conv argihi addop argjlo
9064 1.1 christos res
9065 1.1 christos max min (msr-sie-acci))
9066 1.1 christos (media-multiply-acc-semantics conv argilo addop argjhi
9067 1.1 christos (nextreg rhw res 1)
9068 1.1 christos max min (msr-sie-acci-1))
9069 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
9070 1.1 christos argihi argilo argjhi argjlo)
9071 1.1 christos (media-multiply-acc-semantics conv argihi addop argjlo
9072 1.1 christos (nextreg rhw res 2)
9073 1.1 christos max min (msr-sie-acci-2))
9074 1.1 christos (media-multiply-acc-semantics conv argilo addop argjhi
9075 1.1 christos (nextreg rhw res 3)
9076 1.1 christos max min
9077 1.1 christos (msr-sie-acci-3)))))))
9078 1.1 christos )
9079 1.1 christos
9080 1.1 christos (define-pmacro (media-quad-cross-multiply-acc
9081 1.1 christos name mode conv addop rhw res max min op ope comment)
9082 1.1 christos (dni name
9083 1.1 christos (comment)
9084 1.1 christos ((UNIT FMALL) (MACH fr400,fr450,fr550) (FR550-MAJOR M-4)
9085 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9086 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$" res)
9087 1.1 christos (+ pack res op FRintieven ope FRintjeven)
9088 1.1 christos (media-quad-cross-multiply-acc-semantics 1 mode conv addop rhw res
9089 1.1 christos max min)
9090 1.1 christos ((fr400 (unit u-media-2-quad
9091 1.1 christos (in FRinti FRintieven)
9092 1.1 christos (in FRintj FRintjeven)))
9093 1.1 christos (fr450 (unit u-media-2-quad
9094 1.1 christos (in FRinti FRintieven)
9095 1.1 christos (in FRintj FRintjeven)))
9096 1.1 christos (fr550 (unit u-media-4-quad)))
9097 1.1 christos )
9098 1.1 christos )
9099 1.1 christos
9100 1.1 christos (media-quad-cross-multiply-acc mqmacxhs HI ext add h-acc40S ACC40Sk
9101 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9102 1.1 christos OP_78 OPE1_02
9103 1.1 christos "Media quad cross multiply and accumulate signed")
9104 1.1 christos
9105 1.1 christos (define-pmacro (media-complex-semantics
9106 1.1 christos conv lhs1 rhs1 lhs2 rhs2 res max min sie)
9107 1.1 christos (sequence ((DI tmp1) (DI tmp2))
9108 1.1 christos (media-multiply-semantics conv lhs1 rhs1 tmp1)
9109 1.1 christos (media-multiply-semantics conv lhs2 rhs2 tmp2)
9110 1.1 christos (set tmp1 (sub tmp1 tmp2))
9111 1.1 christos (saturate-v tmp1 max min sie res))
9112 1.1 christos )
9113 1.1 christos
9114 1.1 christos (define-pmacro (media-complex-semantics-i
9115 1.1 christos conv lhs1 rhs1 lhs2 rhs2 res max min sie)
9116 1.1 christos (sequence ((DI tmp1) (DI tmp2))
9117 1.1 christos (media-multiply-semantics conv lhs1 rhs1 tmp1)
9118 1.1 christos (media-multiply-semantics conv lhs2 rhs2 tmp2)
9119 1.1 christos (set tmp1 (add tmp1 tmp2))
9120 1.1 christos (saturate-v tmp1 max min sie res))
9121 1.1 christos )
9122 1.1 christos
9123 1.1 christos (define-pmacro (media-dual-complex-semantics mode conv rhs1 rhs2 max min)
9124 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9125 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
9126 1.1 christos (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
9127 1.1 christos (media-complex-semantics conv argihi rhs1 argilo rhs2 ACC40Sk
9128 1.1 christos max min (msr-sie-acci))))
9129 1.1 christos )
9130 1.1 christos
9131 1.1 christos (define-pmacro (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)
9132 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9133 1.1 christos (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
9134 1.1 christos (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
9135 1.1 christos (media-complex-semantics-i conv argihi rhs1 argilo rhs2 ACC40Sk
9136 1.1 christos max min (msr-sie-acci))))
9137 1.1 christos )
9138 1.1 christos
9139 1.1 christos (define-pmacro (media-dual-complex
9140 1.1 christos name mode conv rhs1 rhs2 max min op ope comment)
9141 1.1 christos (dni name
9142 1.1 christos (comment)
9143 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9144 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9145 1.1 christos (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
9146 1.1 christos (+ pack ACC40Sk op FRinti ope FRintj)
9147 1.1 christos (media-dual-complex-semantics mode conv rhs1 rhs2 max min)
9148 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9149 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9150 1.1 christos )
9151 1.1 christos )
9152 1.1 christos
9153 1.1 christos (define-pmacro (media-dual-complex-i
9154 1.1 christos name mode conv rhs1 rhs2 max min op ope comment)
9155 1.1 christos (dni name
9156 1.1 christos (comment)
9157 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9158 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9159 1.1 christos (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
9160 1.1 christos (+ pack ACC40Sk op FRinti ope FRintj)
9161 1.1 christos (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min)
9162 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9163 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9164 1.1 christos )
9165 1.1 christos )
9166 1.1 christos
9167 1.1 christos (media-dual-complex mcpxrs HI ext argjhi argjlo
9168 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9169 1.1 christos OP_7B OPE1_20
9170 1.1 christos "Media dual complex real signed with saturation")
9171 1.1 christos
9172 1.1 christos (media-dual-complex mcpxru UHI zext argjhi argjlo
9173 1.1 christos (const DI #xffffffffff) (const DI 0)
9174 1.1 christos OP_7B OPE1_21
9175 1.1 christos "Media dual complex real unsigned with saturation")
9176 1.1 christos
9177 1.1 christos (media-dual-complex-i mcpxis HI ext argjlo argjhi
9178 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9179 1.1 christos OP_7B OPE1_22
9180 1.1 christos "Media dual complex imaginary signed with saturation")
9181 1.1 christos
9182 1.1 christos (media-dual-complex-i mcpxiu UHI zext argjlo argjhi
9183 1.1 christos (const DI #xffffffffff) (const DI 0)
9184 1.1 christos OP_7B OPE1_23
9185 1.1 christos "Media dual complex imaginary unsigned with saturation")
9186 1.1 christos
9187 1.1 christos (define-pmacro (conditional-media-dual-complex
9188 1.1 christos name mode conv rhs1 rhs2 max min op ope comment)
9189 1.1 christos (dni name
9190 1.1 christos (comment)
9191 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9192 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
9193 1.1 christos (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
9194 1.1 christos (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
9195 1.1 christos (if (eq CCi (or cond 2))
9196 1.1 christos (media-dual-complex-semantics mode conv rhs1 rhs2 max min))
9197 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9198 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9199 1.1 christos )
9200 1.1 christos )
9201 1.1 christos
9202 1.1 christos (define-pmacro (conditional-media-dual-complex-i
9203 1.1 christos name mode conv rhs1 rhs2 max min op ope comment)
9204 1.1 christos (dni name
9205 1.1 christos (comment)
9206 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9207 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3) CONDITIONAL)
9208 1.1 christos (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
9209 1.1 christos (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
9210 1.1 christos (if (eq CCi (or cond 2))
9211 1.1 christos (media-dual-complex-semantics-i mode conv rhs1 rhs2 max min))
9212 1.1 christos ((fr400 (unit u-media-2)) (fr450 (unit u-media-2))
9213 1.1 christos (fr500 (unit u-media-dual-mul)) (fr550 (unit u-media-4)))
9214 1.1 christos )
9215 1.1 christos )
9216 1.1 christos
9217 1.1 christos (conditional-media-dual-complex cmcpxrs HI ext argjhi argjlo
9218 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9219 1.1 christos OP_75 OPE4_0
9220 1.1 christos "Conditional Media dual complex real signed with saturation")
9221 1.1 christos
9222 1.1 christos (conditional-media-dual-complex cmcpxru UHI zext argjhi argjlo
9223 1.1 christos (const DI #xffffffffff) (const DI 0)
9224 1.1 christos OP_75 OPE4_1
9225 1.1 christos "Conditional Media dual complex real unsigned with saturation")
9226 1.1 christos
9227 1.1 christos (conditional-media-dual-complex-i cmcpxis HI ext argjlo argjhi
9228 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9229 1.1 christos OP_75 OPE4_2
9230 1.1 christos "Conditional Media dual complex imaginary signed with saturation")
9231 1.1 christos
9232 1.1 christos (conditional-media-dual-complex-i cmcpxiu UHI zext argjlo argjhi
9233 1.1 christos (const DI #xffffffffff) (const DI 0)
9234 1.1 christos OP_75 OPE4_3
9235 1.1 christos "Conditional Media dual complex imaginary unsigned with saturation")
9236 1.1 christos
9237 1.1 christos (define-pmacro (media-quad-complex
9238 1.1 christos name mode conv rhs1 rhs2 max min op ope comment)
9239 1.1 christos (dni name
9240 1.1 christos (comment)
9241 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9242 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9243 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
9244 1.1 christos (+ pack ACC40Sk op FRintieven ope FRintjeven)
9245 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9246 1.1 christos (if (register-unaligned ACC40Sk 2)
9247 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
9248 1.1 christos (if (orif (register-unaligned FRintieven 2)
9249 1.1 christos (register-unaligned FRintjeven 2))
9250 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9251 1.1 christos (sequence ((mode argihi) (mode argilo)
9252 1.1 christos (mode argjhi) (mode argjlo))
9253 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
9254 1.1 christos argihi argilo argjhi argjlo)
9255 1.1 christos (media-complex-semantics conv argihi rhs1 argilo rhs2
9256 1.1 christos ACC40Sk
9257 1.1 christos max min (msr-sie-acci))
9258 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
9259 1.1 christos argihi argilo argjhi argjlo)
9260 1.1 christos (media-complex-semantics conv argihi rhs1 argilo rhs2
9261 1.1 christos (nextreg h-acc40S ACC40Sk 1)
9262 1.1 christos max min (msr-sie-acci-1))))))
9263 1.1 christos ((fr400 (unit u-media-2-quad
9264 1.1 christos (in FRinti FRintieven)
9265 1.1 christos (in FRintj FRintjeven)))
9266 1.1 christos (fr450 (unit u-media-2-quad
9267 1.1 christos (in FRinti FRintieven)
9268 1.1 christos (in FRintj FRintjeven)))
9269 1.1 christos (fr500 (unit u-media-quad-complex
9270 1.1 christos (in FRinti FRintieven)
9271 1.1 christos (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
9272 1.1 christos )
9273 1.1 christos )
9274 1.1 christos
9275 1.1 christos (define-pmacro (media-quad-complex-i
9276 1.1 christos name mode conv rhs1 rhs2 max min op ope comment)
9277 1.1 christos (dni name
9278 1.1 christos (comment)
9279 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-4) (FR550-MAJOR M-4)
9280 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9281 1.1 christos (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
9282 1.1 christos (+ pack ACC40Sk op FRintieven ope FRintjeven)
9283 1.1 christos (if (c-call SI "@cpu@_check_acc_range" (index-of ACC40Sk))
9284 1.1 christos (if (register-unaligned ACC40Sk 2)
9285 1.1 christos (c-call VOID "@cpu@_media_acc_not_aligned")
9286 1.1 christos (if (orif (register-unaligned FRintieven 2)
9287 1.1 christos (register-unaligned FRintjeven 2))
9288 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9289 1.1 christos (sequence ((mode argihi) (mode argilo)
9290 1.1 christos (mode argjhi) (mode argjlo))
9291 1.1 christos (extract-hilo FRintieven 0 FRintjeven 0
9292 1.1 christos argihi argilo argjhi argjlo)
9293 1.1 christos (media-complex-semantics-i conv argihi rhs1 argilo rhs2
9294 1.1 christos ACC40Sk
9295 1.1 christos max min (msr-sie-acci))
9296 1.1 christos (extract-hilo FRintieven 1 FRintjeven 1
9297 1.1 christos argihi argilo argjhi argjlo)
9298 1.1 christos (media-complex-semantics-i conv argihi rhs1 argilo rhs2
9299 1.1 christos (nextreg h-acc40S ACC40Sk 1)
9300 1.1 christos max min (msr-sie-acci-1))))))
9301 1.1 christos ((fr400 (unit u-media-2-quad
9302 1.1 christos (in FRinti FRintieven)
9303 1.1 christos (in FRintj FRintjeven)))
9304 1.1 christos (fr450 (unit u-media-2-quad
9305 1.1 christos (in FRinti FRintieven)
9306 1.1 christos (in FRintj FRintjeven)))
9307 1.1 christos (fr500 (unit u-media-quad-complex
9308 1.1 christos (in FRinti FRintieven)
9309 1.1 christos (in FRintj FRintjeven))) (fr550 (unit u-media-4-quad)))
9310 1.1 christos )
9311 1.1 christos )
9312 1.1 christos
9313 1.1 christos (media-quad-complex mqcpxrs HI ext argjhi argjlo
9314 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9315 1.1 christos OP_7B OPE1_24
9316 1.1 christos "Media quad complex real signed with saturation")
9317 1.1 christos
9318 1.1 christos (media-quad-complex mqcpxru UHI zext argjhi argjlo
9319 1.1 christos (const DI #xffffffffff) (const DI 0)
9320 1.1 christos OP_7B OPE1_25
9321 1.1 christos "Media quad complex real unsigned with saturation")
9322 1.1 christos
9323 1.1 christos (media-quad-complex-i mqcpxis HI ext argjlo argjhi
9324 1.1 christos (const DI #x7fffffffff) (const DI #xffffff8000000000)
9325 1.1 christos OP_7B OPE1_26
9326 1.1 christos "Media quad complex imaginary signed with saturation")
9327 1.1 christos
9328 1.1 christos (media-quad-complex-i mqcpxiu UHI zext argjlo argjhi
9329 1.1 christos (const DI #xffffffffff) (const DI 0)
9330 1.1 christos OP_7B OPE1_27
9331 1.1 christos "Media quad complex imaginary unsigned with saturation")
9332 1.1 christos
9333 1.1 christos (define-pmacro (media-pack src1 src2 targ offset)
9334 1.1 christos (sequence ()
9335 1.1 christos (set (halfword hi targ offset) (halfword lo src1 offset))
9336 1.1 christos (set (halfword lo targ offset) (halfword lo src2 offset)))
9337 1.1 christos )
9338 1.1 christos
9339 1.1 christos (define-pmacro (media-expand-halfword-to-word-semantics cond)
9340 1.1 christos (if cond
9341 1.1 christos (sequence ((UHI tmp))
9342 1.1 christos (if (and u6 1)
9343 1.1 christos (set tmp (halfword lo FRinti 0))
9344 1.1 christos (set tmp (halfword hi FRinti 0)))
9345 1.1 christos (set (halfword hi FRintk 0) tmp)
9346 1.1 christos (set (halfword lo FRintk 0) tmp)))
9347 1.1 christos )
9348 1.1 christos
9349 1.1 christos (dni mexpdhw
9350 1.1 christos "Media expand halfword to word"
9351 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9352 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
9353 1.1 christos "mexpdhw$pack $FRinti,$u6,$FRintk"
9354 1.1 christos (+ pack FRintk OP_7B FRinti OPE1_32 u6)
9355 1.1 christos (media-expand-halfword-to-word-semantics 1)
9356 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
9357 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
9358 1.1 christos )
9359 1.1 christos
9360 1.1 christos (dni cmexpdhw
9361 1.1 christos "Conditional media expand halfword to word"
9362 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9363 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1) CONDITIONAL)
9364 1.1 christos "cmexpdhw$pack $FRinti,$u6,$FRintk,$CCi,$cond"
9365 1.1 christos (+ pack FRintk OP_76 FRinti CCi cond OPE4_2 u6)
9366 1.1 christos (media-expand-halfword-to-word-semantics (eq CCi (or cond 2)))
9367 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
9368 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
9369 1.1 christos )
9370 1.1 christos
9371 1.1 christos (define-pmacro (media-expand-halfword-to-double-semantics cond)
9372 1.1 christos (if (register-unaligned FRintkeven 2)
9373 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9374 1.1 christos (if cond
9375 1.1 christos (sequence ((UHI tmp))
9376 1.1 christos ; a hack to get FRintkeven referenced for profiling
9377 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9378 1.1 christos (if (and u6 1)
9379 1.1 christos (set tmp (halfword lo FRinti 0))
9380 1.1 christos (set tmp (halfword hi FRinti 0)))
9381 1.1 christos (set (halfword hi FRintkeven 0) tmp)
9382 1.1 christos (set (halfword lo FRintkeven 0) tmp)
9383 1.1 christos (set (halfword hi FRintkeven 1) tmp)
9384 1.1 christos (set (halfword lo FRintkeven 1) tmp))))
9385 1.1 christos )
9386 1.1 christos
9387 1.1 christos (dni mexpdhd
9388 1.1 christos "Media expand halfword to double"
9389 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9390 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9391 1.1 christos "mexpdhd$pack $FRinti,$u6,$FRintkeven"
9392 1.1 christos (+ pack FRintkeven OP_7B FRinti OPE1_33 u6)
9393 1.1 christos (media-expand-halfword-to-double-semantics 1)
9394 1.1 christos ((fr400 (unit u-media-dual-expand
9395 1.1 christos (out FRintk FRintkeven)))
9396 1.1 christos (fr450 (unit u-media-dual-expand
9397 1.1 christos (out FRintk FRintkeven)))
9398 1.1 christos (fr500 (unit u-media-dual-expand
9399 1.1 christos (out FRintk FRintkeven)))
9400 1.1 christos (fr550 (unit u-media-dual-expand)))
9401 1.1 christos )
9402 1.1 christos
9403 1.1 christos (dni cmexpdhd
9404 1.1 christos "Conditional media expand halfword to double"
9405 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9406 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
9407 1.1 christos "cmexpdhd$pack $FRinti,$u6,$FRintkeven,$CCi,$cond"
9408 1.1 christos (+ pack FRintkeven OP_76 FRinti CCi cond OPE4_3 u6)
9409 1.1 christos (media-expand-halfword-to-double-semantics (eq CCi (or cond 2)))
9410 1.1 christos ((fr400 (unit u-media-dual-expand
9411 1.1 christos (out FRintk FRintkeven)))
9412 1.1 christos (fr450 (unit u-media-dual-expand
9413 1.1 christos (out FRintk FRintkeven)))
9414 1.1 christos (fr500 (unit u-media-dual-expand
9415 1.1 christos (out FRintk FRintkeven)))
9416 1.1 christos (fr550 (unit u-media-dual-expand)))
9417 1.1 christos )
9418 1.1 christos
9419 1.1 christos (dni mpackh
9420 1.1 christos "Media halfword pack"
9421 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9422 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
9423 1.1 christos "mpackh$pack $FRinti,$FRintj,$FRintk"
9424 1.1 christos (+ pack FRintk OP_7B FRinti OPE1_34 FRintj)
9425 1.1 christos (media-pack FRinti FRintj FRintk 0)
9426 1.1 christos ((fr400 (unit u-media-3)) (fr450 (unit u-media-3))
9427 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media)))
9428 1.1 christos )
9429 1.1 christos
9430 1.1 christos (dni mdpackh
9431 1.1 christos "Media dual pack"
9432 1.1 christos ((UNIT FM01) (FR500-MAJOR M-5) (FR550-MAJOR M-3)
9433 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9434 1.1 christos "mdpackh$pack $FRintieven,$FRintjeven,$FRintkeven"
9435 1.1 christos (+ pack FRintkeven OP_7B FRintieven OPE1_36 FRintjeven)
9436 1.1 christos (if (orif (register-unaligned FRintieven 2)
9437 1.1 christos (orif (register-unaligned FRintjeven 2)
9438 1.1 christos (register-unaligned FRintkeven 2)))
9439 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9440 1.1 christos (sequence ()
9441 1.1 christos ; hack to get these referenced for profiling
9442 1.1 christos (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
9443 1.1 christos (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
9444 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9445 1.1 christos (media-pack FRintieven FRintjeven FRintkeven 0)
9446 1.1 christos (media-pack FRintieven FRintjeven FRintkeven 1)))
9447 1.1 christos ((fr400 (unit u-media-3-quad
9448 1.1 christos (in FRinti FRintieven)
9449 1.1 christos (in FRintj FRintjeven)
9450 1.1 christos (out FRintk FRintkeven)))
9451 1.1 christos (fr450 (unit u-media-3-quad
9452 1.1 christos (in FRinti FRintieven)
9453 1.1 christos (in FRintj FRintjeven)
9454 1.1 christos (out FRintk FRintkeven)))
9455 1.1 christos (fr500 (unit u-media-quad-arith
9456 1.1 christos (in FRinti FRintieven)
9457 1.1 christos (in FRintj FRintjeven)
9458 1.1 christos (out FRintk FRintkeven)))
9459 1.1 christos (fr550 (unit u-media-quad)))
9460 1.1 christos )
9461 1.1 christos
9462 1.1 christos (define-pmacro (media-unpack src soff targ toff)
9463 1.1 christos (sequence ()
9464 1.1 christos (set (halfword hi targ toff) (halfword hi src soff))
9465 1.1 christos (set (halfword lo targ toff) (halfword hi src soff))
9466 1.1 christos (set (halfword hi targ (add toff 1)) (halfword lo src soff))
9467 1.1 christos (set (halfword lo targ (add toff 1)) (halfword lo src soff)))
9468 1.1 christos )
9469 1.1 christos
9470 1.1 christos (dni munpackh
9471 1.1 christos "Media halfword unpack"
9472 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9473 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9474 1.1 christos "munpackh$pack $FRinti,$FRintkeven"
9475 1.1 christos (+ pack FRintkeven OP_7B FRinti OPE1_35 (FRj-null))
9476 1.1 christos (if (register-unaligned FRintkeven 2)
9477 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9478 1.1 christos (sequence ()
9479 1.1 christos ; hack to get these referenced for profiling
9480 1.1 christos (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
9481 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9482 1.1 christos (media-unpack FRinti 0 FRintkeven 0)))
9483 1.1 christos ((fr400 (unit u-media-dual-expand
9484 1.1 christos (out FRintk FRintkeven)))
9485 1.1 christos (fr450 (unit u-media-dual-expand
9486 1.1 christos (out FRintk FRintkeven)))
9487 1.1 christos (fr500 (unit u-media-dual-expand
9488 1.1 christos (out FRintk FRintkeven)))
9489 1.1 christos (fr550 (unit u-media-dual-expand)))
9490 1.1 christos )
9491 1.1 christos
9492 1.1 christos (dni mdunpackh
9493 1.1 christos "Media dual unpack"
9494 1.1 christos ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
9495 1.1 christos "mdunpackh$pack $FRintieven,$FRintk"
9496 1.1 christos (+ pack FRintk OP_7B FRintieven OPE1_37 (FRj-null))
9497 1.1 christos (if (orif (register-unaligned FRintieven 2) (register-unaligned FRintk 4))
9498 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9499 1.1 christos (sequence ()
9500 1.1 christos ; hack to get these referenced for profiling
9501 1.1 christos (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
9502 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9503 1.1 christos (media-unpack FRintieven 0 FRintk 0)
9504 1.1 christos (media-unpack FRintieven 1 FRintk 2)))
9505 1.1 christos ((fr500 (unit u-media-dual-unpack
9506 1.1 christos (in FRinti FRintieven))))
9507 1.1 christos )
9508 1.1 christos
9509 1.1 christos (define-pmacro (ubyte num arg offset)
9510 1.1 christos (reg (.sym h-fr_ num) (add (index-of arg) offset)))
9511 1.1 christos
9512 1.1 christos (define-pmacro (mbtoh-semantics cond)
9513 1.1 christos (if (register-unaligned FRintkeven 2)
9514 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9515 1.1 christos (if cond
9516 1.1 christos (sequence ()
9517 1.1 christos (set (halfword hi FRintkeven 0) (ubyte 3 FRintj 0))
9518 1.1 christos (set (halfword lo FRintkeven 0) (ubyte 2 FRintj 0))
9519 1.1 christos (set (halfword hi FRintkeven 1) (ubyte 1 FRintj 0))
9520 1.1 christos (set (halfword lo FRintkeven 1) (ubyte 0 FRintj 0)))))
9521 1.1 christos )
9522 1.1 christos
9523 1.1 christos (dni mbtoh
9524 1.1 christos "Media convert byte to halfword"
9525 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9526 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9527 1.1 christos "mbtoh$pack $FRintj,$FRintkeven"
9528 1.1 christos (+ pack FRintkeven OP_7B (FRi-null) OPE1_38 FRintj)
9529 1.1 christos (sequence ()
9530 1.1 christos ; hack to get these referenced for profiling
9531 1.1 christos (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9532 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9533 1.1 christos (mbtoh-semantics 1))
9534 1.1 christos ((fr400 (unit u-media-dual-expand
9535 1.1 christos (out FRintk FRintkeven)))
9536 1.1 christos (fr450 (unit u-media-dual-expand
9537 1.1 christos (out FRintk FRintkeven)))
9538 1.1 christos (fr500 (unit u-media-dual-btoh
9539 1.1 christos (out FRintk FRintkeven)))
9540 1.1 christos (fr550 (unit u-media-dual-expand)))
9541 1.1 christos )
9542 1.1 christos
9543 1.1 christos (dni cmbtoh
9544 1.1 christos "Conditional media convert byte to halfword"
9545 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9546 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
9547 1.1 christos "cmbtoh$pack $FRintj,$FRintkeven,$CCi,$cond"
9548 1.1 christos (+ pack FRintkeven OP_77 (FRi-null) CCi cond OPE4_0 FRintj)
9549 1.1 christos (sequence ()
9550 1.1 christos ; hack to get these referenced for profiling
9551 1.1 christos (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9552 1.1 christos (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
9553 1.1 christos (mbtoh-semantics (eq CCi (or cond 2))))
9554 1.1 christos ((fr400 (unit u-media-dual-expand
9555 1.1 christos (out FRintk FRintkeven)))
9556 1.1 christos (fr450 (unit u-media-dual-expand
9557 1.1 christos (out FRintk FRintkeven)))
9558 1.1 christos (fr500 (unit u-media-dual-btoh
9559 1.1 christos (out FRintk FRintkeven)))
9560 1.1 christos (fr550 (unit u-media-dual-expand
9561 1.1 christos (in FRinti FRintj))))
9562 1.1 christos )
9563 1.1 christos
9564 1.1 christos (define-pmacro (mhtob-semantics cond)
9565 1.1 christos (if (register-unaligned FRintjeven 2)
9566 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9567 1.1 christos (if cond
9568 1.1 christos (sequence ()
9569 1.1 christos (set (ubyte 3 FRintk 0) (halfword hi FRintjeven 0))
9570 1.1 christos (set (ubyte 2 FRintk 0) (halfword lo FRintjeven 0))
9571 1.1 christos (set (ubyte 1 FRintk 0) (halfword hi FRintjeven 1))
9572 1.1 christos (set (ubyte 0 FRintk 0) (halfword lo FRintjeven 1)))))
9573 1.1 christos )
9574 1.1 christos
9575 1.1 christos (dni mhtob
9576 1.1 christos "Media convert halfword to byte"
9577 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9578 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2))
9579 1.1 christos "mhtob$pack $FRintjeven,$FRintk"
9580 1.1 christos (+ pack FRintk OP_7B (FRi-null) OPE1_39 FRintjeven)
9581 1.1 christos (sequence ()
9582 1.1 christos ; hack to get these referenced for profiling
9583 1.1 christos (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
9584 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9585 1.1 christos (mhtob-semantics 1))
9586 1.1 christos ((fr400 (unit u-media-dual-htob
9587 1.1 christos (in FRintj FRintjeven)))
9588 1.1 christos (fr450 (unit u-media-dual-htob
9589 1.1 christos (in FRintj FRintjeven)))
9590 1.1 christos (fr500 (unit u-media-dual-htob
9591 1.1 christos (in FRintj FRintjeven)))
9592 1.1 christos (fr550 (unit u-media-3-dual
9593 1.1 christos (in FRinti FRintjeven))))
9594 1.1 christos )
9595 1.1 christos
9596 1.1 christos (dni cmhtob
9597 1.1 christos "Conditional media convert halfword to byte"
9598 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9599 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-2) CONDITIONAL)
9600 1.1 christos "cmhtob$pack $FRintjeven,$FRintk,$CCi,$cond"
9601 1.1 christos (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_1 FRintjeven)
9602 1.1 christos (sequence ()
9603 1.1 christos ; hack to get these referenced for profiling
9604 1.1 christos (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
9605 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9606 1.1 christos (mhtob-semantics (eq CCi (or cond 2))))
9607 1.1 christos ((fr400 (unit u-media-dual-htob
9608 1.1 christos (in FRintj FRintjeven)))
9609 1.1 christos (fr450 (unit u-media-dual-htob
9610 1.1 christos (in FRintj FRintjeven)))
9611 1.1 christos (fr500 (unit u-media-dual-htob
9612 1.1 christos (in FRintj FRintjeven)))
9613 1.1 christos (fr550 (unit u-media-3-dual
9614 1.1 christos (in FRinti FRintjeven))))
9615 1.1 christos )
9616 1.1 christos
9617 1.1 christos (define-pmacro (mbtohe-semantics cond)
9618 1.1 christos (if (register-unaligned FRintk 4)
9619 1.1 christos (c-call VOID "@cpu@_media_register_not_aligned")
9620 1.1 christos (if cond
9621 1.1 christos (sequence ()
9622 1.1 christos (set (halfword hi FRintk 0) (ubyte 3 FRintj 0))
9623 1.1 christos (set (halfword lo FRintk 0) (ubyte 3 FRintj 0))
9624 1.1 christos (set (halfword hi FRintk 1) (ubyte 2 FRintj 0))
9625 1.1 christos (set (halfword lo FRintk 1) (ubyte 2 FRintj 0))
9626 1.1 christos (set (halfword hi FRintk 2) (ubyte 1 FRintj 0))
9627 1.1 christos (set (halfword lo FRintk 2) (ubyte 1 FRintj 0))
9628 1.1 christos (set (halfword hi FRintk 3) (ubyte 0 FRintj 0))
9629 1.1 christos (set (halfword lo FRintk 3) (ubyte 0 FRintj 0)))))
9630 1.1 christos )
9631 1.1 christos
9632 1.1 christos (dni mbtohe
9633 1.1 christos "Media convert byte to halfword extended"
9634 1.1 christos ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
9635 1.1 christos "mbtohe$pack $FRintj,$FRintk"
9636 1.1 christos (+ pack FRintk OP_7B (FRi-null) OPE1_3A FRintj)
9637 1.1 christos (sequence ()
9638 1.1 christos ; hack to get these referenced for profiling
9639 1.1 christos (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9640 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9641 1.1 christos (mbtohe-semantics 1))
9642 1.1 christos ((fr500 (unit u-media-dual-btohe)))
9643 1.1 christos )
9644 1.1 christos
9645 1.1 christos (dni cmbtohe
9646 1.1 christos "Conditional media convert byte to halfword extended"
9647 1.1 christos ((UNIT FM01) (FR500-MAJOR M-7) CONDITIONAL (MACH simple,tomcat,frv))
9648 1.1 christos "cmbtohe$pack $FRintj,$FRintk,$CCi,$cond"
9649 1.1 christos (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_2 FRintj)
9650 1.1 christos (sequence ()
9651 1.1 christos ; hack to get these referenced for profiling
9652 1.1 christos (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
9653 1.1 christos (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
9654 1.1 christos (mbtohe-semantics (eq CCi (or cond 2))))
9655 1.1 christos ((fr500 (unit u-media-dual-btohe)))
9656 1.1 christos )
9657 1.1 christos
9658 1.1 christos ; Media NOP
9659 1.1 christos ; A special case of mclracc
9660 1.1 christos (dni mnop "Media nop"
9661 1.1 christos ((UNIT FMALL) (FR500-MAJOR M-1) (FR550-MAJOR M-1)
9662 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-1))
9663 1.1 christos "mnop$pack"
9664 1.1 christos (+ pack (f-ACC40Sk 63) OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null))
9665 1.1 christos (nop)
9666 1.1 christos ()
9667 1.1 christos )
9668 1.1 christos
9669 1.1 christos ; mclracc with #A==0
9670 1.1 christos (dni mclracc-0
9671 1.1 christos "Media clear accumulator(s)"
9672 1.1 christos ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
9673 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9674 1.1 christos "mclracc$pack $ACC40Sk,$A0"
9675 1.1 christos (+ pack ACC40Sk OP_7B (f-A 0) (misc-null-10) OPE1_3B (FRj-null))
9676 1.1 christos (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 0)
9677 1.1 christos ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
9678 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc)))
9679 1.1 christos )
9680 1.1 christos
9681 1.1 christos ; mclracc with #A==1
9682 1.1 christos (dni mclracc-1
9683 1.1 christos "Media clear accumulator(s)"
9684 1.1 christos ((UNIT MCLRACC-1) (FR500-MAJOR M-6) (FR550-MAJOR M-3)
9685 1.1 christos (FR400-MAJOR M-2) (FR450-MAJOR M-4))
9686 1.1 christos "mclracc$pack $ACC40Sk,$A1"
9687 1.1 christos (+ pack ACC40Sk OP_7B (f-A 1) (misc-null-10) OPE1_3B (FRj-null))
9688 1.1 christos (c-call VOID "@cpu@_clear_accumulators" (index-of ACC40Sk) 1)
9689 1.1 christos ((fr400 (unit u-media-4)) (fr450 (unit u-media-4-mclracca))
9690 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-mclracc)))
9691 1.1 christos )
9692 1.1 christos
9693 1.1 christos (dni mrdacc
9694 1.1 christos "Media read accumulator"
9695 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9696 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-5))
9697 1.1 christos "mrdacc$pack $ACC40Si,$FRintk"
9698 1.1 christos (+ pack FRintk OP_7B ACC40Si OPE1_3C (FRj-null))
9699 1.1 christos (set FRintk ACC40Si)
9700 1.1 christos ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
9701 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-acc)))
9702 1.1 christos )
9703 1.1 christos
9704 1.1 christos (dni mrdaccg
9705 1.1 christos "Media read accumulator guard"
9706 1.1 christos ((UNIT FM01) (FR500-MAJOR M-2) (FR550-MAJOR M-3)
9707 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-5))
9708 1.1 christos "mrdaccg$pack $ACCGi,$FRintk"
9709 1.1 christos (+ pack FRintk OP_7B ACCGi OPE1_3E (FRj-null))
9710 1.1 christos (set FRintk ACCGi)
9711 1.1 christos ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg))
9712 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-acc (in ACC40Si ACCGi))))
9713 1.1 christos )
9714 1.1 christos
9715 1.1 christos (dni mwtacc
9716 1.1 christos "Media write accumulator"
9717 1.1 christos ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
9718 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9719 1.1 christos "mwtacc$pack $FRinti,$ACC40Sk"
9720 1.1 christos (+ pack ACC40Sk OP_7B FRinti OPE1_3D (FRj-null))
9721 1.1 christos (set ACC40Sk (or (and ACC40Sk (const DI #xffffffff00000000))
9722 1.1 christos FRinti))
9723 1.1 christos ((fr400 (unit u-media-4)) (fr450 (unit u-media-4))
9724 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc)))
9725 1.1 christos )
9726 1.1 christos
9727 1.1 christos (dni mwtaccg
9728 1.1 christos "Media write accumulator guard"
9729 1.1 christos ((UNIT FM01) (FR500-MAJOR M-3) (FR550-MAJOR M-3)
9730 1.1 christos (FR400-MAJOR M-1) (FR450-MAJOR M-3))
9731 1.1 christos "mwtaccg$pack $FRinti,$ACCGk"
9732 1.1 christos (+ pack ACCGk OP_7B FRinti OPE1_3F (FRj-null))
9733 1.1 christos (sequence ()
9734 1.1 christos ; hack to get these referenced for profiling
9735 1.1 christos (c-raw-call VOID "frv_ref_SI" ACCGk)
9736 1.1 christos (set ACCGk FRinti))
9737 1.1 christos ((fr400 (unit u-media-4-accg)) (fr450 (unit u-media-4-accg))
9738 1.1 christos (fr500 (unit u-media)) (fr550 (unit u-media-3-wtacc (in ACC40Sk ACCGk))))
9739 1.1 christos )
9740 1.1 christos
9741 1.1 christos (define-pmacro (media-cop num op)
9742 1.1 christos (dni (.sym mcop num)
9743 1.1 christos "Media custom instruction"
9744 1.1 christos ((UNIT FM01) (FR500-MAJOR M-1) (MACH frv))
9745 1.1 christos (.str "mcop" num "$pack $FRi,$FRj,$FRk")
9746 1.1 christos (+ pack FRk op FRi OPE1_00 FRj)
9747 1.1 christos (c-call VOID "@cpu@_media_cop" num)
9748 1.1 christos ()
9749 1.1 christos )
9750 1.1 christos )
9751 1.1 christos
9752 1.1 christos (media-cop 1 OP_7C)
9753 1.1 christos (media-cop 2 OP_7D)
9754 1.1 christos
9755 1.1 christos ; nop
9756 1.1 christos ; A nop is defined to be a "ori gr0,0,gr0"
9757 1.1 christos ; This needn't be a macro-insn, but making it one greatly simplifies decode.c
9758 1.1 christos ; On the other hand spending a little time in the decoder is often worth it.
9759 1.1 christos ;
9760 1.1 christos (dnmi nop "nop"
9761 1.1 christos ((UNIT IALL) (FR500-MAJOR I-1) (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9762 1.1 christos "nop$pack"
9763 1.1 christos (emit ori pack (GRi 0) (s12 0) (GRk 0))
9764 1.1 christos )
9765 1.1 christos
9766 1.1 christos ; Floating point NOP
9767 1.1 christos (dni fnop
9768 1.1 christos "Floating point nop"
9769 1.1 christos ((UNIT FMALL) (FR500-MAJOR F-8) (FR550-MAJOR F-1) (MACH simple,tomcat,fr500,fr550,frv))
9770 1.1 christos "fnop$pack"
9771 1.1 christos (+ pack (rd-null) OP_79 (FRi-null) OPE1_0D (FRj-null))
9772 1.1 christos (nop)
9773 1.1 christos ()
9774 1.1 christos )
9775 1.1 christos
9776 1.1 christos ; A return instruction
9777 1.1 christos (dnmi ret "return"
9778 1.1 christos (NO-DIS (UNIT B01) (FR500-MAJOR B-3)
9779 1.1 christos (FR400-MAJOR B-3) (FR450-MAJOR B-3))
9780 1.1 christos "ret$pack"
9781 1.1 christos (emit bralr pack (hint_taken 2))
9782 1.1 christos )
9783 1.1 christos
9784 1.1 christos (dnmi cmp "compare"
9785 1.1 christos (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9786 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9787 1.1 christos "cmp$pack $GRi,$GRj,$ICCi_1"
9788 1.1 christos (emit subcc pack GRi GRj (GRk 0) ICCi_1)
9789 1.1 christos )
9790 1.1 christos
9791 1.1 christos (dnmi cmpi "compare immediate"
9792 1.1 christos (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9793 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9794 1.1 christos "cmpi$pack $GRi,$s10,$ICCi_1"
9795 1.1 christos (emit subicc pack GRi s10 (GRk 0) ICCi_1)
9796 1.1 christos )
9797 1.1 christos
9798 1.1 christos (dnmi ccmp "conditional compare"
9799 1.1 christos (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9800 1.1 christos (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
9801 1.1 christos "ccmp$pack $GRi,$GRj,$CCi,$cond"
9802 1.1 christos (emit csubcc pack GRi GRj (GRk 0) CCi cond)
9803 1.1 christos )
9804
9805 (dnmi mov "move"
9806 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9807 (FR400-MAJOR I-1) (FR450-MAJOR I-1))
9808 "mov$pack $GRi,$GRk"
9809 (emit ori pack GRi (s12 0) GRk)
9810 )
9811
9812 (dnmi cmov "conditional move"
9813 (NO-DIS (UNIT IALL) (FR500-MAJOR I-1)
9814 (FR400-MAJOR I-1) (FR450-MAJOR I-1) CONDITIONAL)
9815 "cmov$pack $GRi,$GRk,$CCi,$cond"
9816 (emit cor pack GRi (GRj 0) GRk CCi cond)
9817 )
9818