00001 #define sign_extend(N,SIZE) (((int)((N) << (sizeof(unsigned)*8-(SIZE)))) >> (sizeof(unsigned)*8-(SIZE)))
00002 #include <assert.h>
00003
00004 #line 2 "machine/mc68k/mc68k.pat.m"
00005
00006
00007
00008
00009
00010 #include "global.h"
00011 #include "decoder.h"
00012 #include "mc68k.pat.h"
00013 #include "ss.h"
00014 #include "csr.h"
00015
00016 #define VAR true
00017 #define VAL false
00018 int InstructionPatterns::SP = 7;
00019 int InstructionPatterns::FP = 6;
00020 bool InstructionPatterns::Aline(ADDRESS& lc, int& a, bool a_isVAR) {
00021 ADDRESS nextPC;
00022
00023
00024 #line 20 "machine/mc68k/mc68k.pat.m"
00025 {
00026 dword MATCH_p =
00027
00028 #line 20 "machine/mc68k/mc68k.pat.m"
00029 lc
00030 ;
00031 unsigned MATCH_w_16_0;
00032 {
00033 MATCH_w_16_0 = getWord(MATCH_p);
00034 if ((MATCH_w_16_0 >> 12 & 0xf) == 10) {
00035 unsigned _a = (MATCH_w_16_0 & 0xfff) ;
00036 nextPC = 2 + MATCH_p;
00037
00038 #line 22 "machine/mc68k/mc68k.pat.m"
00039
00040
00041 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00042
00043 lc = nextPC;
00044
00045 return true;
00046
00047
00048
00049
00050 }
00051 else {
00052 nextPC = MATCH_p;
00053
00054 #line 25 "machine/mc68k/mc68k.pat.m"
00055
00056 return false;
00057
00058
00059
00060
00061 }
00062
00063 }goto MATCH_finished_r;
00064
00065 MATCH_finished_r: (void)0;
00066
00067 }
00068
00069 #line 29 "machine/mc68k/mc68k.pat.m"
00070 }
00071 bool InstructionPatterns::addaw_d16(ADDRESS& lc, int& a, bool a_isVAR) {
00072 ADDRESS nextPC;
00073
00074
00075 #line 31 "machine/mc68k/mc68k.pat.m"
00076 {
00077 dword MATCH_p =
00078
00079 #line 31 "machine/mc68k/mc68k.pat.m"
00080 lc
00081 ;
00082 unsigned MATCH_w_16_0;
00083 unsigned MATCH_w_16_16;
00084 {
00085 MATCH_w_16_0 = getWord(MATCH_p);
00086 if (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00087 (MATCH_w_16_0 >> 12 & 0xf) < 13 ||
00088 14 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00089 (MATCH_w_16_0 >> 12 & 0xf) < 16 ||
00090 (MATCH_w_16_0 >> 12 & 0xf) == 13 &&
00091 (0 <= (MATCH_w_16_0 & 0x7) &&
00092 (MATCH_w_16_0 & 0x7) < 4 || 5 <= (MATCH_w_16_0 & 0x7)
00093 && (MATCH_w_16_0 & 0x7) < 8) ||
00094 (MATCH_w_16_0 >> 12 & 0xf) == 13 &&
00095 (MATCH_w_16_0 & 0x7) == 4 &&
00096 (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00097 (MATCH_w_16_0 >> 3 & 0x7) < 7) ||
00098 (MATCH_w_16_0 >> 12 & 0xf) == 13 &&
00099 (MATCH_w_16_0 & 0x7) == 4 &&
00100 (MATCH_w_16_0 >> 3 & 0x7) == 7 &&
00101 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00102 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
00103 (MATCH_w_16_0 >> 12 & 0xf) == 13 &&
00104 (MATCH_w_16_0 & 0x7) == 4 && (MATCH_w_16_0 >> 3 & 0x7)
00105 == 7 && (MATCH_w_16_0 >> 9 & 0x7)
00106 == 7 && (MATCH_w_16_0 >> 8 & 0x1)
00107 == 0 && (0 <= (MATCH_w_16_0 >> 6 & 0x3)
00108 && (MATCH_w_16_0 >> 6 & 0x3) < 3) ||
00109 (MATCH_w_16_0 >> 12 & 0xf) == 13 &&
00110 (MATCH_w_16_0 & 0x7) == 4 &&
00111 (MATCH_w_16_0 >> 3 & 0x7) == 7 &&
00112 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
00113 (MATCH_w_16_0 >> 8 & 0x1) == 1)
00114 goto MATCH_label_q0;
00115 else {
00116 MATCH_w_16_16 = getWord(2 + MATCH_p);
00117 {
00118 int _a =
00119 sign_extend((MATCH_w_16_16 & 0xffff) , 16);
00120 nextPC = 4 + MATCH_p;
00121
00122 #line 33 "machine/mc68k/mc68k.pat.m"
00123
00124
00125 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00126
00127 lc = nextPC;
00128
00129 return true;
00130
00131
00132
00133
00134 }
00135
00136 }
00137
00138 }goto MATCH_finished_q;
00139
00140 MATCH_label_q0: (void)0;
00141 {
00142 nextPC = MATCH_p;
00143
00144 #line 36 "machine/mc68k/mc68k.pat.m"
00145
00146 return false;
00147
00148
00149
00150
00151 }
00152 goto MATCH_finished_q;
00153
00154 MATCH_finished_q: (void)0;
00155
00156 }
00157
00158 #line 40 "machine/mc68k/mc68k.pat.m"
00159 }
00160 bool InstructionPatterns::addil$daIndirect(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00161 ADDRESS nextPC;
00162
00163
00164 #line 42 "machine/mc68k/mc68k.pat.m"
00165 {
00166 dword MATCH_p =
00167
00168 #line 42 "machine/mc68k/mc68k.pat.m"
00169 lc
00170 ;
00171 unsigned MATCH_w_16_0;
00172 unsigned MATCH_w_16_16;
00173 unsigned MATCH_w_16_32;
00174 {
00175 MATCH_w_16_0 = getWord(MATCH_p);
00176 if (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00177 (MATCH_w_16_0 >> 9 & 0x7) < 3 ||
00178 4 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00179 (MATCH_w_16_0 >> 9 & 0x7) < 8 ||
00180 (MATCH_w_16_0 >> 9 & 0x7) == 3 &&
00181 (0 <= (MATCH_w_16_0 >> 6 & 0x3) &&
00182 (MATCH_w_16_0 >> 6 & 0x3) < 2 ||
00183 (MATCH_w_16_0 >> 6 & 0x3) == 3) ||
00184 (MATCH_w_16_0 >> 9 & 0x7) == 3 &&
00185 (MATCH_w_16_0 >> 6 & 0x3) == 2 &&
00186 ((MATCH_w_16_0 >> 3 & 0x7) == 0 ||
00187 2 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00188 (MATCH_w_16_0 >> 3 & 0x7) < 5) &&
00189 (MATCH_w_16_0 >> 12 & 0xf) == 0 &&
00190 (MATCH_w_16_0 >> 8 & 0x1) == 1 ||
00191 (MATCH_w_16_0 >> 9 & 0x7) == 3 &&
00192 (MATCH_w_16_0 >> 6 & 0x3) == 2 &&
00193 ((MATCH_w_16_0 >> 3 & 0x7) == 0 ||
00194 2 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00195 (MATCH_w_16_0 >> 3 & 0x7) < 5) &&
00196 (1 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00197 (MATCH_w_16_0 >> 12 & 0xf) < 16) ||
00198 (MATCH_w_16_0 >> 9 & 0x7) == 3 &&
00199 (MATCH_w_16_0 >> 6 & 0x3) == 2 &&
00200 ((MATCH_w_16_0 >> 3 & 0x7) == 1 ||
00201 5 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00202 (MATCH_w_16_0 >> 3 & 0x7) < 8))
00203 goto MATCH_label_p0;
00204 else {
00205 MATCH_w_16_16 = getWord(2 + MATCH_p);
00206 MATCH_w_16_32 = getWord(4 + MATCH_p);
00207 {
00208 unsigned _a =
00209 ((MATCH_w_16_16 & 0xffff) << 16) +
00210 (MATCH_w_16_32 & 0xffff) ;
00211 unsigned _b = addressToPC(MATCH_p);
00212 nextPC = 6 + MATCH_p;
00213
00214 #line 44 "machine/mc68k/mc68k.pat.m"
00215
00216
00217 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00218
00219 if (!daIndirect(_b, b, b_isVAR)) return false;
00220
00221 lc = nextPC;
00222
00223 return true;
00224
00225
00226
00227
00228 }
00229
00230 }
00231
00232 }goto MATCH_finished_p;
00233
00234 MATCH_label_p0: (void)0;
00235 {
00236 nextPC = MATCH_p;
00237
00238 #line 48 "machine/mc68k/mc68k.pat.m"
00239
00240 return false;
00241
00242
00243
00244
00245 }
00246 goto MATCH_finished_p;
00247
00248 MATCH_finished_p: (void)0;
00249
00250 }
00251
00252 #line 52 "machine/mc68k/mc68k.pat.m"
00253 }
00254 bool InstructionPatterns::bsr(ADDRESS& lc, int& a, bool a_isVAR) {
00255 ADDRESS nextPC;
00256
00257
00258 #line 54 "machine/mc68k/mc68k.pat.m"
00259 {
00260 dword MATCH_p =
00261
00262 #line 54 "machine/mc68k/mc68k.pat.m"
00263 lc
00264 ;
00265 unsigned MATCH_w_16_0;
00266 {
00267 MATCH_w_16_0 = getWord(MATCH_p);
00268 if ((MATCH_w_16_0 >> 8 & 0xf) == 1 &&
00269 (MATCH_w_16_0 >> 12 & 0xf) == 6) {
00270 unsigned _a = addressToPC(MATCH_p);
00271 nextPC = 2 + MATCH_p;
00272
00273 #line 56 "machine/mc68k/mc68k.pat.m"
00274
00275
00276 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00277
00278 lc = nextPC;
00279
00280 return true;
00281
00282
00283
00284
00285 }
00286 else
00287 goto MATCH_label_o0;
00288
00289 }goto MATCH_finished_o;
00290
00291 MATCH_label_o0: (void)0;
00292 {
00293 nextPC = MATCH_p;
00294
00295 #line 59 "machine/mc68k/mc68k.pat.m"
00296
00297 return false;
00298
00299
00300
00301
00302 }
00303 goto MATCH_finished_o;
00304
00305 MATCH_finished_o: (void)0;
00306
00307 }
00308
00309 #line 63 "machine/mc68k/mc68k.pat.m"
00310 }
00311 bool InstructionPatterns::call_(ADDRESS& lc, int& a, bool a_isVAR) {
00312 ADDRESS nextPC;
00313
00314
00315 #line 65 "machine/mc68k/mc68k.pat.m"
00316 {
00317 dword MATCH_p =
00318
00319 #line 65 "machine/mc68k/mc68k.pat.m"
00320 lc
00321 ;
00322 unsigned MATCH_w_16_0;
00323 unsigned MATCH_w_16_16;
00324 {
00325 MATCH_w_16_0 = getWord(MATCH_p);
00326 if (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00327 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
00328 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00329 (MATCH_w_16_0 >> 12 & 0xf) < 16 ||
00330 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00331 (0 <= (MATCH_w_16_0 & 0x7) &&
00332 (MATCH_w_16_0 & 0x7) < 2 || 3 <= (MATCH_w_16_0 & 0x7)
00333 && (MATCH_w_16_0 & 0x7) < 8) ||
00334 (MATCH_w_16_0 >> 12 & 0xf) == 4 && (MATCH_w_16_0 & 0x7)
00335 == 2 && (0 <= (MATCH_w_16_0 >> 6 & 0x3)
00336 && (MATCH_w_16_0 >> 6 & 0x3) < 2 ||
00337 (MATCH_w_16_0 >> 6 & 0x3) == 3) ||
00338 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00339 (MATCH_w_16_0 & 0x7) == 2 &&
00340 (MATCH_w_16_0 >> 6 & 0x3) == 2 &&
00341 (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00342 (MATCH_w_16_0 >> 3 & 0x7) < 7) ||
00343 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00344 (MATCH_w_16_0 & 0x7) == 2 &&
00345 (MATCH_w_16_0 >> 6 & 0x3) == 2 &&
00346 (MATCH_w_16_0 >> 3 & 0x7) == 7 &&
00347 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00348 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
00349 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00350 (MATCH_w_16_0 & 0x7) == 2 &&
00351 (MATCH_w_16_0 >> 6 & 0x3) == 2 &&
00352 (MATCH_w_16_0 >> 3 & 0x7) == 7 &&
00353 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
00354 (MATCH_w_16_0 >> 8 & 0x1) == 1)
00355 goto MATCH_label_n0;
00356 else {
00357 MATCH_w_16_16 = getWord(2 + MATCH_p);
00358 {
00359 unsigned _a =
00360 2 + sign_extend((MATCH_w_16_16 & 0xffff) , 16) +
00361 addressToPC(MATCH_p);
00362 nextPC = 4 + MATCH_p;
00363
00364 #line 67 "machine/mc68k/mc68k.pat.m"
00365
00366
00367 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00368
00369 lc = nextPC;
00370
00371 return true;
00372
00373
00374
00375
00376 }
00377
00378 }
00379
00380 }goto MATCH_finished_n;
00381
00382 MATCH_label_n0: (void)0;
00383 {
00384 nextPC = MATCH_p;
00385
00386 #line 70 "machine/mc68k/mc68k.pat.m"
00387
00388 return false;
00389
00390
00391
00392
00393 }
00394 goto MATCH_finished_n;
00395
00396 MATCH_finished_n: (void)0;
00397
00398 }
00399
00400 #line 73 "machine/mc68k/mc68k.pat.m"
00401 }
00402 bool InstructionPatterns::daIndirect(ADDRESS& lc, int& a, bool a_isVAR) {
00403
00404
00405 #line 75 "machine/mc68k/mc68k.pat.m"
00406 {
00407 dword MATCH_p =
00408
00409 #line 75 "machine/mc68k/mc68k.pat.m"
00410 lc
00411 ;
00412 unsigned MATCH_w_16_0;
00413 {
00414 MATCH_w_16_0 = getWord(MATCH_p);
00415 if ((MATCH_w_16_0 >> 3 & 0x7) == 2) {
00416 unsigned _a = (MATCH_w_16_0 & 0x7) ;
00417
00418 #line 77 "machine/mc68k/mc68k.pat.m"
00419
00420
00421 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00422
00423 return true;
00424
00425
00426
00427
00428 }
00429 else
00430
00431 #line 79 "machine/mc68k/mc68k.pat.m"
00432
00433 return false;
00434
00435
00436
00437
00438 }goto MATCH_finished_m;
00439
00440 MATCH_finished_m: (void)0;
00441
00442 }
00443
00444 #line 82 "machine/mc68k/mc68k.pat.m"
00445 }
00446 bool InstructionPatterns::daPostInc(ADDRESS& lc, int& a, bool a_isVAR) {
00447
00448
00449 #line 84 "machine/mc68k/mc68k.pat.m"
00450 {
00451 dword MATCH_p =
00452
00453 #line 84 "machine/mc68k/mc68k.pat.m"
00454 lc
00455 ;
00456 unsigned MATCH_w_16_0;
00457 {
00458 MATCH_w_16_0 = getWord(MATCH_p);
00459 if ((MATCH_w_16_0 >> 3 & 0x7) == 3) {
00460 unsigned _a = (MATCH_w_16_0 & 0x7) ;
00461
00462 #line 86 "machine/mc68k/mc68k.pat.m"
00463
00464
00465 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00466
00467 return true;
00468
00469
00470
00471
00472 }
00473 else
00474
00475 #line 88 "machine/mc68k/mc68k.pat.m"
00476
00477 return false;
00478
00479
00480
00481
00482 }goto MATCH_finished_l;
00483
00484 MATCH_finished_l: (void)0;
00485
00486 }
00487
00488 #line 91 "machine/mc68k/mc68k.pat.m"
00489 }
00490 bool InstructionPatterns::daPreDec(ADDRESS& lc, int& a, bool a_isVAR) {
00491
00492
00493 #line 93 "machine/mc68k/mc68k.pat.m"
00494 {
00495 dword MATCH_p =
00496
00497 #line 93 "machine/mc68k/mc68k.pat.m"
00498 lc
00499 ;
00500 unsigned MATCH_w_16_0;
00501 {
00502 MATCH_w_16_0 = getWord(MATCH_p);
00503 if ((MATCH_w_16_0 >> 3 & 0x7) == 4) {
00504 unsigned _a = (MATCH_w_16_0 & 0x7) ;
00505
00506 #line 95 "machine/mc68k/mc68k.pat.m"
00507
00508
00509 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00510
00511 return true;
00512
00513
00514
00515
00516 }
00517 else
00518
00519 #line 97 "machine/mc68k/mc68k.pat.m"
00520
00521 return false;
00522
00523
00524
00525
00526 }goto MATCH_finished_k;
00527
00528 MATCH_finished_k: (void)0;
00529
00530 }
00531
00532 #line 101 "machine/mc68k/mc68k.pat.m"
00533 }
00534 bool InstructionPatterns::leaSpSp(ADDRESS& lc, int& a, bool a_isVAR) {
00535 ADDRESS nextPC;
00536
00537
00538 #line 103 "machine/mc68k/mc68k.pat.m"
00539 {
00540 dword MATCH_p =
00541
00542 #line 103 "machine/mc68k/mc68k.pat.m"
00543 lc
00544 ;
00545 unsigned MATCH_w_16_0;
00546 unsigned MATCH_w_16_16;
00547 {
00548 MATCH_w_16_0 = getWord(MATCH_p);
00549 if (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00550 (MATCH_w_16_0 >> 3 & 0x7) < 5 ||
00551 6 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00552 (MATCH_w_16_0 >> 3 & 0x7) < 8 ||
00553 (MATCH_w_16_0 >> 3 & 0x7) == 5 &&
00554 (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00555 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
00556 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00557 (MATCH_w_16_0 >> 12 & 0xf) < 16) ||
00558 (MATCH_w_16_0 >> 3 & 0x7) == 5 &&
00559 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00560 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00561 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
00562 (MATCH_w_16_0 >> 3 & 0x7) == 5 &&
00563 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00564 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
00565 (0 <= (MATCH_w_16_0 & 0x7) &&
00566 (MATCH_w_16_0 & 0x7) < 7) ||
00567 (MATCH_w_16_0 >> 3 & 0x7) == 5 &&
00568 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00569 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
00570 (MATCH_w_16_0 & 0x7) == 7 &&
00571 (MATCH_w_16_0 >> 8 & 0x1) == 0 ||
00572 (MATCH_w_16_0 >> 3 & 0x7) == 5 &&
00573 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00574 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
00575 (MATCH_w_16_0 & 0x7) == 7 && (MATCH_w_16_0 >> 8 & 0x1)
00576 == 1 && (0 <= (MATCH_w_16_0 >> 6 & 0x3)
00577 && (MATCH_w_16_0 >> 6 & 0x3) < 3))
00578 goto MATCH_label_j0;
00579 else {
00580 MATCH_w_16_16 = getWord(2 + MATCH_p);
00581 {
00582 int _a =
00583 sign_extend((MATCH_w_16_16 & 0xffff) , 16);
00584 nextPC = 4 + MATCH_p;
00585
00586 #line 105 "machine/mc68k/mc68k.pat.m"
00587
00588
00589 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00590
00591 lc = nextPC;
00592
00593 return true;
00594
00595
00596
00597
00598 }
00599
00600 }
00601
00602 }goto MATCH_finished_j;
00603
00604 MATCH_label_j0: (void)0;
00605 {
00606 nextPC = MATCH_p;
00607
00608 #line 108 "machine/mc68k/mc68k.pat.m"
00609
00610 return false;
00611
00612
00613
00614
00615 }
00616 goto MATCH_finished_j;
00617
00618 MATCH_finished_j: (void)0;
00619
00620 }
00621
00622 #line 112 "machine/mc68k/mc68k.pat.m"
00623 }
00624 bool InstructionPatterns::link(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00625 ADDRESS nextPC;
00626
00627
00628 #line 114 "machine/mc68k/mc68k.pat.m"
00629 {
00630 dword MATCH_p =
00631
00632 #line 114 "machine/mc68k/mc68k.pat.m"
00633 lc
00634 ;
00635 unsigned MATCH_w_16_0;
00636 unsigned MATCH_w_16_16;
00637 {
00638 MATCH_w_16_0 = getWord(MATCH_p);
00639 if (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00640 (MATCH_w_16_0 >> 3 & 0x7) < 2 ||
00641 3 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00642 (MATCH_w_16_0 >> 3 & 0x7) < 8 ||
00643 (MATCH_w_16_0 >> 3 & 0x7) == 2 &&
00644 (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00645 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
00646 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00647 (MATCH_w_16_0 >> 12 & 0xf) < 16) ||
00648 (MATCH_w_16_0 >> 3 & 0x7) == 2 &&
00649 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00650 ((MATCH_w_16_0 >> 6 & 0x3) == 0 ||
00651 2 <= (MATCH_w_16_0 >> 6 & 0x3) &&
00652 (MATCH_w_16_0 >> 6 & 0x3) < 4) ||
00653 (MATCH_w_16_0 >> 3 & 0x7) == 2 &&
00654 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00655 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
00656 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00657 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
00658 (MATCH_w_16_0 >> 3 & 0x7) == 2 &&
00659 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00660 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
00661 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
00662 (MATCH_w_16_0 >> 8 & 0x1) == 1)
00663 goto MATCH_label_i0;
00664 else {
00665 MATCH_w_16_16 = getWord(2 + MATCH_p);
00666 {
00667 unsigned _a = (MATCH_w_16_0 & 0x7) ;
00668 int _b =
00669 sign_extend((MATCH_w_16_16 & 0xffff) , 16);
00670 nextPC = 4 + MATCH_p;
00671
00672 #line 116 "machine/mc68k/mc68k.pat.m"
00673
00674
00675 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00676
00677 if (!b_isVAR && (int)_b != b) return false; else b = _b;
00678
00679 lc = nextPC;
00680
00681 return true;
00682
00683
00684
00685
00686 }
00687
00688 }
00689
00690 }goto MATCH_finished_i;
00691
00692 MATCH_label_i0: (void)0;
00693 {
00694 nextPC = MATCH_p;
00695
00696 #line 120 "machine/mc68k/mc68k.pat.m"
00697
00698 return false;
00699
00700
00701
00702
00703 }
00704 goto MATCH_finished_i;
00705
00706 MATCH_finished_i: (void)0;
00707
00708 }
00709
00710 #line 124 "machine/mc68k/mc68k.pat.m"
00711 }
00712 bool InstructionPatterns::movemrl$daPostInc(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00713 ADDRESS nextPC;
00714
00715
00716 #line 126 "machine/mc68k/mc68k.pat.m"
00717 {
00718 dword MATCH_p =
00719
00720 #line 126 "machine/mc68k/mc68k.pat.m"
00721 lc
00722 ;
00723 unsigned MATCH_w_16_0;
00724 unsigned MATCH_w_16_16;
00725 {
00726 MATCH_w_16_0 = getWord(MATCH_p);
00727 if (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00728 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
00729 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00730 (MATCH_w_16_0 >> 12 & 0xf) < 16 ||
00731 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00732 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00733 (MATCH_w_16_0 >> 9 & 0x7) < 6 ||
00734 (MATCH_w_16_0 >> 9 & 0x7) == 7) ||
00735 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00736 (MATCH_w_16_0 >> 9 & 0x7) == 6 &&
00737 (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00738 (MATCH_w_16_0 >> 3 & 0x7) < 2 ||
00739 4 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00740 (MATCH_w_16_0 >> 3 & 0x7) < 8) ||
00741 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00742 (MATCH_w_16_0 >> 9 & 0x7) == 6 &&
00743 (2 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00744 (MATCH_w_16_0 >> 3 & 0x7) < 4) &&
00745 (MATCH_w_16_0 >> 8 & 0x1) == 0 &&
00746 (0 <= (MATCH_w_16_0 >> 6 & 0x3) &&
00747 (MATCH_w_16_0 >> 6 & 0x3) < 3) ||
00748 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00749 (MATCH_w_16_0 >> 9 & 0x7) == 6 &&
00750 (2 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00751 (MATCH_w_16_0 >> 3 & 0x7) < 4) &&
00752 (MATCH_w_16_0 >> 8 & 0x1) == 1)
00753 goto MATCH_label_h0;
00754 else {
00755 MATCH_w_16_16 = getWord(2 + MATCH_p);
00756 {
00757 unsigned _a = addressToPC(MATCH_p);
00758 unsigned _b = (MATCH_w_16_16 & 0xffff) ;
00759 nextPC = 4 + MATCH_p;
00760
00761 #line 128 "machine/mc68k/mc68k.pat.m"
00762
00763
00764 if (!daPostInc(_a, a, a_isVAR)) return false;
00765
00766 if (!b_isVAR && (int)_b != b) return false; else b = _b;
00767
00768 lc = nextPC;
00769
00770 return true;
00771
00772
00773
00774
00775 }
00776
00777 }
00778
00779 }goto MATCH_finished_h;
00780
00781 MATCH_label_h0: (void)0;
00782 {
00783 nextPC = MATCH_p;
00784
00785 #line 132 "machine/mc68k/mc68k.pat.m"
00786
00787 return false;
00788
00789
00790
00791
00792 }
00793 goto MATCH_finished_h;
00794
00795 MATCH_finished_h: (void)0;
00796
00797 }
00798
00799 #line 136 "machine/mc68k/mc68k.pat.m"
00800 }
00801 bool InstructionPatterns::moverml$daPreDec(ADDRESS& lc, int& a, bool a_isVAR, int& b, bool b_isVAR) {
00802 ADDRESS nextPC;
00803
00804
00805 #line 138 "machine/mc68k/mc68k.pat.m"
00806 {
00807 dword MATCH_p =
00808
00809 #line 138 "machine/mc68k/mc68k.pat.m"
00810 lc
00811 ;
00812 unsigned MATCH_w_16_0;
00813 unsigned MATCH_w_16_16;
00814 {
00815 MATCH_w_16_0 = getWord(MATCH_p);
00816 if (((MATCH_w_16_0 >> 3 & 0x7) == 2 ||
00817 (MATCH_w_16_0 >> 3 & 0x7) == 4) &&
00818 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00819 (MATCH_w_16_0 >> 9 & 0x7) == 4 &&
00820 (MATCH_w_16_0 >> 8 & 0x1) == 0 &&
00821 (MATCH_w_16_0 >> 6 & 0x3) == 3) {
00822 MATCH_w_16_16 = getWord(2 + MATCH_p);
00823 {
00824 unsigned _a = (MATCH_w_16_16 & 0xffff) ;
00825 unsigned _b = addressToPC(MATCH_p);
00826 nextPC = 4 + MATCH_p;
00827
00828 #line 140 "machine/mc68k/mc68k.pat.m"
00829
00830
00831 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00832
00833 if (!daPreDec(_b, b, b_isVAR)) return false;
00834
00835 lc = nextPC;
00836
00837 return true;
00838
00839
00840
00841
00842 }
00843
00844 }
00845 else
00846 goto MATCH_label_g0;
00847
00848 }goto MATCH_finished_g;
00849
00850 MATCH_label_g0: (void)0;
00851 {
00852 nextPC = MATCH_p;
00853
00854 #line 144 "machine/mc68k/mc68k.pat.m"
00855
00856 return false;
00857
00858
00859
00860
00861 }
00862 goto MATCH_finished_g;
00863
00864 MATCH_finished_g: (void)0;
00865
00866 }
00867
00868 #line 148 "machine/mc68k/mc68k.pat.m"
00869 }
00870 bool InstructionPatterns::peaPcDisp(ADDRESS& lc, int& a, bool a_isVAR) {
00871 ADDRESS nextPC;
00872
00873
00874 #line 150 "machine/mc68k/mc68k.pat.m"
00875 {
00876 dword MATCH_p =
00877
00878 #line 150 "machine/mc68k/mc68k.pat.m"
00879 lc
00880 ;
00881 unsigned MATCH_w_16_0;
00882 unsigned MATCH_w_16_16;
00883 {
00884 MATCH_w_16_0 = getWord(MATCH_p);
00885 if (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00886 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
00887 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
00888 (MATCH_w_16_0 >> 12 & 0xf) < 16 ||
00889 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00890 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00891 (MATCH_w_16_0 >> 9 & 0x7) < 4 ||
00892 5 <= (MATCH_w_16_0 >> 9 & 0x7) &&
00893 (MATCH_w_16_0 >> 9 & 0x7) < 8) ||
00894 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00895 (MATCH_w_16_0 >> 9 & 0x7) == 4 &&
00896 (0 <= (MATCH_w_16_0 & 0x7) &&
00897 (MATCH_w_16_0 & 0x7) < 2 || 3 <= (MATCH_w_16_0 & 0x7)
00898 && (MATCH_w_16_0 & 0x7) < 8) ||
00899 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00900 (MATCH_w_16_0 >> 9 & 0x7) == 4 &&
00901 (MATCH_w_16_0 & 0x7) == 2 && ((MATCH_w_16_0 >> 6 & 0x3)
00902 == 0 || 2 <= (MATCH_w_16_0 >> 6 & 0x3)
00903 && (MATCH_w_16_0 >> 6 & 0x3) < 4) ||
00904 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00905 (MATCH_w_16_0 >> 9 & 0x7) == 4 &&
00906 (MATCH_w_16_0 & 0x7) == 2 &&
00907 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
00908 (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
00909 (MATCH_w_16_0 >> 3 & 0x7) < 7) ||
00910 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
00911 (MATCH_w_16_0 >> 9 & 0x7) == 4 &&
00912 (MATCH_w_16_0 & 0x7) == 2 &&
00913 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
00914 (MATCH_w_16_0 >> 3 & 0x7) == 7 &&
00915 (MATCH_w_16_0 >> 8 & 0x1) == 1)
00916 goto MATCH_label_f0;
00917 else {
00918 MATCH_w_16_16 = getWord(2 + MATCH_p);
00919 {
00920 int _a =
00921 sign_extend((MATCH_w_16_16 & 0xffff) , 16);
00922 nextPC = 4 + MATCH_p;
00923
00924 #line 152 "machine/mc68k/mc68k.pat.m"
00925
00926
00927 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00928
00929 lc = nextPC;
00930
00931 return true;
00932
00933
00934
00935
00936 }
00937
00938 }
00939
00940 }goto MATCH_finished_f;
00941
00942 MATCH_label_f0: (void)0;
00943 {
00944 nextPC = MATCH_p;
00945
00946 #line 155 "machine/mc68k/mc68k.pat.m"
00947
00948 return false;
00949
00950
00951
00952
00953 }
00954 goto MATCH_finished_f;
00955
00956 MATCH_finished_f: (void)0;
00957
00958 }
00959
00960 #line 159 "machine/mc68k/mc68k.pat.m"
00961 }
00962 bool InstructionPatterns::popreg(ADDRESS& lc, int& a, bool a_isVAR) {
00963 ADDRESS nextPC;
00964
00965
00966 #line 161 "machine/mc68k/mc68k.pat.m"
00967 {
00968 dword MATCH_p =
00969
00970 #line 161 "machine/mc68k/mc68k.pat.m"
00971 lc
00972 ;
00973 unsigned MATCH_w_16_0;
00974 {
00975 MATCH_w_16_0 = getWord(MATCH_p);
00976 if ((MATCH_w_16_0 >> 3 & 0x7) == 3 &&
00977 (MATCH_w_16_0 >> 12 & 0xf) == 2 &&
00978 (MATCH_w_16_0 >> 6 & 0x7) == 0 &&
00979 (MATCH_w_16_0 & 0x7) == 7) {
00980 unsigned _a = (MATCH_w_16_0 & 0x7) ;
00981 nextPC = 2 + MATCH_p;
00982
00983 #line 163 "machine/mc68k/mc68k.pat.m"
00984
00985
00986 if (!a_isVAR && (int)_a != a) return false; else a = _a;
00987
00988 lc = nextPC;
00989
00990 return true;
00991
00992
00993
00994
00995 }
00996 else
00997 goto MATCH_label_e0;
00998
00999 }goto MATCH_finished_e;
01000
01001 MATCH_label_e0: (void)0;
01002 {
01003 nextPC = MATCH_p;
01004
01005 #line 166 "machine/mc68k/mc68k.pat.m"
01006
01007 return false;
01008
01009
01010
01011
01012 }
01013 goto MATCH_finished_e;
01014
01015 MATCH_finished_e: (void)0;
01016
01017 }
01018
01019 #line 170 "machine/mc68k/mc68k.pat.m"
01020 }
01021 bool InstructionPatterns::pushreg(ADDRESS& lc, int& a, bool a_isVAR) {
01022 ADDRESS nextPC;
01023
01024
01025 #line 172 "machine/mc68k/mc68k.pat.m"
01026 {
01027 dword MATCH_p =
01028
01029 #line 172 "machine/mc68k/mc68k.pat.m"
01030 lc
01031 ;
01032 unsigned MATCH_w_16_0;
01033 {
01034 MATCH_w_16_0 = getWord(MATCH_p);
01035 if ((MATCH_w_16_0 >> 6 & 0x7) == 4 &&
01036 (MATCH_w_16_0 >> 12 & 0xf) == 2 &&
01037 (MATCH_w_16_0 >> 3 & 0x7) == 0 &&
01038 (MATCH_w_16_0 >> 9 & 0x7) == 7) {
01039 unsigned _a = (MATCH_w_16_0 & 0x7) ;
01040 nextPC = 2 + MATCH_p;
01041
01042 #line 174 "machine/mc68k/mc68k.pat.m"
01043
01044
01045 if (!a_isVAR && (int)_a != a) return false; else a = _a;
01046
01047 lc = nextPC;
01048
01049 return true;
01050
01051
01052
01053
01054 }
01055 else
01056 goto MATCH_label_d0;
01057
01058 }goto MATCH_finished_d;
01059
01060 MATCH_label_d0: (void)0;
01061 {
01062 nextPC = MATCH_p;
01063
01064 #line 177 "machine/mc68k/mc68k.pat.m"
01065
01066 return false;
01067
01068
01069
01070
01071 }
01072 goto MATCH_finished_d;
01073
01074 MATCH_finished_d: (void)0;
01075
01076 }
01077
01078 #line 181 "machine/mc68k/mc68k.pat.m"
01079 }
01080 bool InstructionPatterns::rts(ADDRESS& lc) {
01081 ADDRESS nextPC;
01082
01083
01084 #line 183 "machine/mc68k/mc68k.pat.m"
01085 {
01086 dword MATCH_p =
01087
01088 #line 183 "machine/mc68k/mc68k.pat.m"
01089 lc
01090 ;
01091 unsigned MATCH_w_16_0;
01092 {
01093 MATCH_w_16_0 = getWord(MATCH_p);
01094 if (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
01095 (MATCH_w_16_0 >> 3 & 0x7) < 6 ||
01096 (MATCH_w_16_0 >> 3 & 0x7) == 7 ||
01097 (MATCH_w_16_0 >> 3 & 0x7) == 6 &&
01098 (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
01099 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
01100 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
01101 (MATCH_w_16_0 >> 12 & 0xf) < 16) ||
01102 (MATCH_w_16_0 >> 3 & 0x7) == 6 &&
01103 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01104 (0 <= (MATCH_w_16_0 & 0x7) &&
01105 (MATCH_w_16_0 & 0x7) < 5 || 6 <= (MATCH_w_16_0 & 0x7)
01106 && (MATCH_w_16_0 & 0x7) < 8) ||
01107 (MATCH_w_16_0 >> 3 & 0x7) == 6 &&
01108 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01109 (MATCH_w_16_0 & 0x7) == 5 && ((MATCH_w_16_0 >> 6 & 0x3)
01110 == 0 || 2 <= (MATCH_w_16_0 >> 6 & 0x3)
01111 && (MATCH_w_16_0 >> 6 & 0x3) < 4) ||
01112 (MATCH_w_16_0 >> 3 & 0x7) == 6 &&
01113 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01114 (MATCH_w_16_0 & 0x7) == 5 &&
01115 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01116 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
01117 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
01118 (MATCH_w_16_0 >> 3 & 0x7) == 6 &&
01119 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01120 (MATCH_w_16_0 & 0x7) == 5 &&
01121 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01122 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
01123 (MATCH_w_16_0 >> 8 & 0x1) == 1)
01124 goto MATCH_label_c0;
01125 else {
01126 nextPC = 2 + MATCH_p;
01127
01128 #line 185 "machine/mc68k/mc68k.pat.m"
01129
01130
01131 lc = nextPC;
01132
01133 return true;
01134
01135
01136
01137
01138 }
01139
01140 }goto MATCH_finished_c;
01141
01142 MATCH_label_c0: (void)0;
01143 {
01144 nextPC = MATCH_p;
01145
01146 #line 187 "machine/mc68k/mc68k.pat.m"
01147
01148 return false;
01149
01150
01151
01152
01153 }
01154 goto MATCH_finished_c;
01155
01156 MATCH_finished_c: (void)0;
01157
01158 }
01159
01160 #line 191 "machine/mc68k/mc68k.pat.m"
01161 }
01162 bool InstructionPatterns::trap(ADDRESS& lc, int& a, bool a_isVAR) {
01163 ADDRESS nextPC;
01164
01165
01166 #line 193 "machine/mc68k/mc68k.pat.m"
01167 {
01168 dword MATCH_p =
01169
01170 #line 193 "machine/mc68k/mc68k.pat.m"
01171 lc
01172 ;
01173 unsigned MATCH_w_16_0;
01174 {
01175 MATCH_w_16_0 = getWord(MATCH_p);
01176 if (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
01177 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
01178 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
01179 (MATCH_w_16_0 >> 12 & 0xf) < 16 ||
01180 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01181 ((MATCH_w_16_0 >> 6 & 0x3) == 0 ||
01182 2 <= (MATCH_w_16_0 >> 6 & 0x3) &&
01183 (MATCH_w_16_0 >> 6 & 0x3) < 4) ||
01184 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01185 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01186 (MATCH_w_16_0 >> 4 & 0x3) == 0 &&
01187 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
01188 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
01189 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01190 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01191 (MATCH_w_16_0 >> 4 & 0x3) == 0 &&
01192 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
01193 (MATCH_w_16_0 >> 8 & 0x1) == 1 ||
01194 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01195 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01196 (1 <= (MATCH_w_16_0 >> 4 & 0x3) &&
01197 (MATCH_w_16_0 >> 4 & 0x3) < 4))
01198 goto MATCH_label_b0;
01199 else {
01200 unsigned _a = (MATCH_w_16_0 & 0xf) ;
01201 nextPC = 2 + MATCH_p;
01202
01203 #line 195 "machine/mc68k/mc68k.pat.m"
01204
01205
01206 if (!a_isVAR && (int)_a != a) return false; else a = _a;
01207
01208 lc = nextPC;
01209
01210 return true;
01211
01212
01213
01214
01215 }
01216
01217 }goto MATCH_finished_b;
01218
01219 MATCH_label_b0: (void)0;
01220 {
01221 nextPC = MATCH_p;
01222
01223 #line 198 "machine/mc68k/mc68k.pat.m"
01224
01225 return false;
01226
01227
01228
01229
01230 }
01231 goto MATCH_finished_b;
01232
01233 MATCH_finished_b: (void)0;
01234
01235 }
01236
01237 #line 202 "machine/mc68k/mc68k.pat.m"
01238 }
01239 bool InstructionPatterns::unlk(ADDRESS& lc, int& a, bool a_isVAR) {
01240 ADDRESS nextPC;
01241
01242
01243 #line 204 "machine/mc68k/mc68k.pat.m"
01244 {
01245 dword MATCH_p =
01246
01247 #line 204 "machine/mc68k/mc68k.pat.m"
01248 lc
01249 ;
01250 unsigned MATCH_w_16_0;
01251 {
01252 MATCH_w_16_0 = getWord(MATCH_p);
01253 if (0 <= (MATCH_w_16_0 >> 3 & 0x7) &&
01254 (MATCH_w_16_0 >> 3 & 0x7) < 3 ||
01255 4 <= (MATCH_w_16_0 >> 3 & 0x7) &&
01256 (MATCH_w_16_0 >> 3 & 0x7) < 8 ||
01257 (MATCH_w_16_0 >> 3 & 0x7) == 3 &&
01258 (0 <= (MATCH_w_16_0 >> 12 & 0xf) &&
01259 (MATCH_w_16_0 >> 12 & 0xf) < 4 ||
01260 5 <= (MATCH_w_16_0 >> 12 & 0xf) &&
01261 (MATCH_w_16_0 >> 12 & 0xf) < 16) ||
01262 (MATCH_w_16_0 >> 3 & 0x7) == 3 &&
01263 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01264 ((MATCH_w_16_0 >> 6 & 0x3) == 0 ||
01265 2 <= (MATCH_w_16_0 >> 6 & 0x3) &&
01266 (MATCH_w_16_0 >> 6 & 0x3) < 4) ||
01267 (MATCH_w_16_0 >> 3 & 0x7) == 3 &&
01268 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01269 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01270 (0 <= (MATCH_w_16_0 >> 9 & 0x7) &&
01271 (MATCH_w_16_0 >> 9 & 0x7) < 7) ||
01272 (MATCH_w_16_0 >> 3 & 0x7) == 3 &&
01273 (MATCH_w_16_0 >> 12 & 0xf) == 4 &&
01274 (MATCH_w_16_0 >> 6 & 0x3) == 1 &&
01275 (MATCH_w_16_0 >> 9 & 0x7) == 7 &&
01276 (MATCH_w_16_0 >> 8 & 0x1) == 1)
01277 goto MATCH_label_a0;
01278 else {
01279 unsigned _a = (MATCH_w_16_0 & 0x7) ;
01280 nextPC = 2 + MATCH_p;
01281
01282 #line 206 "machine/mc68k/mc68k.pat.m"
01283
01284
01285 if (!a_isVAR && (int)_a != a) return false; else a = _a;
01286
01287 lc = nextPC;
01288
01289 return true;
01290
01291
01292
01293
01294 }
01295
01296 }goto MATCH_finished_a;
01297
01298 MATCH_label_a0: (void)0;
01299 {
01300 nextPC = MATCH_p;
01301
01302 #line 209 "machine/mc68k/mc68k.pat.m"
01303
01304 return false;
01305
01306
01307
01308
01309 }
01310 goto MATCH_finished_a;
01311
01312 MATCH_finished_a: (void)0;
01313
01314 }
01315
01316 #line 213 "machine/mc68k/mc68k.pat.m"
01317 }
01318 Logue* InstructionPatterns::std_call(CSR& csr, ADDRESS& lc, int& addr)
01319 {
01320 ADDRESS __save = lc;
01321 if (
01322 call_(lc, addr, VAR)) {
01323 vector<int> params(1); params[0] = addr;
01324 if (__save == lc) return NULL;
01325 return csr.instantiateLogue("std_call",params);
01326 } else {
01327 lc = __save;
01328 return NULL;
01329 }
01330 }
01331 Logue* InstructionPatterns::near_call(CSR& csr, ADDRESS& lc, int& addr)
01332 {
01333 ADDRESS __save = lc;
01334 if (
01335 bsr(lc, addr, VAR)) {
01336 vector<int> params(1); params[0] = addr;
01337 if (__save == lc) return NULL;
01338 return csr.instantiateLogue("near_call",params);
01339 } else {
01340 lc = __save;
01341 return NULL;
01342 }
01343 }
01344 Logue* InstructionPatterns::pea_add_rts(CSR& csr, ADDRESS& lc, int& d32)
01345 {
01346 ADDRESS __save = lc;
01347 int __loc0;
01348 if (
01349 peaPcDisp(lc, __loc0 = 4, VAL) &&
01350 addil$daIndirect(lc, d32, VAR, SP, VAL) &&
01351 rts(lc)) {
01352 vector<int> params(1); params[0] = d32;
01353 if (__save == lc) return NULL;
01354 return csr.instantiateLogue("pea_add_rts",params);
01355 } else {
01356 lc = __save;
01357 return NULL;
01358 }
01359 }
01360 Logue* InstructionPatterns::pea_pea_add_rts(CSR& csr, ADDRESS& lc, int& d32)
01361 {
01362 ADDRESS __save = lc;
01363 int __loc0;
01364 if (
01365 peaPcDisp(lc, __loc0 = 14, VAL) &&
01366 peaPcDisp(lc, __loc0 = 4, VAL) &&
01367 addil$daIndirect(lc, d32, VAR, SP, VAL) &&
01368 rts(lc)) {
01369 vector<int> params(1); params[0] = d32;
01370 if (__save == lc) return NULL;
01371 return csr.instantiateLogue("pea_pea_add_rts",params);
01372 } else {
01373 lc = __save;
01374 return NULL;
01375 }
01376 }
01377 Logue* InstructionPatterns::trap_syscall(CSR& csr, ADDRESS& lc, int& d16)
01378 {
01379 ADDRESS __save = lc;
01380 int __loc0;
01381 if (
01382 trap(lc, __loc0 = 15, VAL) &&
01383 Aline(lc, d16, VAR)) {
01384 vector<int> params(1); params[0] = d16;
01385 if (__save == lc) return NULL;
01386 return csr.instantiateLogue("trap_syscall",params);
01387 } else {
01388 lc = __save;
01389 return NULL;
01390 }
01391 }
01392 Logue* InstructionPatterns::std_link(CSR& csr, ADDRESS& lc, int& locals)
01393 {
01394 ADDRESS __save = lc;
01395 if (
01396 link(lc, FP, VAL, locals, VAR)) {
01397 vector<int> params(1); params[0] = locals;
01398 if (__save == lc) return NULL;
01399 return csr.instantiateLogue("std_link",params);
01400 } else {
01401 lc = __save;
01402 return NULL;
01403 }
01404 }
01405 Logue* InstructionPatterns::link_save(CSR& csr, ADDRESS& lc, int& locals, int& d16)
01406 {
01407 ADDRESS __save = lc;
01408 if (
01409 link(lc, FP, VAL, locals, VAR) &&
01410 moverml$daPreDec(lc, d16, VAR, SP, VAL)) {
01411 vector<int> params(2); params[0] = locals; params[1] = d16;
01412 if (__save == lc) return NULL;
01413 return csr.instantiateLogue("link_save",params);
01414 } else {
01415 lc = __save;
01416 return NULL;
01417 }
01418 }
01419 Logue* InstructionPatterns::link_save1(CSR& csr, ADDRESS& lc, int& locals, int& reg)
01420 {
01421 ADDRESS __save = lc;
01422 if (
01423 link(lc, FP, VAL, locals, VAR) &&
01424 pushreg(lc, reg, VAR)) {
01425 vector<int> params(2); params[0] = locals; params[1] = reg;
01426 if (__save == lc) return NULL;
01427 return csr.instantiateLogue("link_save1",params);
01428 } else {
01429 lc = __save;
01430 return NULL;
01431 }
01432 }
01433 Logue* InstructionPatterns::push_lea(CSR& csr, ADDRESS& lc, int& locals, int& reg)
01434 {
01435 ADDRESS __save = lc;
01436 if (
01437 pushreg(lc, reg, VAR) &&
01438 leaSpSp(lc, locals, VAR)) {
01439 vector<int> params(2); params[0] = locals; params[1] = reg;
01440 if (__save == lc) return NULL;
01441 return csr.instantiateLogue("push_lea",params);
01442 } else {
01443 lc = __save;
01444 return NULL;
01445 }
01446 }
01447 Logue* InstructionPatterns::bare_ret(CSR& csr, ADDRESS& lc)
01448 {
01449 ADDRESS __save = lc;
01450 if (
01451 rts(lc)) {
01452 vector<int> params(0);
01453 if (__save == lc) return NULL;
01454 return csr.instantiateLogue("bare_ret",params);
01455 } else {
01456 lc = __save;
01457 return NULL;
01458 }
01459 }
01460 Logue* InstructionPatterns::std_ret(CSR& csr, ADDRESS& lc)
01461 {
01462 ADDRESS __save = lc;
01463 if (
01464 unlk(lc, FP, VAL) &&
01465 rts(lc)) {
01466 vector<int> params(0);
01467 if (__save == lc) return NULL;
01468 return csr.instantiateLogue("std_ret",params);
01469 } else {
01470 lc = __save;
01471 return NULL;
01472 }
01473 }
01474 Logue* InstructionPatterns::rest_ret(CSR& csr, ADDRESS& lc, int& d16)
01475 {
01476 ADDRESS __save = lc;
01477 if (
01478 movemrl$daPostInc(lc, SP, VAL, d16, VAR) &&
01479 unlk(lc, FP, VAL) &&
01480 rts(lc)) {
01481 vector<int> params(1); params[0] = d16;
01482 if (__save == lc) return NULL;
01483 return csr.instantiateLogue("rest_ret",params);
01484 } else {
01485 lc = __save;
01486 return NULL;
01487 }
01488 }
01489 Logue* InstructionPatterns::rest1_ret(CSR& csr, ADDRESS& lc, int& reg)
01490 {
01491 ADDRESS __save = lc;
01492 if (
01493 popreg(lc, reg, VAR) &&
01494 unlk(lc, FP, VAL) &&
01495 rts(lc)) {
01496 vector<int> params(1); params[0] = reg;
01497 if (__save == lc) return NULL;
01498 return csr.instantiateLogue("rest1_ret",params);
01499 } else {
01500 lc = __save;
01501 return NULL;
01502 }
01503 }
01504 Logue* InstructionPatterns::pop_ret(CSR& csr, ADDRESS& lc, int& reg)
01505 {
01506 ADDRESS __save = lc;
01507 if (
01508 popreg(lc, reg, VAR) &&
01509 rts(lc)) {
01510 vector<int> params(1); params[0] = reg;
01511 if (__save == lc) return NULL;
01512 return csr.instantiateLogue("pop_ret",params);
01513 } else {
01514 lc = __save;
01515 return NULL;
01516 }
01517 }
01518 Logue* InstructionPatterns::clear_stack(CSR& csr, ADDRESS& lc, int& n)
01519 {
01520 ADDRESS __save = lc;
01521 if (
01522 (leaSpSp(lc, n, VAR) ||
01523 addaw_d16(lc, n, VAR))) {
01524 vector<int> params(1); params[0] = n;
01525 if (__save == lc) return NULL;
01526 return csr.instantiateLogue("clear_stack",params);
01527 } else {
01528 lc = __save;
01529 return NULL;
01530 }
01531 }
01532 LogueDict::LogueDict()
01533 {
01534 {
01535 list<string> params;
01536 params.push_back("addr");
01537 theSemTable.addItem("addr");
01538 this->newLogue("std_call","CALLER_PROLOGUE",params);
01539 }
01540 {
01541 list<string> params;
01542 params.push_back("addr");
01543 theSemTable.addItem("addr");
01544 this->newLogue("near_call","CALLER_PROLOGUE",params);
01545 }
01546 {
01547 list<string> params;
01548 params.push_back("d32");
01549 theSemTable.addItem("d32");
01550 this->newLogue("pea_add_rts","CALLER_PROLOGUE",params);
01551 }
01552 {
01553 list<string> params;
01554 params.push_back("d32");
01555 theSemTable.addItem("d32");
01556 this->newLogue("pea_pea_add_rts","CALLER_PROLOGUE",params);
01557 }
01558 {
01559 list<string> params;
01560 params.push_back("d16");
01561 theSemTable.addItem("d16");
01562 this->newLogue("trap_syscall","CALLER_PROLOGUE",params);
01563 }
01564 {
01565 list<string> params;
01566 params.push_back("locals");
01567 theSemTable.addItem("locals");
01568 this->newLogue("std_link","CALLEE_PROLOGUE",params);
01569 }
01570 {
01571 list<string> params;
01572 params.push_back("locals");
01573 theSemTable.addItem("locals");
01574 params.push_back("d16");
01575 theSemTable.addItem("d16");
01576 this->newLogue("link_save","CALLEE_PROLOGUE",params);
01577 }
01578 {
01579 list<string> params;
01580 params.push_back("locals");
01581 theSemTable.addItem("locals");
01582 params.push_back("reg");
01583 theSemTable.addItem("reg");
01584 this->newLogue("link_save1","CALLEE_PROLOGUE",params);
01585 }
01586 {
01587 list<string> params;
01588 params.push_back("locals");
01589 theSemTable.addItem("locals");
01590 params.push_back("reg");
01591 theSemTable.addItem("reg");
01592 this->newLogue("push_lea","CALLEE_PROLOGUE",params);
01593 }
01594 {
01595 list<string> params;
01596 this->newLogue("bare_ret","CALLEE_PROLOGUE",params);
01597 }
01598 {
01599 list<string> params;
01600 this->newLogue("std_ret","CALLEE_EPILOGUE",params);
01601 }
01602 {
01603 list<string> params;
01604 params.push_back("d16");
01605 theSemTable.addItem("d16");
01606 this->newLogue("rest_ret","CALLEE_EPILOGUE",params);
01607 }
01608 {
01609 list<string> params;
01610 params.push_back("reg");
01611 theSemTable.addItem("reg");
01612 this->newLogue("rest1_ret","CALLEE_EPILOGUE",params);
01613 }
01614 {
01615 list<string> params;
01616 params.push_back("reg");
01617 theSemTable.addItem("reg");
01618 this->newLogue("pop_ret","CALLEE_EPILOGUE",params);
01619 }
01620 {
01621 list<string> params;
01622 params.push_back("n");
01623 theSemTable.addItem("n");
01624 this->newLogue("clear_stack","CALLER_EPILOGUE",params);
01625 }
01626 }
01627
01628