1 /* Opcode table for the ARC.
2 Copyright (C) 1994-2016 Free Software Foundation, Inc.
4 Contributed by Claudiu Zissulescu (claziss@synopsys.com)
6 This file is part of libopcodes.
8 This library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 It is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
25 #include "opcode/arc.h"
27 #include "libiberty.h"
29 /* ARC NPS400 Support: The ARC NPS400 core is an ARC700 with some custom
30 instructions. Support for this target is available when binutils is
31 configured and built for the 'arc*-mellanox-*-*' target. As far as
32 possible all ARC NPS400 features are built into all ARC target builds as
33 this reduces the chances that regressions might creep in. */
35 /* Insert RB register into a 32-bit opcode. */
37 insert_rb (unsigned insn
,
39 const char **errmsg ATTRIBUTE_UNUSED
)
41 return insn
| ((value
& 0x07) << 24) | (((value
>> 3) & 0x07) << 12);
45 extract_rb (unsigned insn ATTRIBUTE_UNUSED
,
46 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
48 int value
= (((insn
>> 12) & 0x07) << 3) | ((insn
>> 24) & 0x07);
50 if (value
== 0x3e && invalid
)
51 *invalid
= TRUE
; /* A limm operand, it should be extracted in a
58 insert_rad (unsigned insn
,
60 const char **errmsg ATTRIBUTE_UNUSED
)
63 *errmsg
= _("Improper register value.");
65 return insn
| (value
& 0x3F);
69 insert_rcd (unsigned insn
,
71 const char **errmsg ATTRIBUTE_UNUSED
)
74 *errmsg
= _("Improper register value.");
76 return insn
| ((value
& 0x3F) << 6);
79 /* Dummy insert ZERO operand function. */
82 insert_za (unsigned insn
,
87 *errmsg
= _("operand is not zero");
91 /* Insert Y-bit in bbit/br instructions. This function is called only
92 when solving fixups. */
95 insert_Ybit (unsigned insn
,
97 const char **errmsg ATTRIBUTE_UNUSED
)
105 /* Insert Y-bit in bbit/br instructions. This function is called only
106 when solving fixups. */
109 insert_NYbit (unsigned insn
,
111 const char **errmsg ATTRIBUTE_UNUSED
)
119 /* Insert H register into a 16-bit opcode. */
122 insert_rhv1 (unsigned insn
,
124 const char **errmsg ATTRIBUTE_UNUSED
)
126 return insn
|= ((value
& 0x07) << 5) | ((value
>> 3) & 0x07);
130 extract_rhv1 (unsigned insn ATTRIBUTE_UNUSED
,
131 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
138 /* Insert H register into a 16-bit opcode. */
141 insert_rhv2 (unsigned insn
,
147 _("Register R30 is a limm indicator for this type of instruction.");
148 return insn
|= ((value
& 0x07) << 5) | ((value
>> 3) & 0x03);
152 extract_rhv2 (unsigned insn ATTRIBUTE_UNUSED
,
153 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
155 int value
= ((insn
>> 5) & 0x07) | ((insn
& 0x03) << 3);
161 insert_r0 (unsigned insn
,
163 const char **errmsg ATTRIBUTE_UNUSED
)
166 *errmsg
= _("Register must be R0.");
171 extract_r0 (unsigned insn ATTRIBUTE_UNUSED
,
172 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
179 insert_r1 (unsigned insn
,
181 const char **errmsg ATTRIBUTE_UNUSED
)
184 *errmsg
= _("Register must be R1.");
189 extract_r1 (unsigned insn ATTRIBUTE_UNUSED
,
190 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
196 insert_r2 (unsigned insn
,
198 const char **errmsg ATTRIBUTE_UNUSED
)
201 *errmsg
= _("Register must be R2.");
206 extract_r2 (unsigned insn ATTRIBUTE_UNUSED
,
207 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
213 insert_r3 (unsigned insn
,
215 const char **errmsg ATTRIBUTE_UNUSED
)
218 *errmsg
= _("Register must be R3.");
223 extract_r3 (unsigned insn ATTRIBUTE_UNUSED
,
224 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
230 insert_sp (unsigned insn
,
232 const char **errmsg ATTRIBUTE_UNUSED
)
235 *errmsg
= _("Register must be SP.");
240 extract_sp (unsigned insn ATTRIBUTE_UNUSED
,
241 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
247 insert_gp (unsigned insn
,
249 const char **errmsg ATTRIBUTE_UNUSED
)
252 *errmsg
= _("Register must be GP.");
257 extract_gp (unsigned insn ATTRIBUTE_UNUSED
,
258 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
264 insert_pcl (unsigned insn
,
266 const char **errmsg ATTRIBUTE_UNUSED
)
269 *errmsg
= _("Register must be PCL.");
274 extract_pcl (unsigned insn ATTRIBUTE_UNUSED
,
275 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
281 insert_blink (unsigned insn
,
283 const char **errmsg ATTRIBUTE_UNUSED
)
286 *errmsg
= _("Register must be BLINK.");
291 extract_blink (unsigned insn ATTRIBUTE_UNUSED
,
292 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
298 insert_ilink1 (unsigned insn
,
300 const char **errmsg ATTRIBUTE_UNUSED
)
303 *errmsg
= _("Register must be ILINK1.");
308 extract_ilink1 (unsigned insn ATTRIBUTE_UNUSED
,
309 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
315 insert_ilink2 (unsigned insn
,
317 const char **errmsg ATTRIBUTE_UNUSED
)
320 *errmsg
= _("Register must be ILINK2.");
325 extract_ilink2 (unsigned insn ATTRIBUTE_UNUSED
,
326 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
332 insert_ras (unsigned insn
,
334 const char **errmsg ATTRIBUTE_UNUSED
)
351 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
358 extract_ras (unsigned insn ATTRIBUTE_UNUSED
,
359 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
361 int value
= insn
& 0x07;
369 insert_rbs (unsigned insn
,
371 const char **errmsg ATTRIBUTE_UNUSED
)
385 insn
|= ((value
- 8)) << 8;
388 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
395 extract_rbs (unsigned insn ATTRIBUTE_UNUSED
,
396 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
398 int value
= (insn
>> 8) & 0x07;
406 insert_rcs (unsigned insn
,
408 const char **errmsg ATTRIBUTE_UNUSED
)
422 insn
|= ((value
- 8)) << 5;
425 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
432 extract_rcs (unsigned insn ATTRIBUTE_UNUSED
,
433 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
435 int value
= (insn
>> 5) & 0x07;
443 insert_simm3s (unsigned insn
,
445 const char **errmsg ATTRIBUTE_UNUSED
)
475 *errmsg
= _("Accepted values are from -1 to 6.");
484 extract_simm3s (unsigned insn ATTRIBUTE_UNUSED
,
485 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
487 int value
= (insn
>> 8) & 0x07;
495 insert_rrange (unsigned insn
,
497 const char **errmsg ATTRIBUTE_UNUSED
)
499 int reg1
= (value
>> 16) & 0xFFFF;
500 int reg2
= value
& 0xFFFF;
503 *errmsg
= _("First register of the range should be r13.");
506 if (reg2
< 13 || reg2
> 26)
508 *errmsg
= _("Last register of the range doesn't fit.");
511 insn
|= ((reg2
- 12) & 0x0F) << 1;
516 extract_rrange (unsigned insn ATTRIBUTE_UNUSED
,
517 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
519 return (insn
>> 1) & 0x0F;
523 insert_fpel (unsigned insn
,
525 const char **errmsg ATTRIBUTE_UNUSED
)
529 *errmsg
= _("Invalid register number, should be fp.");
538 extract_fpel (unsigned insn ATTRIBUTE_UNUSED
,
539 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
541 return (insn
& 0x0100) ? 27 : -1;
545 insert_blinkel (unsigned insn
,
547 const char **errmsg ATTRIBUTE_UNUSED
)
551 *errmsg
= _("Invalid register number, should be blink.");
560 extract_blinkel (unsigned insn ATTRIBUTE_UNUSED
,
561 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
563 return (insn
& 0x0200) ? 31 : -1;
567 insert_pclel (unsigned insn
,
569 const char **errmsg ATTRIBUTE_UNUSED
)
573 *errmsg
= _("Invalid register number, should be pcl.");
582 extract_pclel (unsigned insn ATTRIBUTE_UNUSED
,
583 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
585 return (insn
& 0x0400) ? 63 : -1;
589 /* mask = 00000000000000000000111111000000
590 insn = 00011bbb000000000BBBwwwwwwDaaZZ1. */
592 insert_w6 (unsigned insn ATTRIBUTE_UNUSED
,
593 int value ATTRIBUTE_UNUSED
,
594 const char **errmsg ATTRIBUTE_UNUSED
)
596 insn
|= ((value
>> 0) & 0x003f) << 6;
602 /* mask = 00000000000000000000111111000000. */
604 extract_w6 (unsigned insn ATTRIBUTE_UNUSED
,
605 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
609 value
|= ((insn
>> 6) & 0x003f) << 0;
615 /* mask = 0000011100022000
616 insn = 01000ggghhhGG0HH. */
618 insert_g_s (unsigned insn ATTRIBUTE_UNUSED
,
619 int value ATTRIBUTE_UNUSED
,
620 const char **errmsg ATTRIBUTE_UNUSED
)
622 insn
|= ((value
>> 0) & 0x0007) << 8;
623 insn
|= ((value
>> 3) & 0x0003) << 3;
629 /* mask = 0000011100022000. */
631 extract_g_s (unsigned insn ATTRIBUTE_UNUSED
,
632 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
636 value
|= ((insn
>> 8) & 0x0007) << 0;
637 value
|= ((insn
>> 3) & 0x0003) << 3;
639 /* Extend the sign. */
640 int signbit
= 1 << (6 - 1);
641 value
= (value
^ signbit
) - signbit
;
646 /* ARC NPS400 Support: See comment near head of file. */
648 insert_nps_3bit_dst (unsigned insn ATTRIBUTE_UNUSED
,
649 int value ATTRIBUTE_UNUSED
,
650 const char **errmsg ATTRIBUTE_UNUSED
)
664 insn
|= (value
- 8) << 24;
667 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
674 extract_nps_3bit_dst (unsigned insn ATTRIBUTE_UNUSED
,
675 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
677 int value
= (insn
>> 24) & 0x07;
685 insert_nps_3bit_dst_short (unsigned insn ATTRIBUTE_UNUSED
,
686 int value ATTRIBUTE_UNUSED
,
687 const char **errmsg ATTRIBUTE_UNUSED
)
701 insn
|= (value
- 8) << 8;
704 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
711 extract_nps_3bit_dst_short (unsigned insn ATTRIBUTE_UNUSED
,
712 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
714 int value
= (insn
>> 8) & 0x07;
722 insert_nps_3bit_src2 (unsigned insn ATTRIBUTE_UNUSED
,
723 int value ATTRIBUTE_UNUSED
,
724 const char **errmsg ATTRIBUTE_UNUSED
)
738 insn
|= (value
- 8) << 21;
741 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
748 extract_nps_3bit_src2 (unsigned insn ATTRIBUTE_UNUSED
,
749 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
751 int value
= (insn
>> 21) & 0x07;
759 insert_nps_3bit_src2_short (unsigned insn ATTRIBUTE_UNUSED
,
760 int value ATTRIBUTE_UNUSED
,
761 const char **errmsg ATTRIBUTE_UNUSED
)
775 insn
|= (value
- 8) << 5;
778 *errmsg
= _("Register must be either r0-r3 or r12-r15.");
785 extract_nps_3bit_src2_short (unsigned insn ATTRIBUTE_UNUSED
,
786 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
788 int value
= (insn
>> 5) & 0x07;
796 insert_nps_bitop_size_2b (unsigned insn ATTRIBUTE_UNUSED
,
797 int value ATTRIBUTE_UNUSED
,
798 const char **errmsg ATTRIBUTE_UNUSED
)
816 *errmsg
= _("Invalid size, should be 1, 2, 4, or 8.");
825 extract_nps_bitop_size_2b (unsigned insn ATTRIBUTE_UNUSED
,
826 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
828 return 1 << ((insn
>> 10) & 0x3);
832 insert_nps_bitop_uimm8 (unsigned insn ATTRIBUTE_UNUSED
,
833 int value ATTRIBUTE_UNUSED
,
834 const char **errmsg ATTRIBUTE_UNUSED
)
836 insn
|= ((value
>> 5) & 7) << 12;
837 insn
|= (value
& 0x1f);
842 extract_nps_bitop_uimm8 (unsigned insn ATTRIBUTE_UNUSED
,
843 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
845 return (((insn
>> 12) & 0x7) << 5) | (insn
& 0x1f);
849 insert_nps_rflt_uimm6 (unsigned insn ATTRIBUTE_UNUSED
,
850 int value ATTRIBUTE_UNUSED
,
851 const char **errmsg ATTRIBUTE_UNUSED
)
861 *errmsg
= _("invalid immediate, must be 1, 2, or 4");
865 insn
|= (value
<< 6);
870 extract_nps_rflt_uimm6 (unsigned insn ATTRIBUTE_UNUSED
,
871 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
873 return (insn
>> 6) & 0x3f;
877 insert_nps_dst_pos_and_size (unsigned insn ATTRIBUTE_UNUSED
,
878 int value ATTRIBUTE_UNUSED
,
879 const char **errmsg ATTRIBUTE_UNUSED
)
881 insn
|= ((value
& 0x1f) | (((32 - value
- 1) & 0x1f) << 10));
886 extract_nps_dst_pos_and_size (unsigned insn ATTRIBUTE_UNUSED
,
887 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
889 return (insn
& 0x1f);
893 insert_nps_cmem_uimm16 (unsigned insn ATTRIBUTE_UNUSED
,
894 int value ATTRIBUTE_UNUSED
,
895 const char **errmsg ATTRIBUTE_UNUSED
)
897 int top
= (value
>> 16) & 0xffff;
898 if (top
!= 0x0 && top
!= NPS_CMEM_HIGH_VALUE
)
899 *errmsg
= _("invalid value for CMEM ld/st immediate");
900 insn
|= (value
& 0xffff);
905 extract_nps_cmem_uimm16 (unsigned insn ATTRIBUTE_UNUSED
,
906 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
908 return (NPS_CMEM_HIGH_VALUE
<< 16) | (insn
& 0xffff);
911 #define MAKE_SRC_POS_INSERT_EXTRACT_FUNCS(NAME,SHIFT) \
913 insert_nps_##NAME##_pos (unsigned insn ATTRIBUTE_UNUSED, \
914 int value ATTRIBUTE_UNUSED, \
915 const char **errmsg ATTRIBUTE_UNUSED) \
926 *errmsg = _("Invalid position, should be 0, 8, 16, or 24."); \
929 insn |= (value << SHIFT); \
934 extract_nps_##NAME##_pos (unsigned insn ATTRIBUTE_UNUSED, \
935 bfd_boolean * invalid ATTRIBUTE_UNUSED) \
937 return ((insn >> SHIFT) & 0x3) * 8; \
940 MAKE_SRC_POS_INSERT_EXTRACT_FUNCS (src2
, 12)
941 MAKE_SRC_POS_INSERT_EXTRACT_FUNCS (src1
, 10)
943 #define MAKE_BIAS_INSERT_EXTRACT_FUNCS(NAME,LOWER,UPPER,BITS,BIAS,SHIFT)\
945 insert_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \
946 int value ATTRIBUTE_UNUSED, \
947 const char **errmsg ATTRIBUTE_UNUSED) \
949 if (value < LOWER || value > UPPER) \
951 *errmsg = _("Invalid size, value must be " \
952 #LOWER " to " #UPPER "."); \
956 insn |= (value << SHIFT); \
961 extract_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \
962 bfd_boolean * invalid ATTRIBUTE_UNUSED) \
964 return ((insn >> SHIFT) & ((1 << BITS) - 1)) + BIAS; \
967 MAKE_BIAS_INSERT_EXTRACT_FUNCS(addb_size
,2,32,5,1,5)
968 MAKE_BIAS_INSERT_EXTRACT_FUNCS(andb_size
,1,32,5,1,5)
969 MAKE_BIAS_INSERT_EXTRACT_FUNCS(fxorb_size
,8,32,5,8,5)
970 MAKE_BIAS_INSERT_EXTRACT_FUNCS(wxorb_size
,16,32,5,16,5)
971 MAKE_BIAS_INSERT_EXTRACT_FUNCS(bitop_size
,1,32,5,1,10)
972 MAKE_BIAS_INSERT_EXTRACT_FUNCS(qcmp_size
,1,8,3,1,9)
973 MAKE_BIAS_INSERT_EXTRACT_FUNCS(bitop1_size
,1,32,5,1,20)
974 MAKE_BIAS_INSERT_EXTRACT_FUNCS(bitop2_size
,1,32,5,1,25)
975 MAKE_BIAS_INSERT_EXTRACT_FUNCS(hash_width
,1,32,5,1,6)
976 MAKE_BIAS_INSERT_EXTRACT_FUNCS(hash_len
,1,8,3,1,2)
977 MAKE_BIAS_INSERT_EXTRACT_FUNCS(index3
,4,7,2,4,0)
980 extract_nps_qcmp_m3 (unsigned insn ATTRIBUTE_UNUSED
,
981 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
983 int m3
= (insn
>> 5) & 0xf;
990 extract_nps_qcmp_m2 (unsigned insn ATTRIBUTE_UNUSED
,
991 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
993 bfd_boolean tmp_invalid
= FALSE
;
994 int m2
= (insn
>> 15) & 0x1;
995 int m3
= extract_nps_qcmp_m3 (insn
, &tmp_invalid
);
997 if (m2
== 0 && m3
== 0xf)
1003 extract_nps_qcmp_m1 (unsigned insn ATTRIBUTE_UNUSED
,
1004 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1006 bfd_boolean tmp_invalid
= FALSE
;
1007 int m1
= (insn
>> 14) & 0x1;
1008 int m2
= extract_nps_qcmp_m2 (insn
, &tmp_invalid
);
1009 int m3
= extract_nps_qcmp_m3 (insn
, &tmp_invalid
);
1011 if (m1
== 0 && m2
== 0 && m3
== 0xf)
1017 insert_nps_calc_entry_size (unsigned insn ATTRIBUTE_UNUSED
,
1018 int value ATTRIBUTE_UNUSED
,
1019 const char **errmsg ATTRIBUTE_UNUSED
)
1023 if (value
< 1 || value
> 256)
1025 *errmsg
= _("value out of range 1 - 256");
1029 for (pwr
= 0; (value
& 1) == 0; value
>>= 1)
1034 *errmsg
= _("value must be power of 2");
1038 return insn
| (pwr
<< 8);
1042 extract_nps_calc_entry_size (unsigned insn ATTRIBUTE_UNUSED
,
1043 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1045 unsigned entry_size
= (insn
>> 8) & 0xf;
1046 return 1 << entry_size
;
1050 insert_nps_bitop_mod4_msb (unsigned insn ATTRIBUTE_UNUSED
,
1051 int value ATTRIBUTE_UNUSED
,
1052 const char **errmsg ATTRIBUTE_UNUSED
)
1054 return insn
| ((value
& 0x2) << 30);
1058 extract_nps_bitop_mod4_msb (unsigned insn ATTRIBUTE_UNUSED
,
1059 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1061 return (insn
>> 30) & 0x2;
1065 insert_nps_bitop_mod4_lsb (unsigned insn ATTRIBUTE_UNUSED
,
1066 int value ATTRIBUTE_UNUSED
,
1067 const char **errmsg ATTRIBUTE_UNUSED
)
1069 return insn
| ((value
& 0x1) << 15);
1073 extract_nps_bitop_mod4_lsb (unsigned insn ATTRIBUTE_UNUSED
,
1074 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1076 return (insn
>> 15) & 0x1;
1080 insert_nps_bitop_dst_pos3_pos4 (unsigned insn ATTRIBUTE_UNUSED
,
1081 int value ATTRIBUTE_UNUSED
,
1082 const char **errmsg ATTRIBUTE_UNUSED
)
1084 return insn
| (value
<< 10) | (value
<< 5);
1088 extract_nps_bitop_dst_pos3_pos4 (unsigned insn ATTRIBUTE_UNUSED
,
1089 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1091 if (((insn
>> 10) & 0x1f) != ((insn
>> 5) & 0x1f))
1093 return ((insn
>> 5) & 0x1f);
1097 insert_nps_bitop_ins_ext (unsigned insn ATTRIBUTE_UNUSED
,
1098 int value ATTRIBUTE_UNUSED
,
1099 const char **errmsg ATTRIBUTE_UNUSED
)
1101 if (value
< 0 || value
> 28)
1102 *errmsg
= _("Value must be in the range 0 to 28");
1103 return insn
| (value
<< 20);
1107 extract_nps_bitop_ins_ext (unsigned insn ATTRIBUTE_UNUSED
,
1108 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1110 int value
= (insn
>> 20) & 0x1f;
1116 #define MAKE_1BASED_INSERT_EXTRACT_FUNCS(NAME,SHIFT,UPPER,BITS) \
1118 insert_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \
1119 int value ATTRIBUTE_UNUSED, \
1120 const char **errmsg ATTRIBUTE_UNUSED) \
1122 if (value < 1 || value > UPPER) \
1123 *errmsg = _("Value must be in the range 1 to " #UPPER); \
1124 if (value == UPPER) \
1126 return insn | (value << SHIFT); \
1130 extract_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \
1131 bfd_boolean * invalid ATTRIBUTE_UNUSED) \
1133 int value = (insn >> SHIFT) & ((1 << BITS) - 1); \
1139 MAKE_1BASED_INSERT_EXTRACT_FUNCS(field_size
, 6, 8, 3)
1140 MAKE_1BASED_INSERT_EXTRACT_FUNCS(shift_factor
, 9, 8, 3)
1141 MAKE_1BASED_INSERT_EXTRACT_FUNCS(bits_to_scramble
, 12, 8, 3)
1142 MAKE_1BASED_INSERT_EXTRACT_FUNCS(bdlen_max_len
, 5, 256, 8)
1145 insert_nps_min_hofs (unsigned insn ATTRIBUTE_UNUSED
,
1146 int value ATTRIBUTE_UNUSED
,
1147 const char **errmsg ATTRIBUTE_UNUSED
)
1149 if (value
< 0 || value
> 240)
1150 *errmsg
= _("Value must be in the range 0 to 240");
1151 if ((value
% 16) != 0)
1152 *errmsg
= _("Value must be a multiple of 16");
1154 return insn
| (value
<< 6);
1158 extract_nps_min_hofs (unsigned insn ATTRIBUTE_UNUSED
,
1159 bfd_boolean
* invalid ATTRIBUTE_UNUSED
)
1161 int value
= (insn
>> 6) & 0xF;
1165 /* Include the generic extract/insert functions. Order is important
1166 as some of the functions present in the .h may be disabled via
1168 #include "arc-fxi.h"
1170 /* The flag operands table.
1172 The format of the table is
1173 NAME CODE BITS SHIFT FAVAIL. */
1174 const struct arc_flag_operand arc_flag_operands
[] =
1178 #define F_ALWAYS (F_NULL + 1)
1179 { "al", 0, 0, 0, 0 },
1180 #define F_RA (F_ALWAYS + 1)
1181 { "ra", 0, 0, 0, 0 },
1182 #define F_EQUAL (F_RA + 1)
1183 { "eq", 1, 5, 0, 1 },
1184 #define F_ZERO (F_EQUAL + 1)
1185 { "z", 1, 5, 0, 0 },
1186 #define F_NOTEQUAL (F_ZERO + 1)
1187 { "ne", 2, 5, 0, 1 },
1188 #define F_NOTZERO (F_NOTEQUAL + 1)
1189 { "nz", 2, 5, 0, 0 },
1190 #define F_POZITIVE (F_NOTZERO + 1)
1191 { "p", 3, 5, 0, 1 },
1192 #define F_PL (F_POZITIVE + 1)
1193 { "pl", 3, 5, 0, 0 },
1194 #define F_NEGATIVE (F_PL + 1)
1195 { "n", 4, 5, 0, 1 },
1196 #define F_MINUS (F_NEGATIVE + 1)
1197 { "mi", 4, 5, 0, 0 },
1198 #define F_CARRY (F_MINUS + 1)
1199 { "c", 5, 5, 0, 1 },
1200 #define F_CARRYSET (F_CARRY + 1)
1201 { "cs", 5, 5, 0, 0 },
1202 #define F_LOWER (F_CARRYSET + 1)
1203 { "lo", 5, 5, 0, 0 },
1204 #define F_CARRYCLR (F_LOWER + 1)
1205 { "cc", 6, 5, 0, 0 },
1206 #define F_NOTCARRY (F_CARRYCLR + 1)
1207 { "nc", 6, 5, 0, 1 },
1208 #define F_HIGHER (F_NOTCARRY + 1)
1209 { "hs", 6, 5, 0, 0 },
1210 #define F_OVERFLOWSET (F_HIGHER + 1)
1211 { "vs", 7, 5, 0, 0 },
1212 #define F_OVERFLOW (F_OVERFLOWSET + 1)
1213 { "v", 7, 5, 0, 1 },
1214 #define F_NOTOVERFLOW (F_OVERFLOW + 1)
1215 { "nv", 8, 5, 0, 1 },
1216 #define F_OVERFLOWCLR (F_NOTOVERFLOW + 1)
1217 { "vc", 8, 5, 0, 0 },
1218 #define F_GT (F_OVERFLOWCLR + 1)
1219 { "gt", 9, 5, 0, 1 },
1220 #define F_GE (F_GT + 1)
1221 { "ge", 10, 5, 0, 1 },
1222 #define F_LT (F_GE + 1)
1223 { "lt", 11, 5, 0, 1 },
1224 #define F_LE (F_LT + 1)
1225 { "le", 12, 5, 0, 1 },
1226 #define F_HI (F_LE + 1)
1227 { "hi", 13, 5, 0, 1 },
1228 #define F_LS (F_HI + 1)
1229 { "ls", 14, 5, 0, 1 },
1230 #define F_PNZ (F_LS + 1)
1231 { "pnz", 15, 5, 0, 1 },
1234 #define F_FLAG (F_PNZ + 1)
1235 { "f", 1, 1, 15, 1 },
1236 #define F_FFAKE (F_FLAG + 1)
1237 { "f", 0, 0, 0, 1 },
1240 #define F_ND (F_FFAKE + 1)
1241 { "nd", 0, 1, 5, 0 },
1242 #define F_D (F_ND + 1)
1243 { "d", 1, 1, 5, 1 },
1244 #define F_DFAKE (F_D + 1)
1245 { "d", 0, 0, 0, 1 },
1248 #define F_SIZEB1 (F_DFAKE + 1)
1249 { "b", 1, 2, 1, 1 },
1250 #define F_SIZEB7 (F_SIZEB1 + 1)
1251 { "b", 1, 2, 7, 1 },
1252 #define F_SIZEB17 (F_SIZEB7 + 1)
1253 { "b", 1, 2, 17, 1 },
1254 #define F_SIZEW1 (F_SIZEB17 + 1)
1255 { "w", 2, 2, 1, 0 },
1256 #define F_SIZEW7 (F_SIZEW1 + 1)
1257 { "w", 2, 2, 7, 0 },
1258 #define F_SIZEW17 (F_SIZEW7 + 1)
1259 { "w", 2, 2, 17, 0 },
1261 /* Sign extension. */
1262 #define F_SIGN6 (F_SIZEW17 + 1)
1263 { "x", 1, 1, 6, 1 },
1264 #define F_SIGN16 (F_SIGN6 + 1)
1265 { "x", 1, 1, 16, 1 },
1266 #define F_SIGNX (F_SIGN16 + 1)
1267 { "x", 0, 0, 0, 1 },
1269 /* Address write-back modes. */
1270 #define F_A3 (F_SIGNX + 1)
1271 { "a", 1, 2, 3, 0 },
1272 #define F_A9 (F_A3 + 1)
1273 { "a", 1, 2, 9, 0 },
1274 #define F_A22 (F_A9 + 1)
1275 { "a", 1, 2, 22, 0 },
1276 #define F_AW3 (F_A22 + 1)
1277 { "aw", 1, 2, 3, 1 },
1278 #define F_AW9 (F_AW3 + 1)
1279 { "aw", 1, 2, 9, 1 },
1280 #define F_AW22 (F_AW9 + 1)
1281 { "aw", 1, 2, 22, 1 },
1282 #define F_AB3 (F_AW22 + 1)
1283 { "ab", 2, 2, 3, 1 },
1284 #define F_AB9 (F_AB3 + 1)
1285 { "ab", 2, 2, 9, 1 },
1286 #define F_AB22 (F_AB9 + 1)
1287 { "ab", 2, 2, 22, 1 },
1288 #define F_AS3 (F_AB22 + 1)
1289 { "as", 3, 2, 3, 1 },
1290 #define F_AS9 (F_AS3 + 1)
1291 { "as", 3, 2, 9, 1 },
1292 #define F_AS22 (F_AS9 + 1)
1293 { "as", 3, 2, 22, 1 },
1294 #define F_ASFAKE (F_AS22 + 1)
1295 { "as", 0, 0, 0, 1 },
1298 #define F_DI5 (F_ASFAKE + 1)
1299 { "di", 1, 1, 5, 1 },
1300 #define F_DI11 (F_DI5 + 1)
1301 { "di", 1, 1, 11, 1 },
1302 #define F_DI15 (F_DI11 + 1)
1303 { "di", 1, 1, 15, 1 },
1305 /* ARCv2 specific. */
1306 #define F_NT (F_DI15 + 1)
1307 { "nt", 0, 1, 3, 1},
1308 #define F_T (F_NT + 1)
1310 #define F_H1 (F_T + 1)
1311 { "h", 2, 2, 1, 1 },
1312 #define F_H7 (F_H1 + 1)
1313 { "h", 2, 2, 7, 1 },
1314 #define F_H17 (F_H7 + 1)
1315 { "h", 2, 2, 17, 1 },
1318 #define F_NE (F_H17 + 1)
1319 { "ne", 0, 0, 0, 1 },
1321 /* ARC NPS400 Support: See comment near head of file. */
1322 #define F_NPS_CL (F_NE + 1)
1323 { "cl", 0, 0, 0, 1 },
1325 #define F_NPS_FLAG (F_NPS_CL + 1)
1326 { "f", 1, 1, 20, 1 },
1328 #define F_NPS_R (F_NPS_FLAG + 1)
1329 { "r", 1, 1, 15, 1 },
1331 #define F_NPS_RW (F_NPS_R + 1)
1332 { "rw", 0, 1, 7, 1 },
1334 #define F_NPS_RD (F_NPS_RW + 1)
1335 { "rd", 1, 1, 7, 1 },
1337 #define F_NPS_WFT (F_NPS_RD + 1)
1338 { "wft", 0, 0, 0, 1 },
1340 #define F_NPS_IE1 (F_NPS_WFT + 1)
1341 { "ie1", 1, 2, 8, 1 },
1343 #define F_NPS_IE2 (F_NPS_IE1 + 1)
1344 { "ie2", 2, 2, 8, 1 },
1346 #define F_NPS_IE12 (F_NPS_IE2 + 1)
1347 { "ie12", 3, 2, 8, 1 },
1349 #define F_NPS_SYNC_RD (F_NPS_IE12 + 1)
1350 { "rd", 0, 1, 6, 1 },
1352 #define F_NPS_SYNC_WR (F_NPS_SYNC_RD + 1)
1353 { "wr", 1, 1, 6, 1 },
1355 #define F_NPS_HWS_OFF (F_NPS_SYNC_WR + 1)
1356 { "off", 0, 0, 0, 1 },
1358 #define F_NPS_HWS_RESTORE (F_NPS_HWS_OFF + 1)
1359 { "restore", 0, 0, 0, 1 },
1361 #define F_NPS_SX (F_NPS_HWS_RESTORE + 1)
1362 { "sx", 1, 1, 14, 1 },
1364 #define F_NPS_AR (F_NPS_SX + 1)
1365 { "ar", 0, 1, 0, 1 },
1367 #define F_NPS_AL (F_NPS_AR + 1)
1368 { "al", 1, 1, 0, 1 },
1370 #define F_NPS_S (F_NPS_AL + 1)
1371 { "s", 0, 0, 0, 1 },
1373 #define F_NPS_ZNCV_RD (F_NPS_S + 1)
1374 { "rd", 0, 1, 15, 1 },
1376 #define F_NPS_ZNCV_WR (F_NPS_ZNCV_RD + 1)
1377 { "wr", 1, 1, 15, 1 },
1379 #define F_NPS_P0 (F_NPS_ZNCV_WR + 1)
1380 { "p0", 0, 0, 0, 1 },
1382 #define F_NPS_P1 (F_NPS_P0 + 1)
1383 { "p1", 0, 0, 0, 1 },
1385 #define F_NPS_P2 (F_NPS_P1 + 1)
1386 { "p2", 0, 0, 0, 1 },
1388 #define F_NPS_P3 (F_NPS_P2 + 1)
1389 { "p3", 0, 0, 0, 1 },
1392 const unsigned arc_num_flag_operands
= ARRAY_SIZE (arc_flag_operands
);
1394 /* Table of the flag classes.
1396 The format of the table is
1397 CLASS {FLAG_CODE}. */
1398 const struct arc_flag_class arc_flag_classes
[] =
1401 { F_CLASS_NONE
, { F_NULL
} },
1403 #define C_CC (C_EMPTY + 1)
1404 { F_CLASS_OPTIONAL
| F_CLASS_EXTEND
| F_CLASS_COND
,
1405 { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
,
1406 F_NOTZERO
, F_POZITIVE
, F_PL
, F_NEGATIVE
, F_MINUS
,
1407 F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
1408 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
,
1409 F_NOTOVERFLOW
, F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
,
1410 F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
1412 #define C_AA_ADDR3 (C_CC + 1)
1413 #define C_AA27 (C_CC + 1)
1414 { F_CLASS_OPTIONAL
, { F_A3
, F_AW3
, F_AB3
, F_AS3
, F_NULL
} },
1415 #define C_AA_ADDR9 (C_AA_ADDR3 + 1)
1416 #define C_AA21 (C_AA_ADDR3 + 1)
1417 { F_CLASS_OPTIONAL
, { F_A9
, F_AW9
, F_AB9
, F_AS9
, F_NULL
} },
1418 #define C_AA_ADDR22 (C_AA_ADDR9 + 1)
1419 #define C_AA8 (C_AA_ADDR9 + 1)
1420 { F_CLASS_OPTIONAL
, { F_A22
, F_AW22
, F_AB22
, F_AS22
, F_NULL
} },
1422 #define C_F (C_AA_ADDR22 + 1)
1423 { F_CLASS_OPTIONAL
, { F_FLAG
, F_NULL
} },
1424 #define C_FHARD (C_F + 1)
1425 { F_CLASS_OPTIONAL
, { F_FFAKE
, F_NULL
} },
1427 #define C_T (C_FHARD + 1)
1428 { F_CLASS_OPTIONAL
, { F_NT
, F_T
, F_NULL
} },
1429 #define C_D (C_T + 1)
1430 { F_CLASS_OPTIONAL
, { F_ND
, F_D
, F_NULL
} },
1432 #define C_DHARD (C_D + 1)
1433 { F_CLASS_OPTIONAL
, { F_DFAKE
, F_NULL
} },
1435 #define C_DI20 (C_DHARD + 1)
1436 { F_CLASS_OPTIONAL
, { F_DI11
, F_NULL
}},
1437 #define C_DI16 (C_DI20 + 1)
1438 { F_CLASS_OPTIONAL
, { F_DI15
, F_NULL
}},
1439 #define C_DI26 (C_DI16 + 1)
1440 { F_CLASS_OPTIONAL
, { F_DI5
, F_NULL
}},
1442 #define C_X25 (C_DI26 + 1)
1443 { F_CLASS_OPTIONAL
, { F_SIGN6
, F_NULL
}},
1444 #define C_X15 (C_X25 + 1)
1445 { F_CLASS_OPTIONAL
, { F_SIGN16
, F_NULL
}},
1446 #define C_XHARD (C_X15 + 1)
1447 #define C_X (C_X15 + 1)
1448 { F_CLASS_OPTIONAL
, { F_SIGNX
, F_NULL
}},
1450 #define C_ZZ13 (C_X + 1)
1451 { F_CLASS_OPTIONAL
, { F_SIZEB17
, F_SIZEW17
, F_H17
, F_NULL
}},
1452 #define C_ZZ23 (C_ZZ13 + 1)
1453 { F_CLASS_OPTIONAL
, { F_SIZEB7
, F_SIZEW7
, F_H7
, F_NULL
}},
1454 #define C_ZZ29 (C_ZZ23 + 1)
1455 { F_CLASS_OPTIONAL
, { F_SIZEB1
, F_SIZEW1
, F_H1
, F_NULL
}},
1457 #define C_AS (C_ZZ29 + 1)
1458 { F_CLASS_OPTIONAL
, { F_ASFAKE
, F_NULL
}},
1460 #define C_NE (C_AS + 1)
1461 { F_CLASS_OPTIONAL
, { F_NE
, F_NULL
}},
1463 /* ARC NPS400 Support: See comment near head of file. */
1464 #define C_NPS_CL (C_NE + 1)
1465 { F_CLASS_REQUIRED
, { F_NPS_CL
, F_NULL
}},
1467 #define C_NPS_F (C_NPS_CL + 1)
1468 { F_CLASS_OPTIONAL
, { F_NPS_FLAG
, F_NULL
}},
1470 #define C_NPS_R (C_NPS_F + 1)
1471 { F_CLASS_OPTIONAL
, { F_NPS_R
, F_NULL
}},
1473 #define C_NPS_SCHD_RW (C_NPS_R + 1)
1474 { F_CLASS_REQUIRED
, { F_NPS_RW
, F_NPS_RD
, F_NULL
}},
1476 #define C_NPS_SCHD_TRIG (C_NPS_SCHD_RW + 1)
1477 { F_CLASS_REQUIRED
, { F_NPS_WFT
, F_NULL
}},
1479 #define C_NPS_SCHD_IE (C_NPS_SCHD_TRIG + 1)
1480 { F_CLASS_OPTIONAL
, { F_NPS_IE1
, F_NPS_IE2
, F_NPS_IE12
, F_NULL
}},
1482 #define C_NPS_SYNC (C_NPS_SCHD_IE + 1)
1483 { F_CLASS_REQUIRED
, { F_NPS_SYNC_RD
, F_NPS_SYNC_WR
, F_NULL
}},
1485 #define C_NPS_HWS_OFF (C_NPS_SYNC + 1)
1486 { F_CLASS_REQUIRED
, { F_NPS_HWS_OFF
, F_NULL
}},
1488 #define C_NPS_HWS_RESTORE (C_NPS_HWS_OFF + 1)
1489 { F_CLASS_REQUIRED
, { F_NPS_HWS_RESTORE
, F_NULL
}},
1491 #define C_NPS_SX (C_NPS_HWS_RESTORE + 1)
1492 { F_CLASS_OPTIONAL
, { F_NPS_SX
, F_NULL
}},
1494 #define C_NPS_AR_AL (C_NPS_SX + 1)
1495 { F_CLASS_REQUIRED
, { F_NPS_AR
, F_NPS_AL
, F_NULL
}},
1497 #define C_NPS_S (C_NPS_AR_AL + 1)
1498 { F_CLASS_REQUIRED
, { F_NPS_S
, F_NULL
}},
1500 #define C_NPS_ZNCV (C_NPS_S + 1)
1501 { F_CLASS_REQUIRED
, { F_NPS_ZNCV_RD
, F_NPS_ZNCV_WR
, F_NULL
}},
1503 #define C_NPS_P0 (C_NPS_ZNCV + 1)
1504 { F_CLASS_REQUIRED
, { F_NPS_P0
, F_NULL
}},
1506 #define C_NPS_P1 (C_NPS_P0 + 1)
1507 { F_CLASS_REQUIRED
, { F_NPS_P1
, F_NULL
}},
1509 #define C_NPS_P2 (C_NPS_P1 + 1)
1510 { F_CLASS_REQUIRED
, { F_NPS_P2
, F_NULL
}},
1512 #define C_NPS_P3 (C_NPS_P2 + 1)
1513 { F_CLASS_REQUIRED
, { F_NPS_P3
, F_NULL
}},
1516 const unsigned char flags_none
[] = { 0 };
1517 const unsigned char flags_f
[] = { C_F
};
1518 const unsigned char flags_cc
[] = { C_CC
};
1519 const unsigned char flags_ccf
[] = { C_CC
, C_F
};
1521 /* The operands table.
1523 The format of the operands table is:
1525 BITS SHIFT DEFAULT_RELOC FLAGS INSERT_FUN EXTRACT_FUN. */
1526 const struct arc_operand arc_operands
[] =
1528 /* The fields are bits, shift, insert, extract, flags. The zero
1529 index is used to indicate end-of-list. */
1531 { 0, 0, 0, 0, 0, 0 },
1533 #define IGNORED (UNUSED + 1)
1534 { 0, 0, 0, ARC_OPERAND_IGNORE
| ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, 0, 0 },
1536 /* The plain integer register fields. Used by 32 bit
1538 #define RA (IGNORED + 1)
1539 { 6, 0, 0, ARC_OPERAND_IR
, 0, 0 },
1541 { 6, 12, 0, ARC_OPERAND_IR
, insert_rb
, extract_rb
},
1543 { 6, 6, 0, ARC_OPERAND_IR
, 0, 0 },
1544 #define RBdup (RC + 1)
1545 { 6, 12, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
, insert_rb
, extract_rb
},
1547 #define RAD (RBdup + 1)
1548 { 6, 0, 0, ARC_OPERAND_IR
| ARC_OPERAND_TRUNCATE
, insert_rad
, 0 },
1549 #define RCD (RAD + 1)
1550 { 6, 6, 0, ARC_OPERAND_IR
| ARC_OPERAND_TRUNCATE
, insert_rcd
, 0 },
1552 /* The plain integer register fields. Used by short
1554 #define RA16 (RCD + 1)
1555 #define RA_S (RCD + 1)
1556 { 4, 0, 0, ARC_OPERAND_IR
, insert_ras
, extract_ras
},
1557 #define RB16 (RA16 + 1)
1558 #define RB_S (RA16 + 1)
1559 { 4, 8, 0, ARC_OPERAND_IR
, insert_rbs
, extract_rbs
},
1560 #define RB16dup (RB16 + 1)
1561 #define RB_Sdup (RB16 + 1)
1562 { 4, 8, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
, insert_rbs
, extract_rbs
},
1563 #define RC16 (RB16dup + 1)
1564 #define RC_S (RB16dup + 1)
1565 { 4, 5, 0, ARC_OPERAND_IR
, insert_rcs
, extract_rcs
},
1566 #define R6H (RC16 + 1) /* 6bit register field 'h' used
1568 { 6, 5, 0, ARC_OPERAND_IR
, insert_rhv1
, extract_rhv1
},
1569 #define R5H (R6H + 1) /* 5bit register field 'h' used
1571 #define RH_S (R6H + 1) /* 5bit register field 'h' used
1573 { 5, 5, 0, ARC_OPERAND_IR
, insert_rhv2
, extract_rhv2
},
1574 #define R5Hdup (R5H + 1)
1575 #define RH_Sdup (R5H + 1)
1576 { 5, 5, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
,
1577 insert_rhv2
, extract_rhv2
},
1579 #define RG (R5Hdup + 1)
1580 #define G_S (R5Hdup + 1)
1581 { 5, 5, 0, ARC_OPERAND_IR
, insert_g_s
, extract_g_s
},
1583 /* Fix registers. */
1585 #define R0_S (RG + 1)
1586 { 0, 0, 0, ARC_OPERAND_IR
, insert_r0
, extract_r0
},
1588 #define R1_S (R0 + 1)
1589 { 1, 0, 0, ARC_OPERAND_IR
, insert_r1
, extract_r1
},
1591 #define R2_S (R1 + 1)
1592 { 2, 0, 0, ARC_OPERAND_IR
, insert_r2
, extract_r2
},
1594 #define R3_S (R2 + 1)
1595 { 2, 0, 0, ARC_OPERAND_IR
, insert_r3
, extract_r3
},
1596 #define RSP (R3 + 1)
1597 #define SP_S (R3 + 1)
1598 { 5, 0, 0, ARC_OPERAND_IR
, insert_sp
, extract_sp
},
1599 #define SPdup (RSP + 1)
1600 #define SP_Sdup (RSP + 1)
1601 { 5, 0, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
, insert_sp
, extract_sp
},
1602 #define GP (SPdup + 1)
1603 #define GP_S (SPdup + 1)
1604 { 5, 0, 0, ARC_OPERAND_IR
, insert_gp
, extract_gp
},
1606 #define PCL_S (GP + 1)
1607 { 1, 0, 0, ARC_OPERAND_IR
| ARC_OPERAND_NCHK
, insert_pcl
, extract_pcl
},
1609 #define BLINK (PCL_S + 1)
1610 #define BLINK_S (PCL_S + 1)
1611 { 5, 0, 0, ARC_OPERAND_IR
, insert_blink
, extract_blink
},
1613 #define ILINK1 (BLINK + 1)
1614 { 5, 0, 0, ARC_OPERAND_IR
, insert_ilink1
, extract_ilink1
},
1615 #define ILINK2 (ILINK1 + 1)
1616 { 5, 0, 0, ARC_OPERAND_IR
, insert_ilink2
, extract_ilink2
},
1618 /* Long immediate. */
1619 #define LIMM (ILINK2 + 1)
1620 #define LIMM_S (ILINK2 + 1)
1621 { 32, 0, BFD_RELOC_ARC_32_ME
, ARC_OPERAND_LIMM
, insert_limm
, 0 },
1622 #define LIMMdup (LIMM + 1)
1623 { 32, 0, 0, ARC_OPERAND_LIMM
| ARC_OPERAND_DUPLICATE
, insert_limm
, 0 },
1625 /* Special operands. */
1626 #define ZA (LIMMdup + 1)
1627 #define ZB (LIMMdup + 1)
1628 #define ZA_S (LIMMdup + 1)
1629 #define ZB_S (LIMMdup + 1)
1630 #define ZC_S (LIMMdup + 1)
1631 { 0, 0, 0, ARC_OPERAND_UNSIGNED
, insert_za
, 0 },
1633 #define RRANGE_EL (ZA + 1)
1634 { 4, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
| ARC_OPERAND_TRUNCATE
,
1635 insert_rrange
, extract_rrange
},
1636 #define FP_EL (RRANGE_EL + 1)
1637 { 1, 0, 0, ARC_OPERAND_IR
| ARC_OPERAND_IGNORE
| ARC_OPERAND_NCHK
,
1638 insert_fpel
, extract_fpel
},
1639 #define BLINK_EL (FP_EL + 1)
1640 { 1, 0, 0, ARC_OPERAND_IR
| ARC_OPERAND_IGNORE
| ARC_OPERAND_NCHK
,
1641 insert_blinkel
, extract_blinkel
},
1642 #define PCL_EL (BLINK_EL + 1)
1643 { 1, 0, 0, ARC_OPERAND_IR
| ARC_OPERAND_IGNORE
| ARC_OPERAND_NCHK
,
1644 insert_pclel
, extract_pclel
},
1646 /* Fake operand to handle the T flag. */
1647 #define BRAKET (PCL_EL + 1)
1648 #define BRAKETdup (PCL_EL + 1)
1649 { 0, 0, 0, ARC_OPERAND_FAKE
| ARC_OPERAND_BRAKET
, 0, 0 },
1651 /* Fake operand to handle the T flag. */
1652 #define FKT_T (BRAKET + 1)
1653 { 1, 3, 0, ARC_OPERAND_FAKE
, insert_Ybit
, 0 },
1654 /* Fake operand to handle the T flag. */
1655 #define FKT_NT (FKT_T + 1)
1656 { 1, 3, 0, ARC_OPERAND_FAKE
, insert_NYbit
, 0 },
1658 /* UIMM6_20 mask = 00000000000000000000111111000000. */
1659 #define UIMM6_20 (FKT_NT + 1)
1660 {6, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm6_20
, extract_uimm6_20
},
1662 /* SIMM12_20 mask = 00000000000000000000111111222222. */
1663 #define SIMM12_20 (UIMM6_20 + 1)
1664 {12, 0, 0, ARC_OPERAND_SIGNED
, insert_simm12_20
, extract_simm12_20
},
1666 /* SIMM3_5_S mask = 0000011100000000. */
1667 #define SIMM3_5_S (SIMM12_20 + 1)
1668 {3, 0, 0, ARC_OPERAND_SIGNED
| ARC_OPERAND_NCHK
,
1669 insert_simm3s
, extract_simm3s
},
1671 /* UIMM7_A32_11_S mask = 0000000000011111. */
1672 #define UIMM7_A32_11_S (SIMM3_5_S + 1)
1673 {7, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_ALIGNED32
1674 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_IGNORE
, insert_uimm7_a32_11_s
,
1675 extract_uimm7_a32_11_s
},
1677 /* UIMM7_9_S mask = 0000000001111111. */
1678 #define UIMM7_9_S (UIMM7_A32_11_S + 1)
1679 {7, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm7_9_s
, extract_uimm7_9_s
},
1681 /* UIMM3_13_S mask = 0000000000000111. */
1682 #define UIMM3_13_S (UIMM7_9_S + 1)
1683 {3, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm3_13_s
, extract_uimm3_13_s
},
1685 /* SIMM11_A32_7_S mask = 0000000111111111. */
1686 #define SIMM11_A32_7_S (UIMM3_13_S + 1)
1687 {11, 0, BFD_RELOC_ARC_SDA16_LD2
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED32
1688 | ARC_OPERAND_TRUNCATE
, insert_simm11_a32_7_s
, extract_simm11_a32_7_s
},
1690 /* UIMM6_13_S mask = 0000000002220111. */
1691 #define UIMM6_13_S (SIMM11_A32_7_S + 1)
1692 {6, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm6_13_s
, extract_uimm6_13_s
},
1693 /* UIMM5_11_S mask = 0000000000011111. */
1694 #define UIMM5_11_S (UIMM6_13_S + 1)
1695 {5, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_IGNORE
, insert_uimm5_11_s
,
1696 extract_uimm5_11_s
},
1698 /* SIMM9_A16_8 mask = 00000000111111102000000000000000. */
1699 #define SIMM9_A16_8 (UIMM5_11_S + 1)
1700 {9, 0, -SIMM9_A16_8
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED16
1701 | ARC_OPERAND_PCREL
| ARC_OPERAND_TRUNCATE
, insert_simm9_a16_8
,
1702 extract_simm9_a16_8
},
1704 /* UIMM6_8 mask = 00000000000000000000111111000000. */
1705 #define UIMM6_8 (SIMM9_A16_8 + 1)
1706 {6, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm6_8
, extract_uimm6_8
},
1708 /* SIMM21_A16_5 mask = 00000111111111102222222222000000. */
1709 #define SIMM21_A16_5 (UIMM6_8 + 1)
1710 {21, 0, BFD_RELOC_ARC_S21H_PCREL
, ARC_OPERAND_SIGNED
1711 | ARC_OPERAND_ALIGNED16
| ARC_OPERAND_TRUNCATE
,
1712 insert_simm21_a16_5
, extract_simm21_a16_5
},
1714 /* SIMM25_A16_5 mask = 00000111111111102222222222003333. */
1715 #define SIMM25_A16_5 (SIMM21_A16_5 + 1)
1716 {25, 0, BFD_RELOC_ARC_S25H_PCREL
, ARC_OPERAND_SIGNED
1717 | ARC_OPERAND_ALIGNED16
| ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
,
1718 insert_simm25_a16_5
, extract_simm25_a16_5
},
1720 /* SIMM10_A16_7_S mask = 0000000111111111. */
1721 #define SIMM10_A16_7_S (SIMM25_A16_5 + 1)
1722 {10, 0, -SIMM10_A16_7_S
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED16
1723 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm10_a16_7_s
,
1724 extract_simm10_a16_7_s
},
1726 #define SIMM10_A16_7_Sbis (SIMM10_A16_7_S + 1)
1727 {10, 0, -SIMM10_A16_7_Sbis
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED16
1728 | ARC_OPERAND_TRUNCATE
, insert_simm10_a16_7_s
, extract_simm10_a16_7_s
},
1730 /* SIMM7_A16_10_S mask = 0000000000111111. */
1731 #define SIMM7_A16_10_S (SIMM10_A16_7_Sbis + 1)
1732 {7, 0, -SIMM7_A16_10_S
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED16
1733 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm7_a16_10_s
,
1734 extract_simm7_a16_10_s
},
1736 /* SIMM21_A32_5 mask = 00000111111111002222222222000000. */
1737 #define SIMM21_A32_5 (SIMM7_A16_10_S + 1)
1738 {21, 0, BFD_RELOC_ARC_S21W_PCREL
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED32
1739 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm21_a32_5
,
1740 extract_simm21_a32_5
},
1742 /* SIMM25_A32_5 mask = 00000111111111002222222222003333. */
1743 #define SIMM25_A32_5 (SIMM21_A32_5 + 1)
1744 {25, 0, BFD_RELOC_ARC_S25W_PCREL
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED32
1745 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm25_a32_5
,
1746 extract_simm25_a32_5
},
1748 /* SIMM13_A32_5_S mask = 0000011111111111. */
1749 #define SIMM13_A32_5_S (SIMM25_A32_5 + 1)
1750 {13, 0, BFD_RELOC_ARC_S13_PCREL
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED32
1751 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm13_a32_5_s
,
1752 extract_simm13_a32_5_s
},
1754 /* SIMM8_A16_9_S mask = 0000000001111111. */
1755 #define SIMM8_A16_9_S (SIMM13_A32_5_S + 1)
1756 {8, 0, -SIMM8_A16_9_S
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED16
1757 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm8_a16_9_s
,
1758 extract_simm8_a16_9_s
},
1760 /* UIMM3_23 mask = 00000000000000000000000111000000. */
1761 #define UIMM3_23 (SIMM8_A16_9_S + 1)
1762 {3, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm3_23
, extract_uimm3_23
},
1764 /* UIMM10_6_S mask = 0000001111111111. */
1765 #define UIMM10_6_S (UIMM3_23 + 1)
1766 {10, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm10_6_s
, extract_uimm10_6_s
},
1768 /* UIMM6_11_S mask = 0000002200011110. */
1769 #define UIMM6_11_S (UIMM10_6_S + 1)
1770 {6, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm6_11_s
, extract_uimm6_11_s
},
1772 /* SIMM9_8 mask = 00000000111111112000000000000000. */
1773 #define SIMM9_8 (UIMM6_11_S + 1)
1774 {9, 0, BFD_RELOC_ARC_SDA_LDST
, ARC_OPERAND_SIGNED
| ARC_OPERAND_IGNORE
,
1775 insert_simm9_8
, extract_simm9_8
},
1777 /* UIMM10_A32_8_S mask = 0000000011111111. */
1778 #define UIMM10_A32_8_S (SIMM9_8 + 1)
1779 {10, 0, -UIMM10_A32_8_S
, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_ALIGNED32
1780 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_uimm10_a32_8_s
,
1781 extract_uimm10_a32_8_s
},
1783 /* SIMM9_7_S mask = 0000000111111111. */
1784 #define SIMM9_7_S (UIMM10_A32_8_S + 1)
1785 {9, 0, BFD_RELOC_ARC_SDA16_LD
, ARC_OPERAND_SIGNED
, insert_simm9_7_s
,
1788 /* UIMM6_A16_11_S mask = 0000000000011111. */
1789 #define UIMM6_A16_11_S (SIMM9_7_S + 1)
1790 {6, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_ALIGNED16
1791 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_IGNORE
, insert_uimm6_a16_11_s
,
1792 extract_uimm6_a16_11_s
},
1794 /* UIMM5_A32_11_S mask = 0000020000011000. */
1795 #define UIMM5_A32_11_S (UIMM6_A16_11_S + 1)
1796 {5, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_ALIGNED32
1797 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_IGNORE
, insert_uimm5_a32_11_s
,
1798 extract_uimm5_a32_11_s
},
1800 /* SIMM11_A32_13_S mask = 0000022222200111. */
1801 #define SIMM11_A32_13_S (UIMM5_A32_11_S + 1)
1802 {11, 0, BFD_RELOC_ARC_SDA16_ST2
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED32
1803 | ARC_OPERAND_TRUNCATE
, insert_simm11_a32_13_s
, extract_simm11_a32_13_s
},
1805 /* UIMM7_13_S mask = 0000000022220111. */
1806 #define UIMM7_13_S (SIMM11_A32_13_S + 1)
1807 {7, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm7_13_s
, extract_uimm7_13_s
},
1809 /* UIMM6_A16_21 mask = 00000000000000000000011111000000. */
1810 #define UIMM6_A16_21 (UIMM7_13_S + 1)
1811 {6, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_ALIGNED16
1812 | ARC_OPERAND_TRUNCATE
, insert_uimm6_a16_21
, extract_uimm6_a16_21
},
1814 /* UIMM7_11_S mask = 0000022200011110. */
1815 #define UIMM7_11_S (UIMM6_A16_21 + 1)
1816 {7, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm7_11_s
, extract_uimm7_11_s
},
1818 /* UIMM7_A16_20 mask = 00000000000000000000111111000000. */
1819 #define UIMM7_A16_20 (UIMM7_11_S + 1)
1820 {7, 0, -UIMM7_A16_20
, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_ALIGNED16
1821 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_uimm7_a16_20
,
1822 extract_uimm7_a16_20
},
1824 /* SIMM13_A16_20 mask = 00000000000000000000111111222222. */
1825 #define SIMM13_A16_20 (UIMM7_A16_20 + 1)
1826 {13, 0, -SIMM13_A16_20
, ARC_OPERAND_SIGNED
| ARC_OPERAND_ALIGNED16
1827 | ARC_OPERAND_TRUNCATE
| ARC_OPERAND_PCREL
, insert_simm13_a16_20
,
1828 extract_simm13_a16_20
},
1830 /* UIMM8_8_S mask = 0000000011111111. */
1831 #define UIMM8_8_S (SIMM13_A16_20 + 1)
1832 {8, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm8_8_s
, extract_uimm8_8_s
},
1834 /* W6 mask = 00000000000000000000111111000000. */
1835 #define W6 (UIMM8_8_S + 1)
1836 {6, 0, 0, ARC_OPERAND_SIGNED
, insert_w6
, extract_w6
},
1838 /* UIMM6_5_S mask = 0000011111100000. */
1839 #define UIMM6_5_S (W6 + 1)
1840 {6, 0, 0, ARC_OPERAND_UNSIGNED
, insert_uimm6_5_s
, extract_uimm6_5_s
},
1842 /* ARC NPS400 Support: See comment near head of file. */
1843 #define NPS_R_DST_3B (UIMM6_5_S + 1)
1844 { 3, 24, 0, ARC_OPERAND_IR
| ARC_OPERAND_NCHK
, insert_nps_3bit_dst
, extract_nps_3bit_dst
},
1846 #define NPS_R_SRC1_3B (NPS_R_DST_3B + 1)
1847 { 3, 24, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
| ARC_OPERAND_NCHK
, insert_nps_3bit_dst
, extract_nps_3bit_dst
},
1849 #define NPS_R_SRC2_3B (NPS_R_SRC1_3B + 1)
1850 { 3, 21, 0, ARC_OPERAND_IR
| ARC_OPERAND_NCHK
, insert_nps_3bit_src2
, extract_nps_3bit_src2
},
1852 #define NPS_R_DST (NPS_R_SRC2_3B + 1)
1853 { 6, 21, 0, ARC_OPERAND_IR
, NULL
, NULL
},
1855 #define NPS_R_SRC1 (NPS_R_DST + 1)
1856 { 6, 21, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
, NULL
, NULL
},
1858 #define NPS_BITOP_DST_POS (NPS_R_SRC1 + 1)
1859 { 5, 5, 0, ARC_OPERAND_UNSIGNED
, 0, 0 },
1861 #define NPS_BITOP_SRC_POS (NPS_BITOP_DST_POS + 1)
1862 { 5, 0, 0, ARC_OPERAND_UNSIGNED
, 0, 0 },
1864 #define NPS_BITOP_SIZE (NPS_BITOP_SRC_POS + 1)
1865 { 5, 10, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_bitop_size
, extract_nps_bitop_size
},
1867 #define NPS_BITOP_DST_POS_SZ (NPS_BITOP_SIZE + 1)
1868 { 5, 0, 0, ARC_OPERAND_UNSIGNED
, insert_nps_dst_pos_and_size
, extract_nps_dst_pos_and_size
},
1870 #define NPS_BITOP_SIZE_2B (NPS_BITOP_DST_POS_SZ + 1)
1871 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_bitop_size_2b
, extract_nps_bitop_size_2b
},
1873 #define NPS_BITOP_UIMM8 (NPS_BITOP_SIZE_2B + 1)
1874 { 8, 0, 0, ARC_OPERAND_UNSIGNED
, insert_nps_bitop_uimm8
, extract_nps_bitop_uimm8
},
1876 #define NPS_UIMM16 (NPS_BITOP_UIMM8 + 1)
1877 { 16, 0, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1879 #define NPS_SIMM16 (NPS_UIMM16 + 1)
1880 { 16, 0, 0, ARC_OPERAND_SIGNED
, NULL
, NULL
},
1882 #define NPS_RFLT_UIMM6 (NPS_SIMM16 + 1)
1883 { 6, 6, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_rflt_uimm6
, extract_nps_rflt_uimm6
},
1885 #define NPS_XLDST_UIMM16 (NPS_RFLT_UIMM6 + 1)
1886 { 16, 0, BFD_RELOC_ARC_NPS_CMEM16
, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_cmem_uimm16
, extract_nps_cmem_uimm16
},
1888 #define NPS_SRC2_POS (NPS_XLDST_UIMM16 + 1)
1889 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_src2_pos
, extract_nps_src2_pos
},
1891 #define NPS_SRC1_POS (NPS_SRC2_POS + 1)
1892 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_src1_pos
, extract_nps_src1_pos
},
1894 #define NPS_ADDB_SIZE (NPS_SRC1_POS + 1)
1895 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_addb_size
, extract_nps_addb_size
},
1897 #define NPS_ANDB_SIZE (NPS_ADDB_SIZE + 1)
1898 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_andb_size
, extract_nps_andb_size
},
1900 #define NPS_FXORB_SIZE (NPS_ANDB_SIZE + 1)
1901 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_fxorb_size
, extract_nps_fxorb_size
},
1903 #define NPS_WXORB_SIZE (NPS_FXORB_SIZE + 1)
1904 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_wxorb_size
, extract_nps_wxorb_size
},
1906 #define NPS_R_XLDST (NPS_WXORB_SIZE + 1)
1907 { 6, 5, 0, ARC_OPERAND_IR
, NULL
, NULL
},
1909 #define NPS_DIV_UIMM4 (NPS_R_XLDST + 1)
1910 { 4, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1912 #define NPS_QCMP_SIZE (NPS_DIV_UIMM4 + 1)
1913 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_qcmp_size
, extract_nps_qcmp_size
},
1915 #define NPS_QCMP_M1 (NPS_QCMP_SIZE + 1)
1916 { 1, 14, 0, ARC_OPERAND_UNSIGNED
, NULL
, extract_nps_qcmp_m1
},
1918 #define NPS_QCMP_M2 (NPS_QCMP_M1 + 1)
1919 { 1, 15, 0, ARC_OPERAND_UNSIGNED
, NULL
, extract_nps_qcmp_m2
},
1921 #define NPS_QCMP_M3 (NPS_QCMP_M2 + 1)
1922 { 4, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, extract_nps_qcmp_m3
},
1924 #define NPS_CALC_ENTRY_SIZE (NPS_QCMP_M3 + 1)
1925 { 0, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_calc_entry_size
, extract_nps_calc_entry_size
},
1927 #define NPS_R_DST_3B_SHORT (NPS_CALC_ENTRY_SIZE + 1)
1928 { 3, 8, 0, ARC_OPERAND_IR
| ARC_OPERAND_NCHK
, insert_nps_3bit_dst_short
, extract_nps_3bit_dst_short
},
1930 #define NPS_R_SRC1_3B_SHORT (NPS_R_DST_3B_SHORT + 1)
1931 { 3, 8, 0, ARC_OPERAND_IR
| ARC_OPERAND_DUPLICATE
| ARC_OPERAND_NCHK
, insert_nps_3bit_dst_short
, extract_nps_3bit_dst_short
},
1933 #define NPS_R_SRC2_3B_SHORT (NPS_R_SRC1_3B_SHORT + 1)
1934 { 3, 5, 0, ARC_OPERAND_IR
| ARC_OPERAND_NCHK
, insert_nps_3bit_src2_short
, extract_nps_3bit_src2_short
},
1936 #define NPS_BITOP_SIZE2 (NPS_R_SRC2_3B_SHORT + 1)
1937 { 5, 25, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_bitop2_size
, extract_nps_bitop2_size
},
1939 #define NPS_BITOP_SIZE1 (NPS_BITOP_SIZE2 + 1)
1940 { 5, 20, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_bitop1_size
, extract_nps_bitop1_size
},
1942 #define NPS_BITOP_DST_POS3_POS4 (NPS_BITOP_SIZE1 + 1)
1943 { 5, 0, 0, ARC_OPERAND_UNSIGNED
, insert_nps_bitop_dst_pos3_pos4
, extract_nps_bitop_dst_pos3_pos4
},
1945 #define NPS_BITOP_DST_POS4 (NPS_BITOP_DST_POS3_POS4 + 1)
1946 { 5, 10, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1948 #define NPS_BITOP_DST_POS3 (NPS_BITOP_DST_POS4 + 1)
1949 { 5, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1951 #define NPS_BITOP_DST_POS2 (NPS_BITOP_DST_POS3 + 1)
1952 { 5, 15, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1954 #define NPS_BITOP_DST_POS1 (NPS_BITOP_DST_POS2 + 1)
1955 { 5, 10, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1957 #define NPS_BITOP_SRC_POS4 (NPS_BITOP_DST_POS1 + 1)
1958 { 5, 0, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1960 #define NPS_BITOP_SRC_POS3 (NPS_BITOP_SRC_POS4 + 1)
1961 { 5, 20, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1963 #define NPS_BITOP_SRC_POS2 (NPS_BITOP_SRC_POS3 + 1)
1964 { 5, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1966 #define NPS_BITOP_SRC_POS1 (NPS_BITOP_SRC_POS2 + 1)
1967 { 5, 0, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1969 #define NPS_BITOP_MOD4_MSB (NPS_BITOP_SRC_POS1 + 1)
1970 { 2, 0, 0, ARC_OPERAND_UNSIGNED
, insert_nps_bitop_mod4_msb
, extract_nps_bitop_mod4_msb
},
1972 #define NPS_BITOP_MOD4_LSB (NPS_BITOP_MOD4_MSB + 1)
1973 { 2, 0, 0, ARC_OPERAND_UNSIGNED
, insert_nps_bitop_mod4_lsb
, extract_nps_bitop_mod4_lsb
},
1975 #define NPS_BITOP_MOD3 (NPS_BITOP_MOD4_LSB + 1)
1976 { 2, 29, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1978 #define NPS_BITOP_MOD2 (NPS_BITOP_MOD3 + 1)
1979 { 2, 27, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1981 #define NPS_BITOP_MOD1 (NPS_BITOP_MOD2 + 1)
1982 { 2, 25, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1984 #define NPS_BITOP_INS_EXT (NPS_BITOP_MOD1 + 1)
1985 { 5, 20, 0, ARC_OPERAND_UNSIGNED
, insert_nps_bitop_ins_ext
, extract_nps_bitop_ins_ext
},
1987 #define NPS_FIELD_START_POS (NPS_BITOP_INS_EXT + 1)
1988 { 3, 3, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
1990 #define NPS_FIELD_SIZE (NPS_FIELD_START_POS + 1)
1991 { 3, 6, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_field_size
, extract_nps_field_size
},
1993 #define NPS_SHIFT_FACTOR (NPS_FIELD_SIZE + 1)
1994 { 3, 9, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_shift_factor
, extract_nps_shift_factor
},
1996 #define NPS_BITS_TO_SCRAMBLE (NPS_SHIFT_FACTOR + 1)
1997 { 3, 12, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_bits_to_scramble
, extract_nps_bits_to_scramble
},
1999 #define NPS_SRC2_POS_5B (NPS_BITS_TO_SCRAMBLE + 1)
2000 { 5, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2002 #define NPS_BDLEN_MAX_LEN (NPS_SRC2_POS_5B + 1)
2003 { 8, 5, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_bdlen_max_len
, extract_nps_bdlen_max_len
},
2005 #define NPS_MIN_HOFS (NPS_BDLEN_MAX_LEN + 1)
2006 { 4, 6, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_min_hofs
, extract_nps_min_hofs
},
2008 #define NPS_PSBC (NPS_MIN_HOFS + 1)
2009 { 1, 11, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2011 #define NPS_DPI_DST (NPS_PSBC + 1)
2012 { 5, 11, 0, ARC_OPERAND_IR
, NULL
, NULL
},
2014 /* NPS_DPI_SRC1_3B is similar to NPS_R_SRC1_3B but doesn't duplicate an operand */
2015 #define NPS_DPI_SRC1_3B (NPS_DPI_DST + 1)
2016 { 3, 24, 0, ARC_OPERAND_IR
| ARC_OPERAND_NCHK
, insert_nps_3bit_dst
, extract_nps_3bit_dst
},
2018 #define NPS_HASH_WIDTH (NPS_DPI_SRC1_3B + 1)
2019 { 5, 6, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_hash_width
, extract_nps_hash_width
},
2021 #define NPS_HASH_PERM (NPS_HASH_WIDTH + 1)
2022 { 3, 2, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2024 #define NPS_HASH_NONLINEAR (NPS_HASH_PERM + 1)
2025 { 1, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2027 #define NPS_HASH_BASEMAT (NPS_HASH_NONLINEAR + 1)
2028 { 2, 0, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2030 #define NPS_HASH_LEN (NPS_HASH_BASEMAT + 1)
2031 { 3, 2, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_hash_len
, extract_nps_hash_len
},
2033 #define NPS_HASH_OFS (NPS_HASH_LEN + 1)
2034 { 2, 0, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2036 #define NPS_HASH_BASEMAT2 (NPS_HASH_OFS + 1)
2037 { 1, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2039 #define NPS_E4BY_INDEX0 (NPS_HASH_BASEMAT2 + 1)
2040 { 3, 8, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2042 #define NPS_E4BY_INDEX1 (NPS_E4BY_INDEX0 + 1)
2043 { 3, 5, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2045 #define NPS_E4BY_INDEX2 (NPS_E4BY_INDEX1 + 1)
2046 { 3, 2, 0, ARC_OPERAND_UNSIGNED
, NULL
, NULL
},
2048 #define NPS_E4BY_INDEX3 (NPS_E4BY_INDEX2 + 1)
2049 { 2, 0, 0, ARC_OPERAND_UNSIGNED
| ARC_OPERAND_NCHK
, insert_nps_index3
, extract_nps_index3
},
2052 const unsigned arc_num_operands
= ARRAY_SIZE (arc_operands
);
2054 const unsigned arc_Toperand
= FKT_T
;
2055 const unsigned arc_NToperand
= FKT_NT
;
2057 const unsigned char arg_none
[] = { 0 };
2058 const unsigned char arg_32bit_rarbrc
[] = { RA
, RB
, RC
};
2059 const unsigned char arg_32bit_zarbrc
[] = { ZA
, RB
, RC
};
2060 const unsigned char arg_32bit_rbrbrc
[] = { RB
, RBdup
, RC
};
2061 const unsigned char arg_32bit_rarbu6
[] = { RA
, RB
, UIMM6_20
};
2062 const unsigned char arg_32bit_zarbu6
[] = { ZA
, RB
, UIMM6_20
};
2063 const unsigned char arg_32bit_rbrbu6
[] = { RB
, RBdup
, UIMM6_20
};
2064 const unsigned char arg_32bit_rbrbs12
[] = { RB
, RBdup
, SIMM12_20
};
2065 const unsigned char arg_32bit_ralimmrc
[] = { RA
, LIMM
, RC
};
2066 const unsigned char arg_32bit_rarblimm
[] = { RA
, RB
, LIMM
};
2067 const unsigned char arg_32bit_zalimmrc
[] = { ZA
, LIMM
, RC
};
2068 const unsigned char arg_32bit_zarblimm
[] = { ZA
, RB
, LIMM
};
2070 const unsigned char arg_32bit_rbrblimm
[] = { RB
, RBdup
, LIMM
};
2071 const unsigned char arg_32bit_ralimmu6
[] = { RA
, LIMM
, UIMM6_20
};
2072 const unsigned char arg_32bit_zalimmu6
[] = { ZA
, LIMM
, UIMM6_20
};
2074 const unsigned char arg_32bit_zalimms12
[] = { ZA
, LIMM
, SIMM12_20
};
2075 const unsigned char arg_32bit_ralimmlimm
[] = { RA
, LIMM
, LIMMdup
};
2076 const unsigned char arg_32bit_zalimmlimm
[] = { ZA
, LIMM
, LIMMdup
};
2078 const unsigned char arg_32bit_rbrc
[] = { RB
, RC
};
2079 const unsigned char arg_32bit_zarc
[] = { ZA
, RC
};
2080 const unsigned char arg_32bit_rbu6
[] = { RB
, UIMM6_20
};
2081 const unsigned char arg_32bit_zau6
[] = { ZA
, UIMM6_20
};
2082 const unsigned char arg_32bit_rblimm
[] = { RB
, LIMM
};
2083 const unsigned char arg_32bit_zalimm
[] = { ZA
, LIMM
};
2085 const unsigned char arg_32bit_limmrc
[] = { LIMM
, RC
};
2086 const unsigned char arg_32bit_limmu6
[] = { LIMM
, UIMM6_20
};
2087 const unsigned char arg_32bit_limms12
[] = { LIMM
, SIMM12_20
};
2088 const unsigned char arg_32bit_limmlimm
[] = { LIMM
, LIMMdup
};
2090 const unsigned char arg_32bit_rc
[] = { RC
};
2091 const unsigned char arg_32bit_u6
[] = { UIMM6_20
};
2092 const unsigned char arg_32bit_limm
[] = { LIMM
};
2094 /* The opcode table.
2096 The format of the opcode table is:
2098 NAME OPCODE MASK CPU CLASS SUBCLASS { OPERANDS } { FLAGS }.
2100 The table is organised such that, where possible, all instructions with
2101 the same mnemonic are together in a block. When the assembler searches
2102 for a suitable instruction the entries are checked in table order, so
2103 more specific, or specialised cases should appear earlier in the table.
2105 As an example, consider two instructions 'add a,b,u6' and 'add
2106 a,b,limm'. The first takes a 6-bit immediate that is encoded within the
2107 32-bit instruction, while the second takes a 32-bit immediate that is
2108 encoded in a follow-on 32-bit, making the total instruction length
2109 64-bits. In this case the u6 variant must appear first in the table, as
2110 all u6 immediates could also be encoded using the 'limm' extension,
2111 however, we want to use the shorter instruction wherever possible.
2113 It is possible though to split instructions with the same mnemonic into
2114 multiple groups. However, the instructions are still checked in table
2115 order, even across groups. The only time that instructions with the
2116 same mnemonic should be split into different groups is when different
2117 variants of the instruction appear in different architectures, in which
2118 case, grouping all instructions from a particular architecture together
2119 might be preferable to merging the instruction into the main instruction
2122 An example of this split instruction groups can be found with the 'sync'
2123 instruction. The core arc architecture provides a 'sync' instruction,
2124 while the nps instruction set extension provides 'sync.rd' and
2125 'sync.wr'. The rd/wr flags are instruction flags, not part of the
2126 mnemonic, so we end up with two groups for the sync instruction, the
2127 first within the core arc instruction table, and the second within the
2128 nps extension instructions. */
2129 const struct arc_opcode arc_opcodes
[] =
2131 #include "arc-tbl.h"
2132 #include "arc-nps400-tbl.h"
2133 #include "arc-ext-tbl.h"
2135 { NULL
, 0, 0, 0, 0, 0, { 0 }, { 0 } }
2138 /* List with special cases instructions and the applicable flags. */
2139 const struct arc_flag_special arc_flag_special_cases
[] =
2141 { "b", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2142 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2143 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2144 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2145 { "bl", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2146 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2147 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2148 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2149 { "br", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2150 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2151 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2152 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2153 { "j", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2154 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2155 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2156 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2157 { "jl", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2158 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2159 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2160 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2161 { "lp", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2162 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2163 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2164 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2165 { "set", { F_ALWAYS
, F_RA
, F_EQUAL
, F_ZERO
, F_NOTEQUAL
, F_NOTZERO
, F_POZITIVE
,
2166 F_PL
, F_NEGATIVE
, F_MINUS
, F_CARRY
, F_CARRYSET
, F_LOWER
, F_CARRYCLR
,
2167 F_NOTCARRY
, F_HIGHER
, F_OVERFLOWSET
, F_OVERFLOW
, F_NOTOVERFLOW
,
2168 F_OVERFLOWCLR
, F_GT
, F_GE
, F_LT
, F_LE
, F_HI
, F_LS
, F_PNZ
, F_NULL
} },
2169 { "ld", { F_SIZEB17
, F_SIZEW17
, F_H17
, F_NULL
} },
2170 { "st", { F_SIZEB1
, F_SIZEW1
, F_H1
, F_NULL
} }
2173 const unsigned arc_num_flag_special
= ARRAY_SIZE (arc_flag_special_cases
);
2176 const struct arc_reloc_equiv_tab arc_reloc_equiv
[] =
2178 { "sda", "ld", { F_ASFAKE
, F_H1
, F_NULL
},
2179 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST1
},
2180 { "sda", "st", { F_ASFAKE
, F_H1
, F_NULL
},
2181 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST1
},
2182 { "sda", "ld", { F_ASFAKE
, F_SIZEW7
, F_NULL
},
2183 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST1
},
2184 { "sda", "st", { F_ASFAKE
, F_SIZEW7
, F_NULL
},
2185 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST1
},
2187 /* Next two entries will cover the undefined behavior ldb/stb with
2189 { "sda", "ld", { F_ASFAKE
, F_SIZEB7
, F_NULL
},
2190 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST
},
2191 { "sda", "st", { F_ASFAKE
, F_SIZEB7
, F_NULL
},
2192 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST
},
2194 { "sda", "ld", { F_ASFAKE
, F_NULL
},
2195 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST2
},
2196 { "sda", "st", { F_ASFAKE
, F_NULL
},
2197 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST2
},
2198 { "sda", "ldd", { F_ASFAKE
, F_NULL
},
2199 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST2
},
2200 { "sda", "std", { F_ASFAKE
, F_NULL
},
2201 BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST2
},
2203 /* Short instructions. */
2204 { "sda", 0, { F_NULL
}, BFD_RELOC_ARC_SDA16_LD
, BFD_RELOC_ARC_SDA16_LD
},
2205 { "sda", 0, { F_NULL
}, -SIMM10_A16_7_Sbis
, BFD_RELOC_ARC_SDA16_LD1
},
2206 { "sda", 0, { F_NULL
}, BFD_RELOC_ARC_SDA16_LD2
, BFD_RELOC_ARC_SDA16_LD2
},
2207 { "sda", 0, { F_NULL
}, BFD_RELOC_ARC_SDA16_ST2
, BFD_RELOC_ARC_SDA16_ST2
},
2209 { "sda", 0, { F_NULL
}, BFD_RELOC_ARC_32_ME
, BFD_RELOC_ARC_SDA32_ME
},
2210 { "sda", 0, { F_NULL
}, BFD_RELOC_ARC_SDA_LDST
, BFD_RELOC_ARC_SDA_LDST
},
2212 { "plt", 0, { F_NULL
}, BFD_RELOC_ARC_S25H_PCREL
,
2213 BFD_RELOC_ARC_S25H_PCREL_PLT
},
2214 { "plt", 0, { F_NULL
}, BFD_RELOC_ARC_S21H_PCREL
,
2215 BFD_RELOC_ARC_S21H_PCREL_PLT
},
2216 { "plt", 0, { F_NULL
}, BFD_RELOC_ARC_S25W_PCREL
,
2217 BFD_RELOC_ARC_S25W_PCREL_PLT
},
2218 { "plt", 0, { F_NULL
}, BFD_RELOC_ARC_S21W_PCREL
,
2219 BFD_RELOC_ARC_S21W_PCREL_PLT
},
2221 { "plt", 0, { F_NULL
}, BFD_RELOC_ARC_32_ME
, BFD_RELOC_ARC_PLT32
}
2224 const unsigned arc_num_equiv_tab
= ARRAY_SIZE (arc_reloc_equiv
);
2226 const struct arc_pseudo_insn arc_pseudo_insns
[] =
2228 { "push", "st", ".aw", 5, { { RC
, 0, 0, 0 }, { BRAKET
, 1, 0, 1 },
2229 { RB
, 1, 28, 2 }, { SIMM9_8
, 1, -4, 3 },
2230 { BRAKETdup
, 1, 0, 4} } },
2231 { "pop", "ld", ".ab", 5, { { RA
, 0, 0, 0 }, { BRAKET
, 1, 0, 1 },
2232 { RB
, 1, 28, 2 }, { SIMM9_8
, 1, 4, 3 },
2233 { BRAKETdup
, 1, 0, 4} } },
2235 { "brgt", "brlt", NULL
, 3, { { RB
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2236 { SIMM9_A16_8
, 0, 0, 2 } } },
2237 { "brgt", "brge", NULL
, 3, { { RB
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2238 { SIMM9_A16_8
, 0, 0, 2 } } },
2239 { "brgt", "brlt", NULL
, 3, { { RB
, 0, 0, 1 }, { LIMM
, 0, 0, 0 },
2240 { SIMM9_A16_8
, 0, 0, 2 } } },
2241 { "brgt", "brlt", NULL
, 3, { { LIMM
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2242 { SIMM9_A16_8
, 0, 0, 2 } } },
2243 { "brgt", "brge", NULL
, 3, { { LIMM
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2244 { SIMM9_A16_8
, 0, 0, 2 } } },
2246 { "brhi", "brlo", NULL
, 3, { { RB
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2247 { SIMM9_A16_8
, 0, 0, 2 } } },
2248 { "brhi", "brhs", NULL
, 3, { { RB
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2249 { SIMM9_A16_8
, 0, 0, 2 } } },
2250 { "brhi", "brlo", NULL
, 3, { { RB
, 0, 0, 1 }, { LIMM
, 0, 0, 0 },
2251 { SIMM9_A16_8
, 0, 0, 2 } } },
2252 { "brhi", "brlo", NULL
, 3, { { LIMM
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2253 { SIMM9_A16_8
, 0, 0, 2 } } },
2254 { "brhi", "brhs", NULL
, 3, { { LIMM
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2255 { SIMM9_A16_8
, 0, 0, 2 } } },
2257 { "brle", "brge", NULL
, 3, { { RB
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2258 { SIMM9_A16_8
, 0, 0, 2 } } },
2259 { "brle", "brlt", NULL
, 3, { { RB
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2260 { SIMM9_A16_8
, 0, 0, 2 } } },
2261 { "brle", "brge", NULL
, 3, { { RB
, 0, 0, 1 }, { LIMM
, 0, 0, 0 },
2262 { SIMM9_A16_8
, 0, 0, 2 } } },
2263 { "brle", "brge", NULL
, 3, { { LIMM
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2264 { SIMM9_A16_8
, 0, 0, 2 } } },
2265 { "brle", "brlt", NULL
, 3, { { LIMM
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2266 { SIMM9_A16_8
, 0, 0, 2 } } },
2268 { "brls", "brhs", NULL
, 3, { { RB
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2269 { SIMM9_A16_8
, 0, 0, 2 } } },
2270 { "brls", "brlo", NULL
, 3, { { RB
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2271 { SIMM9_A16_8
, 0, 0, 2 } } },
2272 { "brls", "brhs", NULL
, 3, { { RB
, 0, 0, 1 }, { LIMM
, 0, 0, 0 },
2273 { SIMM9_A16_8
, 0, 0, 2 } } },
2274 { "brls", "brhs", NULL
, 3, { { LIMM
, 0, 0, 1 }, { RC
, 0, 0, 0 },
2275 { SIMM9_A16_8
, 0, 0, 2 } } },
2276 { "brls", "brlo", NULL
, 3, { { LIMM
, 0, 0, 0 }, { UIMM6_8
, 0, 1, 1 },
2277 { SIMM9_A16_8
, 0, 0, 2 } } },
2280 const unsigned arc_num_pseudo_insn
=
2281 sizeof (arc_pseudo_insns
) / sizeof (*arc_pseudo_insns
);
2283 const struct arc_aux_reg arc_aux_regs
[] =
2286 #define DEF(ADDR, CPU, SUBCLASS, NAME) \
2287 { ADDR, CPU, SUBCLASS, #NAME, sizeof (#NAME)-1 },
2289 #include "arc-regs.h"
2294 const unsigned arc_num_aux_regs
= ARRAY_SIZE (arc_aux_regs
);
2296 /* NOTE: The order of this array MUST be consistent with 'enum
2297 arc_rlx_types' located in tc-arc.h! */
2298 const struct arc_opcode arc_relax_opcodes
[] =
2300 { NULL
, 0x0, 0x0, 0x0, ARITH
, NONE
, { UNUSED
}, { 0 } },
2302 /* bl_s s13 11111sssssssssss. */
2303 { "bl_s", 0x0000F800, 0x0000F800, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2304 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, BRANCH
, NONE
,
2305 { SIMM13_A32_5_S
}, { 0 }},
2307 /* bl<.d> s25 00001sssssssss10SSSSSSSSSSNRtttt. */
2308 { "bl", 0x08020000, 0xF8030000, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2309 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, BRANCH
, NONE
,
2310 { SIMM25_A32_5
}, { C_D
}},
2312 /* b_s s10 1111000sssssssss. */
2313 { "b_s", 0x0000F000, 0x0000FE00, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2314 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, BRANCH
, NONE
,
2315 { SIMM10_A16_7_S
}, { 0 }},
2317 /* b<.d> s25 00000ssssssssss1SSSSSSSSSSNRtttt. */
2318 { "b", 0x00010000, 0xF8010000, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2319 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, BRANCH
, NONE
,
2320 { SIMM25_A16_5
}, { C_D
}},
2322 /* add_s c,b,u3 01101bbbccc00uuu. Wants UIMM3_13_S_PCREL. */
2323 { "add_s", 0x00006800, 0x0000F818, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2324 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2325 { RC_S
, RB_S
, UIMM3_13_S
}, { 0 }},
2327 /* add<.f> a,b,u6 00100bbb01000000FBBBuuuuuuAAAAAA. Wants
2329 { "add", 0x20400000, 0xF8FF0000, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2330 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2331 { RA
, RB
, UIMM6_20
}, { C_F
}},
2333 /* add<.f> a,b,limm 00100bbb00000000FBBB111110AAAAAA. */
2334 { "add", 0x20000F80, 0xF8FF0FC0, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2335 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2336 { RA
, RB
, LIMM
}, { C_F
}},
2338 /* ld_s c,b,u7 10000bbbcccuuuuu. Wants UIMM7_A32_11_S_PCREL. */
2339 { "ld_s", 0x00008000, 0x0000F800, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2340 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2341 { RC_S
, BRAKET
, RB_S
, UIMM7_A32_11_S
, BRAKETdup
}, { 0 }},
2343 /* ld<.di><.aa><.x><zz> a,b,s9
2344 00010bbbssssssssSBBBDaaZZXAAAAAA. Wants SIMM9_8_PCREL. */
2345 { "ld", 0x10000000, 0xF8000000, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2346 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2347 { RA
, BRAKET
, RB
, SIMM9_8
, BRAKETdup
},
2348 { C_ZZ23
, C_DI20
, C_AA21
, C_X25
}},
2350 /* ld<.di><.aa><.x><zz> a,b,limm 00100bbbaa110ZZXDBBB111110AAAAAA. */
2351 { "ld", 0x20300F80, 0xF8380FC0, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2352 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2353 { RA
, BRAKET
, RB
, LIMM
, BRAKETdup
},
2354 { C_ZZ13
, C_DI16
, C_AA8
, C_X15
}},
2356 /* mov_s b,u8 11011bbbuuuuuuuu. Wants UIMM8_8_S_PCREL. */
2357 { "mov_s", 0x0000D800, 0x0000F800, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2358 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2359 { RB_S
, UIMM8_8_S
}, { 0 }},
2361 /* mov<.f> b,s12 00100bbb10001010FBBBssssssSSSSSS. Wants
2363 { "mov", 0x208A0000, 0xF8FF0000, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2364 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2365 { RB
, SIMM12_20
}, { C_F
}},
2367 /* mov<.f> b,limm 00100bbb00001010FBBB111110RRRRRR. */
2368 { "mov", 0x200A0F80, 0xF8FF0FC0, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2369 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2370 { RB
, LIMM
}, { C_F
}},
2372 /* sub_s c,b,u3 01101bbbccc01uuu. UIMM3_13_S_PCREL. */
2373 { "sub_s", 0x00006808, 0x0000F818, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2374 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2375 { RC_S
, RB_S
, UIMM3_13_S
}, { 0 }},
2377 /* sub<.f> a,b,u6 00100bbb01000010FBBBuuuuuuAAAAAA.
2379 { "sub", 0x20420000, 0xF8FF0000, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2380 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2381 { RA
, RB
, UIMM6_20
}, { C_F
}},
2383 /* sub<.f> a,b,limm 00100bbb00000010FBBB111110AAAAAA. */
2384 { "sub", 0x20020F80, 0xF8FF0FC0, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2385 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2386 { RA
, RB
, LIMM
}, { C_F
}},
2388 /* mpy<.f> a,b,u6 00100bbb01011010FBBBuuuuuuAAAAAA.
2390 { "mpy", 0x205A0000, 0xF8FF0000, ARC_OPCODE_ARC700
| ARC_OPCODE_ARCv2EM
2391 | ARC_OPCODE_ARCv2HS
, ARITH
, MPY6E
, { RA
, RB
, UIMM6_20
}, { C_F
}},
2393 /* mpy<.f> a,b,limm 00100bbb00011010FBBB111110AAAAAA. */
2394 { "mpy", 0x201A0F80, 0xF8FF0FC0, ARC_OPCODE_ARC700
| ARC_OPCODE_ARCv2EM
2395 | ARC_OPCODE_ARCv2HS
, ARITH
, MPY6E
, { RA
, RB
, LIMM
}, { C_F
}},
2397 /* mov<.f><.cc> b,u6 00100bbb11001010FBBBuuuuuu1QQQQQ.
2399 { "mov", 0x20CA0020, 0xF8FF0020, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2400 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2401 { RB
, UIMM6_20
}, { C_F
, C_CC
}},
2403 /* mov<.f><.cc> b,limm 00100bbb11001010FBBB1111100QQQQQ. */
2404 { "mov", 0x20CA0F80, 0xF8FF0FE0, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2405 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, MEMORY
, NONE
,
2406 { RB
, LIMM
}, { C_F
, C_CC
}},
2408 /* add<.f><.cc> b,b,u6 00100bbb11000000FBBBuuuuuu1QQQQQ.
2410 { "add", 0x20C00020, 0xF8FF0020, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2411 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2412 { RB
, RBdup
, UIMM6_20
}, { C_F
, C_CC
}},
2414 /* add<.f><.cc> b,b,limm 00100bbb11000000FBBB1111100QQQQQ. */
2415 { "add", 0x20C00F80, 0xF8FF0FE0, ARC_OPCODE_ARC600
| ARC_OPCODE_ARC700
2416 | ARC_OPCODE_ARCv2EM
| ARC_OPCODE_ARCv2HS
, ARITH
, NONE
,
2417 { RB
, RBdup
, LIMM
}, { C_F
, C_CC
}}
2420 const unsigned arc_num_relax_opcodes
= ARRAY_SIZE (arc_relax_opcodes
);
2422 /* The following instructions are all either 48 or 64 bits long, and
2423 require special handling in the assembler and disassembler.
2425 The first part of each ARC_LONG_OPCODE is the base ARC_OPCODE, this is
2426 either the 16 or 32 bit base instruction, and its opcode list will
2427 always end in a LIMM.
2429 The rest of the ARC_LONG_OPCODE describes how to build the LIMM from the
2430 instruction operands. There are therefore two lists of operands for
2431 each ARC_LONG_OPCODE, the second list contains operands that are merged
2432 into the limm template, in the same way that a standard 32-bit
2433 instruction is built. This generated limm is then added to the list of
2434 tokens that is passed to the standard instruction encoder, along with
2435 the first list of operands (from the base arc_opcode).
2437 The first list of operands then, describes how to build the base
2438 instruction, and includes the 32-bit limm that was previously generated
2439 as the last operand.
2441 In most cases operands are either encoded into the base instruction or
2442 into the limm. When this happens the operand slot will be filled with
2443 an operand identifier in one list, and will be IGNORED in the other
2444 list, this special operand value causes the operand to be ignored,
2445 without being encoded at this point.
2447 However, in some cases, an operand is split between the base instruction
2448 and the 32-bit limm, in this case the operand slot will be filled in
2449 both operand lists (see mov4b for one example of this). */
2450 const struct arc_long_opcode arc_long_opcodes
[] =
2452 /* mrgb - (48 bit instruction). */
2453 { { "mrgb", 0x5803, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC1_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { 0 }},
2454 0x00000000, 0x80000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_SIZE1
, NPS_BITOP_DST_POS2
, NPS_BITOP_SRC_POS2
, NPS_BITOP_SIZE2
}},
2456 /* mrgb.cl - (48 bit instruction). */
2457 { { "mrgb", 0x5803, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC1_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { C_NPS_CL
}},
2458 0x80000000, 0x80000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_SIZE1
, NPS_BITOP_DST_POS2
, NPS_BITOP_SRC_POS2
, NPS_BITOP_SIZE2
}},
2460 /* mov2b - (48 bit instruction). */
2461 { { "mov2b", 0x5800, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC1_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { 0 }},
2462 0x00000000, 0x80000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
}},
2464 /* mov2b.cl - (48 bit instruction). */
2465 { { "mov2b", 0x5800, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { C_NPS_CL
}},
2466 0x80000000, 0x80000000, { IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
}},
2468 /* ext4 - (48 bit instruction). */
2469 { { "ext4b", 0x5801, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC1_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { 0 }},
2470 0x00000000, 0x80000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_INS_EXT
, NPS_BITOP_SRC_POS1
, NPS_BITOP_SRC_POS2
, NPS_BITOP_DST_POS1
, NPS_BITOP_DST_POS2
}},
2472 /* ext4.cl - (48 bit instruction). */
2473 { { "ext4b", 0x5801, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { C_NPS_CL
}},
2474 0x80000000, 0x80000000, { IGNORED
, IGNORED
, NPS_BITOP_INS_EXT
, NPS_BITOP_SRC_POS1
, NPS_BITOP_SRC_POS2
, NPS_BITOP_DST_POS1
, NPS_BITOP_DST_POS2
}},
2476 /* ins4 - (48 bit instruction). */
2477 { { "ins4b", 0x5802, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC1_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { 0 }},
2478 0x00000000, 0x80000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_SRC_POS1
, NPS_BITOP_SRC_POS2
, NPS_BITOP_DST_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_INS_EXT
}},
2480 /* ins4.cl - (48 bit instruction). */
2481 { { "ins4b", 0x5802, 0xf81f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B_SHORT
, NPS_R_SRC2_3B_SHORT
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, LIMM
}, { C_NPS_CL
}},
2482 0x80000000, 0x80000000, { IGNORED
, IGNORED
, NPS_BITOP_SRC_POS1
, NPS_BITOP_SRC_POS2
, NPS_BITOP_DST_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_INS_EXT
}},
2484 /* mov3b - (64 bit instruction). */
2485 { { "mov3b", 0x58100000, 0xf81f801f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B
, NPS_R_SRC1_3B
, NPS_R_SRC2_3B
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS3_POS4
, IGNORED
, IGNORED
, LIMM
}, { 0 }},
2486 0x80000000, 0x80000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
, IGNORED
, NPS_BITOP_MOD3
, NPS_BITOP_SRC_POS3
}},
2488 /* mov4b - (64 bit instruction). */
2489 { { "mov4b", 0x58100000, 0xf81f0000, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B
, NPS_R_SRC1_3B
, NPS_R_SRC2_3B
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS3
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS4
, NPS_BITOP_MOD4_LSB
, NPS_BITOP_SRC_POS4
, LIMM
}, { 0 }},
2490 0x00000000, 0x00000000, { IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
, IGNORED
, NPS_BITOP_MOD3
, NPS_BITOP_SRC_POS3
, IGNORED
, NPS_BITOP_MOD4_MSB
, IGNORED
}},
2492 /* mov3bcl - (64 bit instruction). */
2493 { { "mov3bcl", 0x58110000, 0xf81f801f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B
, NPS_R_SRC2_3B
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS3_POS4
, IGNORED
, IGNORED
, LIMM
}, { 0 }},
2494 0x80000000, 0x80000000, { IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
, IGNORED
, NPS_BITOP_MOD3
, NPS_BITOP_SRC_POS3
}},
2496 /* mov4bcl - (64 bit instruction). */
2497 { { "mov4bcl", 0x58110000, 0xf81f0000, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B
, NPS_R_SRC2_3B
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS3
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS4
, NPS_BITOP_MOD4_LSB
, NPS_BITOP_SRC_POS4
, LIMM
}, { 0 }},
2498 0x00000000, 0x00000000, { IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
, IGNORED
, NPS_BITOP_MOD3
, NPS_BITOP_SRC_POS3
, IGNORED
, NPS_BITOP_MOD4_MSB
, IGNORED
}},
2500 /* mov3b.cl - (64 bit instruction). */
2501 { { "mov3b", 0x58110000, 0xf81f801f, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B
, NPS_R_SRC2_3B
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS3_POS4
, IGNORED
, IGNORED
, LIMM
}, { C_NPS_CL
}},
2502 0x80000000, 0x80000000, { IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
, IGNORED
, NPS_BITOP_MOD3
, NPS_BITOP_SRC_POS3
}},
2504 /* mov4b.cl - (64 bit instruction). */
2505 { { "mov4b", 0x58110000, 0xf81f0000, ARC_OPCODE_NPS400
, BITOP
, NONE
, { NPS_R_DST_3B
, NPS_R_SRC2_3B
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS3
, IGNORED
, IGNORED
, NPS_BITOP_DST_POS4
, NPS_BITOP_MOD4_LSB
, NPS_BITOP_SRC_POS4
, LIMM
}, { C_NPS_CL
}},
2506 0x00000000, 0x00000000, { IGNORED
, IGNORED
, NPS_BITOP_DST_POS1
, NPS_BITOP_MOD1
, NPS_BITOP_SRC_POS1
, NPS_BITOP_DST_POS2
, NPS_BITOP_MOD2
, NPS_BITOP_SRC_POS2
, IGNORED
, NPS_BITOP_MOD3
, NPS_BITOP_SRC_POS3
, IGNORED
, NPS_BITOP_MOD4_MSB
, IGNORED
}},
2509 const unsigned arc_num_long_opcodes
= ARRAY_SIZE (arc_long_opcodes
);