00001
00002
00003
00004
00005
00006
00007
00008 #include "global.h"
00009 #include "decoder.h"
00010 #include "sparc.pat.h"
00011 #include "ss.h"
00012 #include "csr.h"
00013
00014 #define VAR true
00015 #define VAL false
00016 int InstructionPatterns::SP = 14;
00017 int InstructionPatterns::FP = 30;
00018 int InstructionPatterns::o0 = 8;
00019 int InstructionPatterns::i0 = 24;
00020 int InstructionPatterns::i7 = 31;
00021 int InstructionPatterns::o7 = 15;
00022 int InstructionPatterns::g0 = 0;
00023 bool InstructionPatterns::ADD$imode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00024 ADDRESS nextPC;
00025 match lc to
00026 | ADD(_a, _b, _c) =>
00027 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00028 if (!imode(_b, b, b_isVAR)) return false;
00029 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00030 lc = nextPC;
00031 return true;
00032 else
00033 return false;
00034 endmatch
00035 }
00036 bool InstructionPatterns::ADD$rmode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00037 ADDRESS nextPC;
00038 match lc to
00039 | ADD(_a, _b, _c) =>
00040 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00041 if (!rmode(_b, b, b_isVAR)) return false;
00042 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00043 lc = nextPC;
00044 return true;
00045 else
00046 return false;
00047 endmatch
00048 }
00049 bool InstructionPatterns::JMPL$dispA(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00050 ADDRESS nextPC;
00051 match lc to
00052 | JMPL(_a, _b) =>
00053 if (!dispA(_a, a, a_isVAR, b, b_isVAR)) return false;
00054 if (!c_isVAR && (int)_b != c) return false; else c = _b;
00055 lc = nextPC;
00056 return true;
00057 else
00058 return false;
00059 endmatch
00060 }
00061 bool InstructionPatterns::JMPL$indirectA(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00062 ADDRESS nextPC;
00063 match lc to
00064 | JMPL(_a, _b) =>
00065 if (!indirectA(_a, a, a_isVAR)) return false;
00066 if (!b_isVAR && (int)_b != b) return false; else b = _b;
00067 lc = nextPC;
00068 return true;
00069 else
00070 return false;
00071 endmatch
00072 }
00073 bool InstructionPatterns::OR$imode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00074 ADDRESS nextPC;
00075 match lc to
00076 | OR(_a, _b, _c) =>
00077 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00078 if (!imode(_b, b, b_isVAR)) return false;
00079 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00080 lc = nextPC;
00081 return true;
00082 else
00083 return false;
00084 endmatch
00085 }
00086 bool InstructionPatterns::RESTORE$imode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00087 ADDRESS nextPC;
00088 match lc to
00089 | RESTORE(_a, _b, _c) =>
00090 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00091 if (!imode(_b, b, b_isVAR)) return false;
00092 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00093 lc = nextPC;
00094 return true;
00095 else
00096 return false;
00097 endmatch
00098 }
00099 bool InstructionPatterns::RESTORE$rmode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00100 ADDRESS nextPC;
00101 match lc to
00102 | RESTORE(_a, _b, _c) =>
00103 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00104 if (!rmode(_b, b, b_isVAR)) return false;
00105 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00106 lc = nextPC;
00107 return true;
00108 else
00109 return false;
00110 endmatch
00111 }
00112 bool InstructionPatterns::SAVE$imode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00113 ADDRESS nextPC;
00114 match lc to
00115 | SAVE(_a, _b, _c) =>
00116 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00117 if (!imode(_b, b, b_isVAR)) return false;
00118 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00119 lc = nextPC;
00120 return true;
00121 else
00122 return false;
00123 endmatch
00124 }
00125 bool InstructionPatterns::SAVE$rmode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00126 ADDRESS nextPC;
00127 match lc to
00128 | SAVE(_a, _b, _c) =>
00129 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00130 if (!rmode(_b, b, b_isVAR)) return false;
00131 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00132 lc = nextPC;
00133 return true;
00134 else
00135 return false;
00136 endmatch
00137 }
00138 bool InstructionPatterns::SUB$imode(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR, int& c, bool c_isVAR) {
00139 ADDRESS nextPC;
00140 match lc to
00141 | SUB(_a, _b, _c) =>
00142 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00143 if (!imode(_b, b, b_isVAR)) return false;
00144 if (!c_isVAR && (int)_c != c) return false; else c = _c;
00145 lc = nextPC;
00146 return true;
00147 else
00148 return false;
00149 endmatch
00150 }
00151 bool InstructionPatterns::UNIMP(ADDRESS& lc, int& a, bool a_isVAR) {
00152 ADDRESS nextPC;
00153 match lc to
00154 | UNIMP(_a) =>
00155 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00156 lc = nextPC;
00157 return true;
00158 else
00159 return false;
00160 endmatch
00161 }
00162 bool InstructionPatterns::call__(ADDRESS& lc, int& a, bool a_isVAR) {
00163 ADDRESS nextPC;
00164 match lc to
00165 | call__(_a) =>
00166 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00167 lc = nextPC;
00168 return true;
00169 else
00170 return false;
00171 endmatch
00172 }
00173 bool InstructionPatterns::dispA(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00174 match lc to
00175 | dispA(_a, _b) =>
00176 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00177 if (!b_isVAR && (int)_b != b) return false; else b = _b;
00178 return true;
00179 else
00180 return false;
00181 endmatch
00182 }
00183 bool InstructionPatterns::imode(ADDRESS& lc, int& a, bool a_isVAR) {
00184 match lc to
00185 | imode(_a) =>
00186 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00187 return true;
00188 else
00189 return false;
00190 endmatch
00191 }
00192 bool InstructionPatterns::indirectA(ADDRESS& lc, int& a, bool a_isVAR) {
00193 match lc to
00194 | indirectA(_a) =>
00195 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00196 return true;
00197 else
00198 return false;
00199 endmatch
00200 }
00201 bool InstructionPatterns::mov_(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00202 ADDRESS nextPC;
00203 match lc to
00204 | mov_(_a, _b) =>
00205 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00206 if (!b_isVAR && (int)_b != b) return false; else b = _b;
00207 lc = nextPC;
00208 return true;
00209 else
00210 return false;
00211 endmatch
00212 }
00213 bool InstructionPatterns::restore_(ADDRESS& lc) {
00214 ADDRESS nextPC;
00215 match lc to
00216 | restore_() =>
00217 lc = nextPC;
00218 return true;
00219 else
00220 return false;
00221 endmatch
00222 }
00223 bool InstructionPatterns::ret(ADDRESS& lc) {
00224 ADDRESS nextPC;
00225 match lc to
00226 | ret() =>
00227 lc = nextPC;
00228 return true;
00229 else
00230 return false;
00231 endmatch
00232 }
00233 bool InstructionPatterns::retl(ADDRESS& lc) {
00234 ADDRESS nextPC;
00235 match lc to
00236 | retl() =>
00237 lc = nextPC;
00238 return true;
00239 else
00240 return false;
00241 endmatch
00242 }
00243 bool InstructionPatterns::rmode(ADDRESS& lc, int& a, bool a_isVAR) {
00244 match lc to
00245 | rmode(_a) =>
00246 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00247 return true;
00248 else
00249 return false;
00250 endmatch
00251 }
00252 bool InstructionPatterns::sethi(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00253 ADDRESS nextPC;
00254 match lc to
00255 | sethi(_a, _b) =>
00256 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00257 if (!b_isVAR && (int)_b != b) return false; else b = _b;
00258 lc = nextPC;
00259 return true;
00260 else
00261 return false;
00262 endmatch
00263 }
00264 Logue* InstructionPatterns::std_call(CSR& csr, ADDRESS& lc, int& addr)
00265 {
00266 ADDRESS __save = lc;
00267 if (
00268 call__(lc, addr, VAR)) {
00269 vector<int> params(1); params = addr;
00270 if (__save == lc) return NULL;
00271 return csr.instantiateLogue("std_call",params);
00272 } else {
00273 lc = __save;
00274 return NULL;
00275 }
00276 }
00277 Logue* InstructionPatterns::struct_call(CSR& csr, ADDRESS& lc, int& addr, int& imm22)
00278 {
00279 ADDRESS __save = lc;
00280 if (
00281 call__(lc, addr, VAR) &&
00282 (lc += 4, true) &&
00283 UNIMP(lc, imm22, VAR)) {
00284 vector<int> params(2); params = addr; params = imm22;
00285 if (__save == lc) return NULL;
00286 return csr.instantiateLogue("struct_call",params);
00287 } else {
00288 lc = __save;
00289 return NULL;
00290 }
00291 }
00292 Logue* InstructionPatterns::call_rst_ui_reg(CSR& csr, ADDRESS& lc, int& addr, int& imm22, int& rs1, int& rs2, int& rd)
00293 {
00294 ADDRESS __save = lc;
00295 if (
00296 call__(lc, addr, VAR) &&
00297 RESTORE$rmode(lc, rs1, VAR, rs2, VAR, rd, VAR) &&
00298 UNIMP(lc, imm22, VAR)) {
00299 vector<int> params(5); params = addr; params = imm22; params = rs1; params = rs2; params = rd;
00300 if (__save == lc) return NULL;
00301 return csr.instantiateLogue("call_rst_ui_reg",params);
00302 } else {
00303 lc = __save;
00304 return NULL;
00305 }
00306 }
00307 Logue* InstructionPatterns::call_rst_ui_imm(CSR& csr, ADDRESS& lc, int& addr, int& imm22, int& rs1, int& imm, int& rd)
00308 {
00309 ADDRESS __save = lc;
00310 if (
00311 call__(lc, addr, VAR) &&
00312 RESTORE$imode(lc, rs1, VAR, imm, VAR, rd, VAR) &&
00313 UNIMP(lc, imm22, VAR)) {
00314 vector<int> params(5); params = addr; params = imm22; params = rs1; params = imm; params = rd;
00315 if (__save == lc) return NULL;
00316 return csr.instantiateLogue("call_rst_ui_imm",params);
00317 } else {
00318 lc = __save;
00319 return NULL;
00320 }
00321 }
00322 Logue* InstructionPatterns::call_restore_reg(CSR& csr, ADDRESS& lc, int& addr, int& rs1, int& rs2, int& rd)
00323 {
00324 ADDRESS __save = lc;
00325 if (
00326 call__(lc, addr, VAR) &&
00327 RESTORE$rmode(lc, rs1, VAR, rs2, VAR, rd, VAR)) {
00328 vector<int> params(4); params = addr; params = rs1; params = rs2; params = rd;
00329 if (__save == lc) return NULL;
00330 return csr.instantiateLogue("call_restore_reg",params);
00331 } else {
00332 lc = __save;
00333 return NULL;
00334 }
00335 }
00336 Logue* InstructionPatterns::call_restore_imm(CSR& csr, ADDRESS& lc, int& addr, int& rs1, int& imm, int& rd)
00337 {
00338 ADDRESS __save = lc;
00339 if (
00340 call__(lc, addr, VAR) &&
00341 RESTORE$imode(lc, rs1, VAR, imm, VAR, rd, VAR)) {
00342 vector<int> params(4); params = addr; params = rs1; params = imm; params = rd;
00343 if (__save == lc) return NULL;
00344 return csr.instantiateLogue("call_restore_imm",params);
00345 } else {
00346 lc = __save;
00347 return NULL;
00348 }
00349 }
00350 Logue* InstructionPatterns::move_call_move(CSR& csr, ADDRESS& lc, int& addr, int& rd)
00351 {
00352 ADDRESS __save = lc;
00353 if (
00354 mov_(lc, o7, VAL, rd, VAR) &&
00355 call__(lc, addr, VAR) &&
00356 mov_(lc, rd, VAR, o7, VAL)) {
00357 vector<int> params(2); params = addr; params = rd;
00358 if (__save == lc) return NULL;
00359 return csr.instantiateLogue("move_call_move",params);
00360 } else {
00361 lc = __save;
00362 return NULL;
00363 }
00364 }
00365 Logue* InstructionPatterns::move_x_call_move(CSR& csr, ADDRESS& lc, int& addr, int& rd)
00366 {
00367 ADDRESS __save = lc;
00368 if (
00369 mov_(lc, o7, VAL, rd, VAR) &&
00370 (lc += 4, true) &&
00371 call__(lc, addr, VAR) &&
00372 mov_(lc, rd, VAR, o7, VAL)) {
00373 vector<int> params(2); params = addr; params = rd;
00374 if (__save == lc) return NULL;
00375 return csr.instantiateLogue("move_x_call_move",params);
00376 } else {
00377 lc = __save;
00378 return NULL;
00379 }
00380 }
00381 Logue* InstructionPatterns::call_add(CSR& csr, ADDRESS& lc, int& addr, int& imm)
00382 {
00383 ADDRESS __save = lc;
00384 if (
00385 call__(lc, addr, VAR) &&
00386 ADD$imode(lc, o7, VAL, imm, VAR, o7, VAL)) {
00387 vector<int> params(2); params = addr; params = imm;
00388 if (__save == lc) return NULL;
00389 return csr.instantiateLogue("call_add",params);
00390 } else {
00391 lc = __save;
00392 return NULL;
00393 }
00394 }
00395 Logue* InstructionPatterns::jmp_restore_reg(CSR& csr, ADDRESS& lc, int& rs1j, int& rdj, int& rs1, int& rs2, int& rd)
00396 {
00397 ADDRESS __save = lc;
00398 if (
00399 JMPL$indirectA(lc, rs1j, VAR, rdj, VAR) &&
00400 RESTORE$rmode(lc, rs1, VAR, rs2, VAR, rd, VAR)) {
00401 vector<int> params(5); params = rs1j; params = rdj; params = rs1; params = rs2; params = rd;
00402 if (__save == lc) return NULL;
00403 return csr.instantiateLogue("jmp_restore_reg",params);
00404 } else {
00405 lc = __save;
00406 return NULL;
00407 }
00408 }
00409 Logue* InstructionPatterns::jmp_restore_imm(CSR& csr, ADDRESS& lc, int& rs1j, int& rdj, int& rs1, int& imm, int& rd)
00410 {
00411 ADDRESS __save = lc;
00412 if (
00413 JMPL$indirectA(lc, rs1j, VAR, rdj, VAR) &&
00414 RESTORE$imode(lc, rs1, VAR, imm, VAR, rd, VAR)) {
00415 vector<int> params(5); params = rs1j; params = rdj; params = rs1; params = imm; params = rd;
00416 if (__save == lc) return NULL;
00417 return csr.instantiateLogue("jmp_restore_imm",params);
00418 } else {
00419 lc = __save;
00420 return NULL;
00421 }
00422 }
00423 Logue* InstructionPatterns::new_reg_win(CSR& csr, ADDRESS& lc, int& locals)
00424 {
00425 ADDRESS __save = lc;
00426 if (
00427 SAVE$imode(lc, SP, VAL, locals, VAR, SP, VAL)) {
00428 vector<int> params(1); params = locals;
00429 if (__save == lc) return NULL;
00430 return csr.instantiateLogue("new_reg_win",params);
00431 } else {
00432 lc = __save;
00433 return NULL;
00434 }
00435 }
00436 Logue* InstructionPatterns::same_reg_win(CSR& csr, ADDRESS& lc, int& locals)
00437 {
00438 ADDRESS __save = lc;
00439 if (
00440 ADD$imode(lc, SP, VAL, locals, VAR, SP, VAL)) {
00441 vector<int> params(1); params = locals;
00442 if (__save == lc) return NULL;
00443 return csr.instantiateLogue("same_reg_win",params);
00444 } else {
00445 lc = __save;
00446 return NULL;
00447 }
00448 }
00449 Logue* InstructionPatterns::new_reg_win_large(CSR& csr, ADDRESS& lc, int& hiVal, int& loVal, int& reg)
00450 {
00451 ADDRESS __save = lc;
00452 if (
00453 sethi(lc, hiVal, VAR, reg, VAR) &&
00454 (ADD$imode(lc, reg, VAR, loVal, VAR, reg, VAR) ||
00455 OR$imode(lc, reg, VAR, loVal, VAR, reg, VAR)) &&
00456 SAVE$rmode(lc, SP, VAL, reg, VAR, SP, VAL)) {
00457 vector<int> params(3); params = hiVal; params = loVal; params = reg;
00458 if (__save == lc) return NULL;
00459 return csr.instantiateLogue("new_reg_win_large",params);
00460 } else {
00461 lc = __save;
00462 return NULL;
00463 }
00464 }
00465 Logue* InstructionPatterns::same_reg_win_large(CSR& csr, ADDRESS& lc, int& hiVal, int& loVal, int& reg)
00466 {
00467 ADDRESS __save = lc;
00468 if (
00469 sethi(lc, hiVal, VAR, reg, VAR) &&
00470 (ADD$imode(lc, reg, VAR, loVal, VAR, reg, VAR) ||
00471 OR$imode(lc, reg, VAR, loVal, VAR, reg, VAR)) &&
00472 ADD$rmode(lc, SP, VAL, reg, VAR, SP, VAL)) {
00473 vector<int> params(3); params = hiVal; params = loVal; params = reg;
00474 if (__save == lc) return NULL;
00475 return csr.instantiateLogue("same_reg_win_large",params);
00476 } else {
00477 lc = __save;
00478 return NULL;
00479 }
00480 }
00481 Logue* InstructionPatterns::none(CSR& csr, ADDRESS& lc)
00482 {
00483 ADDRESS __save = lc;
00484 if (
00485 (lc += 0, true)) {
00486 vector<int> params(0);
00487 if (__save == lc) return NULL;
00488 return csr.instantiateLogue("none",params);
00489 } else {
00490 lc = __save;
00491 return NULL;
00492 }
00493 }
00494 Logue* InstructionPatterns::std_ret(CSR& csr, ADDRESS& lc)
00495 {
00496 ADDRESS __save = lc;
00497 int __loc0;
00498 if (
00499 (ret(lc) ||
00500 JMPL$dispA(lc, i7, VAL, __loc0 = 12, VAL, g0, VAL)) &&
00501 restore_(lc)) {
00502 vector<int> params(0);
00503 if (__save == lc) return NULL;
00504 return csr.instantiateLogue("std_ret",params);
00505 } else {
00506 lc = __save;
00507 return NULL;
00508 }
00509 }
00510 Logue* InstructionPatterns::ret_reg_val(CSR& csr, ADDRESS& lc, int& rs1, int& rs2)
00511 {
00512 ADDRESS __save = lc;
00513 int __loc0;
00514 if (
00515 (ret(lc) ||
00516 JMPL$dispA(lc, i7, VAL, __loc0 = 12, VAL, g0, VAL)) &&
00517 RESTORE$rmode(lc, rs1, VAR, rs2, VAR, o0, VAL)) {
00518 vector<int> params(2); params = rs1; params = rs2;
00519 if (__save == lc) return NULL;
00520 return csr.instantiateLogue("ret_reg_val",params);
00521 } else {
00522 lc = __save;
00523 return NULL;
00524 }
00525 }
00526 Logue* InstructionPatterns::ret_imm_val(CSR& csr, ADDRESS& lc, int& rs1, int& imm)
00527 {
00528 ADDRESS __save = lc;
00529 int __loc0;
00530 if (
00531 (ret(lc) ||
00532 JMPL$dispA(lc, i7, VAL, __loc0 = 12, VAL, g0, VAL)) &&
00533 RESTORE$imode(lc, rs1, VAR, imm, VAR, o0, VAL)) {
00534 vector<int> params(2); params = rs1; params = imm;
00535 if (__save == lc) return NULL;
00536 return csr.instantiateLogue("ret_imm_val",params);
00537 } else {
00538 lc = __save;
00539 return NULL;
00540 }
00541 }
00542 Logue* InstructionPatterns::leaf_ret(CSR& csr, ADDRESS& lc)
00543 {
00544 ADDRESS __save = lc;
00545 int __loc0;
00546 if (
00547 (retl(lc) ||
00548 JMPL$dispA(lc, o7, VAL, __loc0 = 12, VAL, g0, VAL)) &&
00549 ((SUB$imode(lc, SP, VAL, __loc0, VAR, SP, VAL)) || true)) {
00550 vector<int> params(0);
00551 if (__save == lc) return NULL;
00552 return csr.instantiateLogue("leaf_ret",params);
00553 } else {
00554 lc = __save;
00555 return NULL;
00556 }
00557 }
00558 Logue* InstructionPatterns::ret_struct4(CSR& csr, ADDRESS& lc)
00559 {
00560 ADDRESS __save = lc;
00561 if (
00562 false) {
00563 vector<int> params(0);
00564 if (__save == lc) return NULL;
00565 return csr.instantiateLogue("ret_struct4",params);
00566 } else {
00567 lc = __save;
00568 return NULL;
00569 }
00570 }
00571 LogueDict::LogueDict()
00572 {
00573 {
00574 list<string> params;
00575 params.push_back("addr");
00576 theSemTable.addItem("addr");
00577 this->newLogue("std_call","CALLER_PROLOGUE",params);
00578 }
00579 {
00580 list<string> params;
00581 params.push_back("addr");
00582 theSemTable.addItem("addr");
00583 params.push_back("imm22");
00584 theSemTable.addItem("imm22");
00585 this->newLogue("struct_call","CALLER_PROLOGUE",params);
00586 }
00587 {
00588 list<string> params;
00589 params.push_back("addr");
00590 theSemTable.addItem("addr");
00591 params.push_back("imm22");
00592 theSemTable.addItem("imm22");
00593 params.push_back("rs1");
00594 theSemTable.addItem("rs1");
00595 params.push_back("rs2");
00596 theSemTable.addItem("rs2");
00597 params.push_back("rd");
00598 theSemTable.addItem("rd");
00599 this->newLogue("call_rst_ui_reg","CALLER_PROLOGUE",params);
00600 }
00601 {
00602 list<string> params;
00603 params.push_back("addr");
00604 theSemTable.addItem("addr");
00605 params.push_back("imm22");
00606 theSemTable.addItem("imm22");
00607 params.push_back("rs1");
00608 theSemTable.addItem("rs1");
00609 params.push_back("imm");
00610 theSemTable.addItem("imm");
00611 params.push_back("rd");
00612 theSemTable.addItem("rd");
00613 this->newLogue("call_rst_ui_imm","CALLER_PROLOGUE",params);
00614 }
00615 {
00616 list<string> params;
00617 params.push_back("addr");
00618 theSemTable.addItem("addr");
00619 params.push_back("rs1");
00620 theSemTable.addItem("rs1");
00621 params.push_back("rs2");
00622 theSemTable.addItem("rs2");
00623 params.push_back("rd");
00624 theSemTable.addItem("rd");
00625 this->newLogue("call_restore_reg","CALLER_PROLOGUE",params);
00626 }
00627 {
00628 list<string> params;
00629 params.push_back("addr");
00630 theSemTable.addItem("addr");
00631 params.push_back("rs1");
00632 theSemTable.addItem("rs1");
00633 params.push_back("imm");
00634 theSemTable.addItem("imm");
00635 params.push_back("rd");
00636 theSemTable.addItem("rd");
00637 this->newLogue("call_restore_imm","CALLER_PROLOGUE",params);
00638 }
00639 {
00640 list<string> params;
00641 params.push_back("addr");
00642 theSemTable.addItem("addr");
00643 params.push_back("rd");
00644 theSemTable.addItem("rd");
00645 this->newLogue("move_call_move","CALLER_PROLOGUE",params);
00646 }
00647 {
00648 list<string> params;
00649 params.push_back("addr");
00650 theSemTable.addItem("addr");
00651 params.push_back("rd");
00652 theSemTable.addItem("rd");
00653 this->newLogue("move_x_call_move","CALLER_PROLOGUE",params);
00654 }
00655 {
00656 list<string> params;
00657 params.push_back("addr");
00658 theSemTable.addItem("addr");
00659 params.push_back("imm");
00660 theSemTable.addItem("imm");
00661 this->newLogue("call_add","CALLER_PROLOGUE",params);
00662 }
00663 {
00664 list<string> params;
00665 params.push_back("rs1j");
00666 theSemTable.addItem("rs1j");
00667 params.push_back("rdj");
00668 theSemTable.addItem("rdj");
00669 params.push_back("rs1");
00670 theSemTable.addItem("rs1");
00671 params.push_back("rs2");
00672 theSemTable.addItem("rs2");
00673 params.push_back("rd");
00674 theSemTable.addItem("rd");
00675 this->newLogue("jmp_restore_reg","CALLER_PROLOGUE",params);
00676 }
00677 {
00678 list<string> params;
00679 params.push_back("rs1j");
00680 theSemTable.addItem("rs1j");
00681 params.push_back("rdj");
00682 theSemTable.addItem("rdj");
00683 params.push_back("rs1");
00684 theSemTable.addItem("rs1");
00685 params.push_back("imm");
00686 theSemTable.addItem("imm");
00687 params.push_back("rd");
00688 theSemTable.addItem("rd");
00689 this->newLogue("jmp_restore_imm","CALLER_PROLOGUE",params);
00690 }
00691 {
00692 list<string> params;
00693 params.push_back("locals");
00694 theSemTable.addItem("locals");
00695 this->newLogue("new_reg_win","CALLEE_PROLOGUE",params);
00696 }
00697 {
00698 list<string> params;
00699 params.push_back("locals");
00700 theSemTable.addItem("locals");
00701 this->newLogue("same_reg_win","CALLEE_PROLOGUE",params);
00702 }
00703 {
00704 list<string> params;
00705 params.push_back("hiVal");
00706 theSemTable.addItem("hiVal");
00707 params.push_back("loVal");
00708 theSemTable.addItem("loVal");
00709 params.push_back("reg");
00710 theSemTable.addItem("reg");
00711 this->newLogue("new_reg_win_large","CALLEE_PROLOGUE",params);
00712 }
00713 {
00714 list<string> params;
00715 params.push_back("hiVal");
00716 theSemTable.addItem("hiVal");
00717 params.push_back("loVal");
00718 theSemTable.addItem("loVal");
00719 params.push_back("reg");
00720 theSemTable.addItem("reg");
00721 this->newLogue("same_reg_win_large","CALLEE_PROLOGUE",params);
00722 }
00723 {
00724 list<string> params;
00725 this->newLogue("none","CALLEE_PROLOGUE",params);
00726 }
00727 {
00728 list<string> params;
00729 this->newLogue("std_ret","CALLEE_EPILOGUE",params);
00730 }
00731 {
00732 list<string> params;
00733 params.push_back("rs1");
00734 theSemTable.addItem("rs1");
00735 params.push_back("rs2");
00736 theSemTable.addItem("rs2");
00737 this->newLogue("ret_reg_val","CALLEE_EPILOGUE",params);
00738 }
00739 {
00740 list<string> params;
00741 params.push_back("rs1");
00742 theSemTable.addItem("rs1");
00743 params.push_back("imm");
00744 theSemTable.addItem("imm");
00745 this->newLogue("ret_imm_val","CALLEE_EPILOGUE",params);
00746 }
00747 {
00748 list<string> params;
00749 this->newLogue("leaf_ret","CALLEE_EPILOGUE",params);
00750 }
00751 {
00752 list<string> params;
00753 this->newLogue("ret_struct4","CALLEE_EPILOGUE",params);
00754 }
00755 }