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 /include | |
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 'include')
-rw-r--r-- | include/ChangeLog | 8 | ||||
-rw-r--r-- | include/opcode/arc.h | 194 |
2 files changed, 143 insertions, 59 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 158be71..a87c9b6 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,11 @@ +2016-07-27 Graham Markall <graham.markall@embecosm.com> + + * 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. + 2016-07-20 Claudiu Zissulescu <claziss@synopsys.com> * dis-asm.h: Declare print_arc_disassembler_options. diff --git a/include/opcode/arc.h b/include/opcode/arc.h index f0fefbbc..faa63dc 100644 --- a/include/opcode/arc.h +++ b/include/opcode/arc.h @@ -38,71 +38,73 @@ extern "C" { /* Instruction Class. */ typedef enum - { - ACL, - ARITH, - AUXREG, - BITOP, - BRANCH, - CONTROL, - DPI, - DSP, - FLOAT, - INVALID, - JUMP, - KERNEL, - LOGICAL, - MEMORY, - NET, - } insn_class_t; +{ + ACL, + ARITH, + AUXREG, + BITOP, + BMU, + BRANCH, + CONTROL, + DPI, + DSP, + FLOAT, + INVALID, + JUMP, + KERNEL, + LOGICAL, + MEMORY, + NET, + PMU +} insn_class_t; /* Instruction Subclass. */ typedef enum - { - NONE, - CVT, - BTSCN, - CD1, - CD2, - COND, - DIV, - DP, - DPA, - DPX, - MPY1E, - MPY6E, - MPY7E, - MPY8E, - MPY9E, - NPS400, - QUARKSE, - SHFT1, - SHFT2, - SWAP, - SP, - SPX - } insn_subclass_t; +{ + NONE, + CVT, + BTSCN, + CD1, + CD2, + COND, + DIV, + DP, + DPA, + DPX, + MPY1E, + MPY6E, + MPY7E, + MPY8E, + MPY9E, + NPS400, + QUARKSE, + SHFT1, + SHFT2, + SWAP, + SP, + SPX +} insn_subclass_t; /* Flags class. */ typedef enum - { - F_CLASS_NONE = 0, +{ + F_CLASS_NONE = 0, - /* At most one flag from the set of flags can appear in the - instruction. */ - F_CLASS_OPTIONAL = (1 << 0), + /* At most one flag from the set of flags can appear in the + instruction. */ + F_CLASS_OPTIONAL = (1 << 0), - /* Exactly one from from the set of flags must appear in the - instruction. */ - F_CLASS_REQUIRED = (1 << 1), + /* Exactly one from from the set of flags must appear in the + instruction. */ + F_CLASS_REQUIRED = (1 << 1), - /* The conditional code can be extended over the standard variants - via .extCondCode pseudo-op. */ - F_CLASS_EXTEND = (1 << 2), + /* The conditional code can be extended over the standard variants + via .extCondCode pseudo-op. */ + F_CLASS_EXTEND = (1 << 2), - /* Condition code flag. */ - F_CLASS_COND = (1 << 3) - } flag_class_t; + /* Condition code flag. */ + F_CLASS_COND = (1 << 3) +} flag_class_t; /* The opcode table is an array of struct arc_opcode. */ struct arc_opcode @@ -336,11 +338,24 @@ extern const unsigned arc_NToperand; /* Mark the braket possition. */ #define ARC_OPERAND_BRAKET 0x1000 +/* Address type operand for NPS400. */ +#define ARC_OPERAND_ADDRTYPE 0x2000 + +/* Mark the colon position. */ +#define ARC_OPERAND_COLON 0x4000 + /* Mask for selecting the type for typecheck purposes. */ -#define ARC_OPERAND_TYPECHECK_MASK \ - (ARC_OPERAND_IR | \ - ARC_OPERAND_LIMM | ARC_OPERAND_SIGNED | \ - ARC_OPERAND_UNSIGNED | ARC_OPERAND_BRAKET) +#define ARC_OPERAND_TYPECHECK_MASK \ + (ARC_OPERAND_IR \ + | ARC_OPERAND_LIMM | ARC_OPERAND_SIGNED \ + | ARC_OPERAND_UNSIGNED | ARC_OPERAND_BRAKET \ + | ARC_OPERAND_ADDRTYPE | ARC_OPERAND_COLON) + +/* Macro to determine if an operand is a fake operand. */ +#define ARC_OPERAND_IS_FAKE(op) \ + ((operand->flags & ARC_OPERAND_FAKE) \ + && !((operand->flags & ARC_OPERAND_BRAKET) \ + || (operand->flags & ARC_OPERAND_COLON))) /* The flags structure. */ struct arc_flag_operand @@ -608,6 +623,67 @@ extern const unsigned char arg_32bit_rc[MAX_INSN_ARGS + 1]; extern const unsigned char arg_32bit_u6[MAX_INSN_ARGS + 1]; extern const unsigned char arg_32bit_limm[MAX_INSN_ARGS + 1]; +/* Address types used in the NPS-400. See page 367 of the NPS-400 CTOP + Instruction Set Reference Manual v2.4 for a description of address types. */ + +typedef enum +{ + /* Addresses in memory. */ + + /* Buffer descriptor. */ + ARC_NPS400_ADDRTYPE_BD, + + /* Job identifier. */ + ARC_NPS400_ADDRTYPE_JID, + + /* Linked Buffer Descriptor. */ + ARC_NPS400_ADDRTYPE_LBD, + + /* Multicast Buffer Descriptor. */ + ARC_NPS400_ADDRTYPE_MBD, + + /* Summarized Address. */ + ARC_NPS400_ADDRTYPE_SD, + + /* SMEM Security Context Local Memory. */ + ARC_NPS400_ADDRTYPE_SM, + + /* Extended Address. */ + ARC_NPS400_ADDRTYPE_XA, + + /* Extended Summarized Address. */ + ARC_NPS400_ADDRTYPE_XD, + + /* CMEM offset addresses. */ + + /* On-demand Counter Descriptor. */ + ARC_NPS400_ADDRTYPE_CD, + + /* CMEM Buffer Descriptor. */ + ARC_NPS400_ADDRTYPE_CBD, + + /* CMEM Job Identifier. */ + ARC_NPS400_ADDRTYPE_CJID, + + /* CMEM Linked Buffer Descriptor. */ + ARC_NPS400_ADDRTYPE_CLBD, + + /* CMEM Offset. */ + ARC_NPS400_ADDRTYPE_CM, + + /* CMEM Summarized Address. */ + ARC_NPS400_ADDRTYPE_CSD, + + /* CMEM Extended Address. */ + ARC_NPS400_ADDRTYPE_CXA, + + /* CMEM Extended Summarized Address. */ + ARC_NPS400_ADDRTYPE_CXD + +} arc_nps_address_type; + +#define ARC_NUM_ADDRTYPES 16 + #ifdef __cplusplus } #endif |