forked from Imagelibrary/binutils-gdb
arc: Update opcode related include files for ARCv3.
Add new ARCv3 CPUs and required bits to decode/encode ARCv3 ISA opcodes. Fix 32 bit relocations which were set as signed but should be bitfield: ARC_32_ME, ARC_GLOB_DAT, ARC_JMP_SLOT, ARC_RELATIVE. Remove non-ABI relocation ARC_32_ME_S. include/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> Cupertino Miranda <cupertinomiranda@gmail.com> Bruno Mauricio <brunoasmauricio@gmail.com> * include/elf/arc-cpu.def: Add new HS5x and HS6x CPUs. * include/elf/arc-reloc.def: Add new ARC64 relocations. * include/elf/arc.h (EF_ARC_CPU_ARC64): New define. * include/opcode/arc-attrs.h (FEATURE_LIST_NAME): Update predicate. * include/opcode/arc-func.h: Update formating. (replace_disp8ls): New function. (replace_disp9s): Likewise. (replace_disp6s): Likewise. (replace_disp7s): Likewise. (replace_disp12s): Likewise. * include/opcode/arc.h (ARC_OPCODE_ARC64): New define. (ARC_OPCODE_ARC32): Likewise. (ARC_OPERAND_FP): Likewise. (HARD_FIELDF): Likewise. (ARC_OPCODE_ARCVx): New macro. (arc_flag_class): Update structure to hold new extract/insert functions for flags. (INSN3OP): Update macro. (FP_SIZE, TPOF, DPOF, SOPF, COPF, CONVOPS): New enums. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
This commit is contained in:
committed by
Claudiu Zissulescu
parent
4deb1ee57f
commit
04414221df
@@ -199,13 +199,19 @@ extern int arc_opcode_len (const struct arc_opcode *opcode);
|
||||
#define ARC_OPCODE_ARC700 0x0002 /* ARC 700 specific insns. */
|
||||
#define ARC_OPCODE_ARCv2EM 0x0004 /* ARCv2 EM specific insns. */
|
||||
#define ARC_OPCODE_ARCv2HS 0x0008 /* ARCv2 HS specific insns. */
|
||||
#define ARC_OPCODE_ARC64 0x0010 /* ARC64 specific insns. */
|
||||
#define ARC_OPCODE_ARC32 0x0020 /* ARC32 specific insns. */
|
||||
|
||||
/* CPU combi. */
|
||||
#define ARC_OPCODE_ARCALL (ARC_OPCODE_ARC600 | ARC_OPCODE_ARC700 \
|
||||
| ARC_OPCODE_ARCv2EM | ARC_OPCODE_ARCv2HS)
|
||||
| ARC_OPCODE_ARCv2EM | ARC_OPCODE_ARCv2HS \
|
||||
| ARC_OPCODE_ARC64 | ARC_OPCODE_ARC32)
|
||||
#define ARC_OPCODE_ARCFPX (ARC_OPCODE_ARC700 | ARC_OPCODE_ARCv2EM)
|
||||
#define ARC_OPCODE_ARCV1 (ARC_OPCODE_ARC600 | ARC_OPCODE_ARC700)
|
||||
#define ARC_OPCODE_ARCV2 (ARC_OPCODE_ARCv2EM | ARC_OPCODE_ARCv2HS)
|
||||
#define ARC_OPCODE_ARCVx \
|
||||
(ARC_OPCODE_ARCv2EM | ARC_OPCODE_ARCv2HS | ARC_OPCODE_ARC64 \
|
||||
| ARC_OPCODE_ARC32)
|
||||
#define ARC_OPCODE_ARCMPY6E (ARC_OPCODE_ARC700 | ARC_OPCODE_ARCV2)
|
||||
|
||||
/* The operands table is an array of struct arc_operand. */
|
||||
@@ -325,6 +331,9 @@ extern const unsigned arc_NToperand;
|
||||
/* Mark the colon position. */
|
||||
#define ARC_OPERAND_COLON 0x4000
|
||||
|
||||
/* Mark a floating point register. */
|
||||
#define ARC_OPERAND_FP 0x8000
|
||||
|
||||
/* Mask for selecting the type for typecheck purposes. */
|
||||
#define ARC_OPERAND_TYPECHECK_MASK \
|
||||
(ARC_OPERAND_IR \
|
||||
@@ -369,6 +378,16 @@ struct arc_flag_class
|
||||
|
||||
/* List of valid flags (codes). */
|
||||
unsigned flags[256];
|
||||
|
||||
/* Some special cases needs to use insert/extract functions for
|
||||
flags as well. The function prototypes are identically like the
|
||||
one used for insertion/extraction of an operand. The reason
|
||||
beeing the ability of reusing these functions. */
|
||||
unsigned long long (*insert) (unsigned long long instruction,
|
||||
long long int op,
|
||||
const char **errmsg);
|
||||
long long int (*extract) (unsigned long long instruction,
|
||||
bool *invalid);
|
||||
};
|
||||
|
||||
extern const struct arc_flag_class arc_flag_classes[];
|
||||
@@ -441,6 +460,8 @@ struct arc_pseudo_insn
|
||||
|
||||
extern const struct arc_pseudo_insn arc_pseudo_insns[];
|
||||
extern const unsigned arc_num_pseudo_insn;
|
||||
extern const struct arc_pseudo_insn arc64_pseudo_insns[];
|
||||
extern const unsigned arc64_num_pseudo_insn;
|
||||
|
||||
/* Structure for AUXILIARY registers. */
|
||||
struct arc_aux_reg
|
||||
@@ -478,8 +499,10 @@ extern const unsigned arc_num_relax_opcodes;
|
||||
#define FIELDC(word) ((word & 0x3F) << 6)
|
||||
#define FIELDF (0x01 << 15)
|
||||
#define FIELDQ (0x1F)
|
||||
#define HARD_FIELDF (0x00)
|
||||
|
||||
#define INSN3OP(MOP,SOP) (((MOP & 0x1F) << 27) | ((SOP & 0x3F) << 16))
|
||||
#define INSN3OP(MOP,SOP) \
|
||||
(((MOP & 0x1F) << 27) | ((SOP & 0x3F) << 16) | HARD_FIELDF)
|
||||
#define INSN2OPX(MOP,SOP1,SOP2) (INSN3OP (MOP,SOP1) | (SOP2 & 0x3F))
|
||||
#define INSN2OP(MOP,SOP) (INSN2OPX (MOP,0x2F,SOP))
|
||||
|
||||
@@ -667,6 +690,100 @@ typedef enum
|
||||
|
||||
#define ARC_NUM_ADDRTYPES 16
|
||||
|
||||
/*ARC64 floating point enums. */
|
||||
#define P_HALF 0
|
||||
#define P_SINGLE 1
|
||||
#define P_DOUBLE 2
|
||||
|
||||
#define TOPF_FMADD 0
|
||||
#define TOPF_FMSUB 1
|
||||
#define TOPF_FNMADD 2
|
||||
#define TOPF_FNMSUB 3
|
||||
#define TOPF_VFMADD 4
|
||||
#define TOPF_VFMSUB 5
|
||||
#define TOPF_VFNMADD 6
|
||||
#define TOPF_VFNMSUB 7
|
||||
#define TOPF_VFMADDS 0xC
|
||||
#define TOPF_VFMSUBS 0xD
|
||||
#define TOPF_VFNMADDS 0xE
|
||||
#define TOPF_VFNMSUBS 0xF
|
||||
|
||||
#define DOPF_FADD 0
|
||||
#define DOPF_FSUB 1
|
||||
#define DOPF_FMUL 2
|
||||
#define DOPF_FDIV 3
|
||||
#define DOPF_FCMP 4
|
||||
#define DOPF_FCMPF 5
|
||||
#define DOPF_FMIN 6
|
||||
#define DOPF_FMAX 7
|
||||
#define DOPF_FSGNJ 8
|
||||
#define DOPF_FSGNJN 10
|
||||
#define DOPF_FSGNJX 11
|
||||
#define DOPF_VFADD 0x10
|
||||
#define DOPF_VFSUB 0x11
|
||||
#define DOPF_VFMUL 0x12
|
||||
#define DOPF_VFDIV 0x13
|
||||
#define DOPF_VFADDS 0x14
|
||||
#define DOPF_VFSUBS 0x15
|
||||
#define DOPF_VFMULS 0x16
|
||||
#define DOPF_VFDIVS 0x17
|
||||
#define DOPF_VFUNPKL 0x18
|
||||
#define DOPF_VFUNPKM 0x19
|
||||
#define DOPF_VFPACKL 0x1a
|
||||
#define DOPF_VFPACKM 0x1b
|
||||
#define DOPF_VFBFLYL 0x1c
|
||||
#define DOPF_VFBFLYM 0x1d
|
||||
#define DOPF_VFADDSUB 0x1e
|
||||
#define DOPF_VFSUBADD 0x1f
|
||||
|
||||
#define SOPF_FSQRT 0
|
||||
#define SOPF_VFSQRT 1
|
||||
#define SOPF_VFEXCH 2
|
||||
|
||||
#define COPF_FMOV 0
|
||||
#define COPF_VFMOV 1
|
||||
|
||||
#define FUINT2S 0
|
||||
#define FS2UINT 0
|
||||
#define FINT2S 0
|
||||
#define FS2INT 0
|
||||
#define FSRND 0
|
||||
#define F2UINT_RZ 0
|
||||
#define FSINT_RZ 0
|
||||
#define FSRND_RZ 0
|
||||
#define FMVI2S 0
|
||||
#define FMVS2I 0
|
||||
#define FS2H 0
|
||||
#define FH2S 0
|
||||
#define FS2H_RZ 0
|
||||
|
||||
#define FUINT2D 1
|
||||
#define FS2UL 1
|
||||
#define FINT2D 1
|
||||
#define FS2L 1
|
||||
#define FS2D 1
|
||||
#define FS2UL_RZ 1
|
||||
#define FS2L_RZ 1
|
||||
|
||||
#define FUL2S 2
|
||||
#define FD2UINT 2
|
||||
#define FL2S 2
|
||||
#define FD2INT 2
|
||||
#define FD2S 2
|
||||
#define FD2UINT_RZ 2
|
||||
#define FD2INT_RZ 2
|
||||
|
||||
#define FUL2D 3
|
||||
#define FD2UL 3
|
||||
#define FL2D 3
|
||||
#define FD2L 3
|
||||
#define FDRND 3
|
||||
#define FD2UL_RZ 3
|
||||
#define FD2L_RZ 3
|
||||
#define FDRND_RZ 3
|
||||
#define FMVL2D 3
|
||||
#define FMVD2L 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user