00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "sysdep.h"
00024 #include "opcode/v850.h"
00025 #include <stdio.h>
00026 #include "opintl.h"
00027
00028
00029 #define OP(x) ((x & 0x3f) << 5)
00030 #define OP_MASK OP (0x3f)
00031
00032
00033 #define BOP(x) ((0x0b << 7) | (x & 0x0f))
00034 #define BOP_MASK ((0x0f << 7) | 0x0f)
00035
00036
00037 #define one(x) ((unsigned int) (x))
00038
00039
00040 #define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16))
00041
00042 static long unsigned insert_d9 PARAMS ((long unsigned, long, const char **));
00043 static long unsigned extract_d9 PARAMS ((long unsigned, int *));
00044 static long unsigned insert_d22 PARAMS ((long unsigned, long, const char **));
00045 static long unsigned extract_d22 PARAMS ((long unsigned, int *));
00046 static long unsigned insert_d16_15 PARAMS ((long unsigned, long, const char **));
00047 static long unsigned extract_d16_15 PARAMS ((long unsigned, int *));
00048 static long unsigned insert_d8_7 PARAMS ((long unsigned, long, const char **));
00049 static long unsigned extract_d8_7 PARAMS ((long unsigned, int *));
00050 static long unsigned insert_d8_6 PARAMS ((long unsigned, long, const char **));
00051 static long unsigned extract_d8_6 PARAMS ((long unsigned, int *));
00052 static long unsigned insert_d5_4 PARAMS ((long unsigned, long, const char **));
00053 static long unsigned extract_d5_4 PARAMS ((long unsigned, int *));
00054 static long unsigned insert_d16_16 PARAMS ((long unsigned, long, const char **));
00055 static long unsigned extract_d16_16 PARAMS ((long unsigned, int *));
00056 static long unsigned insert_i9 PARAMS ((long unsigned, long, const char **));
00057 static long unsigned extract_i9 PARAMS ((long unsigned, int *));
00058 static long unsigned insert_u9 PARAMS ((long unsigned, long, const char **));
00059 static long unsigned extract_u9 PARAMS ((long unsigned, int *));
00060 static long unsigned insert_spe PARAMS ((long unsigned, long, const char **));
00061 static long unsigned extract_spe PARAMS ((long unsigned, int *));
00062 static long unsigned insert_i5div PARAMS ((long unsigned, long, const char **));
00063 static long unsigned extract_i5div PARAMS ((long unsigned, int *));
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 static const char * not_valid = N_ ("displacement value is not in range and is not aligned");
00074 static const char * out_of_range = N_ ("displacement value is out of range");
00075 static const char * not_aligned = N_ ("displacement value is not aligned");
00076
00077 static const char * immediate_out_of_range = N_ ("immediate value is out of range");
00078
00079 static unsigned long
00080 insert_d9 (insn, value, errmsg)
00081 unsigned long insn;
00082 long value;
00083 const char ** errmsg;
00084 {
00085 if (value > 0xff || value < -0x100)
00086 {
00087 if ((value % 2) != 0)
00088 * errmsg = _("branch value not in range and to odd offset");
00089 else
00090 * errmsg = _("branch value out of range");
00091 }
00092 else if ((value % 2) != 0)
00093 * errmsg = _("branch to odd offset");
00094
00095 return (insn | ((value & 0x1f0) << 7) | ((value & 0x0e) << 3));
00096 }
00097
00098 static unsigned long
00099 extract_d9 (insn, invalid)
00100 unsigned long insn;
00101 int * invalid ATTRIBUTE_UNUSED;
00102 {
00103 unsigned long ret = ((insn & 0xf800) >> 7) | ((insn & 0x0070) >> 3);
00104
00105 if ((insn & 0x8000) != 0)
00106 ret -= 0x0200;
00107
00108 return ret;
00109 }
00110
00111 static unsigned long
00112 insert_d22 (insn, value, errmsg)
00113 unsigned long insn;
00114 long value;
00115 const char ** errmsg;
00116 {
00117 if (value > 0x1fffff || value < -0x200000)
00118 {
00119 if ((value % 2) != 0)
00120 * errmsg = _("branch value not in range and to an odd offset");
00121 else
00122 * errmsg = _("branch value out of range");
00123 }
00124 else if ((value % 2) != 0)
00125 * errmsg = _("branch to odd offset");
00126
00127 return (insn | ((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16));
00128 }
00129
00130 static unsigned long
00131 extract_d22 (insn, invalid)
00132 unsigned long insn;
00133 int * invalid ATTRIBUTE_UNUSED;
00134 {
00135 signed long ret = ((insn & 0xfffe0000) >> 16) | ((insn & 0x3f) << 16);
00136
00137 return (unsigned long) ((ret << 10) >> 10);
00138 }
00139
00140 static unsigned long
00141 insert_d16_15 (insn, value, errmsg)
00142 unsigned long insn;
00143 long value;
00144 const char ** errmsg;
00145 {
00146 if (value > 0x7fff || value < -0x8000)
00147 {
00148 if ((value % 2) != 0)
00149 * errmsg = _(not_valid);
00150 else
00151 * errmsg = _(out_of_range);
00152 }
00153 else if ((value % 2) != 0)
00154 * errmsg = _(not_aligned);
00155
00156 return insn | ((value & 0xfffe) << 16);
00157 }
00158
00159 static unsigned long
00160 extract_d16_15 (insn, invalid)
00161 unsigned long insn;
00162 int * invalid ATTRIBUTE_UNUSED;
00163 {
00164 signed long ret = (insn & 0xfffe0000);
00165
00166 return ret >> 16;
00167 }
00168
00169 static unsigned long
00170 insert_d8_7 (insn, value, errmsg)
00171 unsigned long insn;
00172 long value;
00173 const char ** errmsg;
00174 {
00175 if (value > 0xff || value < 0)
00176 {
00177 if ((value % 2) != 0)
00178 * errmsg = _(not_valid);
00179 else
00180 * errmsg = _(out_of_range);
00181 }
00182 else if ((value % 2) != 0)
00183 * errmsg = _(not_aligned);
00184
00185 value >>= 1;
00186
00187 return (insn | (value & 0x7f));
00188 }
00189
00190 static unsigned long
00191 extract_d8_7 (insn, invalid)
00192 unsigned long insn;
00193 int * invalid ATTRIBUTE_UNUSED;
00194 {
00195 unsigned long ret = (insn & 0x7f);
00196
00197 return ret << 1;
00198 }
00199
00200 static unsigned long
00201 insert_d8_6 (insn, value, errmsg)
00202 unsigned long insn;
00203 long value;
00204 const char ** errmsg;
00205 {
00206 if (value > 0xff || value < 0)
00207 {
00208 if ((value % 4) != 0)
00209 *errmsg = _(not_valid);
00210 else
00211 * errmsg = _(out_of_range);
00212 }
00213 else if ((value % 4) != 0)
00214 * errmsg = _(not_aligned);
00215
00216 value >>= 1;
00217
00218 return (insn | (value & 0x7e));
00219 }
00220
00221 static unsigned long
00222 extract_d8_6 (insn, invalid)
00223 unsigned long insn;
00224 int * invalid ATTRIBUTE_UNUSED;
00225 {
00226 unsigned long ret = (insn & 0x7e);
00227
00228 return ret << 1;
00229 }
00230
00231 static unsigned long
00232 insert_d5_4 (insn, value, errmsg)
00233 unsigned long insn;
00234 long value;
00235 const char ** errmsg;
00236 {
00237 if (value > 0x1f || value < 0)
00238 {
00239 if (value & 1)
00240 * errmsg = _(not_valid);
00241 else
00242 *errmsg = _(out_of_range);
00243 }
00244 else if (value & 1)
00245 * errmsg = _(not_aligned);
00246
00247 value >>= 1;
00248
00249 return (insn | (value & 0x0f));
00250 }
00251
00252 static unsigned long
00253 extract_d5_4 (insn, invalid)
00254 unsigned long insn;
00255 int * invalid ATTRIBUTE_UNUSED;
00256 {
00257 unsigned long ret = (insn & 0x0f);
00258
00259 return ret << 1;
00260 }
00261
00262 static unsigned long
00263 insert_d16_16 (insn, value, errmsg)
00264 unsigned long insn;
00265 signed long value;
00266 const char ** errmsg;
00267 {
00268 if (value > 0x7fff || value < -0x8000)
00269 * errmsg = _(out_of_range);
00270
00271 return (insn | ((value & 0xfffe) << 16) | ((value & 1) << 5));
00272 }
00273
00274 static unsigned long
00275 extract_d16_16 (insn, invalid)
00276 unsigned long insn;
00277 int * invalid ATTRIBUTE_UNUSED;
00278 {
00279 signed long ret = insn & 0xfffe0000;
00280
00281 ret >>= 16;
00282
00283 ret |= ((insn & 0x20) >> 5);
00284
00285 return ret;
00286 }
00287
00288 static unsigned long
00289 insert_i9 (insn, value, errmsg)
00290 unsigned long insn;
00291 signed long value;
00292 const char ** errmsg;
00293 {
00294 if (value > 0xff || value < -0x100)
00295 * errmsg = _(immediate_out_of_range);
00296
00297 return insn | ((value & 0x1e0) << 13) | (value & 0x1f);
00298 }
00299
00300 static unsigned long
00301 extract_i9 (insn, invalid)
00302 unsigned long insn;
00303 int * invalid ATTRIBUTE_UNUSED;
00304 {
00305 signed long ret = insn & 0x003c0000;
00306
00307 ret <<= 10;
00308 ret >>= 23;
00309
00310 ret |= (insn & 0x1f);
00311
00312 return ret;
00313 }
00314
00315 static unsigned long
00316 insert_u9 (insn, v, errmsg)
00317 unsigned long insn;
00318 long v;
00319 const char ** errmsg;
00320 {
00321 unsigned long value = (unsigned long) v;
00322 if (value > 0x1ff)
00323 * errmsg = _(immediate_out_of_range);
00324
00325 return insn | ((value & 0x1e0) << 13) | (value & 0x1f);
00326 }
00327
00328 static unsigned long
00329 extract_u9 (insn, invalid)
00330 unsigned long insn;
00331 int * invalid ATTRIBUTE_UNUSED;
00332 {
00333 unsigned long ret = insn & 0x003c0000;
00334
00335 ret >>= 13;
00336
00337 ret |= (insn & 0x1f);
00338
00339 return ret;
00340 }
00341
00342 static unsigned long
00343 insert_spe (insn, v, errmsg)
00344 unsigned long insn;
00345 long v;
00346 const char ** errmsg;
00347 {
00348 unsigned long value = (unsigned long) v;
00349
00350 if (value != 3)
00351 * errmsg = _("invalid register for stack adjustment");
00352
00353 return insn & (~ 0x180000);
00354 }
00355
00356 static unsigned long
00357 extract_spe (insn, invalid)
00358 unsigned long insn ATTRIBUTE_UNUSED;
00359 int * invalid ATTRIBUTE_UNUSED;
00360 {
00361 return 3;
00362 }
00363
00364 static unsigned long
00365 insert_i5div (insn, v, errmsg)
00366 unsigned long insn;
00367 long v;
00368 const char ** errmsg;
00369 {
00370 unsigned long value = (unsigned long) v;
00371
00372 if (value > 0x1ff)
00373 {
00374 if (value & 1)
00375 * errmsg = _("immediate value not in range and not even");
00376 else
00377 * errmsg = _(immediate_out_of_range);
00378 }
00379 else if (value & 1)
00380 * errmsg = _("immediate value must be even");
00381
00382 value = 32 - value;
00383
00384 return insn | ((value & 0x1e) << 17);
00385 }
00386
00387 static unsigned long
00388 extract_i5div (insn, invalid)
00389 unsigned long insn;
00390 int * invalid ATTRIBUTE_UNUSED;
00391 {
00392 unsigned long ret = insn & 0x3c0000;
00393
00394 ret >>= 17;
00395
00396 ret = 32 - ret;
00397
00398 return ret;
00399 }
00400
00401
00402
00403
00404
00405 const struct v850_operand v850_operands[] =
00406 {
00407 #define UNUSED 0
00408 { 0, 0, NULL, NULL, 0 },
00409
00410
00411 #define R1 (UNUSED + 1)
00412 { 5, 0, NULL, NULL, V850_OPERAND_REG },
00413
00414
00415 #define R1_NOTR0 (R1 + 1)
00416 { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
00417
00418
00419 #define R2 (R1_NOTR0 + 1)
00420 { 5, 11, NULL, NULL, V850_OPERAND_REG },
00421
00422
00423 #define R2_NOTR0 (R2 + 1)
00424 { 5, 11, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
00425
00426
00427 #define I5 (R2_NOTR0 + 1)
00428 { 5, 0, NULL, NULL, V850_OPERAND_SIGNED },
00429
00430
00431 #define I5U (I5 + 1)
00432 { 5, 0, NULL, NULL, 0 },
00433
00434
00435 #define I16 (I5U + 1)
00436 { 16, 16, NULL, NULL, V850_OPERAND_SIGNED },
00437
00438
00439 #define D7 (I16 + 1)
00440 { 7, 0, NULL, NULL, 0},
00441
00442
00443 #define D16_15 (D7 + 1)
00444 { 15, 17, insert_d16_15, extract_d16_15, V850_OPERAND_SIGNED },
00445
00446
00447 #define B3 (D16_15 + 1)
00448 { 3, 11, NULL, NULL, 0 },
00449
00450
00451 #define CCCC (B3 + 1)
00452 { 4, 0, NULL, NULL, V850_OPERAND_CC },
00453
00454
00455 #define D8_7 (CCCC + 1)
00456 { 7, 0, insert_d8_7, extract_d8_7, 0 },
00457
00458
00459 #define D8_6 (D8_7 + 1)
00460 { 6, 1, insert_d8_6, extract_d8_6, 0 },
00461
00462
00463 #define SR1 (D8_6 + 1)
00464 { 5, 0, NULL, NULL, V850_OPERAND_SRG },
00465
00466
00467 #define EP (SR1 + 1)
00468 { 0, 0, NULL, NULL, V850_OPERAND_EP },
00469
00470
00471 #define I16U (EP + 1)
00472 { 16, 16, NULL, NULL, 0},
00473
00474
00475 #define SR2 (I16U + 1)
00476 { 5, 11, NULL, NULL, V850_OPERAND_SRG },
00477
00478
00479 #define D16 (SR2 + 1)
00480 { 16, 16, NULL, NULL, V850_OPERAND_SIGNED },
00481
00482
00483 #define D9_RELAX (D16 + 1)
00484 { 9, 0, insert_d9, extract_d9, V850_OPERAND_RELAX | V850_OPERAND_SIGNED | V850_OPERAND_DISP },
00485
00486
00487
00488
00489 #define D22 (D9_RELAX + 1)
00490 { 22, 0, insert_d22, extract_d22, V850_OPERAND_SIGNED | V850_OPERAND_DISP },
00491
00492
00493 #define D4 (D22 + 1)
00494 { 4, 0, NULL, NULL, 0},
00495
00496
00497 #define D5_4 (D4 + 1)
00498 { 4, 0, insert_d5_4, extract_d5_4, 0 },
00499
00500
00501 #define D16_16 (D5_4 + 1)
00502 { -1, 0xfffe0020, insert_d16_16, extract_d16_16, 0 },
00503
00504
00505 #define R3 (D16_16 + 1)
00506 { 5, 27, NULL, NULL, V850_OPERAND_REG },
00507
00508
00509 #define MOVCC (R3 + 1)
00510 { 4, 17, NULL, NULL, V850_OPERAND_CC },
00511
00512
00513 #define I9 (MOVCC + 1)
00514 { 9, 0, insert_i9, extract_i9, V850_OPERAND_SIGNED },
00515
00516
00517 #define U9 (I9 + 1)
00518 { 9, 0, insert_u9, extract_u9, 0 },
00519
00520
00521 #define LIST12 (U9 + 1)
00522 { -1, 0xffe00001, NULL, NULL, V850E_PUSH_POP },
00523
00524
00525 #define I6 (LIST12 + 1)
00526 { 6, 0, NULL, NULL, 0 },
00527
00528
00529 #define IMM16 (I6 + 1)
00530 { 16, 16, NULL, NULL, V850_OPERAND_SIGNED | V850E_IMMEDIATE16 },
00531
00532
00533 #define IMM32 (IMM16 + 1)
00534 { 0, 0, NULL, NULL, V850E_IMMEDIATE32 },
00535
00536
00537 #define IMM5 (IMM32 + 1)
00538 { 5, 1, NULL, NULL, 0 },
00539
00540
00541 #define R2DISPOSE (IMM5 + 1)
00542 { 5, 16, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
00543
00544
00545 #define SP (R2DISPOSE + 1)
00546 { 2, 19, insert_spe, extract_spe, V850_OPERAND_REG },
00547
00548
00549 #define I5DIV (SP + 1)
00550 { 9, 0, insert_i5div, extract_i5div, V850_OPERAND_SIGNED },
00551
00552
00553 #define LIST18_H (I5DIV + 1)
00554 { -1, 0xfff8000f, NULL, NULL, V850E_PUSH_POP },
00555
00556
00557 #define LIST18_L (LIST18_H + 1)
00558
00559 { -1, 0xfff8001f, NULL, NULL, V850E_PUSH_POP },
00560 } ;
00561
00562
00563
00564 #define IF1 {R1, R2}
00565
00566
00567 #define IF2 {I5, R2}
00568
00569
00570 #define IF3 {D9_RELAX}
00571
00572
00573 #define IF6 {I16, R1, R2}
00574
00575
00576 #define IF6U {I16U, R1, R2}
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610 const struct v850_opcode v850_opcodes[] =
00611 {
00612 { "breakpoint", 0xffff, 0xffff, {UNUSED}, 0, PROCESSOR_ALL },
00613 { "dbtrap", one (0xf840), one (0xffff), {UNUSED}, 0, PROCESSOR_V850E1 },
00614
00615 { "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL },
00616
00617
00618 { "sld.bu", one (0x0060), one (0x07f0), {D4, EP, R2_NOTR0}, 1, PROCESSOR_V850E1 },
00619 { "sld.bu", one (0x0060), one (0x07f0), {D4, EP, R2_NOTR0}, 1, PROCESSOR_V850E },
00620
00621 { "sld.hu", one (0x0070), one (0x07f0), {D5_4, EP, R2_NOTR0}, 1, PROCESSOR_V850E1 },
00622 { "sld.hu", one (0x0070), one (0x07f0), {D5_4, EP, R2_NOTR0}, 1, PROCESSOR_V850E },
00623
00624 { "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850E1 },
00625 { "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850E },
00626 { "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850 },
00627
00628 { "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850E1 },
00629 { "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850E },
00630 { "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850 },
00631 { "sld.w", one (0x0500), one (0x0781), {D8_6, EP, R2}, 1, PROCESSOR_ALL },
00632 { "sst.b", one (0x0380), one (0x0780), {R2, D7, EP}, 2, PROCESSOR_ALL },
00633 { "sst.h", one (0x0480), one (0x0780), {R2, D8_7, EP}, 2, PROCESSOR_ALL },
00634 { "sst.w", one (0x0501), one (0x0781), {R2, D8_6, EP}, 2, PROCESSOR_ALL },
00635
00636 { "prepare", two (0x0780, 0x0003), two (0xffc0, 0x001f), {LIST12, IMM5, SP}, 0, PROCESSOR_NOT_V850 },
00637 { "prepare", two (0x0780, 0x000b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16}, 0, PROCESSOR_NOT_V850 },
00638 { "prepare", two (0x0780, 0x0013), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16}, 0, PROCESSOR_NOT_V850 },
00639 { "prepare", two (0x0780, 0x001b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM32}, 0, PROCESSOR_NOT_V850 },
00640 { "prepare", two (0x0780, 0x0001), two (0xffc0, 0x001f), {LIST12, IMM5}, 0, PROCESSOR_NOT_V850 },
00641 { "dispose", one (0x0640), one (0xffc0), {IMM5, LIST12, R2DISPOSE},0, PROCESSOR_NOT_V850 },
00642 { "dispose", two (0x0640, 0x0000), two (0xffc0, 0x001f), {IMM5, LIST12}, 0, PROCESSOR_NOT_V850 },
00643
00644 { "ld.b", two (0x0700, 0x0000), two (0x07e0, 0x0000), {D16, R1, R2}, 1, PROCESSOR_ALL },
00645 { "ld.h", two (0x0720, 0x0000), two (0x07e0, 0x0001), {D16_15, R1, R2}, 1, PROCESSOR_ALL },
00646 { "ld.w", two (0x0720, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2}, 1, PROCESSOR_ALL },
00647 { "ld.bu", two (0x0780, 0x0001), two (0x07c0, 0x0001), {D16_16, R1, R2_NOTR0}, 1, PROCESSOR_NOT_V850 },
00648 { "ld.hu", two (0x07e0, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2_NOTR0}, 1, PROCESSOR_NOT_V850 },
00649 { "st.b", two (0x0740, 0x0000), two (0x07e0, 0x0000), {R2, D16, R1}, 2, PROCESSOR_ALL },
00650 { "st.h", two (0x0760, 0x0000), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL },
00651 { "st.w", two (0x0760, 0x0001), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL },
00652
00653
00654 { "zxb", one (0x0080), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
00655 { "zxh", one (0x00c0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
00656 { "sxb", one (0x00a0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
00657 { "sxh", one (0x00e0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
00658 { "bsh", two (0x07e0, 0x0342), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
00659 { "bsw", two (0x07e0, 0x0340), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
00660 { "hsw", two (0x07e0, 0x0344), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
00661
00662
00663 { "switch", one (0x0040), one (0xffe0), {R1}, 1, PROCESSOR_NOT_V850 },
00664 { "callt", one (0x0200), one (0xffc0), {I6}, 0, PROCESSOR_NOT_V850 },
00665 { "ctret", two (0x07e0, 0x0144), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 },
00666
00667
00668 { "setf", two (0x07e0, 0x0000), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_ALL },
00669 { "cmov", two (0x07e0, 0x0320), two (0x07e0, 0x07e1), {MOVCC, R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00670 { "cmov", two (0x07e0, 0x0300), two (0x07e0, 0x07e1), {MOVCC, I5, R2, R3}, 0, PROCESSOR_NOT_V850 },
00671
00672 { "mul", two (0x07e0, 0x0220), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00673 { "mul", two (0x07e0, 0x0240), two (0x07e0, 0x07c3), {I9, R2, R3}, 0, PROCESSOR_NOT_V850 },
00674 { "mulu", two (0x07e0, 0x0222), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00675 { "mulu", two (0x07e0, 0x0242), two (0x07e0, 0x07c3), {U9, R2, R3}, 0, PROCESSOR_NOT_V850 },
00676
00677 { "div", two (0x07e0, 0x02c0), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00678 { "divu", two (0x07e0, 0x02c2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00679 { "divhu", two (0x07e0, 0x0282), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00680 { "divh", two (0x07e0, 0x0280), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
00681 { "divh", OP (0x02), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00682
00683 { "nop", one (0x00), one (0xffff), {0}, 0, PROCESSOR_ALL },
00684 { "mov", OP (0x10), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
00685 { "mov", one (0x0620), one (0xffe0), {IMM32, R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
00686 { "mov", OP (0x00), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00687 { "movea", OP (0x31), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00688 { "movhi", OP (0x32), OP_MASK, {I16U, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00689 { "add", OP (0x0e), OP_MASK, IF1, 0, PROCESSOR_ALL },
00690 { "add", OP (0x12), OP_MASK, IF2, 0, PROCESSOR_ALL },
00691 { "addi", OP (0x30), OP_MASK, IF6, 0, PROCESSOR_ALL },
00692 { "sub", OP (0x0d), OP_MASK, IF1, 0, PROCESSOR_ALL },
00693 { "subr", OP (0x0c), OP_MASK, IF1, 0, PROCESSOR_ALL },
00694 { "mulh", OP (0x17), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
00695 { "mulh", OP (0x07), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00696 { "mulhi", OP (0x37), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00697 { "cmp", OP (0x0f), OP_MASK, IF1, 0, PROCESSOR_ALL },
00698 { "cmp", OP (0x13), OP_MASK, IF2, 0, PROCESSOR_ALL },
00699
00700
00701 { "satadd", OP (0x11), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
00702 { "satadd", OP (0x06), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00703 { "satsub", OP (0x05), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00704 { "satsubi", OP (0x33), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00705 { "satsubr", OP (0x04), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
00706
00707
00708 { "tst", OP (0x0b), OP_MASK, IF1, 0, PROCESSOR_ALL },
00709 { "or", OP (0x08), OP_MASK, IF1, 0, PROCESSOR_ALL },
00710 { "ori", OP (0x34), OP_MASK, IF6U, 0, PROCESSOR_ALL },
00711 { "and", OP (0x0a), OP_MASK, IF1, 0, PROCESSOR_ALL },
00712 { "andi", OP (0x36), OP_MASK, IF6U, 0, PROCESSOR_ALL },
00713 { "xor", OP (0x09), OP_MASK, IF1, 0, PROCESSOR_ALL },
00714 { "xori", OP (0x35), OP_MASK, IF6U, 0, PROCESSOR_ALL },
00715 { "not", OP (0x01), OP_MASK, IF1, 0, PROCESSOR_ALL },
00716 { "sar", OP (0x15), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
00717 { "sar", two (0x07e0, 0x00a0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
00718 { "shl", OP (0x16), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
00719 { "shl", two (0x07e0, 0x00c0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
00720 { "shr", OP (0x14), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
00721 { "shr", two (0x07e0, 0x0080), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
00722 { "sasf", two (0x07e0, 0x0200), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_NOT_V850 },
00723
00724
00725
00726 { "bgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00727 { "bge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00728 { "blt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00729 { "ble", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00730
00731 { "bh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00732 { "bnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00733 { "bl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00734 { "bnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00735
00736 { "be", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00737 { "bne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00738
00739 { "bv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00740 { "bnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00741 { "bn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00742 { "bp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00743 { "bc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00744 { "bnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00745 { "bz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00746 { "bnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00747 { "br", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00748 { "bsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00749
00750
00751
00752
00753
00754
00755
00756 { "jgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00757 { "jge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00758 { "jlt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00759 { "jle", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00760
00761 { "jh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00762 { "jnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00763 { "jl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00764 { "jnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00765
00766 { "je", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00767 { "jne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00768
00769 { "jv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00770 { "jnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00771 { "jn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00772 { "jp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00773 { "jc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00774 { "jnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00775 { "jz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00776 { "jnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00777 { "jsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00778 { "jbr", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL },
00779
00780 { "jr", one (0x0780), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL },
00781 { "jarl", one (0x0780), two (0x07c0, 0x0001), {D22, R2}, 0, PROCESSOR_ALL},
00782
00783
00784 { "set1", two (0x07c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
00785 { "set1", two (0x07e0, 0x00e0), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 },
00786 { "not1", two (0x47c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
00787 { "not1", two (0x07e0, 0x00e2), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 },
00788 { "clr1", two (0x87c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
00789 { "clr1", two (0x07e0, 0x00e4), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 },
00790 { "tst1", two (0xc7c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
00791 { "tst1", two (0x07e0, 0x00e6), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 },
00792
00793
00794 { "di", two (0x07e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
00795 { "ei", two (0x87e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
00796 { "halt", two (0x07e0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
00797 { "reti", two (0x07e0, 0x0140), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
00798 { "trap", two (0x07e0, 0x0100), two (0xffe0, 0xffff), {I5U}, 0, PROCESSOR_ALL },
00799 { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0xffff), {R1, SR2}, 0, PROCESSOR_ALL },
00800 { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0xffff), {SR1, R2}, 0, PROCESSOR_ALL },
00801 { "dbret", two (0x07e0, 0x0146), two (0xffff, 0xffff), {UNUSED}, 0, PROCESSOR_V850E1 },
00802 { 0, 0, 0, {0}, 0, 0 },
00803
00804 } ;
00805
00806 const int v850_num_opcodes =
00807 sizeof (v850_opcodes) / sizeof (v850_opcodes[0]);