arc-ext-tbl.h revision 1.1.1.5 1 1.1 christos /* ARC instruction defintions.
2 1.1.1.5 christos Copyright (C) 2016-2022 Free Software Foundation, Inc.
3 1.1 christos
4 1.1 christos Contributed by Claudiu Zissulescu (claziss (at) synopsys.com)
5 1.1 christos
6 1.1 christos This file is part of libopcodes.
7 1.1 christos
8 1.1 christos This library is free software; you can redistribute it and/or modify
9 1.1 christos it under the terms of the GNU General Public License as published by
10 1.1 christos the Free Software Foundation; either version 3, or (at your option)
11 1.1 christos any later version.
12 1.1 christos
13 1.1 christos It is distributed in the hope that it will be useful, but WITHOUT
14 1.1 christos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 1.1 christos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 1.1 christos License for more details.
17 1.1 christos
18 1.1 christos You should have received a copy of the GNU General Public License
19 1.1 christos along with this program; if not, write to the Free Software Foundation,
20 1.1 christos Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
21 1.1 christos
22 1.1 christos /* Common combinations of FLAGS. */
23 1.1 christos #define FLAGS_NONE { 0 }
24 1.1 christos #define FLAGS_F { C_F }
25 1.1 christos #define FLAGS_CC { C_CC }
26 1.1 christos #define FLAGS_CCF { C_CC, C_F }
27 1.1 christos
28 1.1 christos /* Common combination of arguments. */
29 1.1 christos #define ARG_NONE { 0 }
30 1.1 christos #define ARG_32BIT_RARBRC { RA, RB, RC }
31 1.1 christos #define ARG_32BIT_ZARBRC { ZA, RB, RC }
32 1.1 christos #define ARG_32BIT_RBRBRC { RB, RBdup, RC }
33 1.1 christos #define ARG_32BIT_RARBU6 { RA, RB, UIMM6_20 }
34 1.1 christos #define ARG_32BIT_ZARBU6 { ZA, RB, UIMM6_20 }
35 1.1 christos #define ARG_32BIT_RBRBU6 { RB, RBdup, UIMM6_20 }
36 1.1 christos #define ARG_32BIT_RBRBS12 { RB, RBdup, SIMM12_20 }
37 1.1 christos #define ARG_32BIT_RALIMMRC { RA, LIMM, RC }
38 1.1 christos #define ARG_32BIT_RARBLIMM { RA, RB, LIMM }
39 1.1 christos #define ARG_32BIT_ZALIMMRC { ZA, LIMM, RC }
40 1.1 christos #define ARG_32BIT_ZARBLIMM { ZA, RB, LIMM }
41 1.1 christos
42 1.1 christos #define ARG_32BIT_RBRBLIMM { RB, RBdup, LIMM }
43 1.1 christos #define ARG_32BIT_RALIMMU6 { RA, LIMM, UIMM6_20 }
44 1.1 christos #define ARG_32BIT_ZALIMMU6 { ZA, LIMM, UIMM6_20 }
45 1.1 christos
46 1.1 christos #define ARG_32BIT_ZALIMMS12 { ZA, LIMM, SIMM12_20 }
47 1.1 christos #define ARG_32BIT_RALIMMLIMM { RA, LIMM, LIMMdup }
48 1.1 christos #define ARG_32BIT_ZALIMMLIMM { ZA, LIMM, LIMMdup }
49 1.1 christos
50 1.1 christos #define ARG_32BIT_RBRC { RB, RC }
51 1.1 christos #define ARG_32BIT_ZARC { ZA, RC }
52 1.1 christos #define ARG_32BIT_RBU6 { RB, UIMM6_20 }
53 1.1 christos #define ARG_32BIT_ZAU6 { ZA, UIMM6_20 }
54 1.1 christos #define ARG_32BIT_RBLIMM { RB, LIMM }
55 1.1 christos #define ARG_32BIT_ZALIMM { ZA, LIMM }
56 1.1 christos
57 1.1 christos /* Macro to generate 2 operand extension instruction. */
58 1.1.1.2 christos #define EXTINSN2OPF(NAME, CPU, CLASS, SCLASS, MOP, SOP, FL) \
59 1.1 christos { NAME, INSN2OP_BC (MOP,SOP), MINSN2OP_BC, CPU, CLASS, SCLASS, \
60 1.1.1.2 christos ARG_32BIT_RBRC, FL }, \
61 1.1 christos { NAME, INSN2OP_0C (MOP,SOP), MINSN2OP_0C, CPU, CLASS, SCLASS, \
62 1.1.1.2 christos ARG_32BIT_ZARC, FL }, \
63 1.1 christos { NAME, INSN2OP_BU (MOP,SOP), MINSN2OP_BU, CPU, CLASS, SCLASS, \
64 1.1.1.2 christos ARG_32BIT_RBU6, FL }, \
65 1.1 christos { NAME, INSN2OP_0U (MOP,SOP), MINSN2OP_0U, CPU, CLASS, SCLASS, \
66 1.1.1.2 christos ARG_32BIT_ZAU6, FL }, \
67 1.1 christos { NAME, INSN2OP_BL (MOP,SOP), MINSN2OP_BL, CPU, CLASS, SCLASS, \
68 1.1.1.2 christos ARG_32BIT_RBLIMM, FL }, \
69 1.1 christos { NAME, INSN2OP_0L (MOP,SOP), MINSN2OP_0L, CPU, CLASS, SCLASS, \
70 1.1.1.2 christos ARG_32BIT_ZALIMM, FL },
71 1.1.1.2 christos
72 1.1.1.2 christos #define EXTINSN2OP(NAME, CPU, CLASS, SCLASS, MOP, SOP) \
73 1.1.1.2 christos EXTINSN2OPF(NAME, CPU, CLASS, SCLASS, MOP, SOP, FLAGS_F)
74 1.1 christos
75 1.1 christos /* Macro to generate 3 operand extesion instruction. */
76 1.1 christos #define EXTINSN3OP(NAME, CPU, CLASS, SCLASS, MOP, SOP) \
77 1.1 christos { NAME, INSN3OP_ABC (MOP,SOP), MINSN3OP_ABC, CPU, CLASS, SCLASS, \
78 1.1 christos ARG_32BIT_RARBRC, FLAGS_F }, \
79 1.1 christos { NAME, INSN3OP_0BC (MOP,SOP), MINSN3OP_0BC, CPU, CLASS, SCLASS, \
80 1.1 christos ARG_32BIT_ZARBRC, FLAGS_F }, \
81 1.1 christos { NAME, INSN3OP_CBBC (MOP,SOP), MINSN3OP_CBBC, CPU, CLASS, SCLASS, \
82 1.1 christos ARG_32BIT_RBRBRC, FLAGS_CCF }, \
83 1.1 christos { NAME, INSN3OP_ABU (MOP,SOP), MINSN3OP_ABU, CPU, CLASS, SCLASS, \
84 1.1 christos ARG_32BIT_RARBU6, FLAGS_F }, \
85 1.1 christos { NAME, INSN3OP_0BU (MOP,SOP), MINSN3OP_0BU, CPU, CLASS, SCLASS, \
86 1.1 christos ARG_32BIT_ZARBU6, FLAGS_F }, \
87 1.1 christos { NAME, INSN3OP_CBBU (MOP,SOP), MINSN3OP_CBBU, CPU, CLASS, SCLASS, \
88 1.1 christos ARG_32BIT_RBRBU6, FLAGS_CCF }, \
89 1.1 christos { NAME, INSN3OP_BBS (MOP,SOP), MINSN3OP_BBS, CPU, CLASS, SCLASS, \
90 1.1 christos ARG_32BIT_RBRBS12, FLAGS_F }, \
91 1.1 christos { NAME, INSN3OP_ALC (MOP,SOP), MINSN3OP_ALC, CPU, CLASS, SCLASS, \
92 1.1 christos ARG_32BIT_RALIMMRC, FLAGS_F }, \
93 1.1 christos { NAME, INSN3OP_ABL (MOP,SOP), MINSN3OP_ABL, CPU, CLASS, SCLASS, \
94 1.1 christos ARG_32BIT_RARBLIMM, FLAGS_F }, \
95 1.1 christos { NAME, INSN3OP_0LC (MOP,SOP), MINSN3OP_0LC, CPU, CLASS, SCLASS, \
96 1.1 christos ARG_32BIT_ZALIMMRC, FLAGS_F }, \
97 1.1 christos { NAME, INSN3OP_0BL (MOP,SOP), MINSN3OP_0BL, CPU, CLASS, SCLASS, \
98 1.1 christos ARG_32BIT_ZARBLIMM, FLAGS_F }, \
99 1.1 christos { NAME, INSN3OP_C0LC (MOP,SOP), MINSN3OP_C0LC, CPU, CLASS, SCLASS, \
100 1.1 christos ARG_32BIT_ZALIMMRC, FLAGS_CCF }, \
101 1.1 christos { NAME, INSN3OP_CBBL (MOP,SOP), MINSN3OP_CBBL, CPU, CLASS, SCLASS, \
102 1.1 christos ARG_32BIT_RBRBLIMM, FLAGS_CCF }, \
103 1.1 christos { NAME, INSN3OP_ALU (MOP,SOP), MINSN3OP_ALU, CPU, CLASS, SCLASS, \
104 1.1 christos ARG_32BIT_RALIMMU6, FLAGS_F }, \
105 1.1 christos { NAME, INSN3OP_0LU (MOP,SOP), MINSN3OP_0LU, CPU, CLASS, SCLASS, \
106 1.1 christos ARG_32BIT_ZALIMMU6, FLAGS_F }, \
107 1.1 christos { NAME, INSN3OP_C0LU (MOP,SOP), MINSN3OP_C0LU, CPU, CLASS, SCLASS, \
108 1.1 christos ARG_32BIT_ZALIMMU6, FLAGS_CCF }, \
109 1.1 christos { NAME, INSN3OP_0LS (MOP,SOP), MINSN3OP_0LS, CPU, CLASS, SCLASS, \
110 1.1 christos ARG_32BIT_ZALIMMS12, FLAGS_F }, \
111 1.1 christos { NAME, INSN3OP_ALL (MOP,SOP), MINSN3OP_ALL, CPU, CLASS, SCLASS, \
112 1.1 christos ARG_32BIT_RALIMMLIMM, FLAGS_F }, \
113 1.1 christos { NAME, INSN3OP_0LL (MOP,SOP), MINSN3OP_0LL, CPU, CLASS, SCLASS, \
114 1.1 christos ARG_32BIT_ZALIMMLIMM, FLAGS_F }, \
115 1.1 christos { NAME, INSN3OP_C0LL (MOP,SOP), MINSN3OP_C0LL, CPU, CLASS, SCLASS, \
116 1.1 christos ARG_32BIT_ZALIMMLIMM, FLAGS_CCF },
117 1.1 christos
118 1.1 christos /* Extension instruction declarations. */
119 1.1.1.3 christos EXTINSN2OP ("dsp_fp_flt2i", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE1, 7, 43)
120 1.1.1.3 christos EXTINSN2OP ("dsp_fp_i2flt", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE1, 7, 44)
121 1.1.1.3 christos EXTINSN2OP ("dsp_fp_sqrt", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE2, 7, 45)
122 1.1 christos
123 1.1.1.3 christos EXTINSN3OP ("dsp_fp_div", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE2, 7, 42)
124 1.1.1.3 christos EXTINSN3OP ("dsp_fp_cmp", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE1, 7, 43)
125