ACSE 2.0.3
Advanced Compiler System for Education
Loading...
Searching...
No Matches
codegen.c
Go to the documentation of this file.
1
3
4#include <stddef.h>
5#include "errors.h"
6#include "codegen.h"
7#include "scanner.h"
8#include "target_info.h"
9
10
12{
13 if (!program)
14 return;
15 if (r >= 0 && r < program->firstUnusedReg)
16 return;
17 fatalError("bug: invalid register identifier %d", r);
18}
19
20
21static t_instruction *genRFormatInstruction(
22 t_program *program, int opcode, t_regID rd, t_regID rs1, t_regID rs2)
23{
24 validateRegisterId(program, rd);
25 validateRegisterId(program, rs1);
26 validateRegisterId(program, rs2);
27 return genInstruction(program, opcode, rd, rs1, rs2, NULL, 0);
28}
29
30static t_instruction *genIFormatInstruction(
31 t_program *program, int opcode, t_regID rd, t_regID rs1, int immediate)
32{
33 validateRegisterId(program, rd);
34 validateRegisterId(program, rs1);
35 return genInstruction(program, opcode, rd, rs1, REG_INVALID, NULL, immediate);
36}
37
38static t_instruction *genBFormatInstruction(
39 t_program *program, int opcode, t_regID rs1, t_regID rs2, t_label *label)
40{
41 validateRegisterId(program, rs1);
42 validateRegisterId(program, rs2);
43 return genInstruction(program, opcode, REG_INVALID, rs1, rs2, label, 0);
44}
45
46
48{
49 return genRFormatInstruction(program, OPC_ADD, rd, rs1, rs2);
50}
51
53{
54 return genRFormatInstruction(program, OPC_SUB, rd, rs1, rs2);
55}
56
58{
59 return genRFormatInstruction(program, OPC_AND, rd, rs1, rs2);
60}
61
63{
64 return genRFormatInstruction(program, OPC_OR, rd, rs1, rs2);
65}
66
68{
69 return genRFormatInstruction(program, OPC_XOR, rd, rs1, rs2);
70}
71
73{
74 return genRFormatInstruction(program, OPC_MUL, rd, rs1, rs2);
75}
76
78{
79 return genRFormatInstruction(program, OPC_DIV, rd, rs1, rs2);
80}
81
83{
84 return genRFormatInstruction(program, OPC_REM, rd, rs1, rs2);
85}
86
88{
89 return genRFormatInstruction(program, OPC_SLL, rd, rs1, rs2);
90}
91
93{
94 return genRFormatInstruction(program, OPC_SRL, rd, rs1, rs2);
95}
96
98{
99 return genRFormatInstruction(program, OPC_SRA, rd, rs1, rs2);
100}
101
102
104 t_program *program, t_regID rd, t_regID rs1, int immediate)
105{
106 return genIFormatInstruction(program, OPC_ADDI, rd, rs1, immediate);
107}
108
110 t_program *program, t_regID rd, t_regID rs1, int immediate)
111{
112 return genIFormatInstruction(program, OPC_SUBI, rd, rs1, immediate);
113}
114
116 t_program *program, t_regID rd, t_regID rs1, int immediate)
117{
118 return genIFormatInstruction(program, OPC_ANDI, rd, rs1, immediate);
119}
120
122 t_program *program, t_regID rd, t_regID rs1, int immediate)
123{
124 return genIFormatInstruction(program, OPC_MULI, rd, rs1, immediate);
125}
126
128 t_program *program, t_regID rd, t_regID rs1, int immediate)
129{
130 return genIFormatInstruction(program, OPC_ORI, rd, rs1, immediate);
131}
132
134 t_program *program, t_regID rd, t_regID rs1, int immediate)
135{
136 return genIFormatInstruction(program, OPC_XORI, rd, rs1, immediate);
137}
138
140 t_program *program, t_regID rd, t_regID rs1, int immediate)
141{
142 return genIFormatInstruction(program, OPC_DIVI, rd, rs1, immediate);
143}
144
146 t_program *program, t_regID rd, t_regID rs1, int immediate)
147{
148 return genIFormatInstruction(program, OPC_REMI, rd, rs1, immediate);
149}
150
152 t_program *program, t_regID rd, t_regID rs1, int immediate)
153{
154 return genIFormatInstruction(program, OPC_SLLI, rd, rs1, immediate);
155}
156
158 t_program *program, t_regID rd, t_regID rs1, int immediate)
159{
160 return genIFormatInstruction(program, OPC_SRLI, rd, rs1, immediate);
161}
162
164 t_program *program, t_regID rd, t_regID rs1, int immediate)
165{
166 return genIFormatInstruction(program, OPC_SRAI, rd, rs1, immediate);
167}
168
169
171{
172 return genRFormatInstruction(program, OPC_SEQ, rd, rs1, rs2);
173}
174
176{
177 return genRFormatInstruction(program, OPC_SNE, rd, rs1, rs2);
178}
179
181{
182 return genRFormatInstruction(program, OPC_SLT, rd, rs1, rs2);
183}
184
186{
187 return genRFormatInstruction(program, OPC_SLTU, rd, rs1, rs2);
188}
189
191{
192 return genRFormatInstruction(program, OPC_SGE, rd, rs1, rs2);
193}
194
196{
197 return genRFormatInstruction(program, OPC_SGEU, rd, rs1, rs2);
198}
199
201{
202 return genRFormatInstruction(program, OPC_SGT, rd, rs1, rs2);
203}
204
206{
207 return genRFormatInstruction(program, OPC_SGTU, rd, rs1, rs2);
208}
209
211{
212 return genRFormatInstruction(program, OPC_SLE, rd, rs1, rs2);
213}
214
216{
217 return genRFormatInstruction(program, OPC_SLEU, rd, rs1, rs2);
218}
219
220
222 t_program *program, t_regID rd, t_regID rs1, int immediate)
223{
224 return genIFormatInstruction(program, OPC_SEQI, rd, rs1, immediate);
225}
226
228 t_program *program, t_regID rd, t_regID rs1, int immediate)
229{
230 return genIFormatInstruction(program, OPC_SNEI, rd, rs1, immediate);
231}
232
234 t_program *program, t_regID rd, t_regID rs1, int immediate)
235{
236 return genIFormatInstruction(program, OPC_SLTI, rd, rs1, immediate);
237}
238
240 t_program *program, t_regID rd, t_regID rs1, int immediate)
241{
242 return genIFormatInstruction(program, OPC_SLTIU, rd, rs1, immediate);
243}
244
246 t_program *program, t_regID rd, t_regID rs1, int immediate)
247{
248 return genIFormatInstruction(program, OPC_SGEI, rd, rs1, immediate);
249}
250
252 t_program *program, t_regID rd, t_regID rs1, int immediate)
253{
254 return genIFormatInstruction(program, OPC_SGEIU, rd, rs1, immediate);
255}
256
258 t_program *program, t_regID rd, t_regID rs1, int immediate)
259{
260 return genIFormatInstruction(program, OPC_SGTI, rd, rs1, immediate);
261}
262
264 t_program *program, t_regID rd, t_regID rs1, int immediate)
265{
266 return genIFormatInstruction(program, OPC_SGTIU, rd, rs1, immediate);
267}
268
270 t_program *program, t_regID rd, t_regID rs1, int immediate)
271{
272 return genIFormatInstruction(program, OPC_SLEI, rd, rs1, immediate);
273}
274
276 t_program *program, t_regID rd, t_regID rs1, int immediate)
277{
278 return genIFormatInstruction(program, OPC_SLEIU, rd, rs1, immediate);
279}
280
281
283{
284 return genInstruction(
285 program, OPC_J, REG_INVALID, REG_INVALID, REG_INVALID, label, 0);
286}
287
288
290 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
291{
292 return genBFormatInstruction(program, OPC_BEQ, rs1, rs2, label);
293}
294
296 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
297{
298 return genBFormatInstruction(program, OPC_BNE, rs1, rs2, label);
299}
300
302 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
303{
304 return genBFormatInstruction(program, OPC_BLT, rs1, rs2, label);
305}
306
308 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
309{
310 return genBFormatInstruction(program, OPC_BLTU, rs1, rs2, label);
311}
312
314 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
315{
316 return genBFormatInstruction(program, OPC_BGE, rs1, rs2, label);
317}
318
320 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
321{
322 return genBFormatInstruction(program, OPC_BGEU, rs1, rs2, label);
323}
324
326 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
327{
328 return genBFormatInstruction(program, OPC_BGT, rs1, rs2, label);
329}
330
332 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
333{
334 return genBFormatInstruction(program, OPC_BGTU, rs1, rs2, label);
335}
336
338 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
339{
340 return genBFormatInstruction(program, OPC_BLE, rs1, rs2, label);
341}
342
344 t_program *program, t_regID rs1, t_regID rs2, t_label *label)
345{
346 return genBFormatInstruction(program, OPC_BLEU, rs1, rs2, label);
347}
348
349
350t_instruction *genLI(t_program *program, t_regID rd, int immediate)
351{
352 validateRegisterId(program, rd);
353 return genInstruction(
354 program, OPC_LI, rd, REG_INVALID, REG_INVALID, NULL, immediate);
355}
356
358{
359 validateRegisterId(program, rd);
360 return genInstruction(
361 program, OPC_LA, rd, REG_INVALID, REG_INVALID, label, 0);
362}
363
364t_instruction *genLW(t_program *program, t_regID rd, int immediate, t_regID rs1)
365{
366 validateRegisterId(program, rd);
367 validateRegisterId(program, rs1);
368 return genInstruction(program, OPC_LW, rd, rs1, REG_INVALID, NULL, immediate);
369}
370
372 t_program *program, t_regID rs2, int immediate, t_regID rs1)
373{
374 validateRegisterId(program, rs2);
375 validateRegisterId(program, rs1);
376 return genInstruction(
377 program, OPC_SW, REG_INVALID, rs1, rs2, NULL, immediate);
378}
379
381{
382 validateRegisterId(program, rd);
383 return genInstruction(
384 program, OPC_LW_G, rd, REG_INVALID, REG_INVALID, label, 0);
385}
386
388 t_program *program, t_regID rs1, t_label *label, t_regID r_temp)
389{
390 validateRegisterId(program, rs1);
391 return genInstruction(program, OPC_SW_G, r_temp, rs1, REG_INVALID, label, 0);
392}
393
394
396{
397 return genInstruction(
398 program, OPC_NOP, REG_INVALID, REG_INVALID, REG_INVALID, NULL, 0);
399}
400
402{
403 return genInstruction(
404 program, OPC_ECALL, REG_INVALID, REG_INVALID, REG_INVALID, NULL, 0);
405}
406
408{
409 return genInstruction(
410 program, OPC_EBREAK, REG_INVALID, REG_INVALID, REG_INVALID, NULL, 0);
411}
412
413
419
421{
422 validateRegisterId(program, rd);
423 return genInstruction(
424 program, OPC_CALL_READ_INT, rd, REG_INVALID, REG_INVALID, NULL, 0);
425}
426
428{
429 validateRegisterId(program, rs1);
430 return genInstruction(
431 program, OPC_CALL_PRINT_INT, REG_INVALID, rs1, REG_INVALID, NULL, 0);
432}
433
435{
436 validateRegisterId(program, rs1);
437 return genInstruction(
438 program, OPC_CALL_PRINT_CHAR, REG_INVALID, rs1, REG_INVALID, NULL, 0);
439}
440
441
443{
444 // Check if the symbol is an array; in that case do not generate any more
445 // code. Calling emitError will eventually stop compilation anyway.
446 if (isArray(var)) {
447 emitError(curFileLoc, "'%s' is an array", var->ID);
448 return REG_0;
449 }
450
451 // Generate an LA instruction to load the label address into a register.
452 t_regID rAddr = getNewRegister(program);
453 genLA(program, rAddr, var->label);
454 // Generate a LW from the address.
455 t_regID rRes = getNewRegister(program);
456 genLW(program, rRes, 0, rAddr);
457 return rRes;
458}
459
460
462{
463 // Check if the symbol is an array; in that case bail out without generating
464 // any code (but emitting an error that will eventually stop further
465 // compilation).
466 if (isArray(var)) {
467 emitError(curFileLoc, "'%s' is an array", var->ID);
468 return;
469 }
470
471 // Generate an LA instruction to load the label address into a register.
472 t_regID rAddr = getNewRegister(program);
473 genLA(program, rAddr, var->label);
474 // Generate a SW to the address specified by the label.
475 genSW(program, reg, 0, rAddr);
476}
477
478void genStoreConstantToVariable(t_program *program, t_symbol *var, int val)
479{
480 // Generate a copy of the constant value into a register.
481 t_regID rVal = getNewRegister(program);
482 genLI(program, rVal, val);
483 // Copy the register value into the variable.
484 genStoreRegisterToVariable(program, var, rVal);
485}
486
487
497{
498 if (!isArray(array)) {
499 // If the symbol is not an array, bail out returning a dummy register ID.
500 emitError(curFileLoc, "'%s' is a scalar", array->ID);
501 return REG_0;
502 }
503 t_label *label = array->label;
504
505 // Generate a load of the base address using LA
506 t_regID rAddr = getNewRegister(program);
507 genLA(program, rAddr, label);
508
509 // Generate the code to compute the offset of the element in the array in
510 // bytes. Assume the type is an integer (no other scalar types are supported).
511 t_regID rOffset;
512 int sizeofElem = 4 / TARGET_PTR_GRANULARITY;
513 if (sizeofElem != 1) {
514 rOffset = getNewRegister(program);
515 genMULI(program, rOffset, rIdx, sizeofElem);
516 } else {
517 rOffset = rIdx;
518 }
519
520 // Generate the code which computes the final address by summing the base
521 // address to the offset of the element.
522 genADD(program, rAddr, rAddr, rOffset);
523 return rAddr;
524}
525
526
528{
529 // Generate code that loads the address of the array element in a register
530 // and then loads the element itself from that memory address.
531 t_regID rAddr = genLoadArrayAddress(program, array, rIdx);
532 t_regID rVal = getNewRegister(program);
533 genLW(program, rVal, 0, rAddr);
534 return rVal;
535}
536
537
539 t_program *program, t_symbol *array, t_regID rIdx, t_regID rVal)
540{
541 // Generate code that loads the address of the array element in a register
542 // and then stores the new value in that address.
543 t_regID rAddr = genLoadArrayAddress(program, array, rIdx);
544 genSW(program, rVal, 0, rAddr);
545}
546
548 t_program *program, t_symbol *array, t_regID rIdx, int val)
549{
550 // Generate code to move the constant value into a register.
551 t_regID rVal = getNewRegister(program);
552 genLI(program, rVal, val);
553 // Generate the array access itself.
554 genStoreRegisterToArrayElement(program, array, rIdx, rVal);
555}
void validateRegisterId(t_program *program, t_regID r)
Definition codegen.c:11
t_regID genLoadArrayAddress(t_program *program, t_symbol *array, t_regID rIdx)
Definition codegen.c:496
Code generation functions.
Error logging utilities.
void emitError(t_fileLocation loc, const char *fmt,...)
Definition errors.c:23
void fatalError(const char *format,...)
Definition errors.c:32
t_instruction * genADD(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:47
t_instruction * genSGTU(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:205
t_instruction * genPrintCharSyscall(t_program *program, t_regID rs1)
Definition codegen.c:434
t_instruction * genSGEI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:245
t_instruction * genBNE(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:295
t_instruction * genLW(t_program *program, t_regID rd, int immediate, t_regID rs1)
Definition codegen.c:364
t_instruction * genSRA(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:97
t_instruction * genSGE(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:190
t_instruction * genREM(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:82
void genStoreRegisterToVariable(t_program *program, t_symbol *var, t_regID reg)
Definition codegen.c:461
t_instruction * genSLTI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:233
t_regID genLoadVariable(t_program *program, t_symbol *var)
Definition codegen.c:442
t_instruction * genXORI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:133
t_instruction * genECALL(t_program *program)
Definition codegen.c:401
t_instruction * genBGTU(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:331
t_instruction * genSLE(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:210
t_instruction * genSWGlobal(t_program *program, t_regID rs1, t_label *label, t_regID r_temp)
Definition codegen.c:387
t_instruction * genANDI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:115
t_instruction * genSUB(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:52
void genStoreRegisterToArrayElement(t_program *program, t_symbol *array, t_regID rIdx, t_regID rVal)
Definition codegen.c:538
void genStoreConstantToArrayElement(t_program *program, t_symbol *array, t_regID rIdx, int val)
Definition codegen.c:547
t_instruction * genSEQ(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:170
t_instruction * genSLTU(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:185
t_instruction * genLI(t_program *program, t_regID rd, int immediate)
Definition codegen.c:350
t_instruction * genSRLI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:157
t_regID genLoadArrayElement(t_program *program, t_symbol *array, t_regID rIdx)
Definition codegen.c:527
t_instruction * genBLEU(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:343
t_instruction * genOR(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:62
t_instruction * genSGEIU(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:251
t_instruction * genMULI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:121
t_instruction * genDIVI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:139
t_instruction * genExit0Syscall(t_program *program)
Definition codegen.c:414
t_instruction * genSGTI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:257
t_instruction * genSLTIU(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:239
t_instruction * genLWGlobal(t_program *program, t_regID rd, t_label *label)
Definition codegen.c:380
t_instruction * genSRAI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:163
t_instruction * genSEQI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:221
t_instruction * genADDI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:103
t_instruction * genSLLI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:151
t_instruction * genSLEI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:269
void genStoreConstantToVariable(t_program *program, t_symbol *var, int val)
Definition codegen.c:478
t_instruction * genSLEU(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:215
t_instruction * genBEQ(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:289
t_instruction * genXOR(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:67
t_instruction * genSNEI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:227
t_instruction * genJ(t_program *program, t_label *label)
Definition codegen.c:282
t_instruction * genAND(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:57
t_instruction * genSLT(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:180
t_instruction * genSUBI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:109
t_instruction * genNOP(t_program *program)
Definition codegen.c:395
t_instruction * genBGE(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:313
t_instruction * genSLEIU(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:275
t_instruction * genLA(t_program *program, t_regID rd, t_label *label)
Definition codegen.c:357
t_instruction * genSRL(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:92
t_instruction * genORI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:127
t_instruction * genREMI(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:145
t_instruction * genPrintIntSyscall(t_program *program, t_regID rs1)
Definition codegen.c:427
t_instruction * genSGEU(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:195
t_instruction * genSGTIU(t_program *program, t_regID rd, t_regID rs1, int immediate)
Definition codegen.c:263
t_instruction * genSNE(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:175
t_instruction * genBLT(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:301
t_instruction * genSLL(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:87
t_instruction * genSGT(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:200
t_instruction * genReadIntSyscall(t_program *program, t_regID rd)
Definition codegen.c:420
t_instruction * genBLTU(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:307
t_instruction * genBLE(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:337
t_instruction * genBGEU(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:319
t_instruction * genDIV(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:77
t_instruction * genBGT(t_program *program, t_regID rs1, t_regID rs2, t_label *label)
Definition codegen.c:325
t_instruction * genMUL(t_program *program, t_regID rd, t_regID rs1, t_regID rs2)
Definition codegen.c:72
t_instruction * genSW(t_program *program, t_regID rs2, int immediate, t_regID rs1)
Definition codegen.c:371
t_instruction * genEBREAK(t_program *program)
Definition codegen.c:407
t_fileLocation curFileLoc
Definition scanner.l:11
char * ID
Symbol name (should never be a NULL pointer or an empty string "").
Definition program.h:88
t_label * label
Definition program.h:91
t_regID getNewRegister(t_program *program)
Definition program.c:398
#define REG_INVALID
Constant used for invalid register identifiers.
Definition program.h:31
bool isArray(t_symbol *symbol)
Definition program.c:445
#define REG_0
Constant identifying a register whose value is always zero.
Definition program.h:33
t_instruction * genInstruction(t_program *program, int opcode, t_regID rd, t_regID rs1, t_regID rs2, t_label *label, int immediate)
Definition program.c:338
int t_regID
Type for register identifiers.
Definition program.h:28
#define TARGET_PTR_GRANULARITY
Number of bytes for each memory address.
Definition target_info.h:30
@ OPC_SGTU
@ OPC_SW
@ OPC_ECALL
@ OPC_SGTI
@ OPC_CALL_EXIT_0
@ OPC_SW_G
@ OPC_BGT
@ OPC_MULI
@ OPC_BGE
@ OPC_LI
@ OPC_DIV
Definition target_info.h:94
@ OPC_SLTU
@ OPC_SLT
@ OPC_SRL
Definition target_info.h:97
@ OPC_XORI
@ OPC_ADDI
@ OPC_SGT
@ OPC_LW_G
@ OPC_SEQI
@ OPC_OR
Definition target_info.h:91
@ OPC_SUB
Definition target_info.h:89
@ OPC_SGEIU
@ OPC_XOR
Definition target_info.h:92
@ OPC_SLTIU
@ OPC_CALL_PRINT_CHAR
@ OPC_BLT
@ OPC_SGTIU
@ OPC_CALL_READ_INT
@ OPC_EBREAK
@ OPC_SLTI
@ OPC_SNE
@ OPC_BLTU
@ OPC_SRLI
@ OPC_SRA
Definition target_info.h:98
@ OPC_SLL
Definition target_info.h:96
@ OPC_SLEU
@ OPC_BNE
@ OPC_ORI
@ OPC_REM
Definition target_info.h:95
@ OPC_SLEI
@ OPC_ANDI
@ OPC_LW
@ OPC_J
@ OPC_BLEU
@ OPC_NOP
@ OPC_BGTU
@ OPC_SEQ
@ OPC_ADD
Definition target_info.h:88
@ OPC_BEQ
@ OPC_SLEIU
@ OPC_SGEI
@ OPC_LA
@ OPC_CALL_PRINT_INT
@ OPC_SNEI
@ OPC_BLE
@ OPC_SUBI
@ OPC_DIVI
@ OPC_SRAI
@ OPC_MUL
Definition target_info.h:93
@ OPC_REMI
@ OPC_SLLI
@ OPC_AND
Definition target_info.h:90
@ OPC_SGEU
@ OPC_BGEU
@ OPC_SLE
@ OPC_SGE
Header file associated to scanner.y.
Properties of the target machine.