diff options
author | Graham Markall <graham.markall@embecosm.com> | 2016-07-27 15:57:18 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-07-27 15:57:18 +0100 |
commit | db18dbabad8e7b63e98d47813ef20acac7072350 (patch) | |
tree | 471a5ded9cd7d7ee511866e79c425616193daeeb /opcodes | |
parent | 61d2d2b5492d892d804861225b45396fdaa0b404 (diff) | |
download | gdb-db18dbabad8e7b63e98d47813ef20acac7072350.zip gdb-db18dbabad8e7b63e98d47813ef20acac7072350.tar.gz gdb-db18dbabad8e7b63e98d47813ef20acac7072350.tar.bz2 |
Begin implementing ARC NPS-400 Accelerator instructions
opcodes * arc-nps400-tbl.h: Change block comments to GNU format.
* arc-dis.c: Add new globals addrtypenames,
addrtypenames_max, and addtypeunknown.
(get_addrtype): New function.
(print_insn_arc): Print colons and address types when
required.
* arc-opc.c: Add MAKE_INSERT_NPS_ADDRTYPE macro and use to
define insert and extract functions for all address types.
(arc_operands): Add operands for colon and all address
types.
* arc-nps-400-tbl.h: Add NPS-400 BMU instructions to opcode table.
* arc-opc.c: Add NPS_BD_TYPE and NPS_BMU_NUM operands,
insert_nps_bd_num_buff and extract_nps_bd_num_buff functions.
* arc-nps-400-tbl.h: Add NPS-400 PMU instructions to opcode table.
* arc-opc.c: Add NPS_PMU_NXT_DST and NPS_PMU_NUM_JOB operands,
insert_nps_pmu_num_job and extract_nps_pmu_num_job functions.
include * opcode/arc.h: Add ARC_OPERAND_ADDRTYPE,
ARC_OPERAND_COLON. Add the arc_nps_address_type enum and
ARC_NUM_ADDRTYPES.
* opcode/arc.h: Add BMU to insn_class_t enum.
* opcode/arc.h: Add PMU to insn_class_t enum.
gas * config/tc-arc.c: Add new global arc_addrtype_hash.
Define O_colon and O_addrtype.
(debug_exp): Add O_colon and O_addrtype.
(tokenize_arguments): Handle colon and address type
tokens.
(declare_addrtype): New function.
(md_begin): Initialise arc_addrtype_hash.
(arc_parse_name): Add lookup of address types.
(assemble_insn): Handle colons and address types by
ignoring them.
* testsuite/gas/arc/nps400-8.s: New file.
* testsuite/gas/arc/nps400-8.d: New file.
* testsuite/gas/arc/nps400-8.s: Add PMU instruction tests.
* testsuite/gas/arc/nps400-8.d: Add expected PMU
instruction output.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 19 | ||||
-rw-r--r-- | opcodes/arc-dis.c | 45 | ||||
-rw-r--r-- | opcodes/arc-ext.c | 10 | ||||
-rw-r--r-- | opcodes/arc-nps400-tbl.h | 110 | ||||
-rw-r--r-- | opcodes/arc-opc.c | 131 |
5 files changed, 283 insertions, 32 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 66551db..c218197 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,22 @@ +2016-07-27 Graham Markall <graham.markall@embecosm.com> + + * arc-nps400-tbl.h: Change block comments to GNU format. + * arc-dis.c: Add new globals addrtypenames, + addrtypenames_max, and addtypeunknown. + (get_addrtype): New function. + (print_insn_arc): Print colons and address types when + required. + * arc-opc.c: Add MAKE_INSERT_NPS_ADDRTYPE macro and use to + define insert and extract functions for all address types. + (arc_operands): Add operands for colon and all address + types. + * arc-nps-400-tbl.h: Add NPS-400 BMU instructions to opcode table. + * arc-opc.c: Add NPS_BD_TYPE and NPS_BMU_NUM operands, + insert_nps_bd_num_buff and extract_nps_bd_num_buff functions. + * arc-nps-400-tbl.h: Add NPS-400 PMU instructions to opcode table. + * arc-opc.c: Add NPS_PMU_NXT_DST and NPS_PMU_NUM_JOB operands, + insert_nps_pmu_num_job and extract_nps_pmu_num_job functions. + 2016-07-21 H.J. Lu <hongjiu.lu@intel.com> * configure: Regenerated. diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index 7b78bdc..73d648d 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -85,6 +85,16 @@ static const char * const regnames[64] = "r56", "r57", "ACCL", "ACCH", "lp_count", "rezerved", "LIMM", "pcl" }; +static const char * const addrtypenames[ARC_NUM_ADDRTYPES] = +{ + "bd", "jid", "lbd", "mbd", "sd", "sm", "xa", "xd", + "cd", "cbd", "cjid", "clbd", "cm", "csd", "cxa", "cxd" +}; + +static int addrtypenames_max = ARC_NUM_ADDRTYPES - 1; + +static const char * const addrtypeunknown = "unknown"; + /* This structure keeps track which instruction class(es) should be ignored durring disassembling. */ @@ -175,7 +185,7 @@ skip_this_opcode (const struct arc_opcode * opcode, /* If we found an incompatibility then we must skip. */ if (t != NULL) return TRUE; - + /* Even if we do not precisely know the if the right mnemonics is correctly displayed, keep the disassmbled code class consistent. */ @@ -653,6 +663,18 @@ get_auxreg (const struct arc_opcode *opcode, return NULL; } +/* Convert a value representing an address type to a string used to refer to + the address type in assembly code. */ + +static const char * +get_addrtype (int value) +{ + if (value < 0 || value > addrtypenames_max) + return addrtypeunknown; + + return addrtypenames[value]; +} + /* Calculate the instruction length for an instruction starting with MSB and LSB, the most and least significant byte. The ISA_MASK is used to filter the instructions considered to only those that are part of the @@ -1104,8 +1126,7 @@ print_insn_arc (bfd_vma memaddr, } /* Only take input from real operands. */ - if ((operand->flags & ARC_OPERAND_FAKE) - && !(operand->flags & ARC_OPERAND_BRAKET)) + if (ARC_OPERAND_IS_FAKE (operand)) continue; if ((operand->flags & ARC_OPERAND_IGNORE) @@ -1113,6 +1134,12 @@ print_insn_arc (bfd_vma memaddr, && value == -1) continue; + if (operand->flags & ARC_OPERAND_COLON) + { + (*info->fprintf_func) (info->stream, ":"); + continue; + } + if (need_comma) (*info->fprintf_func) (info->stream, ","); @@ -1124,6 +1151,8 @@ print_insn_arc (bfd_vma memaddr, continue; } + need_comma = TRUE; + /* Print the operand as directed by the flags. */ if (operand->flags & ARC_OPERAND_IR) { @@ -1145,6 +1174,7 @@ print_insn_arc (bfd_vma memaddr, else if (operand->flags & ARC_OPERAND_LIMM) { const char *rname = get_auxreg (opcode, value, isa_mask); + if (rname && open_braket) (*info->fprintf_func) (info->stream, "%s", rname); else @@ -1172,6 +1202,13 @@ print_insn_arc (bfd_vma memaddr, else (*info->fprintf_func) (info->stream, "%d", value); } + else if (operand->flags & ARC_OPERAND_ADDRTYPE) + { + const char *addrtype = get_addrtype (value); + (*info->fprintf_func) (info->stream, "%s", addrtype); + /* A colon follow an address type. */ + need_comma = FALSE; + } else { if (operand->flags & ARC_OPERAND_TRUNCATE @@ -1189,8 +1226,6 @@ print_insn_arc (bfd_vma memaddr, (*info->fprintf_func) (info->stream, "%#x", value); } } - - need_comma = TRUE; } return insn_len; diff --git a/opcodes/arc-ext.c b/opcodes/arc-ext.c index f7d2191..c12cabe 100644 --- a/opcodes/arc-ext.c +++ b/opcodes/arc-ext.c @@ -53,16 +53,16 @@ struct ExtAuxRegister { - long address; - char* name; - struct ExtAuxRegister* next; + long address; + char * name; + struct ExtAuxRegister * next; }; struct ExtCoreRegister { short number; enum ExtReadWrite rw; - char* name; + char * name; }; struct arcExtMap @@ -70,7 +70,7 @@ struct arcExtMap struct ExtAuxRegister* auxRegisters; struct ExtInstruction* instructions[INST_HASH_SIZE]; struct ExtCoreRegister coreRegisters[NUM_EXT_CORE]; - char* condCodes[NUM_EXT_COND]; + char * condCodes[NUM_EXT_COND]; }; diff --git a/opcodes/arc-nps400-tbl.h b/opcodes/arc-nps400-tbl.h index 580659a..4ac038c 100644 --- a/opcodes/arc-nps400-tbl.h +++ b/opcodes/arc-nps400-tbl.h @@ -1,4 +1,4 @@ -/**** Bit Manipulation Instructions ****/ +/* Bit Manipulation Instructions. */ /* movl<.cl> */ { "movh", 0x48080000, 0xf81f0000, ARC_OPCODE_ARC700, BITOP, NPS400, { NPS_R_DST, NPS_R_SRC1, NPS_UIMM16 }, { 0 }}, @@ -148,7 +148,7 @@ /* crc32<.r> 0,limm,u6 00111 110 01 110100 R 111 uuuuuu 111110 */ { "crc32", 0x3e74703e, 0xffff703f, ARC_OPCODE_ARC700, BITOP, NPS400, { ZA, LIMM, UIMM6_20 }, { C_NPS_R }}, -/**** Arithmetic & Logic Instructions ****/ +/* Arithmetic & Logic Instructions. */ #define ADDB_LIKE(NAME,SUBOP2) \ { NAME, (0x48000000 | SUBOP2), 0xf80f001f, ARC_OPCODE_ARC700, ARITH, NPS400, { NPS_R_DST_3B, NPS_R_SRC1_3B, NPS_R_SRC2_3B, NPS_SRC1_POS, NPS_SRC2_POS, NPS_ADDB_SIZE }, { C_NPS_F, C_NPS_SX }}, @@ -367,7 +367,7 @@ ADDL_LIKE ("xorl", 0xE, NPS_UIMM16) /* hofs a,b,min_hofs,psbc */ { "hofs", 0x38760000, 0xf8ff0000, ARC_OPCODE_ARC700, ARITH, NPS400, { RA, RB, NPS_MIN_HOFS, NPS_PSBC }, { C_F }}, -/**** Protocol Decoder Instructions ****/ +/* Protocol Decoder Instructions. */ /* dctcp b,c 00111bbb001011110bbbcccccc000000 */ { "dctcp", 0x382f0000, 0xf8ff803f, ARC_OPCODE_ARC700, NET, NPS400, { RB, RC }, { 0 }}, @@ -381,12 +381,12 @@ ADDL_LIKE ("xorl", 0xE, NPS_UIMM16) /* dcet a,b,c 00111bbb001000000bbbccccccaaaaaa */ { "dcet", 0x38200000, 0xf8ff8000, ARC_OPCODE_ARC700, NET, NPS400, { RA, RB, RC }, { 0 }}, -/**** ACL Instructions ****/ +/* ACL Instructions. */ /* dcacl<.f> a,b,c 00111bbb001001010bbbccccccaaaaaa */ { "dcacl", 0x38250000, 0xf8ff0000, ARC_OPCODE_ARC700, ACL, NPS400, { RA, RB, RC }, { C_F }}, -/**** DPI Instructions ****/ +/* DPI Instructions. */ /* hash dst,src1,src2,width,perm,nonlinear,basemat */ { "hash", 0x58180000, 0xf81f0000, ARC_OPCODE_ARC700, DPI, NPS400, { NPS_DPI_DST, NPS_DPI_SRC1_3B, NPS_R_SRC2_3B, NPS_HASH_WIDTH, NPS_HASH_PERM, NPS_HASH_NONLINEAR, NPS_HASH_BASEMAT }, { 0 }}, @@ -524,7 +524,7 @@ HASH_P(3, 0xC) /* ldbit<.x2|.x4>.di<.cl> a,[limm,c] 001001100011011X1111CCCCCCAAAAAA */ { "ldbit", 0x2636f000, 0xff3ef000, ARC_OPCODE_ARC700, DPI, NPS400, { RA, BRAKET, LIMM, RC, BRAKETdup }, { C_NPS_LDBIT_X_2, C_NPS_LDBIT_DI, C_NPS_LDBIT_CL2 }}, -/**** Pipeline Control Instructions ****/ +/* Pipeline Control Instructions. */ /* schd<.rw|.rd> */ { "schd", 0x3e6f7004, 0xffffff7f, ARC_OPCODE_ARC700, CONTROL, NPS400, { 0 }, { C_NPS_SCHD_RW }}, @@ -541,7 +541,7 @@ HASH_P(3, 0xC) /* hwscd.restore 0,C */ { "hwschd", 0x3e6f7003, 0xfffff03f, ARC_OPCODE_ARC700, CONTROL, NPS400, { ZA, RC }, { C_NPS_HWS_RESTORE }}, -/**** Load / Store From (0x57f00000 + Offset) Instructions ****/ +/* Load / Store From (0x57f00000 + Offset) Instructions. */ #define XLDST_LIKE(NAME,SUBOP2) \ { NAME, (0x58000000 | (SUBOP2 << 16)), 0xf81f0000, ARC_OPCODE_ARC700, MEMORY, NPS400, { NPS_R_DST, BRAKET, NPS_XLDST_UIMM16, BRAKETdup }, { 0 }}, @@ -552,3 +552,99 @@ XLDST_LIKE("xld", 0xa) XLDST_LIKE("xstb", 0xc) XLDST_LIKE("xstw", 0xd) XLDST_LIKE("xst", 0xe) + +/* BMU Instructions. */ + +/* sbdalc dst, src1, type */ +{ "sbdalc", 0x38500040, 0xf8ff09c0, ARC_OPCODE_ARC700, BMU, NPS400, { RA, RB, NPS_BD_TYPE }, { 0 }}, + +/* bdalc dst, [cm:src1], src1, src2 */ +{ "bdalc", 0x38100000, 0xf8ff0000, ARC_OPCODE_ARC700, BMU, NPS400, { RA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, RC }, { 0 }}, + +/* bdalc dst, [cm:src1], src1, type, num_buff */ +{ "bdalc", 0x38500800, 0xf8ff0800, ARC_OPCODE_ARC700, BMU, NPS400, { RA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, NPS_BD_TYPE, NPS_BMU_NUM }, { 0 }}, + +/* sbdfre 0, src1, src2 */ +{ "sbdfre", 0x3817003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, RB, RC }, { 0 }}, + +/* bdfre 0, [cm:src1], src1, src2 */ +{ "bdfre", 0x3811003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, RC }, { 0 }}, + +/* bdfre 0, [cm:src1], src1, type, num_buff */ +{ "bdfre", 0x3851083e, 0xf8ff083f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, NPS_BD_TYPE, NPS_BMU_NUM }, { 0 }}, + +/* bdfre 0, [cm:src1], src1, num_buff */ +{ "bdfre", 0x3851003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, NPS_BMU_NUM }, { 0 }}, + +/* bdbgt 0, src1, src2 */ +{ "bdbgt", 0x3818003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, RB, RC }, { 0 }}, + +/* sidxalc dst, src1 */ +{ "sidxalc", 0x385c0040, 0xf8ff0040, ARC_OPCODE_ARC700, BMU, NPS400, { RA, RB }, { 0 }}, + +/* idxalc dst, [cm:src1], src1, src2 */ +{ "idxalc", 0x381c0000, 0xf8ff0000, ARC_OPCODE_ARC700, BMU, NPS400, { RA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, RC }, { 0 }}, + +/* idxalc dst, [cm:src1], src1, num_idx */ +{ "idxalc", 0x385c0800, 0xf8ff0800, ARC_OPCODE_ARC700, BMU, NPS400, { RA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, NPS_BMU_NUM }, { 0 }}, + +/* sidxfre 0, src1, src2 */ +{ "sidxfre", 0x381d003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, RB, RC }, { 0 }}, + +/* idxfre 0, [cm:src1], src1, src2 */ +{ "idxfre", 0x381e003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, RC }, { 0 }}, + +/* idxfre 0, [cm:src1], src1, num_buff */ +{ "idxfre", 0x385e003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, NPS_BMU_NUM }, { 0 }}, + +/* idxbgt 0, src1, src2 */ +{ "idxbgt", 0x3819003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, RB, RC }, { 0 }}, + +/* efabgt 0, limm, src2 */ +{ "efabgt", 0x3e0d703e, 0xfffff03f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, LIMM, RC }, { 0 }}, + +/* efabgt 0, src1, limm */ +{ "efabgt", 0x380d0fbe, 0xf8ff80ff, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, RB, LIMM }, { 0 }}, + +/* efabgt 0, src1, src2 */ +{ "efabgt", 0x380d003e, 0xf8ff003f, ARC_OPCODE_ARC700, BMU, NPS400, { ZA, RB, RC }, { 0 }}, + +/* efabgt dst, limm, src2 */ +{ "efabgt", 0x3e0d7000, 0xfffff000, ARC_OPCODE_ARC700, BMU, NPS400, { RA, LIMM, RC }, { 0 }}, + +/* efabgt dst, src1, limm */ +{ "efabgt", 0x380d0f80, 0xf8ff0fc0, ARC_OPCODE_ARC700, BMU, NPS400, { RA, RB, LIMM }, { 0 }}, + +/* efabgt dst, src1, src2 */ +{ "efabgt", 0x380d0000, 0xf8ff8000, ARC_OPCODE_ARC700, BMU, NPS400, { RA, RB, RC }, { 0 }}, + +/* PMU Instructions. */ + +/* jobget<.cl> 0, [cjid:src1] */ +{ "jobget", 0x3e2f7020, 0xfffff03f, ARC_OPCODE_ARC700, PMU, NPS400, { ZA, BRAKET, NPS_CJID, COLON, RC, BRAKET }, { 0 }}, + +{ "jobget", 0x3e2f7021, 0xfffff03f, ARC_OPCODE_ARC700, PMU, NPS400, { ZA, BRAKET, NPS_CJID, COLON, RC, BRAKET }, { C_NPS_CL }}, + +/* jobdn 0, [cjid:src1], src1, src2 */ +{ "jobdn", 0x3812003e, 0xf8ff803f, ARC_OPCODE_ARC700, PMU, NPS400, { ZA, BRAKET, NPS_CJID, COLON, RB, BRAKETdup, RBdup, RC }, { 0 }}, + +/* jobdn 0, [cjid:src1], src1, nxt_dst */ +{ "jobdn", 0x3852003e, 0xf8ff803f, ARC_OPCODE_ARC700, PMU, NPS400, { ZA, BRAKET, NPS_CJID, COLON, RB, BRAKETdup, RBdup, NPS_PMU_NXT_DST }, { 0 }}, + +/* sjobalc dst, src1 */ +{ "sjobalc", 0x385f0040, 0xf8ff8fc0, ARC_OPCODE_ARC700, PMU, NPS400, { RA, RB }, { 0 }}, + +/* jobalc dst, [cm:src1], src1, num_job */ +{ "jobalc", 0x385f0800, 0xf8ff8800, ARC_OPCODE_ARC700, PMU, NPS400, { RA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, NPS_PMU_NUM_JOB }, { 0 }}, + +/* jobalc dst, [cm:src1], src1, src2 */ +{ "jobalc", 0x381f0000, 0xf8ff8000, ARC_OPCODE_ARC700, PMU, NPS400, { RA, BRAKET, NPS_CM, COLON, RB, BRAKETdup, RBdup, RC }, { 0 }}, + +/* jobbgt dst, src1, src2 */ +{ "jobbgt", 0x381a0000, 0xf8ff0000, ARC_OPCODE_ARC700, PMU, NPS400, { RA, RB, RC }, { 0 }}, + +/* cnljob 0 */ +{ "cnljob", 0x3e6f70ff, 0xffffffff, ARC_OPCODE_ARC700, PMU, NPS400, { ZA }, { 0 }}, + +/* qseq dst, [src1] */ +{ "qseq", 0x386f0028, 0xf8ff803f, ARC_OPCODE_ARC700, PMU, NPS400, { RB, BRAKET, RC, BRAKETdup }, { 0 }}, diff --git a/opcodes/arc-opc.c b/opcodes/arc-opc.c index ad50ebc..44dd7b2 100644 --- a/opcodes/arc-opc.c +++ b/opcodes/arc-opc.c @@ -962,17 +962,17 @@ extract_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \ return ((insn >> SHIFT) & ((1 << BITS) - 1)) + BIAS; \ } -MAKE_BIAS_INSERT_EXTRACT_FUNCS(addb_size,2,32,5,1,5) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(andb_size,1,32,5,1,5) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(fxorb_size,8,32,5,8,5) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(wxorb_size,16,32,5,16,5) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(bitop_size,1,32,5,1,10) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(qcmp_size,1,8,3,1,9) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(bitop1_size,1,32,5,1,20) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(bitop2_size,1,32,5,1,25) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(hash_width,1,32,5,1,6) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(hash_len,1,8,3,1,2) -MAKE_BIAS_INSERT_EXTRACT_FUNCS(index3,4,7,2,4,0) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (addb_size,2,32,5,1,5) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (andb_size,1,32,5,1,5) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (fxorb_size,8,32,5,8,5) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (wxorb_size,16,32,5,16,5) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (bitop_size,1,32,5,1,10) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (qcmp_size,1,8,3,1,9) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (bitop1_size,1,32,5,1,20) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (bitop2_size,1,32,5,1,25) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (hash_width,1,32,5,1,6) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (hash_len,1,8,3,1,2) +MAKE_BIAS_INSERT_EXTRACT_FUNCS (index3,4,7,2,4,0) static int extract_nps_qcmp_m3 (unsigned insn ATTRIBUTE_UNUSED, @@ -1134,10 +1134,12 @@ extract_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \ return value; \ } -MAKE_1BASED_INSERT_EXTRACT_FUNCS(field_size, 6, 8, 3) -MAKE_1BASED_INSERT_EXTRACT_FUNCS(shift_factor, 9, 8, 3) -MAKE_1BASED_INSERT_EXTRACT_FUNCS(bits_to_scramble, 12, 8, 3) -MAKE_1BASED_INSERT_EXTRACT_FUNCS(bdlen_max_len, 5, 256, 8) +MAKE_1BASED_INSERT_EXTRACT_FUNCS (field_size, 6, 8, 3) +MAKE_1BASED_INSERT_EXTRACT_FUNCS (shift_factor, 9, 8, 3) +MAKE_1BASED_INSERT_EXTRACT_FUNCS (bits_to_scramble, 12, 8, 3) +MAKE_1BASED_INSERT_EXTRACT_FUNCS (bdlen_max_len, 5, 256, 8) +MAKE_1BASED_INSERT_EXTRACT_FUNCS (bd_num_buff, 6, 8, 3) +MAKE_1BASED_INSERT_EXTRACT_FUNCS (pmu_num_job, 6, 4, 2) static unsigned insert_nps_min_hofs (unsigned insn ATTRIBUTE_UNUSED, @@ -1160,6 +1162,42 @@ extract_nps_min_hofs (unsigned insn ATTRIBUTE_UNUSED, return value * 16; } +#define MAKE_INSERT_NPS_ADDRTYPE(NAME,VALUE) \ +static unsigned \ +insert_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \ + int value ATTRIBUTE_UNUSED, \ + const char **errmsg ATTRIBUTE_UNUSED) \ +{ \ + if (value != ARC_NPS400_ADDRTYPE_##VALUE) \ + *errmsg = _("Invalid address type for operand"); \ + return insn; \ +} \ + \ +static int \ +extract_nps_##NAME (unsigned insn ATTRIBUTE_UNUSED, \ + bfd_boolean * invalid ATTRIBUTE_UNUSED) \ +{ \ + return ARC_NPS400_ADDRTYPE_##VALUE; \ +} + +MAKE_INSERT_NPS_ADDRTYPE (bd, BD) +MAKE_INSERT_NPS_ADDRTYPE (jid, JID) +MAKE_INSERT_NPS_ADDRTYPE (lbd, LBD) +MAKE_INSERT_NPS_ADDRTYPE (mbd, MBD) +MAKE_INSERT_NPS_ADDRTYPE (sd, SD) +MAKE_INSERT_NPS_ADDRTYPE (sm, SM) +MAKE_INSERT_NPS_ADDRTYPE (xa, XA) +MAKE_INSERT_NPS_ADDRTYPE (xd, XD) +MAKE_INSERT_NPS_ADDRTYPE (cd, CD) +MAKE_INSERT_NPS_ADDRTYPE (cbd, CBD) +MAKE_INSERT_NPS_ADDRTYPE (cjid, CJID) +MAKE_INSERT_NPS_ADDRTYPE (clbd, CLBD) +MAKE_INSERT_NPS_ADDRTYPE (cm, CM) +MAKE_INSERT_NPS_ADDRTYPE (csd, CSD) +MAKE_INSERT_NPS_ADDRTYPE (cxa, CXA) +MAKE_INSERT_NPS_ADDRTYPE (cxd, CXD) + + /* Include the generic extract/insert functions. Order is important as some of the functions present in the .h may be disabled via defines. */ @@ -2081,6 +2119,69 @@ const struct arc_operand arc_operands[] = #define NPS_E4BY_INDEX3 (NPS_E4BY_INDEX2 + 1) { 2, 0, 0, ARC_OPERAND_UNSIGNED | ARC_OPERAND_NCHK, insert_nps_index3, extract_nps_index3 }, + +#define COLON (NPS_E4BY_INDEX3 + 1) + { 0, 0, 0, ARC_OPERAND_COLON | ARC_OPERAND_FAKE, NULL, NULL }, + +#define NPS_BD (COLON + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_bd, extract_nps_bd }, + +#define NPS_JID (NPS_BD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_jid, extract_nps_jid }, + +#define NPS_LBD (NPS_JID + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_lbd, extract_nps_lbd }, + +#define NPS_MBD (NPS_LBD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_mbd, extract_nps_mbd }, + +#define NPS_SD (NPS_MBD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_sd, extract_nps_sd }, + +#define NPS_SM (NPS_SD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_sm, extract_nps_sm }, + +#define NPS_XA (NPS_SM + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_xa, extract_nps_xa }, + +#define NPS_XD (NPS_XA + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_xd, extract_nps_xd }, + +#define NPS_CD (NPS_XD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_cd, extract_nps_cd }, + +#define NPS_CBD (NPS_CD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_cbd, extract_nps_cbd }, + +#define NPS_CJID (NPS_CBD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_cjid, extract_nps_cjid }, + +#define NPS_CLBD (NPS_CJID + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_clbd, extract_nps_clbd }, + +#define NPS_CM (NPS_CLBD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_cm, extract_nps_cm }, + +#define NPS_CSD (NPS_CM + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_csd, extract_nps_csd }, + +#define NPS_CXA (NPS_CSD + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_cxa, extract_nps_cxa }, + +#define NPS_CXD (NPS_CXA + 1) + { 0, 0, 0, ARC_OPERAND_ADDRTYPE | ARC_OPERAND_NCHK, insert_nps_cxd, extract_nps_cxd }, + +#define NPS_BD_TYPE (NPS_CXD + 1) + { 1, 10, 0, ARC_OPERAND_UNSIGNED, NULL, NULL }, + +#define NPS_BMU_NUM (NPS_BD_TYPE + 1) + { 3, 0, 0, ARC_OPERAND_UNSIGNED | ARC_OPERAND_NCHK, insert_nps_bd_num_buff, extract_nps_bd_num_buff }, + +#define NPS_PMU_NXT_DST (NPS_BMU_NUM + 1) + { 4, 6, 0, ARC_OPERAND_UNSIGNED, NULL, NULL }, + +#define NPS_PMU_NUM_JOB (NPS_PMU_NXT_DST + 1) + { 2, 6, 0, ARC_OPERAND_UNSIGNED | ARC_OPERAND_NCHK, insert_nps_pmu_num_job, extract_nps_pmu_num_job }, }; const unsigned arc_num_operands = ARRAY_SIZE (arc_operands); |