Debian Codegraph @

src/cpu/core_full/support.h

raw symbols SCIP
1 enum {
2 L_N=0,
3 L_SKIP,
4 /* Grouped ones using MOD/RM */
5 L_MODRM,L_MODRM_NVM,L_POPwRM,L_POPdRM,
6
7 L_Ib,L_Iw,L_Id,
8 L_Ibx,L_Iwx,L_Idx, //Sign extend
9 L_Ifw,L_Ifd,
10 L_OP,
11
12 L_REGb,L_REGw,L_REGd,
13 L_REGbIb,L_REGwIw,L_REGdId,
14 L_POPw,L_POPd,
15 L_POPfw,L_POPfd,
16 L_SEG,
17
18 L_INTO,
19
20 L_VAL,
21 L_PRESEG,
22 L_DOUBLE,
23 L_PREOP,L_PREADD,L_PREREP,L_PREREPNE,
24 L_STRING,
25
26 /* Direct ones */
27 D_IRETw,D_IRETd,
28 D_PUSHAw,D_PUSHAd,
29 D_POPAw,D_POPAd,
30 D_POPSEGw,D_POPSEGd,
31 D_DAA,D_DAS,
32 D_AAA,D_AAS,
33 D_CBW,D_CWDE,
34 D_CWD,D_CDQ,
35 D_SETALC,
36 D_XLAT,
37 D_CLI,D_STI,D_STC,D_CLC,D_CMC,D_CLD,D_STD,
38 D_NOP,D_WAIT,
39 D_ENTERw,D_ENTERd,
40 D_LEAVEw,D_LEAVEd,
41
42 D_RETFw,D_RETFd,
43 D_RETFwIw,D_RETFdIw,
44 D_POPF,D_PUSHF,
45 D_SAHF,D_LAHF,
46 D_CPUID,
47 D_HLT,D_CLTS,
48 D_LOCK,D_ICEBP,
49 L_ERROR
50 };
51
52
53 enum {
54 O_N=t_LASTFLAG,
55 O_COND,
56 O_XCHG_AX,O_XCHG_EAX,
57 O_IMULRw,O_IMULRd,
58 O_BOUNDw,O_BOUNDd,
59 O_CALLNw,O_CALLNd,
60 O_CALLFw,O_CALLFd,
61 O_JMPFw,O_JMPFd,
62
63 O_OPAL,O_ALOP,
64 O_OPAX,O_AXOP,
65 O_OPEAX,O_EAXOP,
66 O_INT,
67 O_SEGDS,O_SEGES,O_SEGFS,O_SEGGS,O_SEGSS,
68 O_LOOP,O_LOOPZ,O_LOOPNZ,O_JCXZ,
69 O_INb,O_INw,O_INd,
70 O_OUTb,O_OUTw,O_OUTd,
71
72 O_NOT,O_AAM,O_AAD,
73 O_MULb,O_MULw,O_MULd,
74 O_IMULb,O_IMULw,O_IMULd,
75 O_DIVb,O_DIVw,O_DIVd,
76 O_IDIVb,O_IDIVw,O_IDIVd,
77 O_CBACK,
78
79
80 O_DSHLw,O_DSHLd,
81 O_DSHRw,O_DSHRd,
82 O_C_O ,O_C_NO ,O_C_B ,O_C_NB ,O_C_Z ,O_C_NZ ,O_C_BE ,O_C_NBE,
83 O_C_S ,O_C_NS ,O_C_P ,O_C_NP ,O_C_L ,O_C_NL ,O_C_LE ,O_C_NLE,
84
85 O_GRP6w,O_GRP6d,
86 O_GRP7w,O_GRP7d,
87 O_M_CRx_Rd,O_M_Rd_CRx,
88 O_M_DRx_Rd,O_M_Rd_DRx,
89 O_M_TRx_Rd,O_M_Rd_TRx,
90 O_LAR,O_LSL,
91 O_ARPL,
92
93 O_BTw,O_BTSw,O_BTRw,O_BTCw,
94 O_BTd,O_BTSd,O_BTRd,O_BTCd,
95 O_BSFw,O_BSRw,O_BSFd,O_BSRd,
96
97 O_BSWAPw, O_BSWAPd,
98 O_CMPXCHG,
99 O_FPU
100
101
102 };
103
104 enum {
105 S_N=0,
106 S_C_Eb,
107 S_Eb,S_Gb,S_EbGb,
108 S_Ew,S_Gw,S_EwGw,
109 S_Ed,S_Gd,S_EdGd,S_EdMw,
110
111
112 S_REGb,S_REGw,S_REGd,
113 S_PUSHw,S_PUSHd,
114 S_SEGm,
115 S_SEGGw,S_SEGGd,
116
117
118 S_AIPw,S_C_AIPw,
119 S_AIPd,S_C_AIPd,
120
121 S_IP,S_IPIw
122 };
123
124 enum {
125 R_OUTSB,R_OUTSW,R_OUTSD,
126 R_INSB,R_INSW,R_INSD,
127 R_MOVSB,R_MOVSW,R_MOVSD,
128 R_LODSB,R_LODSW,R_LODSD,
129 R_STOSB,R_STOSW,R_STOSD,
130 R_SCASB,R_SCASW,R_SCASD,
131 R_CMPSB,R_CMPSW,R_CMPSD
132 };
133
134 enum {
135 M_None=0,
136 M_Ebx,M_Eb,M_Gb,M_EbGb,M_GbEb,
137 M_Ewx,M_Ew,M_Gw,M_EwGw,M_GwEw,M_EwxGwx,M_EwGwt,
138 M_Edx,M_Ed,M_Gd,M_EdGd,M_GdEd,M_EdxGdx,M_EdGdt,
139
140 M_EbIb,M_EwIb,M_EdIb,
141 M_EwIw,M_EwIbx,M_EwxIbx,M_EwxIwx,M_EwGwIb,M_EwGwCL,
142 M_EdId,M_EdIbx,M_EdGdIb,M_EdGdCL,
143
144 M_Efw,M_Efd,
145
146 M_Ib,M_Iw,M_Id,
147
148
149 M_SEG,M_EA,
150 M_GRP,
151 M_GRP_Ib,M_GRP_CL,M_GRP_1,
152
153 M_POPw,M_POPd
154 };
155
156 struct OpCode {
157 Bit8u load,op,save,extra;
158 };
159
160 struct FullData {
161 Bitu entry;
162 Bitu rm;
163 EAPoint rm_eaa;
164 Bitu rm_off;
165 Bitu rm_eai;
166 Bitu rm_index;
167 Bitu rm_mod;
168 OpCode code;
169 EAPoint cseip;
170 #ifdef WORDS_BIGENDIAN
171 union {
172 Bit32u dword[1];
173 Bit32s dwords[1];
174 Bit16u word[2];
175 Bit16s words[2];
176 Bit8u byte[4];
177 Bit8s bytes[4];
178 } blah1,blah2,blah_imm;
179 #else
180 union {
181 Bit8u b;Bit8s bs;
182 Bit16u w;Bit16s ws;
183 Bit32u d;Bit32s ds;
184 } op1,op2,imm;
185 #endif
186 Bitu new_flags;
187 struct {
188 EAPoint base;
189 } seg;
190 Bitu cond;
191 bool repz;
192 Bitu prefix;
193 };
194
195 /* Some defines to get the names correct. */
196 #ifdef WORDS_BIGENDIAN
197
198 #define inst_op1_b inst.blah1.byte[3]
199 #define inst_op1_bs inst.blah1.bytes[3]
200 #define inst_op1_w inst.blah1.word[1]
201 #define inst_op1_ws inst.blah1.words[1]
202 #define inst_op1_d inst.blah1.dword[0]
203 #define inst_op1_ds inst.blah1.dwords[0]
204
205 #define inst_op2_b inst.blah2.byte[3]
206 #define inst_op2_bs inst.blah2.bytes[3]
207 #define inst_op2_w inst.blah2.word[1]
208 #define inst_op2_ws inst.blah2.words[1]
209 #define inst_op2_d inst.blah2.dword[0]
210 #define inst_op2_ds inst.blah2.dwords[0]
211
212 #define inst_imm_b inst.blah_imm.byte[3]
213 #define inst_imm_bs inst.blah_imm.bytes[3]
214 #define inst_imm_w inst.blah_imm.word[1]
215 #define inst_imm_ws inst.blah_imm.words[1]
216 #define inst_imm_d inst.blah_imm.dword[0]
217 #define inst_imm_ds inst.blah_imm.dwords[0]
218
219 #else
220
221 #define inst_op1_b inst.op1.b
222 #define inst_op1_bs inst.op1.bs
223 #define inst_op1_w inst.op1.w
224 #define inst_op1_ws inst.op1.ws
225 #define inst_op1_d inst.op1.d
226 #define inst_op1_ds inst.op1.ds
227
228 #define inst_op2_b inst.op2.b
229 #define inst_op2_bs inst.op2.bs
230 #define inst_op2_w inst.op2.w
231 #define inst_op2_ws inst.op2.ws
232 #define inst_op2_d inst.op2.d
233 #define inst_op2_ds inst.op2.ds
234
235 #define inst_imm_b inst.imm.b
236 #define inst_imm_bs inst.imm.bs
237 #define inst_imm_w inst.imm.w
238 #define inst_imm_ws inst.imm.ws
239 #define inst_imm_d inst.imm.d
240 #define inst_imm_ds inst.imm.ds
241
242 #endif
243
244
245 #define PREFIX_NONE 0x0
246 #define PREFIX_ADDR 0x1
247 #define PREFIX_SEG 0x2
248 #define PREFIX_REP 0x4
249