Rev 5191 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5191 | Rev 6324 | ||
---|---|---|---|
1 | /* TILE-Gx opcode information. |
1 | /* TILE-Gx opcode information. |
2 | * |
2 | * |
3 | * Copyright 2011 Free Software Foundation, Inc. |
3 | * Copyright (C) 2011-2015 Free Software Foundation, Inc. |
4 | * |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify |
5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by |
6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 3 of the License, or |
7 | * the Free Software Foundation; either version 3 of the License, or |
8 | * (at your option) any later version. |
8 | * (at your option) any later version. |
9 | * |
9 | * |
10 | * This program is distributed in the hope that it will be useful, |
10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. |
13 | * GNU General Public License for more details. |
14 | * |
14 | * |
15 | * You should have received a copy of the GNU General Public License |
15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software |
16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
17 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
18 | * MA 02110-1301, USA. |
18 | * MA 02110-1301, USA. |
19 | */ |
19 | */ |
20 | 20 | ||
21 | #ifndef opcode_tile_h |
21 | #ifndef opcode_tile_h |
22 | #define opcode_tile_h |
22 | #define opcode_tile_h |
- | 23 | ||
- | 24 | #ifdef __cplusplus |
|
- | 25 | extern "C" { |
|
- | 26 | #endif |
|
23 | 27 | ||
24 | typedef unsigned long long tilegx_bundle_bits; |
28 | typedef unsigned long long tilegx_bundle_bits; |
25 | 29 | ||
26 | 30 | ||
27 | enum |
31 | enum |
28 | { |
32 | { |
29 | TILEGX_MAX_OPERANDS = 4 /* bfexts */ |
33 | TILEGX_MAX_OPERANDS = 4 /* bfexts */ |
30 | }; |
34 | }; |
31 | 35 | ||
32 | typedef enum |
36 | typedef enum |
33 | { |
37 | { |
34 | TILEGX_OPC_BPT, |
38 | TILEGX_OPC_BPT, |
35 | TILEGX_OPC_INFO, |
39 | TILEGX_OPC_INFO, |
36 | TILEGX_OPC_INFOL, |
40 | TILEGX_OPC_INFOL, |
37 | TILEGX_OPC_LD4S_TLS, |
41 | TILEGX_OPC_LD4S_TLS, |
38 | TILEGX_OPC_LD_TLS, |
42 | TILEGX_OPC_LD_TLS, |
39 | TILEGX_OPC_MOVE, |
43 | TILEGX_OPC_MOVE, |
40 | TILEGX_OPC_MOVEI, |
44 | TILEGX_OPC_MOVEI, |
41 | TILEGX_OPC_MOVELI, |
45 | TILEGX_OPC_MOVELI, |
42 | TILEGX_OPC_PREFETCH, |
46 | TILEGX_OPC_PREFETCH, |
43 | TILEGX_OPC_PREFETCH_ADD_L1, |
47 | TILEGX_OPC_PREFETCH_ADD_L1, |
44 | TILEGX_OPC_PREFETCH_ADD_L1_FAULT, |
48 | TILEGX_OPC_PREFETCH_ADD_L1_FAULT, |
45 | TILEGX_OPC_PREFETCH_ADD_L2, |
49 | TILEGX_OPC_PREFETCH_ADD_L2, |
46 | TILEGX_OPC_PREFETCH_ADD_L2_FAULT, |
50 | TILEGX_OPC_PREFETCH_ADD_L2_FAULT, |
47 | TILEGX_OPC_PREFETCH_ADD_L3, |
51 | TILEGX_OPC_PREFETCH_ADD_L3, |
48 | TILEGX_OPC_PREFETCH_ADD_L3_FAULT, |
52 | TILEGX_OPC_PREFETCH_ADD_L3_FAULT, |
49 | TILEGX_OPC_PREFETCH_L1, |
53 | TILEGX_OPC_PREFETCH_L1, |
50 | TILEGX_OPC_PREFETCH_L1_FAULT, |
54 | TILEGX_OPC_PREFETCH_L1_FAULT, |
51 | TILEGX_OPC_PREFETCH_L2, |
55 | TILEGX_OPC_PREFETCH_L2, |
52 | TILEGX_OPC_PREFETCH_L2_FAULT, |
56 | TILEGX_OPC_PREFETCH_L2_FAULT, |
53 | TILEGX_OPC_PREFETCH_L3, |
57 | TILEGX_OPC_PREFETCH_L3, |
54 | TILEGX_OPC_PREFETCH_L3_FAULT, |
58 | TILEGX_OPC_PREFETCH_L3_FAULT, |
55 | TILEGX_OPC_RAISE, |
59 | TILEGX_OPC_RAISE, |
56 | TILEGX_OPC_ADD, |
60 | TILEGX_OPC_ADD, |
57 | TILEGX_OPC_ADDI, |
61 | TILEGX_OPC_ADDI, |
58 | TILEGX_OPC_ADDLI, |
62 | TILEGX_OPC_ADDLI, |
59 | TILEGX_OPC_ADDX, |
63 | TILEGX_OPC_ADDX, |
60 | TILEGX_OPC_ADDXI, |
64 | TILEGX_OPC_ADDXI, |
61 | TILEGX_OPC_ADDXLI, |
65 | TILEGX_OPC_ADDXLI, |
62 | TILEGX_OPC_ADDXSC, |
66 | TILEGX_OPC_ADDXSC, |
63 | TILEGX_OPC_AND, |
67 | TILEGX_OPC_AND, |
64 | TILEGX_OPC_ANDI, |
68 | TILEGX_OPC_ANDI, |
65 | TILEGX_OPC_BEQZ, |
69 | TILEGX_OPC_BEQZ, |
66 | TILEGX_OPC_BEQZT, |
70 | TILEGX_OPC_BEQZT, |
67 | TILEGX_OPC_BFEXTS, |
71 | TILEGX_OPC_BFEXTS, |
68 | TILEGX_OPC_BFEXTU, |
72 | TILEGX_OPC_BFEXTU, |
69 | TILEGX_OPC_BFINS, |
73 | TILEGX_OPC_BFINS, |
70 | TILEGX_OPC_BGEZ, |
74 | TILEGX_OPC_BGEZ, |
71 | TILEGX_OPC_BGEZT, |
75 | TILEGX_OPC_BGEZT, |
72 | TILEGX_OPC_BGTZ, |
76 | TILEGX_OPC_BGTZ, |
73 | TILEGX_OPC_BGTZT, |
77 | TILEGX_OPC_BGTZT, |
74 | TILEGX_OPC_BLBC, |
78 | TILEGX_OPC_BLBC, |
75 | TILEGX_OPC_BLBCT, |
79 | TILEGX_OPC_BLBCT, |
76 | TILEGX_OPC_BLBS, |
80 | TILEGX_OPC_BLBS, |
77 | TILEGX_OPC_BLBST, |
81 | TILEGX_OPC_BLBST, |
78 | TILEGX_OPC_BLEZ, |
82 | TILEGX_OPC_BLEZ, |
79 | TILEGX_OPC_BLEZT, |
83 | TILEGX_OPC_BLEZT, |
80 | TILEGX_OPC_BLTZ, |
84 | TILEGX_OPC_BLTZ, |
81 | TILEGX_OPC_BLTZT, |
85 | TILEGX_OPC_BLTZT, |
82 | TILEGX_OPC_BNEZ, |
86 | TILEGX_OPC_BNEZ, |
83 | TILEGX_OPC_BNEZT, |
87 | TILEGX_OPC_BNEZT, |
84 | TILEGX_OPC_CLZ, |
88 | TILEGX_OPC_CLZ, |
85 | TILEGX_OPC_CMOVEQZ, |
89 | TILEGX_OPC_CMOVEQZ, |
86 | TILEGX_OPC_CMOVNEZ, |
90 | TILEGX_OPC_CMOVNEZ, |
87 | TILEGX_OPC_CMPEQ, |
91 | TILEGX_OPC_CMPEQ, |
88 | TILEGX_OPC_CMPEQI, |
92 | TILEGX_OPC_CMPEQI, |
89 | TILEGX_OPC_CMPEXCH, |
93 | TILEGX_OPC_CMPEXCH, |
90 | TILEGX_OPC_CMPEXCH4, |
94 | TILEGX_OPC_CMPEXCH4, |
91 | TILEGX_OPC_CMPLES, |
95 | TILEGX_OPC_CMPLES, |
92 | TILEGX_OPC_CMPLEU, |
96 | TILEGX_OPC_CMPLEU, |
93 | TILEGX_OPC_CMPLTS, |
97 | TILEGX_OPC_CMPLTS, |
94 | TILEGX_OPC_CMPLTSI, |
98 | TILEGX_OPC_CMPLTSI, |
95 | TILEGX_OPC_CMPLTU, |
99 | TILEGX_OPC_CMPLTU, |
96 | TILEGX_OPC_CMPLTUI, |
100 | TILEGX_OPC_CMPLTUI, |
97 | TILEGX_OPC_CMPNE, |
101 | TILEGX_OPC_CMPNE, |
98 | TILEGX_OPC_CMUL, |
102 | TILEGX_OPC_CMUL, |
99 | TILEGX_OPC_CMULA, |
103 | TILEGX_OPC_CMULA, |
100 | TILEGX_OPC_CMULAF, |
104 | TILEGX_OPC_CMULAF, |
101 | TILEGX_OPC_CMULF, |
105 | TILEGX_OPC_CMULF, |
102 | TILEGX_OPC_CMULFR, |
106 | TILEGX_OPC_CMULFR, |
103 | TILEGX_OPC_CMULH, |
107 | TILEGX_OPC_CMULH, |
104 | TILEGX_OPC_CMULHR, |
108 | TILEGX_OPC_CMULHR, |
105 | TILEGX_OPC_CRC32_32, |
109 | TILEGX_OPC_CRC32_32, |
106 | TILEGX_OPC_CRC32_8, |
110 | TILEGX_OPC_CRC32_8, |
107 | TILEGX_OPC_CTZ, |
111 | TILEGX_OPC_CTZ, |
108 | TILEGX_OPC_DBLALIGN, |
112 | TILEGX_OPC_DBLALIGN, |
109 | TILEGX_OPC_DBLALIGN2, |
113 | TILEGX_OPC_DBLALIGN2, |
110 | TILEGX_OPC_DBLALIGN4, |
114 | TILEGX_OPC_DBLALIGN4, |
111 | TILEGX_OPC_DBLALIGN6, |
115 | TILEGX_OPC_DBLALIGN6, |
112 | TILEGX_OPC_DRAIN, |
116 | TILEGX_OPC_DRAIN, |
113 | TILEGX_OPC_DTLBPR, |
117 | TILEGX_OPC_DTLBPR, |
114 | TILEGX_OPC_EXCH, |
118 | TILEGX_OPC_EXCH, |
115 | TILEGX_OPC_EXCH4, |
119 | TILEGX_OPC_EXCH4, |
116 | TILEGX_OPC_FDOUBLE_ADD_FLAGS, |
120 | TILEGX_OPC_FDOUBLE_ADD_FLAGS, |
117 | TILEGX_OPC_FDOUBLE_ADDSUB, |
121 | TILEGX_OPC_FDOUBLE_ADDSUB, |
118 | TILEGX_OPC_FDOUBLE_MUL_FLAGS, |
122 | TILEGX_OPC_FDOUBLE_MUL_FLAGS, |
119 | TILEGX_OPC_FDOUBLE_PACK1, |
123 | TILEGX_OPC_FDOUBLE_PACK1, |
120 | TILEGX_OPC_FDOUBLE_PACK2, |
124 | TILEGX_OPC_FDOUBLE_PACK2, |
121 | TILEGX_OPC_FDOUBLE_SUB_FLAGS, |
125 | TILEGX_OPC_FDOUBLE_SUB_FLAGS, |
122 | TILEGX_OPC_FDOUBLE_UNPACK_MAX, |
126 | TILEGX_OPC_FDOUBLE_UNPACK_MAX, |
123 | TILEGX_OPC_FDOUBLE_UNPACK_MIN, |
127 | TILEGX_OPC_FDOUBLE_UNPACK_MIN, |
124 | TILEGX_OPC_FETCHADD, |
128 | TILEGX_OPC_FETCHADD, |
125 | TILEGX_OPC_FETCHADD4, |
129 | TILEGX_OPC_FETCHADD4, |
126 | TILEGX_OPC_FETCHADDGEZ, |
130 | TILEGX_OPC_FETCHADDGEZ, |
127 | TILEGX_OPC_FETCHADDGEZ4, |
131 | TILEGX_OPC_FETCHADDGEZ4, |
128 | TILEGX_OPC_FETCHAND, |
132 | TILEGX_OPC_FETCHAND, |
129 | TILEGX_OPC_FETCHAND4, |
133 | TILEGX_OPC_FETCHAND4, |
130 | TILEGX_OPC_FETCHOR, |
134 | TILEGX_OPC_FETCHOR, |
131 | TILEGX_OPC_FETCHOR4, |
135 | TILEGX_OPC_FETCHOR4, |
132 | TILEGX_OPC_FINV, |
136 | TILEGX_OPC_FINV, |
133 | TILEGX_OPC_FLUSH, |
137 | TILEGX_OPC_FLUSH, |
134 | TILEGX_OPC_FLUSHWB, |
138 | TILEGX_OPC_FLUSHWB, |
135 | TILEGX_OPC_FNOP, |
139 | TILEGX_OPC_FNOP, |
136 | TILEGX_OPC_FSINGLE_ADD1, |
140 | TILEGX_OPC_FSINGLE_ADD1, |
137 | TILEGX_OPC_FSINGLE_ADDSUB2, |
141 | TILEGX_OPC_FSINGLE_ADDSUB2, |
138 | TILEGX_OPC_FSINGLE_MUL1, |
142 | TILEGX_OPC_FSINGLE_MUL1, |
139 | TILEGX_OPC_FSINGLE_MUL2, |
143 | TILEGX_OPC_FSINGLE_MUL2, |
140 | TILEGX_OPC_FSINGLE_PACK1, |
144 | TILEGX_OPC_FSINGLE_PACK1, |
141 | TILEGX_OPC_FSINGLE_PACK2, |
145 | TILEGX_OPC_FSINGLE_PACK2, |
142 | TILEGX_OPC_FSINGLE_SUB1, |
146 | TILEGX_OPC_FSINGLE_SUB1, |
143 | TILEGX_OPC_ICOH, |
147 | TILEGX_OPC_ICOH, |
144 | TILEGX_OPC_ILL, |
148 | TILEGX_OPC_ILL, |
145 | TILEGX_OPC_INV, |
149 | TILEGX_OPC_INV, |
146 | TILEGX_OPC_IRET, |
150 | TILEGX_OPC_IRET, |
147 | TILEGX_OPC_J, |
151 | TILEGX_OPC_J, |
148 | TILEGX_OPC_JAL, |
152 | TILEGX_OPC_JAL, |
149 | TILEGX_OPC_JALR, |
153 | TILEGX_OPC_JALR, |
150 | TILEGX_OPC_JALRP, |
154 | TILEGX_OPC_JALRP, |
151 | TILEGX_OPC_JR, |
155 | TILEGX_OPC_JR, |
152 | TILEGX_OPC_JRP, |
156 | TILEGX_OPC_JRP, |
153 | TILEGX_OPC_LD, |
157 | TILEGX_OPC_LD, |
154 | TILEGX_OPC_LD1S, |
158 | TILEGX_OPC_LD1S, |
155 | TILEGX_OPC_LD1S_ADD, |
159 | TILEGX_OPC_LD1S_ADD, |
156 | TILEGX_OPC_LD1U, |
160 | TILEGX_OPC_LD1U, |
157 | TILEGX_OPC_LD1U_ADD, |
161 | TILEGX_OPC_LD1U_ADD, |
158 | TILEGX_OPC_LD2S, |
162 | TILEGX_OPC_LD2S, |
159 | TILEGX_OPC_LD2S_ADD, |
163 | TILEGX_OPC_LD2S_ADD, |
160 | TILEGX_OPC_LD2U, |
164 | TILEGX_OPC_LD2U, |
161 | TILEGX_OPC_LD2U_ADD, |
165 | TILEGX_OPC_LD2U_ADD, |
162 | TILEGX_OPC_LD4S, |
166 | TILEGX_OPC_LD4S, |
163 | TILEGX_OPC_LD4S_ADD, |
167 | TILEGX_OPC_LD4S_ADD, |
164 | TILEGX_OPC_LD4U, |
168 | TILEGX_OPC_LD4U, |
165 | TILEGX_OPC_LD4U_ADD, |
169 | TILEGX_OPC_LD4U_ADD, |
166 | TILEGX_OPC_LD_ADD, |
170 | TILEGX_OPC_LD_ADD, |
167 | TILEGX_OPC_LDNA, |
171 | TILEGX_OPC_LDNA, |
168 | TILEGX_OPC_LDNA_ADD, |
172 | TILEGX_OPC_LDNA_ADD, |
169 | TILEGX_OPC_LDNT, |
173 | TILEGX_OPC_LDNT, |
170 | TILEGX_OPC_LDNT1S, |
174 | TILEGX_OPC_LDNT1S, |
171 | TILEGX_OPC_LDNT1S_ADD, |
175 | TILEGX_OPC_LDNT1S_ADD, |
172 | TILEGX_OPC_LDNT1U, |
176 | TILEGX_OPC_LDNT1U, |
173 | TILEGX_OPC_LDNT1U_ADD, |
177 | TILEGX_OPC_LDNT1U_ADD, |
174 | TILEGX_OPC_LDNT2S, |
178 | TILEGX_OPC_LDNT2S, |
175 | TILEGX_OPC_LDNT2S_ADD, |
179 | TILEGX_OPC_LDNT2S_ADD, |
176 | TILEGX_OPC_LDNT2U, |
180 | TILEGX_OPC_LDNT2U, |
177 | TILEGX_OPC_LDNT2U_ADD, |
181 | TILEGX_OPC_LDNT2U_ADD, |
178 | TILEGX_OPC_LDNT4S, |
182 | TILEGX_OPC_LDNT4S, |
179 | TILEGX_OPC_LDNT4S_ADD, |
183 | TILEGX_OPC_LDNT4S_ADD, |
180 | TILEGX_OPC_LDNT4U, |
184 | TILEGX_OPC_LDNT4U, |
181 | TILEGX_OPC_LDNT4U_ADD, |
185 | TILEGX_OPC_LDNT4U_ADD, |
182 | TILEGX_OPC_LDNT_ADD, |
186 | TILEGX_OPC_LDNT_ADD, |
183 | TILEGX_OPC_LNK, |
187 | TILEGX_OPC_LNK, |
184 | TILEGX_OPC_MF, |
188 | TILEGX_OPC_MF, |
185 | TILEGX_OPC_MFSPR, |
189 | TILEGX_OPC_MFSPR, |
186 | TILEGX_OPC_MM, |
190 | TILEGX_OPC_MM, |
187 | TILEGX_OPC_MNZ, |
191 | TILEGX_OPC_MNZ, |
188 | TILEGX_OPC_MTSPR, |
192 | TILEGX_OPC_MTSPR, |
189 | TILEGX_OPC_MUL_HS_HS, |
193 | TILEGX_OPC_MUL_HS_HS, |
190 | TILEGX_OPC_MUL_HS_HU, |
194 | TILEGX_OPC_MUL_HS_HU, |
191 | TILEGX_OPC_MUL_HS_LS, |
195 | TILEGX_OPC_MUL_HS_LS, |
192 | TILEGX_OPC_MUL_HS_LU, |
196 | TILEGX_OPC_MUL_HS_LU, |
193 | TILEGX_OPC_MUL_HU_HU, |
197 | TILEGX_OPC_MUL_HU_HU, |
194 | TILEGX_OPC_MUL_HU_LS, |
198 | TILEGX_OPC_MUL_HU_LS, |
195 | TILEGX_OPC_MUL_HU_LU, |
199 | TILEGX_OPC_MUL_HU_LU, |
196 | TILEGX_OPC_MUL_LS_LS, |
200 | TILEGX_OPC_MUL_LS_LS, |
197 | TILEGX_OPC_MUL_LS_LU, |
201 | TILEGX_OPC_MUL_LS_LU, |
198 | TILEGX_OPC_MUL_LU_LU, |
202 | TILEGX_OPC_MUL_LU_LU, |
199 | TILEGX_OPC_MULA_HS_HS, |
203 | TILEGX_OPC_MULA_HS_HS, |
200 | TILEGX_OPC_MULA_HS_HU, |
204 | TILEGX_OPC_MULA_HS_HU, |
201 | TILEGX_OPC_MULA_HS_LS, |
205 | TILEGX_OPC_MULA_HS_LS, |
202 | TILEGX_OPC_MULA_HS_LU, |
206 | TILEGX_OPC_MULA_HS_LU, |
203 | TILEGX_OPC_MULA_HU_HU, |
207 | TILEGX_OPC_MULA_HU_HU, |
204 | TILEGX_OPC_MULA_HU_LS, |
208 | TILEGX_OPC_MULA_HU_LS, |
205 | TILEGX_OPC_MULA_HU_LU, |
209 | TILEGX_OPC_MULA_HU_LU, |
206 | TILEGX_OPC_MULA_LS_LS, |
210 | TILEGX_OPC_MULA_LS_LS, |
207 | TILEGX_OPC_MULA_LS_LU, |
211 | TILEGX_OPC_MULA_LS_LU, |
208 | TILEGX_OPC_MULA_LU_LU, |
212 | TILEGX_OPC_MULA_LU_LU, |
209 | TILEGX_OPC_MULAX, |
213 | TILEGX_OPC_MULAX, |
210 | TILEGX_OPC_MULX, |
214 | TILEGX_OPC_MULX, |
211 | TILEGX_OPC_MZ, |
215 | TILEGX_OPC_MZ, |
212 | TILEGX_OPC_NAP, |
216 | TILEGX_OPC_NAP, |
213 | TILEGX_OPC_NOP, |
217 | TILEGX_OPC_NOP, |
214 | TILEGX_OPC_NOR, |
218 | TILEGX_OPC_NOR, |
215 | TILEGX_OPC_OR, |
219 | TILEGX_OPC_OR, |
216 | TILEGX_OPC_ORI, |
220 | TILEGX_OPC_ORI, |
217 | TILEGX_OPC_PCNT, |
221 | TILEGX_OPC_PCNT, |
218 | TILEGX_OPC_REVBITS, |
222 | TILEGX_OPC_REVBITS, |
219 | TILEGX_OPC_REVBYTES, |
223 | TILEGX_OPC_REVBYTES, |
220 | TILEGX_OPC_ROTL, |
224 | TILEGX_OPC_ROTL, |
221 | TILEGX_OPC_ROTLI, |
225 | TILEGX_OPC_ROTLI, |
222 | TILEGX_OPC_SHL, |
226 | TILEGX_OPC_SHL, |
223 | TILEGX_OPC_SHL16INSLI, |
227 | TILEGX_OPC_SHL16INSLI, |
224 | TILEGX_OPC_SHL1ADD, |
228 | TILEGX_OPC_SHL1ADD, |
225 | TILEGX_OPC_SHL1ADDX, |
229 | TILEGX_OPC_SHL1ADDX, |
226 | TILEGX_OPC_SHL2ADD, |
230 | TILEGX_OPC_SHL2ADD, |
227 | TILEGX_OPC_SHL2ADDX, |
231 | TILEGX_OPC_SHL2ADDX, |
228 | TILEGX_OPC_SHL3ADD, |
232 | TILEGX_OPC_SHL3ADD, |
229 | TILEGX_OPC_SHL3ADDX, |
233 | TILEGX_OPC_SHL3ADDX, |
230 | TILEGX_OPC_SHLI, |
234 | TILEGX_OPC_SHLI, |
231 | TILEGX_OPC_SHLX, |
235 | TILEGX_OPC_SHLX, |
232 | TILEGX_OPC_SHLXI, |
236 | TILEGX_OPC_SHLXI, |
233 | TILEGX_OPC_SHRS, |
237 | TILEGX_OPC_SHRS, |
234 | TILEGX_OPC_SHRSI, |
238 | TILEGX_OPC_SHRSI, |
235 | TILEGX_OPC_SHRU, |
239 | TILEGX_OPC_SHRU, |
236 | TILEGX_OPC_SHRUI, |
240 | TILEGX_OPC_SHRUI, |
237 | TILEGX_OPC_SHRUX, |
241 | TILEGX_OPC_SHRUX, |
238 | TILEGX_OPC_SHRUXI, |
242 | TILEGX_OPC_SHRUXI, |
239 | TILEGX_OPC_SHUFFLEBYTES, |
243 | TILEGX_OPC_SHUFFLEBYTES, |
240 | TILEGX_OPC_ST, |
244 | TILEGX_OPC_ST, |
241 | TILEGX_OPC_ST1, |
245 | TILEGX_OPC_ST1, |
242 | TILEGX_OPC_ST1_ADD, |
246 | TILEGX_OPC_ST1_ADD, |
243 | TILEGX_OPC_ST2, |
247 | TILEGX_OPC_ST2, |
244 | TILEGX_OPC_ST2_ADD, |
248 | TILEGX_OPC_ST2_ADD, |
245 | TILEGX_OPC_ST4, |
249 | TILEGX_OPC_ST4, |
246 | TILEGX_OPC_ST4_ADD, |
250 | TILEGX_OPC_ST4_ADD, |
247 | TILEGX_OPC_ST_ADD, |
251 | TILEGX_OPC_ST_ADD, |
248 | TILEGX_OPC_STNT, |
252 | TILEGX_OPC_STNT, |
249 | TILEGX_OPC_STNT1, |
253 | TILEGX_OPC_STNT1, |
250 | TILEGX_OPC_STNT1_ADD, |
254 | TILEGX_OPC_STNT1_ADD, |
251 | TILEGX_OPC_STNT2, |
255 | TILEGX_OPC_STNT2, |
252 | TILEGX_OPC_STNT2_ADD, |
256 | TILEGX_OPC_STNT2_ADD, |
253 | TILEGX_OPC_STNT4, |
257 | TILEGX_OPC_STNT4, |
254 | TILEGX_OPC_STNT4_ADD, |
258 | TILEGX_OPC_STNT4_ADD, |
255 | TILEGX_OPC_STNT_ADD, |
259 | TILEGX_OPC_STNT_ADD, |
256 | TILEGX_OPC_SUB, |
260 | TILEGX_OPC_SUB, |
257 | TILEGX_OPC_SUBX, |
261 | TILEGX_OPC_SUBX, |
258 | TILEGX_OPC_SUBXSC, |
262 | TILEGX_OPC_SUBXSC, |
259 | TILEGX_OPC_SWINT0, |
263 | TILEGX_OPC_SWINT0, |
260 | TILEGX_OPC_SWINT1, |
264 | TILEGX_OPC_SWINT1, |
261 | TILEGX_OPC_SWINT2, |
265 | TILEGX_OPC_SWINT2, |
262 | TILEGX_OPC_SWINT3, |
266 | TILEGX_OPC_SWINT3, |
263 | TILEGX_OPC_TBLIDXB0, |
267 | TILEGX_OPC_TBLIDXB0, |
264 | TILEGX_OPC_TBLIDXB1, |
268 | TILEGX_OPC_TBLIDXB1, |
265 | TILEGX_OPC_TBLIDXB2, |
269 | TILEGX_OPC_TBLIDXB2, |
266 | TILEGX_OPC_TBLIDXB3, |
270 | TILEGX_OPC_TBLIDXB3, |
267 | TILEGX_OPC_V1ADD, |
271 | TILEGX_OPC_V1ADD, |
268 | TILEGX_OPC_V1ADDI, |
272 | TILEGX_OPC_V1ADDI, |
269 | TILEGX_OPC_V1ADDUC, |
273 | TILEGX_OPC_V1ADDUC, |
270 | TILEGX_OPC_V1ADIFFU, |
274 | TILEGX_OPC_V1ADIFFU, |
271 | TILEGX_OPC_V1AVGU, |
275 | TILEGX_OPC_V1AVGU, |
272 | TILEGX_OPC_V1CMPEQ, |
276 | TILEGX_OPC_V1CMPEQ, |
273 | TILEGX_OPC_V1CMPEQI, |
277 | TILEGX_OPC_V1CMPEQI, |
274 | TILEGX_OPC_V1CMPLES, |
278 | TILEGX_OPC_V1CMPLES, |
275 | TILEGX_OPC_V1CMPLEU, |
279 | TILEGX_OPC_V1CMPLEU, |
276 | TILEGX_OPC_V1CMPLTS, |
280 | TILEGX_OPC_V1CMPLTS, |
277 | TILEGX_OPC_V1CMPLTSI, |
281 | TILEGX_OPC_V1CMPLTSI, |
278 | TILEGX_OPC_V1CMPLTU, |
282 | TILEGX_OPC_V1CMPLTU, |
279 | TILEGX_OPC_V1CMPLTUI, |
283 | TILEGX_OPC_V1CMPLTUI, |
280 | TILEGX_OPC_V1CMPNE, |
284 | TILEGX_OPC_V1CMPNE, |
281 | TILEGX_OPC_V1DDOTPU, |
285 | TILEGX_OPC_V1DDOTPU, |
282 | TILEGX_OPC_V1DDOTPUA, |
286 | TILEGX_OPC_V1DDOTPUA, |
283 | TILEGX_OPC_V1DDOTPUS, |
287 | TILEGX_OPC_V1DDOTPUS, |
284 | TILEGX_OPC_V1DDOTPUSA, |
288 | TILEGX_OPC_V1DDOTPUSA, |
285 | TILEGX_OPC_V1DOTP, |
289 | TILEGX_OPC_V1DOTP, |
286 | TILEGX_OPC_V1DOTPA, |
290 | TILEGX_OPC_V1DOTPA, |
287 | TILEGX_OPC_V1DOTPU, |
291 | TILEGX_OPC_V1DOTPU, |
288 | TILEGX_OPC_V1DOTPUA, |
292 | TILEGX_OPC_V1DOTPUA, |
289 | TILEGX_OPC_V1DOTPUS, |
293 | TILEGX_OPC_V1DOTPUS, |
290 | TILEGX_OPC_V1DOTPUSA, |
294 | TILEGX_OPC_V1DOTPUSA, |
291 | TILEGX_OPC_V1INT_H, |
295 | TILEGX_OPC_V1INT_H, |
292 | TILEGX_OPC_V1INT_L, |
296 | TILEGX_OPC_V1INT_L, |
293 | TILEGX_OPC_V1MAXU, |
297 | TILEGX_OPC_V1MAXU, |
294 | TILEGX_OPC_V1MAXUI, |
298 | TILEGX_OPC_V1MAXUI, |
295 | TILEGX_OPC_V1MINU, |
299 | TILEGX_OPC_V1MINU, |
296 | TILEGX_OPC_V1MINUI, |
300 | TILEGX_OPC_V1MINUI, |
297 | TILEGX_OPC_V1MNZ, |
301 | TILEGX_OPC_V1MNZ, |
298 | TILEGX_OPC_V1MULTU, |
302 | TILEGX_OPC_V1MULTU, |
299 | TILEGX_OPC_V1MULU, |
303 | TILEGX_OPC_V1MULU, |
300 | TILEGX_OPC_V1MULUS, |
304 | TILEGX_OPC_V1MULUS, |
301 | TILEGX_OPC_V1MZ, |
305 | TILEGX_OPC_V1MZ, |
302 | TILEGX_OPC_V1SADAU, |
306 | TILEGX_OPC_V1SADAU, |
303 | TILEGX_OPC_V1SADU, |
307 | TILEGX_OPC_V1SADU, |
304 | TILEGX_OPC_V1SHL, |
308 | TILEGX_OPC_V1SHL, |
305 | TILEGX_OPC_V1SHLI, |
309 | TILEGX_OPC_V1SHLI, |
306 | TILEGX_OPC_V1SHRS, |
310 | TILEGX_OPC_V1SHRS, |
307 | TILEGX_OPC_V1SHRSI, |
311 | TILEGX_OPC_V1SHRSI, |
308 | TILEGX_OPC_V1SHRU, |
312 | TILEGX_OPC_V1SHRU, |
309 | TILEGX_OPC_V1SHRUI, |
313 | TILEGX_OPC_V1SHRUI, |
310 | TILEGX_OPC_V1SUB, |
314 | TILEGX_OPC_V1SUB, |
311 | TILEGX_OPC_V1SUBUC, |
315 | TILEGX_OPC_V1SUBUC, |
312 | TILEGX_OPC_V2ADD, |
316 | TILEGX_OPC_V2ADD, |
313 | TILEGX_OPC_V2ADDI, |
317 | TILEGX_OPC_V2ADDI, |
314 | TILEGX_OPC_V2ADDSC, |
318 | TILEGX_OPC_V2ADDSC, |
315 | TILEGX_OPC_V2ADIFFS, |
319 | TILEGX_OPC_V2ADIFFS, |
316 | TILEGX_OPC_V2AVGS, |
320 | TILEGX_OPC_V2AVGS, |
317 | TILEGX_OPC_V2CMPEQ, |
321 | TILEGX_OPC_V2CMPEQ, |
318 | TILEGX_OPC_V2CMPEQI, |
322 | TILEGX_OPC_V2CMPEQI, |
319 | TILEGX_OPC_V2CMPLES, |
323 | TILEGX_OPC_V2CMPLES, |
320 | TILEGX_OPC_V2CMPLEU, |
324 | TILEGX_OPC_V2CMPLEU, |
321 | TILEGX_OPC_V2CMPLTS, |
325 | TILEGX_OPC_V2CMPLTS, |
322 | TILEGX_OPC_V2CMPLTSI, |
326 | TILEGX_OPC_V2CMPLTSI, |
323 | TILEGX_OPC_V2CMPLTU, |
327 | TILEGX_OPC_V2CMPLTU, |
324 | TILEGX_OPC_V2CMPLTUI, |
328 | TILEGX_OPC_V2CMPLTUI, |
325 | TILEGX_OPC_V2CMPNE, |
329 | TILEGX_OPC_V2CMPNE, |
326 | TILEGX_OPC_V2DOTP, |
330 | TILEGX_OPC_V2DOTP, |
327 | TILEGX_OPC_V2DOTPA, |
331 | TILEGX_OPC_V2DOTPA, |
328 | TILEGX_OPC_V2INT_H, |
332 | TILEGX_OPC_V2INT_H, |
329 | TILEGX_OPC_V2INT_L, |
333 | TILEGX_OPC_V2INT_L, |
330 | TILEGX_OPC_V2MAXS, |
334 | TILEGX_OPC_V2MAXS, |
331 | TILEGX_OPC_V2MAXSI, |
335 | TILEGX_OPC_V2MAXSI, |
332 | TILEGX_OPC_V2MINS, |
336 | TILEGX_OPC_V2MINS, |
333 | TILEGX_OPC_V2MINSI, |
337 | TILEGX_OPC_V2MINSI, |
334 | TILEGX_OPC_V2MNZ, |
338 | TILEGX_OPC_V2MNZ, |
335 | TILEGX_OPC_V2MULFSC, |
339 | TILEGX_OPC_V2MULFSC, |
336 | TILEGX_OPC_V2MULS, |
340 | TILEGX_OPC_V2MULS, |
337 | TILEGX_OPC_V2MULTS, |
341 | TILEGX_OPC_V2MULTS, |
338 | TILEGX_OPC_V2MZ, |
342 | TILEGX_OPC_V2MZ, |
339 | TILEGX_OPC_V2PACKH, |
343 | TILEGX_OPC_V2PACKH, |
340 | TILEGX_OPC_V2PACKL, |
344 | TILEGX_OPC_V2PACKL, |
341 | TILEGX_OPC_V2PACKUC, |
345 | TILEGX_OPC_V2PACKUC, |
342 | TILEGX_OPC_V2SADAS, |
346 | TILEGX_OPC_V2SADAS, |
343 | TILEGX_OPC_V2SADAU, |
347 | TILEGX_OPC_V2SADAU, |
344 | TILEGX_OPC_V2SADS, |
348 | TILEGX_OPC_V2SADS, |
345 | TILEGX_OPC_V2SADU, |
349 | TILEGX_OPC_V2SADU, |
346 | TILEGX_OPC_V2SHL, |
350 | TILEGX_OPC_V2SHL, |
347 | TILEGX_OPC_V2SHLI, |
351 | TILEGX_OPC_V2SHLI, |
348 | TILEGX_OPC_V2SHLSC, |
352 | TILEGX_OPC_V2SHLSC, |
349 | TILEGX_OPC_V2SHRS, |
353 | TILEGX_OPC_V2SHRS, |
350 | TILEGX_OPC_V2SHRSI, |
354 | TILEGX_OPC_V2SHRSI, |
351 | TILEGX_OPC_V2SHRU, |
355 | TILEGX_OPC_V2SHRU, |
352 | TILEGX_OPC_V2SHRUI, |
356 | TILEGX_OPC_V2SHRUI, |
353 | TILEGX_OPC_V2SUB, |
357 | TILEGX_OPC_V2SUB, |
354 | TILEGX_OPC_V2SUBSC, |
358 | TILEGX_OPC_V2SUBSC, |
355 | TILEGX_OPC_V4ADD, |
359 | TILEGX_OPC_V4ADD, |
356 | TILEGX_OPC_V4ADDSC, |
360 | TILEGX_OPC_V4ADDSC, |
357 | TILEGX_OPC_V4INT_H, |
361 | TILEGX_OPC_V4INT_H, |
358 | TILEGX_OPC_V4INT_L, |
362 | TILEGX_OPC_V4INT_L, |
359 | TILEGX_OPC_V4PACKSC, |
363 | TILEGX_OPC_V4PACKSC, |
360 | TILEGX_OPC_V4SHL, |
364 | TILEGX_OPC_V4SHL, |
361 | TILEGX_OPC_V4SHLSC, |
365 | TILEGX_OPC_V4SHLSC, |
362 | TILEGX_OPC_V4SHRS, |
366 | TILEGX_OPC_V4SHRS, |
363 | TILEGX_OPC_V4SHRU, |
367 | TILEGX_OPC_V4SHRU, |
364 | TILEGX_OPC_V4SUB, |
368 | TILEGX_OPC_V4SUB, |
365 | TILEGX_OPC_V4SUBSC, |
369 | TILEGX_OPC_V4SUBSC, |
366 | TILEGX_OPC_WH64, |
370 | TILEGX_OPC_WH64, |
367 | TILEGX_OPC_XOR, |
371 | TILEGX_OPC_XOR, |
368 | TILEGX_OPC_XORI, |
372 | TILEGX_OPC_XORI, |
369 | TILEGX_OPC_NONE |
373 | TILEGX_OPC_NONE |
370 | } tilegx_mnemonic; |
374 | } tilegx_mnemonic; |
371 | 375 | ||
372 | /* 64-bit pattern for a { bpt ; nop } bundle. */ |
376 | /* 64-bit pattern for a { bpt ; nop } bundle. */ |
373 | #define TILEGX_BPT_BUNDLE 0x286a44ae51485000ULL |
377 | #define TILEGX_BPT_BUNDLE 0x286a44ae51485000ULL |
374 | 378 | ||
375 | 379 | ||
376 | 380 | ||
377 | static __inline unsigned int |
381 | static __inline unsigned int |
378 | get_BFEnd_X0(tilegx_bundle_bits num) |
382 | get_BFEnd_X0(tilegx_bundle_bits num) |
379 | { |
383 | { |
380 | const unsigned int n = (unsigned int)num; |
384 | const unsigned int n = (unsigned int)num; |
381 | return (((n >> 12)) & 0x3f); |
385 | return (((n >> 12)) & 0x3f); |
382 | } |
386 | } |
383 | 387 | ||
384 | static __inline unsigned int |
388 | static __inline unsigned int |
385 | get_BFOpcodeExtension_X0(tilegx_bundle_bits num) |
389 | get_BFOpcodeExtension_X0(tilegx_bundle_bits num) |
386 | { |
390 | { |
387 | const unsigned int n = (unsigned int)num; |
391 | const unsigned int n = (unsigned int)num; |
388 | return (((n >> 24)) & 0xf); |
392 | return (((n >> 24)) & 0xf); |
389 | } |
393 | } |
390 | 394 | ||
391 | static __inline unsigned int |
395 | static __inline unsigned int |
392 | get_BFStart_X0(tilegx_bundle_bits num) |
396 | get_BFStart_X0(tilegx_bundle_bits num) |
393 | { |
397 | { |
394 | const unsigned int n = (unsigned int)num; |
398 | const unsigned int n = (unsigned int)num; |
395 | return (((n >> 18)) & 0x3f); |
399 | return (((n >> 18)) & 0x3f); |
396 | } |
400 | } |
397 | 401 | ||
398 | static __inline unsigned int |
402 | static __inline unsigned int |
399 | get_BrOff_X1(tilegx_bundle_bits n) |
403 | get_BrOff_X1(tilegx_bundle_bits n) |
400 | { |
404 | { |
401 | return (((unsigned int)(n >> 31)) & 0x0000003f) | |
405 | return (((unsigned int)(n >> 31)) & 0x0000003f) | |
402 | (((unsigned int)(n >> 37)) & 0x0001ffc0); |
406 | (((unsigned int)(n >> 37)) & 0x0001ffc0); |
403 | } |
407 | } |
404 | 408 | ||
405 | static __inline unsigned int |
409 | static __inline unsigned int |
406 | get_BrType_X1(tilegx_bundle_bits n) |
410 | get_BrType_X1(tilegx_bundle_bits n) |
407 | { |
411 | { |
408 | return (((unsigned int)(n >> 54)) & 0x1f); |
412 | return (((unsigned int)(n >> 54)) & 0x1f); |
409 | } |
413 | } |
410 | 414 | ||
411 | static __inline unsigned int |
415 | static __inline unsigned int |
412 | get_Dest_Imm8_X1(tilegx_bundle_bits n) |
416 | get_Dest_Imm8_X1(tilegx_bundle_bits n) |
413 | { |
417 | { |
414 | return (((unsigned int)(n >> 31)) & 0x0000003f) | |
418 | return (((unsigned int)(n >> 31)) & 0x0000003f) | |
415 | (((unsigned int)(n >> 43)) & 0x000000c0); |
419 | (((unsigned int)(n >> 43)) & 0x000000c0); |
416 | } |
420 | } |
417 | 421 | ||
418 | static __inline unsigned int |
422 | static __inline unsigned int |
419 | get_Dest_X0(tilegx_bundle_bits num) |
423 | get_Dest_X0(tilegx_bundle_bits num) |
420 | { |
424 | { |
421 | const unsigned int n = (unsigned int)num; |
425 | const unsigned int n = (unsigned int)num; |
422 | return (((n >> 0)) & 0x3f); |
426 | return (((n >> 0)) & 0x3f); |
423 | } |
427 | } |
424 | 428 | ||
425 | static __inline unsigned int |
429 | static __inline unsigned int |
426 | get_Dest_X1(tilegx_bundle_bits n) |
430 | get_Dest_X1(tilegx_bundle_bits n) |
427 | { |
431 | { |
428 | return (((unsigned int)(n >> 31)) & 0x3f); |
432 | return (((unsigned int)(n >> 31)) & 0x3f); |
429 | } |
433 | } |
430 | 434 | ||
431 | static __inline unsigned int |
435 | static __inline unsigned int |
432 | get_Dest_Y0(tilegx_bundle_bits num) |
436 | get_Dest_Y0(tilegx_bundle_bits num) |
433 | { |
437 | { |
434 | const unsigned int n = (unsigned int)num; |
438 | const unsigned int n = (unsigned int)num; |
435 | return (((n >> 0)) & 0x3f); |
439 | return (((n >> 0)) & 0x3f); |
436 | } |
440 | } |
437 | 441 | ||
438 | static __inline unsigned int |
442 | static __inline unsigned int |
439 | get_Dest_Y1(tilegx_bundle_bits n) |
443 | get_Dest_Y1(tilegx_bundle_bits n) |
440 | { |
444 | { |
441 | return (((unsigned int)(n >> 31)) & 0x3f); |
445 | return (((unsigned int)(n >> 31)) & 0x3f); |
442 | } |
446 | } |
443 | 447 | ||
444 | static __inline unsigned int |
448 | static __inline unsigned int |
445 | get_Imm16_X0(tilegx_bundle_bits num) |
449 | get_Imm16_X0(tilegx_bundle_bits num) |
446 | { |
450 | { |
447 | const unsigned int n = (unsigned int)num; |
451 | const unsigned int n = (unsigned int)num; |
448 | return (((n >> 12)) & 0xffff); |
452 | return (((n >> 12)) & 0xffff); |
449 | } |
453 | } |
450 | 454 | ||
451 | static __inline unsigned int |
455 | static __inline unsigned int |
452 | get_Imm16_X1(tilegx_bundle_bits n) |
456 | get_Imm16_X1(tilegx_bundle_bits n) |
453 | { |
457 | { |
454 | return (((unsigned int)(n >> 43)) & 0xffff); |
458 | return (((unsigned int)(n >> 43)) & 0xffff); |
455 | } |
459 | } |
456 | 460 | ||
457 | static __inline unsigned int |
461 | static __inline unsigned int |
458 | get_Imm8OpcodeExtension_X0(tilegx_bundle_bits num) |
462 | get_Imm8OpcodeExtension_X0(tilegx_bundle_bits num) |
459 | { |
463 | { |
460 | const unsigned int n = (unsigned int)num; |
464 | const unsigned int n = (unsigned int)num; |
461 | return (((n >> 20)) & 0xff); |
465 | return (((n >> 20)) & 0xff); |
462 | } |
466 | } |
463 | 467 | ||
464 | static __inline unsigned int |
468 | static __inline unsigned int |
465 | get_Imm8OpcodeExtension_X1(tilegx_bundle_bits n) |
469 | get_Imm8OpcodeExtension_X1(tilegx_bundle_bits n) |
466 | { |
470 | { |
467 | return (((unsigned int)(n >> 51)) & 0xff); |
471 | return (((unsigned int)(n >> 51)) & 0xff); |
468 | } |
472 | } |
469 | 473 | ||
470 | static __inline unsigned int |
474 | static __inline unsigned int |
471 | get_Imm8_X0(tilegx_bundle_bits num) |
475 | get_Imm8_X0(tilegx_bundle_bits num) |
472 | { |
476 | { |
473 | const unsigned int n = (unsigned int)num; |
477 | const unsigned int n = (unsigned int)num; |
474 | return (((n >> 12)) & 0xff); |
478 | return (((n >> 12)) & 0xff); |
475 | } |
479 | } |
476 | 480 | ||
477 | static __inline unsigned int |
481 | static __inline unsigned int |
478 | get_Imm8_X1(tilegx_bundle_bits n) |
482 | get_Imm8_X1(tilegx_bundle_bits n) |
479 | { |
483 | { |
480 | return (((unsigned int)(n >> 43)) & 0xff); |
484 | return (((unsigned int)(n >> 43)) & 0xff); |
481 | } |
485 | } |
482 | 486 | ||
483 | static __inline unsigned int |
487 | static __inline unsigned int |
484 | get_Imm8_Y0(tilegx_bundle_bits num) |
488 | get_Imm8_Y0(tilegx_bundle_bits num) |
485 | { |
489 | { |
486 | const unsigned int n = (unsigned int)num; |
490 | const unsigned int n = (unsigned int)num; |
487 | return (((n >> 12)) & 0xff); |
491 | return (((n >> 12)) & 0xff); |
488 | } |
492 | } |
489 | 493 | ||
490 | static __inline unsigned int |
494 | static __inline unsigned int |
491 | get_Imm8_Y1(tilegx_bundle_bits n) |
495 | get_Imm8_Y1(tilegx_bundle_bits n) |
492 | { |
496 | { |
493 | return (((unsigned int)(n >> 43)) & 0xff); |
497 | return (((unsigned int)(n >> 43)) & 0xff); |
494 | } |
498 | } |
495 | 499 | ||
496 | static __inline unsigned int |
500 | static __inline unsigned int |
497 | get_JumpOff_X1(tilegx_bundle_bits n) |
501 | get_JumpOff_X1(tilegx_bundle_bits n) |
498 | { |
502 | { |
499 | return (((unsigned int)(n >> 31)) & 0x7ffffff); |
503 | return (((unsigned int)(n >> 31)) & 0x7ffffff); |
500 | } |
504 | } |
501 | 505 | ||
502 | static __inline unsigned int |
506 | static __inline unsigned int |
503 | get_JumpOpcodeExtension_X1(tilegx_bundle_bits n) |
507 | get_JumpOpcodeExtension_X1(tilegx_bundle_bits n) |
504 | { |
508 | { |
505 | return (((unsigned int)(n >> 58)) & 0x1); |
509 | return (((unsigned int)(n >> 58)) & 0x1); |
506 | } |
510 | } |
507 | 511 | ||
508 | static __inline unsigned int |
512 | static __inline unsigned int |
509 | get_MF_Imm14_X1(tilegx_bundle_bits n) |
513 | get_MF_Imm14_X1(tilegx_bundle_bits n) |
510 | { |
514 | { |
511 | return (((unsigned int)(n >> 37)) & 0x3fff); |
515 | return (((unsigned int)(n >> 37)) & 0x3fff); |
512 | } |
516 | } |
513 | 517 | ||
514 | static __inline unsigned int |
518 | static __inline unsigned int |
515 | get_MT_Imm14_X1(tilegx_bundle_bits n) |
519 | get_MT_Imm14_X1(tilegx_bundle_bits n) |
516 | { |
520 | { |
517 | return (((unsigned int)(n >> 31)) & 0x0000003f) | |
521 | return (((unsigned int)(n >> 31)) & 0x0000003f) | |
518 | (((unsigned int)(n >> 37)) & 0x00003fc0); |
522 | (((unsigned int)(n >> 37)) & 0x00003fc0); |
519 | } |
523 | } |
520 | 524 | ||
521 | static __inline unsigned int |
525 | static __inline unsigned int |
522 | get_Mode(tilegx_bundle_bits n) |
526 | get_Mode(tilegx_bundle_bits n) |
523 | { |
527 | { |
524 | return (((unsigned int)(n >> 62)) & 0x3); |
528 | return (((unsigned int)(n >> 62)) & 0x3); |
525 | } |
529 | } |
526 | 530 | ||
527 | static __inline unsigned int |
531 | static __inline unsigned int |
528 | get_Opcode_X0(tilegx_bundle_bits num) |
532 | get_Opcode_X0(tilegx_bundle_bits num) |
529 | { |
533 | { |
530 | const unsigned int n = (unsigned int)num; |
534 | const unsigned int n = (unsigned int)num; |
531 | return (((n >> 28)) & 0x7); |
535 | return (((n >> 28)) & 0x7); |
532 | } |
536 | } |
533 | 537 | ||
534 | static __inline unsigned int |
538 | static __inline unsigned int |
535 | get_Opcode_X1(tilegx_bundle_bits n) |
539 | get_Opcode_X1(tilegx_bundle_bits n) |
536 | { |
540 | { |
537 | return (((unsigned int)(n >> 59)) & 0x7); |
541 | return (((unsigned int)(n >> 59)) & 0x7); |
538 | } |
542 | } |
539 | 543 | ||
540 | static __inline unsigned int |
544 | static __inline unsigned int |
541 | get_Opcode_Y0(tilegx_bundle_bits num) |
545 | get_Opcode_Y0(tilegx_bundle_bits num) |
542 | { |
546 | { |
543 | const unsigned int n = (unsigned int)num; |
547 | const unsigned int n = (unsigned int)num; |
544 | return (((n >> 27)) & 0xf); |
548 | return (((n >> 27)) & 0xf); |
545 | } |
549 | } |
546 | 550 | ||
547 | static __inline unsigned int |
551 | static __inline unsigned int |
548 | get_Opcode_Y1(tilegx_bundle_bits n) |
552 | get_Opcode_Y1(tilegx_bundle_bits n) |
549 | { |
553 | { |
550 | return (((unsigned int)(n >> 58)) & 0xf); |
554 | return (((unsigned int)(n >> 58)) & 0xf); |
551 | } |
555 | } |
552 | 556 | ||
553 | static __inline unsigned int |
557 | static __inline unsigned int |
554 | get_Opcode_Y2(tilegx_bundle_bits n) |
558 | get_Opcode_Y2(tilegx_bundle_bits n) |
555 | { |
559 | { |
556 | return (((n >> 26)) & 0x00000001) | |
560 | return (((n >> 26)) & 0x00000001) | |
557 | (((unsigned int)(n >> 56)) & 0x00000002); |
561 | (((unsigned int)(n >> 56)) & 0x00000002); |
558 | } |
562 | } |
559 | 563 | ||
560 | static __inline unsigned int |
564 | static __inline unsigned int |
561 | get_RRROpcodeExtension_X0(tilegx_bundle_bits num) |
565 | get_RRROpcodeExtension_X0(tilegx_bundle_bits num) |
562 | { |
566 | { |
563 | const unsigned int n = (unsigned int)num; |
567 | const unsigned int n = (unsigned int)num; |
564 | return (((n >> 18)) & 0x3ff); |
568 | return (((n >> 18)) & 0x3ff); |
565 | } |
569 | } |
566 | 570 | ||
567 | static __inline unsigned int |
571 | static __inline unsigned int |
568 | get_RRROpcodeExtension_X1(tilegx_bundle_bits n) |
572 | get_RRROpcodeExtension_X1(tilegx_bundle_bits n) |
569 | { |
573 | { |
570 | return (((unsigned int)(n >> 49)) & 0x3ff); |
574 | return (((unsigned int)(n >> 49)) & 0x3ff); |
571 | } |
575 | } |
572 | 576 | ||
573 | static __inline unsigned int |
577 | static __inline unsigned int |
574 | get_RRROpcodeExtension_Y0(tilegx_bundle_bits num) |
578 | get_RRROpcodeExtension_Y0(tilegx_bundle_bits num) |
575 | { |
579 | { |
576 | const unsigned int n = (unsigned int)num; |
580 | const unsigned int n = (unsigned int)num; |
577 | return (((n >> 18)) & 0x3); |
581 | return (((n >> 18)) & 0x3); |
578 | } |
582 | } |
579 | 583 | ||
580 | static __inline unsigned int |
584 | static __inline unsigned int |
581 | get_RRROpcodeExtension_Y1(tilegx_bundle_bits n) |
585 | get_RRROpcodeExtension_Y1(tilegx_bundle_bits n) |
582 | { |
586 | { |
583 | return (((unsigned int)(n >> 49)) & 0x3); |
587 | return (((unsigned int)(n >> 49)) & 0x3); |
584 | } |
588 | } |
585 | 589 | ||
586 | static __inline unsigned int |
590 | static __inline unsigned int |
587 | get_ShAmt_X0(tilegx_bundle_bits num) |
591 | get_ShAmt_X0(tilegx_bundle_bits num) |
588 | { |
592 | { |
589 | const unsigned int n = (unsigned int)num; |
593 | const unsigned int n = (unsigned int)num; |
590 | return (((n >> 12)) & 0x3f); |
594 | return (((n >> 12)) & 0x3f); |
591 | } |
595 | } |
592 | 596 | ||
593 | static __inline unsigned int |
597 | static __inline unsigned int |
594 | get_ShAmt_X1(tilegx_bundle_bits n) |
598 | get_ShAmt_X1(tilegx_bundle_bits n) |
595 | { |
599 | { |
596 | return (((unsigned int)(n >> 43)) & 0x3f); |
600 | return (((unsigned int)(n >> 43)) & 0x3f); |
597 | } |
601 | } |
598 | 602 | ||
599 | static __inline unsigned int |
603 | static __inline unsigned int |
600 | get_ShAmt_Y0(tilegx_bundle_bits num) |
604 | get_ShAmt_Y0(tilegx_bundle_bits num) |
601 | { |
605 | { |
602 | const unsigned int n = (unsigned int)num; |
606 | const unsigned int n = (unsigned int)num; |
603 | return (((n >> 12)) & 0x3f); |
607 | return (((n >> 12)) & 0x3f); |
604 | } |
608 | } |
605 | 609 | ||
606 | static __inline unsigned int |
610 | static __inline unsigned int |
607 | get_ShAmt_Y1(tilegx_bundle_bits n) |
611 | get_ShAmt_Y1(tilegx_bundle_bits n) |
608 | { |
612 | { |
609 | return (((unsigned int)(n >> 43)) & 0x3f); |
613 | return (((unsigned int)(n >> 43)) & 0x3f); |
610 | } |
614 | } |
611 | 615 | ||
612 | static __inline unsigned int |
616 | static __inline unsigned int |
613 | get_ShiftOpcodeExtension_X0(tilegx_bundle_bits num) |
617 | get_ShiftOpcodeExtension_X0(tilegx_bundle_bits num) |
614 | { |
618 | { |
615 | const unsigned int n = (unsigned int)num; |
619 | const unsigned int n = (unsigned int)num; |
616 | return (((n >> 18)) & 0x3ff); |
620 | return (((n >> 18)) & 0x3ff); |
617 | } |
621 | } |
618 | 622 | ||
619 | static __inline unsigned int |
623 | static __inline unsigned int |
620 | get_ShiftOpcodeExtension_X1(tilegx_bundle_bits n) |
624 | get_ShiftOpcodeExtension_X1(tilegx_bundle_bits n) |
621 | { |
625 | { |
622 | return (((unsigned int)(n >> 49)) & 0x3ff); |
626 | return (((unsigned int)(n >> 49)) & 0x3ff); |
623 | } |
627 | } |
624 | 628 | ||
625 | static __inline unsigned int |
629 | static __inline unsigned int |
626 | get_ShiftOpcodeExtension_Y0(tilegx_bundle_bits num) |
630 | get_ShiftOpcodeExtension_Y0(tilegx_bundle_bits num) |
627 | { |
631 | { |
628 | const unsigned int n = (unsigned int)num; |
632 | const unsigned int n = (unsigned int)num; |
629 | return (((n >> 18)) & 0x3); |
633 | return (((n >> 18)) & 0x3); |
630 | } |
634 | } |
631 | 635 | ||
632 | static __inline unsigned int |
636 | static __inline unsigned int |
633 | get_ShiftOpcodeExtension_Y1(tilegx_bundle_bits n) |
637 | get_ShiftOpcodeExtension_Y1(tilegx_bundle_bits n) |
634 | { |
638 | { |
635 | return (((unsigned int)(n >> 49)) & 0x3); |
639 | return (((unsigned int)(n >> 49)) & 0x3); |
636 | } |
640 | } |
637 | 641 | ||
638 | static __inline unsigned int |
642 | static __inline unsigned int |
639 | get_SrcA_X0(tilegx_bundle_bits num) |
643 | get_SrcA_X0(tilegx_bundle_bits num) |
640 | { |
644 | { |
641 | const unsigned int n = (unsigned int)num; |
645 | const unsigned int n = (unsigned int)num; |
642 | return (((n >> 6)) & 0x3f); |
646 | return (((n >> 6)) & 0x3f); |
643 | } |
647 | } |
644 | 648 | ||
645 | static __inline unsigned int |
649 | static __inline unsigned int |
646 | get_SrcA_X1(tilegx_bundle_bits n) |
650 | get_SrcA_X1(tilegx_bundle_bits n) |
647 | { |
651 | { |
648 | return (((unsigned int)(n >> 37)) & 0x3f); |
652 | return (((unsigned int)(n >> 37)) & 0x3f); |
649 | } |
653 | } |
650 | 654 | ||
651 | static __inline unsigned int |
655 | static __inline unsigned int |
652 | get_SrcA_Y0(tilegx_bundle_bits num) |
656 | get_SrcA_Y0(tilegx_bundle_bits num) |
653 | { |
657 | { |
654 | const unsigned int n = (unsigned int)num; |
658 | const unsigned int n = (unsigned int)num; |
655 | return (((n >> 6)) & 0x3f); |
659 | return (((n >> 6)) & 0x3f); |
656 | } |
660 | } |
657 | 661 | ||
658 | static __inline unsigned int |
662 | static __inline unsigned int |
659 | get_SrcA_Y1(tilegx_bundle_bits n) |
663 | get_SrcA_Y1(tilegx_bundle_bits n) |
660 | { |
664 | { |
661 | return (((unsigned int)(n >> 37)) & 0x3f); |
665 | return (((unsigned int)(n >> 37)) & 0x3f); |
662 | } |
666 | } |
663 | 667 | ||
664 | static __inline unsigned int |
668 | static __inline unsigned int |
665 | get_SrcA_Y2(tilegx_bundle_bits num) |
669 | get_SrcA_Y2(tilegx_bundle_bits num) |
666 | { |
670 | { |
667 | const unsigned int n = (unsigned int)num; |
671 | const unsigned int n = (unsigned int)num; |
668 | return (((n >> 20)) & 0x3f); |
672 | return (((n >> 20)) & 0x3f); |
669 | } |
673 | } |
670 | 674 | ||
671 | static __inline unsigned int |
675 | static __inline unsigned int |
672 | get_SrcBDest_Y2(tilegx_bundle_bits n) |
676 | get_SrcBDest_Y2(tilegx_bundle_bits n) |
673 | { |
677 | { |
674 | return (((unsigned int)(n >> 51)) & 0x3f); |
678 | return (((unsigned int)(n >> 51)) & 0x3f); |
675 | } |
679 | } |
676 | 680 | ||
677 | static __inline unsigned int |
681 | static __inline unsigned int |
678 | get_SrcB_X0(tilegx_bundle_bits num) |
682 | get_SrcB_X0(tilegx_bundle_bits num) |
679 | { |
683 | { |
680 | const unsigned int n = (unsigned int)num; |
684 | const unsigned int n = (unsigned int)num; |
681 | return (((n >> 12)) & 0x3f); |
685 | return (((n >> 12)) & 0x3f); |
682 | } |
686 | } |
683 | 687 | ||
684 | static __inline unsigned int |
688 | static __inline unsigned int |
685 | get_SrcB_X1(tilegx_bundle_bits n) |
689 | get_SrcB_X1(tilegx_bundle_bits n) |
686 | { |
690 | { |
687 | return (((unsigned int)(n >> 43)) & 0x3f); |
691 | return (((unsigned int)(n >> 43)) & 0x3f); |
688 | } |
692 | } |
689 | 693 | ||
690 | static __inline unsigned int |
694 | static __inline unsigned int |
691 | get_SrcB_Y0(tilegx_bundle_bits num) |
695 | get_SrcB_Y0(tilegx_bundle_bits num) |
692 | { |
696 | { |
693 | const unsigned int n = (unsigned int)num; |
697 | const unsigned int n = (unsigned int)num; |
694 | return (((n >> 12)) & 0x3f); |
698 | return (((n >> 12)) & 0x3f); |
695 | } |
699 | } |
696 | 700 | ||
697 | static __inline unsigned int |
701 | static __inline unsigned int |
698 | get_SrcB_Y1(tilegx_bundle_bits n) |
702 | get_SrcB_Y1(tilegx_bundle_bits n) |
699 | { |
703 | { |
700 | return (((unsigned int)(n >> 43)) & 0x3f); |
704 | return (((unsigned int)(n >> 43)) & 0x3f); |
701 | } |
705 | } |
702 | 706 | ||
703 | static __inline unsigned int |
707 | static __inline unsigned int |
704 | get_UnaryOpcodeExtension_X0(tilegx_bundle_bits num) |
708 | get_UnaryOpcodeExtension_X0(tilegx_bundle_bits num) |
705 | { |
709 | { |
706 | const unsigned int n = (unsigned int)num; |
710 | const unsigned int n = (unsigned int)num; |
707 | return (((n >> 12)) & 0x3f); |
711 | return (((n >> 12)) & 0x3f); |
708 | } |
712 | } |
709 | 713 | ||
710 | static __inline unsigned int |
714 | static __inline unsigned int |
711 | get_UnaryOpcodeExtension_X1(tilegx_bundle_bits n) |
715 | get_UnaryOpcodeExtension_X1(tilegx_bundle_bits n) |
712 | { |
716 | { |
713 | return (((unsigned int)(n >> 43)) & 0x3f); |
717 | return (((unsigned int)(n >> 43)) & 0x3f); |
714 | } |
718 | } |
715 | 719 | ||
716 | static __inline unsigned int |
720 | static __inline unsigned int |
717 | get_UnaryOpcodeExtension_Y0(tilegx_bundle_bits num) |
721 | get_UnaryOpcodeExtension_Y0(tilegx_bundle_bits num) |
718 | { |
722 | { |
719 | const unsigned int n = (unsigned int)num; |
723 | const unsigned int n = (unsigned int)num; |
720 | return (((n >> 12)) & 0x3f); |
724 | return (((n >> 12)) & 0x3f); |
721 | } |
725 | } |
722 | 726 | ||
723 | static __inline unsigned int |
727 | static __inline unsigned int |
724 | get_UnaryOpcodeExtension_Y1(tilegx_bundle_bits n) |
728 | get_UnaryOpcodeExtension_Y1(tilegx_bundle_bits n) |
725 | { |
729 | { |
726 | return (((unsigned int)(n >> 43)) & 0x3f); |
730 | return (((unsigned int)(n >> 43)) & 0x3f); |
727 | } |
731 | } |
728 | 732 | ||
729 | 733 | ||
730 | static __inline int |
734 | static __inline int |
731 | sign_extend(int n, int num_bits) |
735 | sign_extend(int n, int num_bits) |
732 | { |
736 | { |
733 | int shift = (int)(sizeof(int) * 8 - num_bits); |
737 | int shift = (int)(sizeof(int) * 8 - num_bits); |
734 | return (n << shift) >> shift; |
738 | return (n << shift) >> shift; |
735 | } |
739 | } |
736 | 740 | ||
737 | 741 | ||
738 | 742 | ||
739 | static __inline tilegx_bundle_bits |
743 | static __inline tilegx_bundle_bits |
740 | create_BFEnd_X0(int num) |
744 | create_BFEnd_X0(int num) |
741 | { |
745 | { |
742 | const unsigned int n = (unsigned int)num; |
746 | const unsigned int n = (unsigned int)num; |
743 | return ((n & 0x3f) << 12); |
747 | return ((n & 0x3f) << 12); |
744 | } |
748 | } |
745 | 749 | ||
746 | static __inline tilegx_bundle_bits |
750 | static __inline tilegx_bundle_bits |
747 | create_BFOpcodeExtension_X0(int num) |
751 | create_BFOpcodeExtension_X0(int num) |
748 | { |
752 | { |
749 | const unsigned int n = (unsigned int)num; |
753 | const unsigned int n = (unsigned int)num; |
750 | return ((n & 0xf) << 24); |
754 | return ((n & 0xf) << 24); |
751 | } |
755 | } |
752 | 756 | ||
753 | static __inline tilegx_bundle_bits |
757 | static __inline tilegx_bundle_bits |
754 | create_BFStart_X0(int num) |
758 | create_BFStart_X0(int num) |
755 | { |
759 | { |
756 | const unsigned int n = (unsigned int)num; |
760 | const unsigned int n = (unsigned int)num; |
757 | return ((n & 0x3f) << 18); |
761 | return ((n & 0x3f) << 18); |
758 | } |
762 | } |
759 | 763 | ||
760 | static __inline tilegx_bundle_bits |
764 | static __inline tilegx_bundle_bits |
761 | create_BrOff_X1(int num) |
765 | create_BrOff_X1(int num) |
762 | { |
766 | { |
763 | const unsigned int n = (unsigned int)num; |
767 | const unsigned int n = (unsigned int)num; |
764 | return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) | |
768 | return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) | |
765 | (((tilegx_bundle_bits)(n & 0x0001ffc0)) << 37); |
769 | (((tilegx_bundle_bits)(n & 0x0001ffc0)) << 37); |
766 | } |
770 | } |
767 | 771 | ||
768 | static __inline tilegx_bundle_bits |
772 | static __inline tilegx_bundle_bits |
769 | create_BrType_X1(int num) |
773 | create_BrType_X1(int num) |
770 | { |
774 | { |
771 | const unsigned int n = (unsigned int)num; |
775 | const unsigned int n = (unsigned int)num; |
772 | return (((tilegx_bundle_bits)(n & 0x1f)) << 54); |
776 | return (((tilegx_bundle_bits)(n & 0x1f)) << 54); |
773 | } |
777 | } |
774 | 778 | ||
775 | static __inline tilegx_bundle_bits |
779 | static __inline tilegx_bundle_bits |
776 | create_Dest_Imm8_X1(int num) |
780 | create_Dest_Imm8_X1(int num) |
777 | { |
781 | { |
778 | const unsigned int n = (unsigned int)num; |
782 | const unsigned int n = (unsigned int)num; |
779 | return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) | |
783 | return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) | |
780 | (((tilegx_bundle_bits)(n & 0x000000c0)) << 43); |
784 | (((tilegx_bundle_bits)(n & 0x000000c0)) << 43); |
781 | } |
785 | } |
782 | 786 | ||
783 | static __inline tilegx_bundle_bits |
787 | static __inline tilegx_bundle_bits |
784 | create_Dest_X0(int num) |
788 | create_Dest_X0(int num) |
785 | { |
789 | { |
786 | const unsigned int n = (unsigned int)num; |
790 | const unsigned int n = (unsigned int)num; |
787 | return ((n & 0x3f) << 0); |
791 | return ((n & 0x3f) << 0); |
788 | } |
792 | } |
789 | 793 | ||
790 | static __inline tilegx_bundle_bits |
794 | static __inline tilegx_bundle_bits |
791 | create_Dest_X1(int num) |
795 | create_Dest_X1(int num) |
792 | { |
796 | { |
793 | const unsigned int n = (unsigned int)num; |
797 | const unsigned int n = (unsigned int)num; |
794 | return (((tilegx_bundle_bits)(n & 0x3f)) << 31); |
798 | return (((tilegx_bundle_bits)(n & 0x3f)) << 31); |
795 | } |
799 | } |
796 | 800 | ||
797 | static __inline tilegx_bundle_bits |
801 | static __inline tilegx_bundle_bits |
798 | create_Dest_Y0(int num) |
802 | create_Dest_Y0(int num) |
799 | { |
803 | { |
800 | const unsigned int n = (unsigned int)num; |
804 | const unsigned int n = (unsigned int)num; |
801 | return ((n & 0x3f) << 0); |
805 | return ((n & 0x3f) << 0); |
802 | } |
806 | } |
803 | 807 | ||
804 | static __inline tilegx_bundle_bits |
808 | static __inline tilegx_bundle_bits |
805 | create_Dest_Y1(int num) |
809 | create_Dest_Y1(int num) |
806 | { |
810 | { |
807 | const unsigned int n = (unsigned int)num; |
811 | const unsigned int n = (unsigned int)num; |
808 | return (((tilegx_bundle_bits)(n & 0x3f)) << 31); |
812 | return (((tilegx_bundle_bits)(n & 0x3f)) << 31); |
809 | } |
813 | } |
810 | 814 | ||
811 | static __inline tilegx_bundle_bits |
815 | static __inline tilegx_bundle_bits |
812 | create_Imm16_X0(int num) |
816 | create_Imm16_X0(int num) |
813 | { |
817 | { |
814 | const unsigned int n = (unsigned int)num; |
818 | const unsigned int n = (unsigned int)num; |
815 | return ((n & 0xffff) << 12); |
819 | return ((n & 0xffff) << 12); |
816 | } |
820 | } |
817 | 821 | ||
818 | static __inline tilegx_bundle_bits |
822 | static __inline tilegx_bundle_bits |
819 | create_Imm16_X1(int num) |
823 | create_Imm16_X1(int num) |
820 | { |
824 | { |
821 | const unsigned int n = (unsigned int)num; |
825 | const unsigned int n = (unsigned int)num; |
822 | return (((tilegx_bundle_bits)(n & 0xffff)) << 43); |
826 | return (((tilegx_bundle_bits)(n & 0xffff)) << 43); |
823 | } |
827 | } |
824 | 828 | ||
825 | static __inline tilegx_bundle_bits |
829 | static __inline tilegx_bundle_bits |
826 | create_Imm8OpcodeExtension_X0(int num) |
830 | create_Imm8OpcodeExtension_X0(int num) |
827 | { |
831 | { |
828 | const unsigned int n = (unsigned int)num; |
832 | const unsigned int n = (unsigned int)num; |
829 | return ((n & 0xff) << 20); |
833 | return ((n & 0xff) << 20); |
830 | } |
834 | } |
831 | 835 | ||
832 | static __inline tilegx_bundle_bits |
836 | static __inline tilegx_bundle_bits |
833 | create_Imm8OpcodeExtension_X1(int num) |
837 | create_Imm8OpcodeExtension_X1(int num) |
834 | { |
838 | { |
835 | const unsigned int n = (unsigned int)num; |
839 | const unsigned int n = (unsigned int)num; |
836 | return (((tilegx_bundle_bits)(n & 0xff)) << 51); |
840 | return (((tilegx_bundle_bits)(n & 0xff)) << 51); |
837 | } |
841 | } |
838 | 842 | ||
839 | static __inline tilegx_bundle_bits |
843 | static __inline tilegx_bundle_bits |
840 | create_Imm8_X0(int num) |
844 | create_Imm8_X0(int num) |
841 | { |
845 | { |
842 | const unsigned int n = (unsigned int)num; |
846 | const unsigned int n = (unsigned int)num; |
843 | return ((n & 0xff) << 12); |
847 | return ((n & 0xff) << 12); |
844 | } |
848 | } |
845 | 849 | ||
846 | static __inline tilegx_bundle_bits |
850 | static __inline tilegx_bundle_bits |
847 | create_Imm8_X1(int num) |
851 | create_Imm8_X1(int num) |
848 | { |
852 | { |
849 | const unsigned int n = (unsigned int)num; |
853 | const unsigned int n = (unsigned int)num; |
850 | return (((tilegx_bundle_bits)(n & 0xff)) << 43); |
854 | return (((tilegx_bundle_bits)(n & 0xff)) << 43); |
851 | } |
855 | } |
852 | 856 | ||
853 | static __inline tilegx_bundle_bits |
857 | static __inline tilegx_bundle_bits |
854 | create_Imm8_Y0(int num) |
858 | create_Imm8_Y0(int num) |
855 | { |
859 | { |
856 | const unsigned int n = (unsigned int)num; |
860 | const unsigned int n = (unsigned int)num; |
857 | return ((n & 0xff) << 12); |
861 | return ((n & 0xff) << 12); |
858 | } |
862 | } |
859 | 863 | ||
860 | static __inline tilegx_bundle_bits |
864 | static __inline tilegx_bundle_bits |
861 | create_Imm8_Y1(int num) |
865 | create_Imm8_Y1(int num) |
862 | { |
866 | { |
863 | const unsigned int n = (unsigned int)num; |
867 | const unsigned int n = (unsigned int)num; |
864 | return (((tilegx_bundle_bits)(n & 0xff)) << 43); |
868 | return (((tilegx_bundle_bits)(n & 0xff)) << 43); |
865 | } |
869 | } |
866 | 870 | ||
867 | static __inline tilegx_bundle_bits |
871 | static __inline tilegx_bundle_bits |
868 | create_JumpOff_X1(int num) |
872 | create_JumpOff_X1(int num) |
869 | { |
873 | { |
870 | const unsigned int n = (unsigned int)num; |
874 | const unsigned int n = (unsigned int)num; |
871 | return (((tilegx_bundle_bits)(n & 0x7ffffff)) << 31); |
875 | return (((tilegx_bundle_bits)(n & 0x7ffffff)) << 31); |
872 | } |
876 | } |
873 | 877 | ||
874 | static __inline tilegx_bundle_bits |
878 | static __inline tilegx_bundle_bits |
875 | create_JumpOpcodeExtension_X1(int num) |
879 | create_JumpOpcodeExtension_X1(int num) |
876 | { |
880 | { |
877 | const unsigned int n = (unsigned int)num; |
881 | const unsigned int n = (unsigned int)num; |
878 | return (((tilegx_bundle_bits)(n & 0x1)) << 58); |
882 | return (((tilegx_bundle_bits)(n & 0x1)) << 58); |
879 | } |
883 | } |
880 | 884 | ||
881 | static __inline tilegx_bundle_bits |
885 | static __inline tilegx_bundle_bits |
882 | create_MF_Imm14_X1(int num) |
886 | create_MF_Imm14_X1(int num) |
883 | { |
887 | { |
884 | const unsigned int n = (unsigned int)num; |
888 | const unsigned int n = (unsigned int)num; |
885 | return (((tilegx_bundle_bits)(n & 0x3fff)) << 37); |
889 | return (((tilegx_bundle_bits)(n & 0x3fff)) << 37); |
886 | } |
890 | } |
887 | 891 | ||
888 | static __inline tilegx_bundle_bits |
892 | static __inline tilegx_bundle_bits |
889 | create_MT_Imm14_X1(int num) |
893 | create_MT_Imm14_X1(int num) |
890 | { |
894 | { |
891 | const unsigned int n = (unsigned int)num; |
895 | const unsigned int n = (unsigned int)num; |
892 | return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) | |
896 | return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) | |
893 | (((tilegx_bundle_bits)(n & 0x00003fc0)) << 37); |
897 | (((tilegx_bundle_bits)(n & 0x00003fc0)) << 37); |
894 | } |
898 | } |
895 | 899 | ||
896 | static __inline tilegx_bundle_bits |
900 | static __inline tilegx_bundle_bits |
897 | create_Mode(int num) |
901 | create_Mode(int num) |
898 | { |
902 | { |
899 | const unsigned int n = (unsigned int)num; |
903 | const unsigned int n = (unsigned int)num; |
900 | return (((tilegx_bundle_bits)(n & 0x3)) << 62); |
904 | return (((tilegx_bundle_bits)(n & 0x3)) << 62); |
901 | } |
905 | } |
902 | 906 | ||
903 | static __inline tilegx_bundle_bits |
907 | static __inline tilegx_bundle_bits |
904 | create_Opcode_X0(int num) |
908 | create_Opcode_X0(int num) |
905 | { |
909 | { |
906 | const unsigned int n = (unsigned int)num; |
910 | const unsigned int n = (unsigned int)num; |
907 | return ((n & 0x7) << 28); |
911 | return ((n & 0x7) << 28); |
908 | } |
912 | } |
909 | 913 | ||
910 | static __inline tilegx_bundle_bits |
914 | static __inline tilegx_bundle_bits |
911 | create_Opcode_X1(int num) |
915 | create_Opcode_X1(int num) |
912 | { |
916 | { |
913 | const unsigned int n = (unsigned int)num; |
917 | const unsigned int n = (unsigned int)num; |
914 | return (((tilegx_bundle_bits)(n & 0x7)) << 59); |
918 | return (((tilegx_bundle_bits)(n & 0x7)) << 59); |
915 | } |
919 | } |
916 | 920 | ||
917 | static __inline tilegx_bundle_bits |
921 | static __inline tilegx_bundle_bits |
918 | create_Opcode_Y0(int num) |
922 | create_Opcode_Y0(int num) |
919 | { |
923 | { |
920 | const unsigned int n = (unsigned int)num; |
924 | const unsigned int n = (unsigned int)num; |
921 | return ((n & 0xf) << 27); |
925 | return ((n & 0xf) << 27); |
922 | } |
926 | } |
923 | 927 | ||
924 | static __inline tilegx_bundle_bits |
928 | static __inline tilegx_bundle_bits |
925 | create_Opcode_Y1(int num) |
929 | create_Opcode_Y1(int num) |
926 | { |
930 | { |
927 | const unsigned int n = (unsigned int)num; |
931 | const unsigned int n = (unsigned int)num; |
928 | return (((tilegx_bundle_bits)(n & 0xf)) << 58); |
932 | return (((tilegx_bundle_bits)(n & 0xf)) << 58); |
929 | } |
933 | } |
930 | 934 | ||
931 | static __inline tilegx_bundle_bits |
935 | static __inline tilegx_bundle_bits |
932 | create_Opcode_Y2(int num) |
936 | create_Opcode_Y2(int num) |
933 | { |
937 | { |
934 | const unsigned int n = (unsigned int)num; |
938 | const unsigned int n = (unsigned int)num; |
935 | return ((n & 0x00000001) << 26) | |
939 | return ((n & 0x00000001) << 26) | |
936 | (((tilegx_bundle_bits)(n & 0x00000002)) << 56); |
940 | (((tilegx_bundle_bits)(n & 0x00000002)) << 56); |
937 | } |
941 | } |
938 | 942 | ||
939 | static __inline tilegx_bundle_bits |
943 | static __inline tilegx_bundle_bits |
940 | create_RRROpcodeExtension_X0(int num) |
944 | create_RRROpcodeExtension_X0(int num) |
941 | { |
945 | { |
942 | const unsigned int n = (unsigned int)num; |
946 | const unsigned int n = (unsigned int)num; |
943 | return ((n & 0x3ff) << 18); |
947 | return ((n & 0x3ff) << 18); |
944 | } |
948 | } |
945 | 949 | ||
946 | static __inline tilegx_bundle_bits |
950 | static __inline tilegx_bundle_bits |
947 | create_RRROpcodeExtension_X1(int num) |
951 | create_RRROpcodeExtension_X1(int num) |
948 | { |
952 | { |
949 | const unsigned int n = (unsigned int)num; |
953 | const unsigned int n = (unsigned int)num; |
950 | return (((tilegx_bundle_bits)(n & 0x3ff)) << 49); |
954 | return (((tilegx_bundle_bits)(n & 0x3ff)) << 49); |
951 | } |
955 | } |
952 | 956 | ||
953 | static __inline tilegx_bundle_bits |
957 | static __inline tilegx_bundle_bits |
954 | create_RRROpcodeExtension_Y0(int num) |
958 | create_RRROpcodeExtension_Y0(int num) |
955 | { |
959 | { |
956 | const unsigned int n = (unsigned int)num; |
960 | const unsigned int n = (unsigned int)num; |
957 | return ((n & 0x3) << 18); |
961 | return ((n & 0x3) << 18); |
958 | } |
962 | } |
959 | 963 | ||
960 | static __inline tilegx_bundle_bits |
964 | static __inline tilegx_bundle_bits |
961 | create_RRROpcodeExtension_Y1(int num) |
965 | create_RRROpcodeExtension_Y1(int num) |
962 | { |
966 | { |
963 | const unsigned int n = (unsigned int)num; |
967 | const unsigned int n = (unsigned int)num; |
964 | return (((tilegx_bundle_bits)(n & 0x3)) << 49); |
968 | return (((tilegx_bundle_bits)(n & 0x3)) << 49); |
965 | } |
969 | } |
966 | 970 | ||
967 | static __inline tilegx_bundle_bits |
971 | static __inline tilegx_bundle_bits |
968 | create_ShAmt_X0(int num) |
972 | create_ShAmt_X0(int num) |
969 | { |
973 | { |
970 | const unsigned int n = (unsigned int)num; |
974 | const unsigned int n = (unsigned int)num; |
971 | return ((n & 0x3f) << 12); |
975 | return ((n & 0x3f) << 12); |
972 | } |
976 | } |
973 | 977 | ||
974 | static __inline tilegx_bundle_bits |
978 | static __inline tilegx_bundle_bits |
975 | create_ShAmt_X1(int num) |
979 | create_ShAmt_X1(int num) |
976 | { |
980 | { |
977 | const unsigned int n = (unsigned int)num; |
981 | const unsigned int n = (unsigned int)num; |
978 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
982 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
979 | } |
983 | } |
980 | 984 | ||
981 | static __inline tilegx_bundle_bits |
985 | static __inline tilegx_bundle_bits |
982 | create_ShAmt_Y0(int num) |
986 | create_ShAmt_Y0(int num) |
983 | { |
987 | { |
984 | const unsigned int n = (unsigned int)num; |
988 | const unsigned int n = (unsigned int)num; |
985 | return ((n & 0x3f) << 12); |
989 | return ((n & 0x3f) << 12); |
986 | } |
990 | } |
987 | 991 | ||
988 | static __inline tilegx_bundle_bits |
992 | static __inline tilegx_bundle_bits |
989 | create_ShAmt_Y1(int num) |
993 | create_ShAmt_Y1(int num) |
990 | { |
994 | { |
991 | const unsigned int n = (unsigned int)num; |
995 | const unsigned int n = (unsigned int)num; |
992 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
996 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
993 | } |
997 | } |
994 | 998 | ||
995 | static __inline tilegx_bundle_bits |
999 | static __inline tilegx_bundle_bits |
996 | create_ShiftOpcodeExtension_X0(int num) |
1000 | create_ShiftOpcodeExtension_X0(int num) |
997 | { |
1001 | { |
998 | const unsigned int n = (unsigned int)num; |
1002 | const unsigned int n = (unsigned int)num; |
999 | return ((n & 0x3ff) << 18); |
1003 | return ((n & 0x3ff) << 18); |
1000 | } |
1004 | } |
1001 | 1005 | ||
1002 | static __inline tilegx_bundle_bits |
1006 | static __inline tilegx_bundle_bits |
1003 | create_ShiftOpcodeExtension_X1(int num) |
1007 | create_ShiftOpcodeExtension_X1(int num) |
1004 | { |
1008 | { |
1005 | const unsigned int n = (unsigned int)num; |
1009 | const unsigned int n = (unsigned int)num; |
1006 | return (((tilegx_bundle_bits)(n & 0x3ff)) << 49); |
1010 | return (((tilegx_bundle_bits)(n & 0x3ff)) << 49); |
1007 | } |
1011 | } |
1008 | 1012 | ||
1009 | static __inline tilegx_bundle_bits |
1013 | static __inline tilegx_bundle_bits |
1010 | create_ShiftOpcodeExtension_Y0(int num) |
1014 | create_ShiftOpcodeExtension_Y0(int num) |
1011 | { |
1015 | { |
1012 | const unsigned int n = (unsigned int)num; |
1016 | const unsigned int n = (unsigned int)num; |
1013 | return ((n & 0x3) << 18); |
1017 | return ((n & 0x3) << 18); |
1014 | } |
1018 | } |
1015 | 1019 | ||
1016 | static __inline tilegx_bundle_bits |
1020 | static __inline tilegx_bundle_bits |
1017 | create_ShiftOpcodeExtension_Y1(int num) |
1021 | create_ShiftOpcodeExtension_Y1(int num) |
1018 | { |
1022 | { |
1019 | const unsigned int n = (unsigned int)num; |
1023 | const unsigned int n = (unsigned int)num; |
1020 | return (((tilegx_bundle_bits)(n & 0x3)) << 49); |
1024 | return (((tilegx_bundle_bits)(n & 0x3)) << 49); |
1021 | } |
1025 | } |
1022 | 1026 | ||
1023 | static __inline tilegx_bundle_bits |
1027 | static __inline tilegx_bundle_bits |
1024 | create_SrcA_X0(int num) |
1028 | create_SrcA_X0(int num) |
1025 | { |
1029 | { |
1026 | const unsigned int n = (unsigned int)num; |
1030 | const unsigned int n = (unsigned int)num; |
1027 | return ((n & 0x3f) << 6); |
1031 | return ((n & 0x3f) << 6); |
1028 | } |
1032 | } |
1029 | 1033 | ||
1030 | static __inline tilegx_bundle_bits |
1034 | static __inline tilegx_bundle_bits |
1031 | create_SrcA_X1(int num) |
1035 | create_SrcA_X1(int num) |
1032 | { |
1036 | { |
1033 | const unsigned int n = (unsigned int)num; |
1037 | const unsigned int n = (unsigned int)num; |
1034 | return (((tilegx_bundle_bits)(n & 0x3f)) << 37); |
1038 | return (((tilegx_bundle_bits)(n & 0x3f)) << 37); |
1035 | } |
1039 | } |
1036 | 1040 | ||
1037 | static __inline tilegx_bundle_bits |
1041 | static __inline tilegx_bundle_bits |
1038 | create_SrcA_Y0(int num) |
1042 | create_SrcA_Y0(int num) |
1039 | { |
1043 | { |
1040 | const unsigned int n = (unsigned int)num; |
1044 | const unsigned int n = (unsigned int)num; |
1041 | return ((n & 0x3f) << 6); |
1045 | return ((n & 0x3f) << 6); |
1042 | } |
1046 | } |
1043 | 1047 | ||
1044 | static __inline tilegx_bundle_bits |
1048 | static __inline tilegx_bundle_bits |
1045 | create_SrcA_Y1(int num) |
1049 | create_SrcA_Y1(int num) |
1046 | { |
1050 | { |
1047 | const unsigned int n = (unsigned int)num; |
1051 | const unsigned int n = (unsigned int)num; |
1048 | return (((tilegx_bundle_bits)(n & 0x3f)) << 37); |
1052 | return (((tilegx_bundle_bits)(n & 0x3f)) << 37); |
1049 | } |
1053 | } |
1050 | 1054 | ||
1051 | static __inline tilegx_bundle_bits |
1055 | static __inline tilegx_bundle_bits |
1052 | create_SrcA_Y2(int num) |
1056 | create_SrcA_Y2(int num) |
1053 | { |
1057 | { |
1054 | const unsigned int n = (unsigned int)num; |
1058 | const unsigned int n = (unsigned int)num; |
1055 | return ((n & 0x3f) << 20); |
1059 | return ((n & 0x3f) << 20); |
1056 | } |
1060 | } |
1057 | 1061 | ||
1058 | static __inline tilegx_bundle_bits |
1062 | static __inline tilegx_bundle_bits |
1059 | create_SrcBDest_Y2(int num) |
1063 | create_SrcBDest_Y2(int num) |
1060 | { |
1064 | { |
1061 | const unsigned int n = (unsigned int)num; |
1065 | const unsigned int n = (unsigned int)num; |
1062 | return (((tilegx_bundle_bits)(n & 0x3f)) << 51); |
1066 | return (((tilegx_bundle_bits)(n & 0x3f)) << 51); |
1063 | } |
1067 | } |
1064 | 1068 | ||
1065 | static __inline tilegx_bundle_bits |
1069 | static __inline tilegx_bundle_bits |
1066 | create_SrcB_X0(int num) |
1070 | create_SrcB_X0(int num) |
1067 | { |
1071 | { |
1068 | const unsigned int n = (unsigned int)num; |
1072 | const unsigned int n = (unsigned int)num; |
1069 | return ((n & 0x3f) << 12); |
1073 | return ((n & 0x3f) << 12); |
1070 | } |
1074 | } |
1071 | 1075 | ||
1072 | static __inline tilegx_bundle_bits |
1076 | static __inline tilegx_bundle_bits |
1073 | create_SrcB_X1(int num) |
1077 | create_SrcB_X1(int num) |
1074 | { |
1078 | { |
1075 | const unsigned int n = (unsigned int)num; |
1079 | const unsigned int n = (unsigned int)num; |
1076 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1080 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1077 | } |
1081 | } |
1078 | 1082 | ||
1079 | static __inline tilegx_bundle_bits |
1083 | static __inline tilegx_bundle_bits |
1080 | create_SrcB_Y0(int num) |
1084 | create_SrcB_Y0(int num) |
1081 | { |
1085 | { |
1082 | const unsigned int n = (unsigned int)num; |
1086 | const unsigned int n = (unsigned int)num; |
1083 | return ((n & 0x3f) << 12); |
1087 | return ((n & 0x3f) << 12); |
1084 | } |
1088 | } |
1085 | 1089 | ||
1086 | static __inline tilegx_bundle_bits |
1090 | static __inline tilegx_bundle_bits |
1087 | create_SrcB_Y1(int num) |
1091 | create_SrcB_Y1(int num) |
1088 | { |
1092 | { |
1089 | const unsigned int n = (unsigned int)num; |
1093 | const unsigned int n = (unsigned int)num; |
1090 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1094 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1091 | } |
1095 | } |
1092 | 1096 | ||
1093 | static __inline tilegx_bundle_bits |
1097 | static __inline tilegx_bundle_bits |
1094 | create_UnaryOpcodeExtension_X0(int num) |
1098 | create_UnaryOpcodeExtension_X0(int num) |
1095 | { |
1099 | { |
1096 | const unsigned int n = (unsigned int)num; |
1100 | const unsigned int n = (unsigned int)num; |
1097 | return ((n & 0x3f) << 12); |
1101 | return ((n & 0x3f) << 12); |
1098 | } |
1102 | } |
1099 | 1103 | ||
1100 | static __inline tilegx_bundle_bits |
1104 | static __inline tilegx_bundle_bits |
1101 | create_UnaryOpcodeExtension_X1(int num) |
1105 | create_UnaryOpcodeExtension_X1(int num) |
1102 | { |
1106 | { |
1103 | const unsigned int n = (unsigned int)num; |
1107 | const unsigned int n = (unsigned int)num; |
1104 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1108 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1105 | } |
1109 | } |
1106 | 1110 | ||
1107 | static __inline tilegx_bundle_bits |
1111 | static __inline tilegx_bundle_bits |
1108 | create_UnaryOpcodeExtension_Y0(int num) |
1112 | create_UnaryOpcodeExtension_Y0(int num) |
1109 | { |
1113 | { |
1110 | const unsigned int n = (unsigned int)num; |
1114 | const unsigned int n = (unsigned int)num; |
1111 | return ((n & 0x3f) << 12); |
1115 | return ((n & 0x3f) << 12); |
1112 | } |
1116 | } |
1113 | 1117 | ||
1114 | static __inline tilegx_bundle_bits |
1118 | static __inline tilegx_bundle_bits |
1115 | create_UnaryOpcodeExtension_Y1(int num) |
1119 | create_UnaryOpcodeExtension_Y1(int num) |
1116 | { |
1120 | { |
1117 | const unsigned int n = (unsigned int)num; |
1121 | const unsigned int n = (unsigned int)num; |
1118 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1122 | return (((tilegx_bundle_bits)(n & 0x3f)) << 43); |
1119 | } |
1123 | } |
1120 | 1124 | ||
1121 | 1125 | ||
1122 | typedef enum |
1126 | typedef enum |
1123 | { |
1127 | { |
1124 | TILEGX_PIPELINE_X0, |
1128 | TILEGX_PIPELINE_X0, |
1125 | TILEGX_PIPELINE_X1, |
1129 | TILEGX_PIPELINE_X1, |
1126 | TILEGX_PIPELINE_Y0, |
1130 | TILEGX_PIPELINE_Y0, |
1127 | TILEGX_PIPELINE_Y1, |
1131 | TILEGX_PIPELINE_Y1, |
1128 | TILEGX_PIPELINE_Y2, |
1132 | TILEGX_PIPELINE_Y2, |
1129 | } tilegx_pipeline; |
1133 | } tilegx_pipeline; |
1130 | 1134 | ||
1131 | #define tilegx_is_x_pipeline(p) ((int)(p) <= (int)TILEGX_PIPELINE_X1) |
1135 | #define tilegx_is_x_pipeline(p) ((int)(p) <= (int)TILEGX_PIPELINE_X1) |
1132 | 1136 | ||
1133 | typedef enum |
1137 | typedef enum |
1134 | { |
1138 | { |
1135 | TILEGX_OP_TYPE_REGISTER, |
1139 | TILEGX_OP_TYPE_REGISTER, |
1136 | TILEGX_OP_TYPE_IMMEDIATE, |
1140 | TILEGX_OP_TYPE_IMMEDIATE, |
1137 | TILEGX_OP_TYPE_ADDRESS, |
1141 | TILEGX_OP_TYPE_ADDRESS, |
1138 | TILEGX_OP_TYPE_SPR |
1142 | TILEGX_OP_TYPE_SPR |
1139 | } tilegx_operand_type; |
1143 | } tilegx_operand_type; |
1140 | 1144 | ||
1141 | /* These are the bits that determine if a bundle is in the X encoding. */ |
1145 | /* These are the bits that determine if a bundle is in the X encoding. */ |
1142 | #define TILEGX_BUNDLE_MODE_MASK ((tilegx_bundle_bits)3 << 62) |
1146 | #define TILEGX_BUNDLE_MODE_MASK ((tilegx_bundle_bits)3 << 62) |
1143 | 1147 | ||
1144 | enum |
1148 | enum |
1145 | { |
1149 | { |
1146 | /* Maximum number of instructions in a bundle (2 for X, 3 for Y). */ |
1150 | /* Maximum number of instructions in a bundle (2 for X, 3 for Y). */ |
1147 | TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE = 3, |
1151 | TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE = 3, |
1148 | 1152 | ||
1149 | /* How many different pipeline encodings are there? X0, X1, Y0, Y1, Y2. */ |
1153 | /* How many different pipeline encodings are there? X0, X1, Y0, Y1, Y2. */ |
1150 | TILEGX_NUM_PIPELINE_ENCODINGS = 5, |
1154 | TILEGX_NUM_PIPELINE_ENCODINGS = 5, |
1151 | 1155 | ||
1152 | /* Log base 2 of TILEGX_BUNDLE_SIZE_IN_BYTES. */ |
1156 | /* Log base 2 of TILEGX_BUNDLE_SIZE_IN_BYTES. */ |
1153 | TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES = 3, |
1157 | TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES = 3, |
1154 | 1158 | ||
1155 | /* Instructions take this many bytes. */ |
1159 | /* Instructions take this many bytes. */ |
1156 | TILEGX_BUNDLE_SIZE_IN_BYTES = 1 << TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES, |
1160 | TILEGX_BUNDLE_SIZE_IN_BYTES = 1 << TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES, |
1157 | 1161 | ||
1158 | /* Log base 2 of TILEGX_BUNDLE_ALIGNMENT_IN_BYTES. */ |
1162 | /* Log base 2 of TILEGX_BUNDLE_ALIGNMENT_IN_BYTES. */ |
1159 | TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES = 3, |
1163 | TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES = 3, |
1160 | 1164 | ||
1161 | /* Bundles should be aligned modulo this number of bytes. */ |
1165 | /* Bundles should be aligned modulo this number of bytes. */ |
1162 | TILEGX_BUNDLE_ALIGNMENT_IN_BYTES = |
1166 | TILEGX_BUNDLE_ALIGNMENT_IN_BYTES = |
1163 | (1 << TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES), |
1167 | (1 << TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES), |
1164 | 1168 | ||
1165 | /* Number of registers (some are magic, such as network I/O). */ |
1169 | /* Number of registers (some are magic, such as network I/O). */ |
1166 | TILEGX_NUM_REGISTERS = 64, |
1170 | TILEGX_NUM_REGISTERS = 64, |
1167 | }; |
1171 | }; |
1168 | 1172 | ||
1169 | 1173 | ||
1170 | struct tilegx_operand |
1174 | struct tilegx_operand |
1171 | { |
1175 | { |
1172 | /* Is this operand a register, immediate or address? */ |
1176 | /* Is this operand a register, immediate or address? */ |
1173 | tilegx_operand_type type; |
1177 | tilegx_operand_type type; |
1174 | 1178 | ||
1175 | /* The default relocation type for this operand. */ |
1179 | /* The default relocation type for this operand. */ |
1176 | signed int default_reloc : 16; |
1180 | signed int default_reloc : 16; |
1177 | 1181 | ||
1178 | /* How many bits is this value? (used for range checking) */ |
1182 | /* How many bits is this value? (used for range checking) */ |
1179 | unsigned int num_bits : 5; |
1183 | unsigned int num_bits : 5; |
1180 | 1184 | ||
1181 | /* Is the value signed? (used for range checking) */ |
1185 | /* Is the value signed? (used for range checking) */ |
1182 | unsigned int is_signed : 1; |
1186 | unsigned int is_signed : 1; |
1183 | 1187 | ||
1184 | /* Is this operand a source register? */ |
1188 | /* Is this operand a source register? */ |
1185 | unsigned int is_src_reg : 1; |
1189 | unsigned int is_src_reg : 1; |
1186 | 1190 | ||
1187 | /* Is this operand written? (i.e. is it a destination register) */ |
1191 | /* Is this operand written? (i.e. is it a destination register) */ |
1188 | unsigned int is_dest_reg : 1; |
1192 | unsigned int is_dest_reg : 1; |
1189 | 1193 | ||
1190 | /* Is this operand PC-relative? */ |
1194 | /* Is this operand PC-relative? */ |
1191 | unsigned int is_pc_relative : 1; |
1195 | unsigned int is_pc_relative : 1; |
1192 | 1196 | ||
1193 | /* By how many bits do we right shift the value before inserting? */ |
1197 | /* By how many bits do we right shift the value before inserting? */ |
1194 | unsigned int rightshift : 2; |
1198 | unsigned int rightshift : 2; |
1195 | 1199 | ||
1196 | /* Return the bits for this operand to be ORed into an existing bundle. */ |
1200 | /* Return the bits for this operand to be ORed into an existing bundle. */ |
1197 | tilegx_bundle_bits (*insert) (int op); |
1201 | tilegx_bundle_bits (*insert) (int op); |
1198 | 1202 | ||
1199 | /* Extract this operand and return it. */ |
1203 | /* Extract this operand and return it. */ |
1200 | unsigned int (*extract) (tilegx_bundle_bits bundle); |
1204 | unsigned int (*extract) (tilegx_bundle_bits bundle); |
1201 | }; |
1205 | }; |
1202 | 1206 | ||
1203 | 1207 | ||
1204 | extern const struct tilegx_operand tilegx_operands[]; |
1208 | extern const struct tilegx_operand tilegx_operands[]; |
1205 | 1209 | ||
1206 | /* One finite-state machine per pipe for rapid instruction decoding. */ |
1210 | /* One finite-state machine per pipe for rapid instruction decoding. */ |
1207 | extern const unsigned short * const |
1211 | extern const unsigned short * const |
1208 | tilegx_bundle_decoder_fsms[TILEGX_NUM_PIPELINE_ENCODINGS]; |
1212 | tilegx_bundle_decoder_fsms[TILEGX_NUM_PIPELINE_ENCODINGS]; |
1209 | 1213 | ||
1210 | 1214 | ||
1211 | struct tilegx_opcode |
1215 | struct tilegx_opcode |
1212 | { |
1216 | { |
1213 | /* The opcode mnemonic, e.g. "add" */ |
1217 | /* The opcode mnemonic, e.g. "add" */ |
1214 | const char *name; |
1218 | const char *name; |
1215 | 1219 | ||
1216 | /* The enum value for this mnemonic. */ |
1220 | /* The enum value for this mnemonic. */ |
1217 | tilegx_mnemonic mnemonic; |
1221 | tilegx_mnemonic mnemonic; |
1218 | 1222 | ||
1219 | /* A bit mask of which of the five pipes this instruction |
1223 | /* A bit mask of which of the five pipes this instruction |
1220 | is compatible with: |
1224 | is compatible with: |
1221 | X0 0x01 |
1225 | X0 0x01 |
1222 | X1 0x02 |
1226 | X1 0x02 |
1223 | Y0 0x04 |
1227 | Y0 0x04 |
1224 | Y1 0x08 |
1228 | Y1 0x08 |
1225 | Y2 0x10 */ |
1229 | Y2 0x10 */ |
1226 | unsigned char pipes; |
1230 | unsigned char pipes; |
1227 | 1231 | ||
1228 | /* How many operands are there? */ |
1232 | /* How many operands are there? */ |
1229 | unsigned char num_operands; |
1233 | unsigned char num_operands; |
1230 | 1234 | ||
1231 | /* Which register does this write implicitly, or TREG_ZERO if none? */ |
1235 | /* Which register does this write implicitly, or TREG_ZERO if none? */ |
1232 | unsigned char implicitly_written_register; |
1236 | unsigned char implicitly_written_register; |
1233 | 1237 | ||
1234 | /* Can this be bundled with other instructions (almost always true). */ |
1238 | /* Can this be bundled with other instructions (almost always true). */ |
1235 | unsigned char can_bundle; |
1239 | unsigned char can_bundle; |
1236 | 1240 | ||
1237 | /* The description of the operands. Each of these is an |
1241 | /* The description of the operands. Each of these is an |
1238 | * index into the tilegx_operands[] table. */ |
1242 | * index into the tilegx_operands[] table. */ |
1239 | unsigned char operands[TILEGX_NUM_PIPELINE_ENCODINGS][TILEGX_MAX_OPERANDS]; |
1243 | unsigned char operands[TILEGX_NUM_PIPELINE_ENCODINGS][TILEGX_MAX_OPERANDS]; |
1240 | 1244 | ||
1241 | #if !defined(__KERNEL__) && !defined(_LIBC) |
1245 | #if !defined(__KERNEL__) && !defined(_LIBC) |
1242 | /* A mask of which bits have predefined values for each pipeline. |
1246 | /* A mask of which bits have predefined values for each pipeline. |
1243 | * This is useful for disassembly. */ |
1247 | * This is useful for disassembly. */ |
1244 | tilegx_bundle_bits fixed_bit_masks[TILEGX_NUM_PIPELINE_ENCODINGS]; |
1248 | tilegx_bundle_bits fixed_bit_masks[TILEGX_NUM_PIPELINE_ENCODINGS]; |
1245 | 1249 | ||
1246 | /* For each bit set in fixed_bit_masks, what the value is for this |
1250 | /* For each bit set in fixed_bit_masks, what the value is for this |
1247 | * instruction. */ |
1251 | * instruction. */ |
1248 | tilegx_bundle_bits fixed_bit_values[TILEGX_NUM_PIPELINE_ENCODINGS]; |
1252 | tilegx_bundle_bits fixed_bit_values[TILEGX_NUM_PIPELINE_ENCODINGS]; |
1249 | #endif |
1253 | #endif |
1250 | }; |
1254 | }; |
1251 | 1255 | ||
1252 | extern const struct tilegx_opcode tilegx_opcodes[]; |
1256 | extern const struct tilegx_opcode tilegx_opcodes[]; |
1253 | 1257 | ||
1254 | /* Used for non-textual disassembly into structs. */ |
1258 | /* Used for non-textual disassembly into structs. */ |
1255 | struct tilegx_decoded_instruction |
1259 | struct tilegx_decoded_instruction |
1256 | { |
1260 | { |
1257 | const struct tilegx_opcode *opcode; |
1261 | const struct tilegx_opcode *opcode; |
1258 | const struct tilegx_operand *operands[TILEGX_MAX_OPERANDS]; |
1262 | const struct tilegx_operand *operands[TILEGX_MAX_OPERANDS]; |
1259 | long long operand_values[TILEGX_MAX_OPERANDS]; |
1263 | long long operand_values[TILEGX_MAX_OPERANDS]; |
1260 | }; |
1264 | }; |
1261 | 1265 | ||
1262 | 1266 | ||
1263 | /* Disassemble a bundle into a struct for machine processing. */ |
1267 | /* Disassemble a bundle into a struct for machine processing. */ |
1264 | extern int parse_insn_tilegx(tilegx_bundle_bits bits, |
1268 | extern int parse_insn_tilegx(tilegx_bundle_bits bits, |
1265 | unsigned long long pc, |
1269 | unsigned long long pc, |
1266 | struct tilegx_decoded_instruction |
1270 | struct tilegx_decoded_instruction |
1267 | decoded[TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE]); |
1271 | decoded[TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE]); |
1268 | 1272 | ||
1269 | 1273 | ||
1270 | #if !defined(__KERNEL__) && !defined(_LIBC) |
1274 | #if !defined(__KERNEL__) && !defined(_LIBC) |
1271 | /* Canonical names of all the registers. */ |
1275 | /* Canonical names of all the registers. */ |
1272 | /* ISSUE: This table lives in "tile-dis.c" */ |
1276 | /* ISSUE: This table lives in "tile-dis.c" */ |
1273 | extern const char * const tilegx_register_names[]; |
1277 | extern const char * const tilegx_register_names[]; |
1274 | 1278 | ||
1275 | /* Descriptor for a special-purpose register. */ |
1279 | /* Descriptor for a special-purpose register. */ |
1276 | struct tilegx_spr |
1280 | struct tilegx_spr |
1277 | { |
1281 | { |
1278 | /* The number */ |
1282 | /* The number */ |
1279 | int number; |
1283 | int number; |
1280 | 1284 | ||
1281 | /* The name */ |
1285 | /* The name */ |
1282 | const char *name; |
1286 | const char *name; |
1283 | }; |
1287 | }; |
1284 | 1288 | ||
1285 | /* List of all the SPRs; ordered by increasing number. */ |
1289 | /* List of all the SPRs; ordered by increasing number. */ |
1286 | extern const struct tilegx_spr tilegx_sprs[]; |
1290 | extern const struct tilegx_spr tilegx_sprs[]; |
1287 | 1291 | ||
1288 | /* Number of special-purpose registers. */ |
1292 | /* Number of special-purpose registers. */ |
1289 | extern const int tilegx_num_sprs; |
1293 | extern const int tilegx_num_sprs; |
1290 | 1294 | ||
1291 | extern const char * |
1295 | extern const char * |
1292 | get_tilegx_spr_name (int num); |
1296 | get_tilegx_spr_name (int num); |
1293 | #endif /* !__KERNEL__ && !_LIBC */ |
1297 | #endif /* !__KERNEL__ && !_LIBC */ |
1294 | 1298 | ||
1295 | /* Make a few "tile_" variables to simply common code between |
1299 | /* Make a few "tile_" variables to simply common code between |
1296 | architectures. */ |
1300 | architectures. */ |
1297 | 1301 | ||
1298 | typedef tilegx_bundle_bits tile_bundle_bits; |
1302 | typedef tilegx_bundle_bits tile_bundle_bits; |
1299 | #define TILE_BUNDLE_SIZE_IN_BYTES TILEGX_BUNDLE_SIZE_IN_BYTES |
1303 | #define TILE_BUNDLE_SIZE_IN_BYTES TILEGX_BUNDLE_SIZE_IN_BYTES |
1300 | #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES |
1304 | #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES |
1301 | #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \ |
1305 | #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \ |
1302 | TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES |
1306 | TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES |
- | 1307 | ||
- | 1308 | #ifdef __cplusplus |
|
- | 1309 | } |
|
- | 1310 | #endif |
|
1303 | 1311 | ||
1304 | #endif /* opcode_tilegx_h */><>><>><>=>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><> |
1312 | #endif /* opcode_tilegx_h */><>><>><>=>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><> |