1 | /* $Id: IEMInternal.h 37034 2011-05-10 18:10:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IEM - Internal header file.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___IEMInternal_h
|
---|
19 | #define ___IEMInternal_h
|
---|
20 |
|
---|
21 | #include <VBox/vmm/stam.h>
|
---|
22 | #include <VBox/vmm/cpum.h>
|
---|
23 | #include <VBox/param.h>
|
---|
24 |
|
---|
25 |
|
---|
26 | RT_C_DECLS_BEGIN
|
---|
27 |
|
---|
28 |
|
---|
29 | /** @defgroup grp_iem_int Internals
|
---|
30 | * @ingroup grp_iem
|
---|
31 | * @internal
|
---|
32 | * @{
|
---|
33 | */
|
---|
34 |
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Operand or addressing mode.
|
---|
38 | */
|
---|
39 | typedef enum IEMMODE
|
---|
40 | {
|
---|
41 | IEMMODE_16BIT = 0,
|
---|
42 | IEMMODE_32BIT,
|
---|
43 | IEMMODE_64BIT
|
---|
44 | } IEMMODE;
|
---|
45 | AssertCompileSize(IEMMODE, 4);
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Extended operand mode that includes a representation of 8-bit.
|
---|
49 | *
|
---|
50 | * This is used for packing down modes when invoking some C instruction
|
---|
51 | * implementations.
|
---|
52 | */
|
---|
53 | typedef enum IEMMODEX
|
---|
54 | {
|
---|
55 | IEMMODEX_16BIT = IEMMODE_16BIT,
|
---|
56 | IEMMODEX_32BIT = IEMMODE_32BIT,
|
---|
57 | IEMMODEX_64BIT = IEMMODE_64BIT,
|
---|
58 | IEMMODEX_8BIT
|
---|
59 | } IEMMODEX;
|
---|
60 | AssertCompileSize(IEMMODEX, 4);
|
---|
61 |
|
---|
62 |
|
---|
63 | #ifdef IEM_VERIFICATION_MODE
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Verification event type.
|
---|
67 | */
|
---|
68 | typedef enum IEMVERIFYEVENT
|
---|
69 | {
|
---|
70 | IEMVERIFYEVENT_INVALID = 0,
|
---|
71 | IEMVERIFYEVENT_IOPORT_READ,
|
---|
72 | IEMVERIFYEVENT_IOPORT_WRITE,
|
---|
73 | IEMVERIFYEVENT_RAM_WRITE,
|
---|
74 | IEMVERIFYEVENT_RAM_READ
|
---|
75 | } IEMVERIFYEVENT;
|
---|
76 |
|
---|
77 | /** Checks if the event type is a RAM read or write. */
|
---|
78 | # define IEMVERIFYEVENT_IS_RAM(a_enmType) ((a_enmType) == IEMVERIFYEVENT_RAM_WRITE || (a_enmType) == IEMVERIFYEVENT_RAM_READ)
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * Verification event record.
|
---|
82 | */
|
---|
83 | typedef struct IEMVERIFYEVTREC
|
---|
84 | {
|
---|
85 | /** Pointer to the next record in the list. */
|
---|
86 | struct IEMVERIFYEVTREC *pNext;
|
---|
87 | /** The event type. */
|
---|
88 | IEMVERIFYEVENT enmEvent;
|
---|
89 | /** The event data. */
|
---|
90 | union
|
---|
91 | {
|
---|
92 | /** IEMVERIFYEVENT_IOPORT_READ */
|
---|
93 | struct
|
---|
94 | {
|
---|
95 | RTIOPORT Port;
|
---|
96 | uint32_t cbValue;
|
---|
97 | } IOPortRead;
|
---|
98 |
|
---|
99 | /** IEMVERIFYEVENT_IOPORT_WRITE */
|
---|
100 | struct
|
---|
101 | {
|
---|
102 | RTIOPORT Port;
|
---|
103 | uint32_t cbValue;
|
---|
104 | uint32_t u32Value;
|
---|
105 | } IOPortWrite;
|
---|
106 |
|
---|
107 | /** IEMVERIFYEVENT_RAM_READ */
|
---|
108 | struct
|
---|
109 | {
|
---|
110 | RTGCPHYS GCPhys;
|
---|
111 | uint32_t cb;
|
---|
112 | } RamRead;
|
---|
113 |
|
---|
114 | /** IEMVERIFYEVENT_RAM_WRITE */
|
---|
115 | struct
|
---|
116 | {
|
---|
117 | RTGCPHYS GCPhys;
|
---|
118 | uint32_t cb;
|
---|
119 | uint8_t ab[32];
|
---|
120 | } RamWrite;
|
---|
121 | } u;
|
---|
122 | } IEMVERIFYEVTREC;
|
---|
123 | /** Pointer to an IEM event verification records. */
|
---|
124 | typedef IEMVERIFYEVTREC *PIEMVERIFYEVTREC;
|
---|
125 |
|
---|
126 | #endif /* IEM_VERIFICATION_MODE */
|
---|
127 |
|
---|
128 |
|
---|
129 | /**
|
---|
130 | * The per-CPU IEM state.
|
---|
131 | */
|
---|
132 | typedef struct IEMCPU
|
---|
133 | {
|
---|
134 | /** Pointer to the CPU context - ring-3 contex. */
|
---|
135 | R3PTRTYPE(PCPUMCTX) pCtxR3;
|
---|
136 | /** Pointer to the CPU context - ring-0 contex. */
|
---|
137 | R0PTRTYPE(PCPUMCTX) pCtxR0;
|
---|
138 | /** Pointer to the CPU context - raw-mode contex. */
|
---|
139 | RCPTRTYPE(PCPUMCTX) pCtxRC;
|
---|
140 |
|
---|
141 | /** Offset of the VMCPU structure relative to this structure (negative). */
|
---|
142 | int32_t offVMCpu;
|
---|
143 | /** Offset of the VM structure relative to this structure (negative). */
|
---|
144 | int32_t offVM;
|
---|
145 |
|
---|
146 | /** Whether to bypass access handlers or not. */
|
---|
147 | bool fByPassHandlers;
|
---|
148 | /** Explicit alignment padding. */
|
---|
149 | bool afAlignment0[4];
|
---|
150 |
|
---|
151 | /** Exception / interrupt recursion depth. */
|
---|
152 | int8_t cXcptRecursions;
|
---|
153 | /** The current exception / interrupt . */
|
---|
154 | uint8_t uCurXcpt;
|
---|
155 | /** The CPL. */
|
---|
156 | uint8_t uCpl;
|
---|
157 | /** The current CPU execution mode (CS). */
|
---|
158 | IEMMODE enmCpuMode;
|
---|
159 |
|
---|
160 | /** @name Statistics
|
---|
161 | * @{ */
|
---|
162 | /** The number of instructions we've executed. */
|
---|
163 | uint32_t cInstructions;
|
---|
164 | /** The number of potential exits. */
|
---|
165 | uint32_t cPotentialExits;
|
---|
166 | #ifdef IEM_VERIFICATION_MODE
|
---|
167 | /** The Number of I/O port reads that has been performed. */
|
---|
168 | uint32_t cIOReads;
|
---|
169 | /** The Number of I/O port writes that has been performed. */
|
---|
170 | uint32_t cIOWrites;
|
---|
171 | /** Set if no comparison to REM is currently performed.
|
---|
172 | * This is used to skip past really slow bits. */
|
---|
173 | bool fNoRem;
|
---|
174 | bool afAlignment1[3];
|
---|
175 | /** Mask of undefined eflags.
|
---|
176 | * The verifier will any difference in these flags. */
|
---|
177 | uint32_t fUndefinedEFlags;
|
---|
178 | /** The physical address corresponding to abOpcodes[0]. */
|
---|
179 | RTGCPHYS GCPhysOpcodes;
|
---|
180 | #endif
|
---|
181 | /** @} */
|
---|
182 |
|
---|
183 | /** @name Decoder state.
|
---|
184 | * @{ */
|
---|
185 |
|
---|
186 | /** The default addressing mode . */
|
---|
187 | IEMMODE enmDefAddrMode;
|
---|
188 | /** The effective addressing mode . */
|
---|
189 | IEMMODE enmEffAddrMode;
|
---|
190 | /** The default operand mode . */
|
---|
191 | IEMMODE enmDefOpSize;
|
---|
192 | /** The effective operand mode . */
|
---|
193 | IEMMODE enmEffOpSize;
|
---|
194 |
|
---|
195 | /** The prefix mask (IEM_OP_PRF_XXX). */
|
---|
196 | uint32_t fPrefixes;
|
---|
197 | /** The extra REX ModR/M register field bit (REX.R << 3). */
|
---|
198 | uint8_t uRexReg;
|
---|
199 | /** The extra REX ModR/M r/m field, SIB base and opcode reg bit
|
---|
200 | * (REX.B << 3). */
|
---|
201 | uint8_t uRexB;
|
---|
202 | /** The extra REX SIB index field bit (REX.X << 3). */
|
---|
203 | uint8_t uRexIndex;
|
---|
204 | /** The effective segment register (X86_SREG_XXX). */
|
---|
205 | uint8_t iEffSeg;
|
---|
206 |
|
---|
207 | /** The current offset into abOpcodes. */
|
---|
208 | uint8_t offOpcode;
|
---|
209 | /** The size of what has currently been fetched into abOpcodes. */
|
---|
210 | uint8_t cbOpcode;
|
---|
211 | /** The opcode bytes. */
|
---|
212 | uint8_t abOpcode[15];
|
---|
213 |
|
---|
214 | /** @}*/
|
---|
215 |
|
---|
216 | /** Alignment padding for aMemMappings. */
|
---|
217 | uint8_t abAlignment2[5];
|
---|
218 |
|
---|
219 | /** The number of active guest memory mappings. */
|
---|
220 | uint8_t cActiveMappings;
|
---|
221 | /** The next unused mapping index. */
|
---|
222 | uint8_t iNextMapping;
|
---|
223 | /** Records for tracking guest memory mappings. */
|
---|
224 | struct
|
---|
225 | {
|
---|
226 | /** The address of the mapped bytes. */
|
---|
227 | void *pv;
|
---|
228 | #if defined(IN_RC) && HC_ARCH_BITS == 64
|
---|
229 | uint32_t u32Alignment3; /**< Alignment padding. */
|
---|
230 | #endif
|
---|
231 | /** The access flags (IEM_ACCESS_XXX).
|
---|
232 | * IEM_ACCESS_INVALID if the entry is unused. */
|
---|
233 | uint32_t fAccess;
|
---|
234 | #if HC_ARCH_BITS == 64
|
---|
235 | uint32_t u32Alignment4; /**< Alignment padding. */
|
---|
236 | #endif
|
---|
237 | } aMemMappings[3];
|
---|
238 |
|
---|
239 | /** Bounce buffer info.
|
---|
240 | * This runs in parallel to aMemMappings. */
|
---|
241 | struct
|
---|
242 | {
|
---|
243 | /** The physical address of the first byte. */
|
---|
244 | RTGCPHYS GCPhysFirst;
|
---|
245 | /** The physical address of the second page. */
|
---|
246 | RTGCPHYS GCPhysSecond;
|
---|
247 | /** The number of bytes in the first page. */
|
---|
248 | uint16_t cbFirst;
|
---|
249 | /** The number of bytes in the second page. */
|
---|
250 | uint16_t cbSecond;
|
---|
251 | /** Whether it's unassigned memory. */
|
---|
252 | bool fUnassigned;
|
---|
253 | /** Explicit alignment padding. */
|
---|
254 | bool afAlignment5[3];
|
---|
255 | } aMemBbMappings[3];
|
---|
256 |
|
---|
257 | /** Bounce buffer storage.
|
---|
258 | * This runs in parallel to aMemMappings and aMemBbMappings. */
|
---|
259 | struct
|
---|
260 | {
|
---|
261 | uint8_t ab[64];
|
---|
262 | } aBounceBuffers[3];
|
---|
263 |
|
---|
264 | #ifdef IEM_VERIFICATION_MODE
|
---|
265 | /** The event verification records for what IEM did (LIFO). */
|
---|
266 | R3PTRTYPE(PIEMVERIFYEVTREC) pIemEvtRecHead;
|
---|
267 | /** Insertion point for pIemEvtRecHead. */
|
---|
268 | R3PTRTYPE(PIEMVERIFYEVTREC *) ppIemEvtRecNext;
|
---|
269 | /** The event verification records for what the other party did (FIFO). */
|
---|
270 | R3PTRTYPE(PIEMVERIFYEVTREC) pOtherEvtRecHead;
|
---|
271 | /** Insertion point for pOtherEvtRecHead. */
|
---|
272 | R3PTRTYPE(PIEMVERIFYEVTREC *) ppOtherEvtRecNext;
|
---|
273 | /** List of free event records. */
|
---|
274 | R3PTRTYPE(PIEMVERIFYEVTREC) pFreeEvtRec;
|
---|
275 | #endif
|
---|
276 | } IEMCPU;
|
---|
277 | /** Pointer to the per-CPU IEM state. */
|
---|
278 | typedef IEMCPU *PIEMCPU;
|
---|
279 |
|
---|
280 | /** Converts a IEMCPU pointer to a VMCPU pointer.
|
---|
281 | * @returns VMCPU pointer.
|
---|
282 | * @param a_pIemCpu The IEM per CPU instance data.
|
---|
283 | */
|
---|
284 | #define IEMCPU_TO_VMCPU(a_pIemCpu) ((PVMCPU)( (uintptr_t)(a_pIemCpu) + a_pIemCpu->offVMCpu ))
|
---|
285 |
|
---|
286 | /** Converts a IEMCPU pointer to a VM pointer.
|
---|
287 | * @returns VM pointer.
|
---|
288 | * @param a_pIemCpu The IEM per CPU instance data.
|
---|
289 | */
|
---|
290 | #define IEMCPU_TO_VM(a_pIemCpu) ((PVM)( (uintptr_t)(a_pIemCpu) + a_pIemCpu->offVM ))
|
---|
291 |
|
---|
292 | /** @name IEM_ACCESS_XXX - Access details.
|
---|
293 | * @{ */
|
---|
294 | #define IEM_ACCESS_INVALID UINT32_C(0x000000ff)
|
---|
295 | #define IEM_ACCESS_TYPE_READ UINT32_C(0x00000001)
|
---|
296 | #define IEM_ACCESS_TYPE_WRITE UINT32_C(0x00000002)
|
---|
297 | #define IEM_ACCESS_TYPE_EXEC UINT32_C(0x00000004)
|
---|
298 | #define IEM_ACCESS_TYPE_MASK UINT32_C(0x00000007)
|
---|
299 | #define IEM_ACCESS_WHAT_CODE UINT32_C(0x00000010)
|
---|
300 | #define IEM_ACCESS_WHAT_DATA UINT32_C(0x00000020)
|
---|
301 | #define IEM_ACCESS_WHAT_STACK UINT32_C(0x00000030)
|
---|
302 | #define IEM_ACCESS_WHAT_SYS UINT32_C(0x00000040)
|
---|
303 | #define IEM_ACCESS_WHAT_MASK UINT32_C(0x00000070)
|
---|
304 | /** Used in aMemMappings to indicate that the entry is bounce buffered. */
|
---|
305 | #define IEM_ACCESS_BOUNCE_BUFFERED UINT32_C(0x00000100)
|
---|
306 | /** Read+write data alias. */
|
---|
307 | #define IEM_ACCESS_DATA_RW (IEM_ACCESS_TYPE_READ | IEM_ACCESS_TYPE_WRITE | IEM_ACCESS_WHAT_DATA)
|
---|
308 | /** Write data alias. */
|
---|
309 | #define IEM_ACCESS_DATA_W (IEM_ACCESS_TYPE_WRITE | IEM_ACCESS_WHAT_DATA)
|
---|
310 | /** Read data alias. */
|
---|
311 | #define IEM_ACCESS_DATA_R (IEM_ACCESS_TYPE_READ | IEM_ACCESS_WHAT_DATA)
|
---|
312 | /** Instruction fetch alias. */
|
---|
313 | #define IEM_ACCESS_INSTRUCTION (IEM_ACCESS_TYPE_EXEC | IEM_ACCESS_WHAT_CODE)
|
---|
314 | /** Stack write alias. */
|
---|
315 | #define IEM_ACCESS_STACK_W (IEM_ACCESS_TYPE_WRITE | IEM_ACCESS_WHAT_STACK)
|
---|
316 | /** Stack read alias. */
|
---|
317 | #define IEM_ACCESS_STACK_R (IEM_ACCESS_TYPE_READ | IEM_ACCESS_WHAT_STACK)
|
---|
318 | /** @} */
|
---|
319 |
|
---|
320 | /** @name Prefix constants (IEMCPU::fPrefixes)
|
---|
321 | * @{ */
|
---|
322 | #define IEM_OP_PRF_SEG_CS RT_BIT_32(0)
|
---|
323 | #define IEM_OP_PRF_SEG_SS RT_BIT_32(1)
|
---|
324 | #define IEM_OP_PRF_SEG_DS RT_BIT_32(2)
|
---|
325 | #define IEM_OP_PRF_SEG_ES RT_BIT_32(3)
|
---|
326 | #define IEM_OP_PRF_SEG_FS RT_BIT_32(4)
|
---|
327 | #define IEM_OP_PRF_SEG_GS RT_BIT_32(5)
|
---|
328 | #define IEM_OP_PRF_SEG_MASK UINT32_C(0x3f)
|
---|
329 |
|
---|
330 | #define IEM_OP_PRF_SIZE_OP RT_BIT_32(8)
|
---|
331 | #define IEM_OP_PRF_SIZE_REX_W RT_BIT_32(9)
|
---|
332 | #define IEM_OP_PRF_SIZE_ADDR RT_BIT_32(10)
|
---|
333 |
|
---|
334 | #define IEM_OP_PRF_LOCK RT_BIT_32(16)
|
---|
335 | #define IEM_OP_PRF_REPNZ RT_BIT_32(17)
|
---|
336 | #define IEM_OP_PRF_REPZ RT_BIT_32(18)
|
---|
337 |
|
---|
338 | #define IEM_OP_PRF_REX RT_BIT_32(24)
|
---|
339 | #define IEM_OP_PRF_REX_R RT_BIT_32(25)
|
---|
340 | #define IEM_OP_PRF_REX_B RT_BIT_32(26)
|
---|
341 | #define IEM_OP_PRF_REX_X RT_BIT_32(27)
|
---|
342 | /** @} */
|
---|
343 |
|
---|
344 | /**
|
---|
345 | * Tests if verification mode is enabled.
|
---|
346 | *
|
---|
347 | * This expands to @c false when IEM_VERIFICATION_MODE is not defined and
|
---|
348 | * should therefore cause the compiler to eliminate the verification branch
|
---|
349 | * of an if statement. */
|
---|
350 | #ifdef IEM_VERIFICATION_MODE
|
---|
351 | # define IEM_VERIFICATION_ENABLED(a_pIemCpu) (!(a_pIemCpu)->fNoRem)
|
---|
352 | #else
|
---|
353 | # define IEM_VERIFICATION_ENABLED(a_pIemCpu) (false)
|
---|
354 | #endif
|
---|
355 |
|
---|
356 | /**
|
---|
357 | * Indicates to the verifier that the given flag set is undefined.
|
---|
358 | *
|
---|
359 | * Can be invoked again to add more flags.
|
---|
360 | *
|
---|
361 | * This is a NOOP if the verifier isn't compiled in.
|
---|
362 | */
|
---|
363 | #ifdef IEM_VERIFICATION_MODE
|
---|
364 | # define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { pIemCpu->fUndefinedEFlags |= (a_fEfl); } while (0)
|
---|
365 | #else
|
---|
366 | # define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { } while (0)
|
---|
367 | #endif
|
---|
368 |
|
---|
369 |
|
---|
370 | /** @def IEM_DECL_IMPL_TYPE
|
---|
371 | * For typedef'ing an instruction implementation function.
|
---|
372 | *
|
---|
373 | * @param a_RetType The return type.
|
---|
374 | * @param a_Name The name of the type.
|
---|
375 | * @param a_ArgList The argument list enclosed in parentheses.
|
---|
376 | */
|
---|
377 |
|
---|
378 | /** @def IEM_DECL_IMPL_DEF
|
---|
379 | * For defining an instruction implementation function.
|
---|
380 | *
|
---|
381 | * @param a_RetType The return type.
|
---|
382 | * @param a_Name The name of the type.
|
---|
383 | * @param a_ArgList The argument list enclosed in parentheses.
|
---|
384 | */
|
---|
385 |
|
---|
386 | #if defined(__GNUC__) && defined(RT_ARCH_X86)
|
---|
387 | # define IEM_DECL_IMPL_TYPE(a_RetType, a_Name, a_ArgList) \
|
---|
388 | __attribute__((__fastcall__)) a_RetType (a_Name) a_ArgList
|
---|
389 | # define IEM_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) \
|
---|
390 | __attribute__((__fastcall__, __nothrow__)) a_RetType a_Name a_ArgList
|
---|
391 |
|
---|
392 | #elif defined(_MSC_VER) && defined(RT_ARCH_X86)
|
---|
393 | # define IEM_DECL_IMPL_TYPE(a_RetType, a_Name, a_ArgList) \
|
---|
394 | a_RetType (__fastcall a_Name) a_ArgList
|
---|
395 | # define IEM_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) \
|
---|
396 | a_RetType __fastcall a_Name a_ArgList
|
---|
397 |
|
---|
398 | #else
|
---|
399 | # define IEM_DECL_IMPL_TYPE(a_RetType, a_Name, a_ArgList) \
|
---|
400 | a_RetType (VBOXCALL a_Name) a_ArgList
|
---|
401 | # define IEM_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) \
|
---|
402 | a_RetType VBOXCALL a_Name a_ArgList
|
---|
403 |
|
---|
404 | #endif
|
---|
405 |
|
---|
406 | /** @name Arithmetic assignment operations on bytes (binary).
|
---|
407 | * @{ */
|
---|
408 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINU8, (uint8_t *pu8Dst, uint8_t u8Src, uint32_t *pEFlags));
|
---|
409 | typedef FNIEMAIMPLBINU8 *PFNIEMAIMPLBINU8;
|
---|
410 | FNIEMAIMPLBINU8 iemAImpl_add_u8, iemAImpl_add_u8_locked;
|
---|
411 | FNIEMAIMPLBINU8 iemAImpl_adc_u8, iemAImpl_adc_u8_locked;
|
---|
412 | FNIEMAIMPLBINU8 iemAImpl_sub_u8, iemAImpl_sub_u8_locked;
|
---|
413 | FNIEMAIMPLBINU8 iemAImpl_sbb_u8, iemAImpl_sbb_u8_locked;
|
---|
414 | FNIEMAIMPLBINU8 iemAImpl_or_u8, iemAImpl_or_u8_locked;
|
---|
415 | FNIEMAIMPLBINU8 iemAImpl_xor_u8, iemAImpl_xor_u8_locked;
|
---|
416 | FNIEMAIMPLBINU8 iemAImpl_and_u8, iemAImpl_and_u8_locked;
|
---|
417 | /** @} */
|
---|
418 |
|
---|
419 | /** @name Arithmetic assignment operations on words (binary).
|
---|
420 | * @{ */
|
---|
421 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINU16, (uint16_t *pu16Dst, uint16_t u16Src, uint32_t *pEFlags));
|
---|
422 | typedef FNIEMAIMPLBINU16 *PFNIEMAIMPLBINU16;
|
---|
423 | FNIEMAIMPLBINU16 iemAImpl_add_u16, iemAImpl_add_u16_locked;
|
---|
424 | FNIEMAIMPLBINU16 iemAImpl_adc_u16, iemAImpl_adc_u16_locked;
|
---|
425 | FNIEMAIMPLBINU16 iemAImpl_sub_u16, iemAImpl_sub_u16_locked;
|
---|
426 | FNIEMAIMPLBINU16 iemAImpl_sbb_u16, iemAImpl_sbb_u16_locked;
|
---|
427 | FNIEMAIMPLBINU16 iemAImpl_or_u16, iemAImpl_or_u16_locked;
|
---|
428 | FNIEMAIMPLBINU16 iemAImpl_xor_u16, iemAImpl_xor_u16_locked;
|
---|
429 | FNIEMAIMPLBINU16 iemAImpl_and_u16, iemAImpl_and_u16_locked;
|
---|
430 | /** @} */
|
---|
431 |
|
---|
432 | /** @name Arithmetic assignment operations on double words (binary).
|
---|
433 | * @{ */
|
---|
434 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINU32, (uint32_t *pu32Dst, uint32_t u32Src, uint32_t *pEFlags));
|
---|
435 | typedef FNIEMAIMPLBINU32 *PFNIEMAIMPLBINU32;
|
---|
436 | FNIEMAIMPLBINU32 iemAImpl_add_u32, iemAImpl_add_u32_locked;
|
---|
437 | FNIEMAIMPLBINU32 iemAImpl_adc_u32, iemAImpl_adc_u32_locked;
|
---|
438 | FNIEMAIMPLBINU32 iemAImpl_sub_u32, iemAImpl_sub_u32_locked;
|
---|
439 | FNIEMAIMPLBINU32 iemAImpl_sbb_u32, iemAImpl_sbb_u32_locked;
|
---|
440 | FNIEMAIMPLBINU32 iemAImpl_or_u32, iemAImpl_or_u32_locked;
|
---|
441 | FNIEMAIMPLBINU32 iemAImpl_xor_u32, iemAImpl_xor_u32_locked;
|
---|
442 | FNIEMAIMPLBINU32 iemAImpl_and_u32, iemAImpl_and_u32_locked;
|
---|
443 | /** @} */
|
---|
444 |
|
---|
445 | /** @name Arithmetic assignment operations on quad words (binary).
|
---|
446 | * @{ */
|
---|
447 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINU64, (uint64_t *pu64Dst, uint64_t u64Src, uint32_t *pEFlags));
|
---|
448 | typedef FNIEMAIMPLBINU64 *PFNIEMAIMPLBINU64;
|
---|
449 | FNIEMAIMPLBINU64 iemAImpl_add_u64, iemAImpl_add_u64_locked;
|
---|
450 | FNIEMAIMPLBINU64 iemAImpl_adc_u64, iemAImpl_adc_u64_locked;
|
---|
451 | FNIEMAIMPLBINU64 iemAImpl_sub_u64, iemAImpl_sub_u64_locked;
|
---|
452 | FNIEMAIMPLBINU64 iemAImpl_sbb_u64, iemAImpl_sbb_u64_locked;
|
---|
453 | FNIEMAIMPLBINU64 iemAImpl_or_u64, iemAImpl_or_u64_locked;
|
---|
454 | FNIEMAIMPLBINU64 iemAImpl_xor_u64, iemAImpl_xor_u64_locked;
|
---|
455 | FNIEMAIMPLBINU64 iemAImpl_and_u64, iemAImpl_and_u64_locked;
|
---|
456 | /** @} */
|
---|
457 |
|
---|
458 | /** @name Compare operations (thrown in with the binary ops).
|
---|
459 | * @{ */
|
---|
460 | FNIEMAIMPLBINU8 iemAImpl_cmp_u8;
|
---|
461 | FNIEMAIMPLBINU16 iemAImpl_cmp_u16;
|
---|
462 | FNIEMAIMPLBINU32 iemAImpl_cmp_u32;
|
---|
463 | FNIEMAIMPLBINU64 iemAImpl_cmp_u64;
|
---|
464 | /** @} */
|
---|
465 |
|
---|
466 | /** @name Test operations (thrown in with the binary ops).
|
---|
467 | * @{ */
|
---|
468 | FNIEMAIMPLBINU8 iemAImpl_test_u8;
|
---|
469 | FNIEMAIMPLBINU16 iemAImpl_test_u16;
|
---|
470 | FNIEMAIMPLBINU32 iemAImpl_test_u32;
|
---|
471 | FNIEMAIMPLBINU64 iemAImpl_test_u64;
|
---|
472 | /** @} */
|
---|
473 |
|
---|
474 | /** @name Bit operations operations (thrown in with the binary ops).
|
---|
475 | * @{ */
|
---|
476 | FNIEMAIMPLBINU16 iemAImpl_bt_u16, iemAImpl_bt_u16_locked;
|
---|
477 | FNIEMAIMPLBINU32 iemAImpl_bt_u32, iemAImpl_bt_u32_locked;
|
---|
478 | FNIEMAIMPLBINU64 iemAImpl_bt_u64, iemAImpl_bt_u64_locked;
|
---|
479 | FNIEMAIMPLBINU16 iemAImpl_btc_u16, iemAImpl_btc_u16_locked;
|
---|
480 | FNIEMAIMPLBINU32 iemAImpl_btc_u32, iemAImpl_btc_u32_locked;
|
---|
481 | FNIEMAIMPLBINU64 iemAImpl_btc_u64, iemAImpl_btc_u64_locked;
|
---|
482 | FNIEMAIMPLBINU16 iemAImpl_btr_u16, iemAImpl_btr_u16_locked;
|
---|
483 | FNIEMAIMPLBINU32 iemAImpl_btr_u32, iemAImpl_btr_u32_locked;
|
---|
484 | FNIEMAIMPLBINU64 iemAImpl_btr_u64, iemAImpl_btr_u64_locked;
|
---|
485 | FNIEMAIMPLBINU16 iemAImpl_bts_u16, iemAImpl_bts_u16_locked;
|
---|
486 | FNIEMAIMPLBINU32 iemAImpl_bts_u32, iemAImpl_bts_u32_locked;
|
---|
487 | FNIEMAIMPLBINU64 iemAImpl_bts_u64, iemAImpl_bts_u64_locked;
|
---|
488 | /** @} */
|
---|
489 |
|
---|
490 | /** @name Exchange memory with register operations.
|
---|
491 | * @{ */
|
---|
492 | IEM_DECL_IMPL_DEF(void, iemAImpl_xchg_u8, (uint8_t *pu8Mem, uint8_t *pu8Reg));
|
---|
493 | IEM_DECL_IMPL_DEF(void, iemAImpl_xchg_u16,(uint16_t *pu16Mem, uint16_t *pu16Reg));
|
---|
494 | IEM_DECL_IMPL_DEF(void, iemAImpl_xchg_u32,(uint32_t *pu32Mem, uint32_t *pu32Reg));
|
---|
495 | IEM_DECL_IMPL_DEF(void, iemAImpl_xchg_u64,(uint64_t *pu64Mem, uint64_t *pu64Reg));
|
---|
496 | /** @} */
|
---|
497 |
|
---|
498 | /** @name Double precision shifts
|
---|
499 | * @{ */
|
---|
500 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTDBLU16,(uint16_t *pu16Dst, uint16_t u16Src, uint8_t cShift, uint32_t *pEFlags));
|
---|
501 | typedef FNIEMAIMPLSHIFTDBLU16 *PFNIEMAIMPLSHIFTDBLU16;
|
---|
502 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTDBLU32,(uint32_t *pu32Dst, uint32_t u32Src, uint8_t cShift, uint32_t *pEFlags));
|
---|
503 | typedef FNIEMAIMPLSHIFTDBLU32 *PFNIEMAIMPLSHIFTDBLU32;
|
---|
504 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTDBLU64,(uint64_t *pu64Dst, uint64_t u64Src, uint8_t cShift, uint32_t *pEFlags));
|
---|
505 | typedef FNIEMAIMPLSHIFTDBLU64 *PFNIEMAIMPLSHIFTDBLU64;
|
---|
506 | FNIEMAIMPLSHIFTDBLU16 iemAImpl_shld_u16;
|
---|
507 | FNIEMAIMPLSHIFTDBLU32 iemAImpl_shld_u32;
|
---|
508 | FNIEMAIMPLSHIFTDBLU64 iemAImpl_shld_u64;
|
---|
509 | FNIEMAIMPLSHIFTDBLU16 iemAImpl_shrd_u16;
|
---|
510 | FNIEMAIMPLSHIFTDBLU32 iemAImpl_shrd_u32;
|
---|
511 | FNIEMAIMPLSHIFTDBLU64 iemAImpl_shrd_u64;
|
---|
512 | /** @} */
|
---|
513 |
|
---|
514 |
|
---|
515 | /** @name Bit search operations (thrown in with the binary ops).
|
---|
516 | * @{ */
|
---|
517 | FNIEMAIMPLBINU16 iemAImpl_bsf_u16;
|
---|
518 | FNIEMAIMPLBINU32 iemAImpl_bsf_u32;
|
---|
519 | FNIEMAIMPLBINU64 iemAImpl_bsf_u64;
|
---|
520 | FNIEMAIMPLBINU16 iemAImpl_bsr_u16;
|
---|
521 | FNIEMAIMPLBINU32 iemAImpl_bsr_u32;
|
---|
522 | FNIEMAIMPLBINU64 iemAImpl_bsr_u64;
|
---|
523 | /** @} */
|
---|
524 |
|
---|
525 | /** @name Signed multiplication operations (thrown in with the binary ops).
|
---|
526 | * @{ */
|
---|
527 | FNIEMAIMPLBINU16 iemAImpl_imul_two_u16;
|
---|
528 | FNIEMAIMPLBINU32 iemAImpl_imul_two_u32;
|
---|
529 | FNIEMAIMPLBINU64 iemAImpl_imul_two_u64;
|
---|
530 | /** @} */
|
---|
531 |
|
---|
532 | /** @name Arithmetic assignment operations on bytes (unary).
|
---|
533 | * @{ */
|
---|
534 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLUNARYU8, (uint8_t *pu8Dst, uint32_t *pEFlags));
|
---|
535 | typedef FNIEMAIMPLUNARYU8 *PFNIEMAIMPLUNARYU8;
|
---|
536 | FNIEMAIMPLUNARYU8 iemAImpl_inc_u8, iemAImpl_inc_u8_locked;
|
---|
537 | FNIEMAIMPLUNARYU8 iemAImpl_dec_u8, iemAImpl_dec_u8_locked;
|
---|
538 | FNIEMAIMPLUNARYU8 iemAImpl_not_u8, iemAImpl_not_u8_locked;
|
---|
539 | FNIEMAIMPLUNARYU8 iemAImpl_neg_u8, iemAImpl_neg_u8_locked;
|
---|
540 | /** @} */
|
---|
541 |
|
---|
542 | /** @name Arithmetic assignment operations on words (unary).
|
---|
543 | * @{ */
|
---|
544 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLUNARYU16, (uint16_t *pu16Dst, uint32_t *pEFlags));
|
---|
545 | typedef FNIEMAIMPLUNARYU16 *PFNIEMAIMPLUNARYU16;
|
---|
546 | FNIEMAIMPLUNARYU16 iemAImpl_inc_u16, iemAImpl_inc_u16_locked;
|
---|
547 | FNIEMAIMPLUNARYU16 iemAImpl_dec_u16, iemAImpl_dec_u16_locked;
|
---|
548 | FNIEMAIMPLUNARYU16 iemAImpl_not_u16, iemAImpl_not_u16_locked;
|
---|
549 | FNIEMAIMPLUNARYU16 iemAImpl_neg_u16, iemAImpl_neg_u16_locked;
|
---|
550 | /** @} */
|
---|
551 |
|
---|
552 | /** @name Arithmetic assignment operations on double words (unary).
|
---|
553 | * @{ */
|
---|
554 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLUNARYU32, (uint32_t *pu32Dst, uint32_t *pEFlags));
|
---|
555 | typedef FNIEMAIMPLUNARYU32 *PFNIEMAIMPLUNARYU32;
|
---|
556 | FNIEMAIMPLUNARYU32 iemAImpl_inc_u32, iemAImpl_inc_u32_locked;
|
---|
557 | FNIEMAIMPLUNARYU32 iemAImpl_dec_u32, iemAImpl_dec_u32_locked;
|
---|
558 | FNIEMAIMPLUNARYU32 iemAImpl_not_u32, iemAImpl_not_u32_locked;
|
---|
559 | FNIEMAIMPLUNARYU32 iemAImpl_neg_u32, iemAImpl_neg_u32_locked;
|
---|
560 | /** @} */
|
---|
561 |
|
---|
562 | /** @name Arithmetic assignment operations on quad words (unary).
|
---|
563 | * @{ */
|
---|
564 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLUNARYU64, (uint64_t *pu64Dst, uint32_t *pEFlags));
|
---|
565 | typedef FNIEMAIMPLUNARYU64 *PFNIEMAIMPLUNARYU64;
|
---|
566 | FNIEMAIMPLUNARYU64 iemAImpl_inc_u64, iemAImpl_inc_u64_locked;
|
---|
567 | FNIEMAIMPLUNARYU64 iemAImpl_dec_u64, iemAImpl_dec_u64_locked;
|
---|
568 | FNIEMAIMPLUNARYU64 iemAImpl_not_u64, iemAImpl_not_u64_locked;
|
---|
569 | FNIEMAIMPLUNARYU64 iemAImpl_neg_u64, iemAImpl_neg_u64_locked;
|
---|
570 | /** @} */
|
---|
571 |
|
---|
572 |
|
---|
573 | /** @name Shift operations on bytes (Group 2).
|
---|
574 | * @{ */
|
---|
575 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTU8,(uint8_t *pu8Dst, uint8_t cShift, uint32_t *pEFlags));
|
---|
576 | typedef FNIEMAIMPLSHIFTU8 *PFNIEMAIMPLSHIFTU8;
|
---|
577 | FNIEMAIMPLSHIFTU8 iemAImpl_rol_u8;
|
---|
578 | FNIEMAIMPLSHIFTU8 iemAImpl_ror_u8;
|
---|
579 | FNIEMAIMPLSHIFTU8 iemAImpl_rcl_u8;
|
---|
580 | FNIEMAIMPLSHIFTU8 iemAImpl_rcr_u8;
|
---|
581 | FNIEMAIMPLSHIFTU8 iemAImpl_shl_u8;
|
---|
582 | FNIEMAIMPLSHIFTU8 iemAImpl_shr_u8;
|
---|
583 | FNIEMAIMPLSHIFTU8 iemAImpl_sar_u8;
|
---|
584 | /** @} */
|
---|
585 |
|
---|
586 | /** @name Shift operations on words (Group 2).
|
---|
587 | * @{ */
|
---|
588 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTU16,(uint16_t *pu16Dst, uint8_t cShift, uint32_t *pEFlags));
|
---|
589 | typedef FNIEMAIMPLSHIFTU16 *PFNIEMAIMPLSHIFTU16;
|
---|
590 | FNIEMAIMPLSHIFTU16 iemAImpl_rol_u16;
|
---|
591 | FNIEMAIMPLSHIFTU16 iemAImpl_ror_u16;
|
---|
592 | FNIEMAIMPLSHIFTU16 iemAImpl_rcl_u16;
|
---|
593 | FNIEMAIMPLSHIFTU16 iemAImpl_rcr_u16;
|
---|
594 | FNIEMAIMPLSHIFTU16 iemAImpl_shl_u16;
|
---|
595 | FNIEMAIMPLSHIFTU16 iemAImpl_shr_u16;
|
---|
596 | FNIEMAIMPLSHIFTU16 iemAImpl_sar_u16;
|
---|
597 | /** @} */
|
---|
598 |
|
---|
599 | /** @name Shift operations on double words (Group 2).
|
---|
600 | * @{ */
|
---|
601 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTU32,(uint32_t *pu32Dst, uint8_t cShift, uint32_t *pEFlags));
|
---|
602 | typedef FNIEMAIMPLSHIFTU32 *PFNIEMAIMPLSHIFTU32;
|
---|
603 | FNIEMAIMPLSHIFTU32 iemAImpl_rol_u32;
|
---|
604 | FNIEMAIMPLSHIFTU32 iemAImpl_ror_u32;
|
---|
605 | FNIEMAIMPLSHIFTU32 iemAImpl_rcl_u32;
|
---|
606 | FNIEMAIMPLSHIFTU32 iemAImpl_rcr_u32;
|
---|
607 | FNIEMAIMPLSHIFTU32 iemAImpl_shl_u32;
|
---|
608 | FNIEMAIMPLSHIFTU32 iemAImpl_shr_u32;
|
---|
609 | FNIEMAIMPLSHIFTU32 iemAImpl_sar_u32;
|
---|
610 | /** @} */
|
---|
611 |
|
---|
612 | /** @name Shift operations on words (Group 2).
|
---|
613 | * @{ */
|
---|
614 | typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLSHIFTU64,(uint64_t *pu64Dst, uint8_t cShift, uint32_t *pEFlags));
|
---|
615 | typedef FNIEMAIMPLSHIFTU64 *PFNIEMAIMPLSHIFTU64;
|
---|
616 | FNIEMAIMPLSHIFTU64 iemAImpl_rol_u64;
|
---|
617 | FNIEMAIMPLSHIFTU64 iemAImpl_ror_u64;
|
---|
618 | FNIEMAIMPLSHIFTU64 iemAImpl_rcl_u64;
|
---|
619 | FNIEMAIMPLSHIFTU64 iemAImpl_rcr_u64;
|
---|
620 | FNIEMAIMPLSHIFTU64 iemAImpl_shl_u64;
|
---|
621 | FNIEMAIMPLSHIFTU64 iemAImpl_shr_u64;
|
---|
622 | FNIEMAIMPLSHIFTU64 iemAImpl_sar_u64;
|
---|
623 | /** @} */
|
---|
624 |
|
---|
625 | /** @name Multiplication and division operations.
|
---|
626 | * @{ */
|
---|
627 | typedef IEM_DECL_IMPL_TYPE(int, FNIEMAIMPLMULDIVU8,(uint16_t *pu16AX, uint8_t u8FactorDivisor, uint32_t *pEFlags));
|
---|
628 | typedef FNIEMAIMPLMULDIVU8 *PFNIEMAIMPLMULDIVU8;
|
---|
629 | FNIEMAIMPLMULDIVU8 iemAImpl_mul_u8, iemAImpl_imul_u8;
|
---|
630 | FNIEMAIMPLMULDIVU8 iemAImpl_div_u8, iemAImpl_idiv_u8;
|
---|
631 |
|
---|
632 | typedef IEM_DECL_IMPL_TYPE(int, FNIEMAIMPLMULDIVU16,(uint16_t *pu16AX, uint16_t *pu16DX, uint16_t u16FactorDivisor, uint32_t *pEFlags));
|
---|
633 | typedef FNIEMAIMPLMULDIVU16 *PFNIEMAIMPLMULDIVU16;
|
---|
634 | FNIEMAIMPLMULDIVU16 iemAImpl_mul_u16, iemAImpl_imul_u16;
|
---|
635 | FNIEMAIMPLMULDIVU16 iemAImpl_div_u16, iemAImpl_idiv_u16;
|
---|
636 |
|
---|
637 | typedef IEM_DECL_IMPL_TYPE(int, FNIEMAIMPLMULDIVU32,(uint32_t *pu32EAX, uint32_t *pu32EDX, uint32_t u32FactorDivisor, uint32_t *pEFlags));
|
---|
638 | typedef FNIEMAIMPLMULDIVU32 *PFNIEMAIMPLMULDIVU32;
|
---|
639 | FNIEMAIMPLMULDIVU32 iemAImpl_mul_u32, iemAImpl_imul_u32;
|
---|
640 | FNIEMAIMPLMULDIVU32 iemAImpl_div_u32, iemAImpl_idiv_u32;
|
---|
641 |
|
---|
642 | typedef IEM_DECL_IMPL_TYPE(int, FNIEMAIMPLMULDIVU64,(uint64_t *pu64RAX, uint64_t *pu64RDX, uint64_t u64FactorDivisor, uint32_t *pEFlags));
|
---|
643 | typedef FNIEMAIMPLMULDIVU64 *PFNIEMAIMPLMULDIVU64;
|
---|
644 | FNIEMAIMPLMULDIVU64 iemAImpl_mul_u64, iemAImpl_imul_u64;
|
---|
645 | FNIEMAIMPLMULDIVU64 iemAImpl_div_u64, iemAImpl_idiv_u64;
|
---|
646 | /** @} */
|
---|
647 |
|
---|
648 |
|
---|
649 | /** @name Function tables.
|
---|
650 | * @{
|
---|
651 | */
|
---|
652 |
|
---|
653 | /**
|
---|
654 | * Function table for a binary operator providing implementation based on
|
---|
655 | * operand size.
|
---|
656 | */
|
---|
657 | typedef struct IEMOPBINSIZES
|
---|
658 | {
|
---|
659 | PFNIEMAIMPLBINU8 pfnNormalU8, pfnLockedU8;
|
---|
660 | PFNIEMAIMPLBINU16 pfnNormalU16, pfnLockedU16;
|
---|
661 | PFNIEMAIMPLBINU32 pfnNormalU32, pfnLockedU32;
|
---|
662 | PFNIEMAIMPLBINU64 pfnNormalU64, pfnLockedU64;
|
---|
663 | } IEMOPBINSIZES;
|
---|
664 | /** Pointer to a binary operator function table. */
|
---|
665 | typedef IEMOPBINSIZES const *PCIEMOPBINSIZES;
|
---|
666 |
|
---|
667 |
|
---|
668 | /**
|
---|
669 | * Function table for a unary operator providing implementation based on
|
---|
670 | * operand size.
|
---|
671 | */
|
---|
672 | typedef struct IEMOPUNARYSIZES
|
---|
673 | {
|
---|
674 | PFNIEMAIMPLUNARYU8 pfnNormalU8, pfnLockedU8;
|
---|
675 | PFNIEMAIMPLUNARYU16 pfnNormalU16, pfnLockedU16;
|
---|
676 | PFNIEMAIMPLUNARYU32 pfnNormalU32, pfnLockedU32;
|
---|
677 | PFNIEMAIMPLUNARYU64 pfnNormalU64, pfnLockedU64;
|
---|
678 | } IEMOPUNARYSIZES;
|
---|
679 | /** Pointer to a unary operator function table. */
|
---|
680 | typedef IEMOPUNARYSIZES const *PCIEMOPUNARYSIZES;
|
---|
681 |
|
---|
682 |
|
---|
683 | /**
|
---|
684 | * Function table for a shift operator providing implementation based on
|
---|
685 | * operand size.
|
---|
686 | */
|
---|
687 | typedef struct IEMOPSHIFTSIZES
|
---|
688 | {
|
---|
689 | PFNIEMAIMPLSHIFTU8 pfnNormalU8;
|
---|
690 | PFNIEMAIMPLSHIFTU16 pfnNormalU16;
|
---|
691 | PFNIEMAIMPLSHIFTU32 pfnNormalU32;
|
---|
692 | PFNIEMAIMPLSHIFTU64 pfnNormalU64;
|
---|
693 | } IEMOPSHIFTSIZES;
|
---|
694 | /** Pointer to a shift operator function table. */
|
---|
695 | typedef IEMOPSHIFTSIZES const *PCIEMOPSHIFTSIZES;
|
---|
696 |
|
---|
697 |
|
---|
698 | /**
|
---|
699 | * Function table for a multiplication or division operation.
|
---|
700 | */
|
---|
701 | typedef struct IEMOPMULDIVSIZES
|
---|
702 | {
|
---|
703 | PFNIEMAIMPLMULDIVU8 pfnU8;
|
---|
704 | PFNIEMAIMPLMULDIVU16 pfnU16;
|
---|
705 | PFNIEMAIMPLMULDIVU32 pfnU32;
|
---|
706 | PFNIEMAIMPLMULDIVU64 pfnU64;
|
---|
707 | } IEMOPMULDIVSIZES;
|
---|
708 | /** Pointer to a multiplication or division operation function table. */
|
---|
709 | typedef IEMOPMULDIVSIZES const *PCIEMOPMULDIVSIZES;
|
---|
710 |
|
---|
711 |
|
---|
712 | /**
|
---|
713 | * Function table for a double precision shift operator providing implementation
|
---|
714 | * based on operand size.
|
---|
715 | */
|
---|
716 | typedef struct IEMOPSHIFTDBLSIZES
|
---|
717 | {
|
---|
718 | PFNIEMAIMPLSHIFTDBLU16 pfnNormalU16;
|
---|
719 | PFNIEMAIMPLSHIFTDBLU32 pfnNormalU32;
|
---|
720 | PFNIEMAIMPLSHIFTDBLU64 pfnNormalU64;
|
---|
721 | } IEMOPSHIFTDBLSIZES;
|
---|
722 | /** Pointer to a double precision shift function table. */
|
---|
723 | typedef IEMOPSHIFTDBLSIZES const *PCIEMOPSHIFTDBLSIZES;
|
---|
724 |
|
---|
725 |
|
---|
726 | /** @} */
|
---|
727 |
|
---|
728 |
|
---|
729 | /** @name C instruction implementations for anything slightly complicated.
|
---|
730 | * @{ */
|
---|
731 |
|
---|
732 | /**
|
---|
733 | * For typedef'ing or declaring a C instruction implementation function taking
|
---|
734 | * no extra arguments.
|
---|
735 | *
|
---|
736 | * @param a_Name The name of the type.
|
---|
737 | */
|
---|
738 | # define IEM_CIMPL_DECL_TYPE_0(a_Name) \
|
---|
739 | IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr))
|
---|
740 | /**
|
---|
741 | * For defining a C instruction implementation function taking no extra
|
---|
742 | * arguments.
|
---|
743 | *
|
---|
744 | * @param a_Name The name of the function
|
---|
745 | */
|
---|
746 | # define IEM_CIMPL_DEF_0(a_Name) \
|
---|
747 | IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr))
|
---|
748 | /**
|
---|
749 | * For calling a C instruction implementation function taking no extra
|
---|
750 | * arguments.
|
---|
751 | *
|
---|
752 | * This special call macro adds default arguments to the call and allow us to
|
---|
753 | * change these later.
|
---|
754 | *
|
---|
755 | * @param a_fn The name of the function.
|
---|
756 | */
|
---|
757 | # define IEM_CIMPL_CALL_0(a_fn) a_fn(pIemCpu, cbInstr)
|
---|
758 |
|
---|
759 | /**
|
---|
760 | * For typedef'ing or declaring a C instruction implementation function taking
|
---|
761 | * one extra argument.
|
---|
762 | *
|
---|
763 | * @param a_Name The name of the type.
|
---|
764 | * @param a_Type0 The argument type.
|
---|
765 | * @param a_Arg0 The argument name.
|
---|
766 | */
|
---|
767 | # define IEM_CIMPL_DECL_TYPE_1(a_Name, a_Type0, a_Arg0) \
|
---|
768 | IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0))
|
---|
769 | /**
|
---|
770 | * For defining a C instruction implementation function taking one extra
|
---|
771 | * argument.
|
---|
772 | *
|
---|
773 | * @param a_Name The name of the function
|
---|
774 | * @param a_Type0 The argument type.
|
---|
775 | * @param a_Arg0 The argument name.
|
---|
776 | */
|
---|
777 | # define IEM_CIMPL_DEF_1(a_Name, a_Type0, a_Arg0) \
|
---|
778 | IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0))
|
---|
779 | /**
|
---|
780 | * For calling a C instruction implementation function taking one extra
|
---|
781 | * argument.
|
---|
782 | *
|
---|
783 | * This special call macro adds default arguments to the call and allow us to
|
---|
784 | * change these later.
|
---|
785 | *
|
---|
786 | * @param a_fn The name of the function.
|
---|
787 | * @param a0 The name of the 1st argument.
|
---|
788 | */
|
---|
789 | # define IEM_CIMPL_CALL_1(a_fn, a0) a_fn(pIemCpu, cbInstr, (a0))
|
---|
790 |
|
---|
791 | /**
|
---|
792 | * For typedef'ing or declaring a C instruction implementation function taking
|
---|
793 | * two extra arguments.
|
---|
794 | *
|
---|
795 | * @param a_Name The name of the type.
|
---|
796 | * @param a_Type0 The type of the 1st argument
|
---|
797 | * @param a_Arg0 The name of the 1st argument.
|
---|
798 | * @param a_Type1 The type of the 2nd argument.
|
---|
799 | * @param a_Arg1 The name of the 2nd argument.
|
---|
800 | */
|
---|
801 | # define IEM_CIMPL_DECL_TYPE_2(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1) \
|
---|
802 | IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1))
|
---|
803 | /**
|
---|
804 | * For defining a C instruction implementation function taking two extra
|
---|
805 | * arguments.
|
---|
806 | *
|
---|
807 | * @param a_Name The name of the function.
|
---|
808 | * @param a_Type0 The type of the 1st argument
|
---|
809 | * @param a_Arg0 The name of the 1st argument.
|
---|
810 | * @param a_Type1 The type of the 2nd argument.
|
---|
811 | * @param a_Arg1 The name of the 2nd argument.
|
---|
812 | */
|
---|
813 | # define IEM_CIMPL_DEF_2(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1) \
|
---|
814 | IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1))
|
---|
815 | /**
|
---|
816 | * For calling a C instruction implementation function taking two extra
|
---|
817 | * arguments.
|
---|
818 | *
|
---|
819 | * This special call macro adds default arguments to the call and allow us to
|
---|
820 | * change these later.
|
---|
821 | *
|
---|
822 | * @param a_fn The name of the function.
|
---|
823 | * @param a0 The name of the 1st argument.
|
---|
824 | * @param a1 The name of the 2nd argument.
|
---|
825 | */
|
---|
826 | # define IEM_CIMPL_CALL_2(a_fn, a0, a1) a_fn(pIemCpu, cbInstr, (a0), (a1))
|
---|
827 |
|
---|
828 | /**
|
---|
829 | * For typedef'ing or declaring a C instruction implementation function taking
|
---|
830 | * three extra arguments.
|
---|
831 | *
|
---|
832 | * @param a_Name The name of the type.
|
---|
833 | * @param a_Type0 The type of the 1st argument
|
---|
834 | * @param a_Arg0 The name of the 1st argument.
|
---|
835 | * @param a_Type1 The type of the 2nd argument.
|
---|
836 | * @param a_Arg1 The name of the 2nd argument.
|
---|
837 | * @param a_Type2 The type of the 3rd argument.
|
---|
838 | * @param a_Arg2 The name of the 3rd argument.
|
---|
839 | */
|
---|
840 | # define IEM_CIMPL_DECL_TYPE_3(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2) \
|
---|
841 | IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2))
|
---|
842 | /**
|
---|
843 | * For defining a C instruction implementation function taking three extra
|
---|
844 | * arguments.
|
---|
845 | *
|
---|
846 | * @param a_Name The name of the function.
|
---|
847 | * @param a_Type0 The type of the 1st argument
|
---|
848 | * @param a_Arg0 The name of the 1st argument.
|
---|
849 | * @param a_Type1 The type of the 2nd argument.
|
---|
850 | * @param a_Arg1 The name of the 2nd argument.
|
---|
851 | * @param a_Type2 The type of the 3rd argument.
|
---|
852 | * @param a_Arg2 The name of the 3rd argument.
|
---|
853 | */
|
---|
854 | # define IEM_CIMPL_DEF_3(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2) \
|
---|
855 | IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2))
|
---|
856 | /**
|
---|
857 | * For calling a C instruction implementation function taking three extra
|
---|
858 | * arguments.
|
---|
859 | *
|
---|
860 | * This special call macro adds default arguments to the call and allow us to
|
---|
861 | * change these later.
|
---|
862 | *
|
---|
863 | * @param a_fn The name of the function.
|
---|
864 | * @param a0 The name of the 1st argument.
|
---|
865 | * @param a1 The name of the 2nd argument.
|
---|
866 | * @param a2 The name of the 3rd argument.
|
---|
867 | */
|
---|
868 | # define IEM_CIMPL_CALL_3(a_fn, a0, a1, a2) a_fn(pIemCpu, cbInstr, (a0), (a1), (a2))
|
---|
869 |
|
---|
870 |
|
---|
871 | /**
|
---|
872 | * For typedef'ing or declaring a C instruction implementation function taking
|
---|
873 | * four extra arguments.
|
---|
874 | *
|
---|
875 | * @param a_Name The name of the type.
|
---|
876 | * @param a_Type0 The type of the 1st argument
|
---|
877 | * @param a_Arg0 The name of the 1st argument.
|
---|
878 | * @param a_Type1 The type of the 2nd argument.
|
---|
879 | * @param a_Arg1 The name of the 2nd argument.
|
---|
880 | * @param a_Type2 The type of the 3rd argument.
|
---|
881 | * @param a_Arg2 The name of the 3rd argument.
|
---|
882 | * @param a_Type3 The type of the 4th argument.
|
---|
883 | * @param a_Arg3 The name of the 4th argument.
|
---|
884 | */
|
---|
885 | # define IEM_CIMPL_DECL_TYPE_4(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3) \
|
---|
886 | IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, a_Type3 a_Arg3))
|
---|
887 | /**
|
---|
888 | * For defining a C instruction implementation function taking four extra
|
---|
889 | * arguments.
|
---|
890 | *
|
---|
891 | * @param a_Name The name of the function.
|
---|
892 | * @param a_Type0 The type of the 1st argument
|
---|
893 | * @param a_Arg0 The name of the 1st argument.
|
---|
894 | * @param a_Type1 The type of the 2nd argument.
|
---|
895 | * @param a_Arg1 The name of the 2nd argument.
|
---|
896 | * @param a_Type2 The type of the 3rd argument.
|
---|
897 | * @param a_Arg2 The name of the 3rd argument.
|
---|
898 | * @param a_Type3 The type of the 4th argument.
|
---|
899 | * @param a_Arg3 The name of the 4th argument.
|
---|
900 | */
|
---|
901 | # define IEM_CIMPL_DEF_4(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, aArg3) \
|
---|
902 | IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, a_Type3 a_Arg3))
|
---|
903 | /**
|
---|
904 | * For calling a C instruction implementation function taking four extra
|
---|
905 | * arguments.
|
---|
906 | *
|
---|
907 | * This special call macro adds default arguments to the call and allow us to
|
---|
908 | * change these later.
|
---|
909 | *
|
---|
910 | * @param a_fn The name of the function.
|
---|
911 | * @param a0 The name of the 1st argument.
|
---|
912 | * @param a1 The name of the 2nd argument.
|
---|
913 | * @param a2 The name of the 3rd argument.
|
---|
914 | * @param a3 The name of the 4th argument.
|
---|
915 | */
|
---|
916 | # define IEM_CIMPL_CALL_4(a_fn, a0, a1, a2, a3) a_fn(pIemCpu, cbInstr, (a0), (a1), (a2), (a3))
|
---|
917 |
|
---|
918 |
|
---|
919 | /**
|
---|
920 | * For typedef'ing or declaring a C instruction implementation function taking
|
---|
921 | * five extra arguments.
|
---|
922 | *
|
---|
923 | * @param a_Name The name of the type.
|
---|
924 | * @param a_Type0 The type of the 1st argument
|
---|
925 | * @param a_Arg0 The name of the 1st argument.
|
---|
926 | * @param a_Type1 The type of the 2nd argument.
|
---|
927 | * @param a_Arg1 The name of the 2nd argument.
|
---|
928 | * @param a_Type2 The type of the 3rd argument.
|
---|
929 | * @param a_Arg2 The name of the 3rd argument.
|
---|
930 | * @param a_Type3 The type of the 4th argument.
|
---|
931 | * @param a_Arg3 The name of the 4th argument.
|
---|
932 | * @param a_Type4 The type of the 5th argument.
|
---|
933 | * @param a_Arg4 The name of the 5th argument.
|
---|
934 | */
|
---|
935 | # define IEM_CIMPL_DECL_TYPE_5(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3, a_Type4, a_Arg4) \
|
---|
936 | IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, \
|
---|
937 | a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, \
|
---|
938 | a_Type3 a_Arg3, a_Type4 a_Arg4))
|
---|
939 | /**
|
---|
940 | * For defining a C instruction implementation function taking five extra
|
---|
941 | * arguments.
|
---|
942 | *
|
---|
943 | * @param a_Name The name of the function.
|
---|
944 | * @param a_Type0 The type of the 1st argument
|
---|
945 | * @param a_Arg0 The name of the 1st argument.
|
---|
946 | * @param a_Type1 The type of the 2nd argument.
|
---|
947 | * @param a_Arg1 The name of the 2nd argument.
|
---|
948 | * @param a_Type2 The type of the 3rd argument.
|
---|
949 | * @param a_Arg2 The name of the 3rd argument.
|
---|
950 | * @param a_Type3 The type of the 4th argument.
|
---|
951 | * @param a_Arg3 The name of the 4th argument.
|
---|
952 | * @param a_Type4 The type of the 5th argument.
|
---|
953 | * @param a_Arg4 The name of the 5th argument.
|
---|
954 | */
|
---|
955 | # define IEM_CIMPL_DEF_5(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3, a_Type4, a_Arg4) \
|
---|
956 | IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, \
|
---|
957 | a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, \
|
---|
958 | a_Type3 a_Arg3, a_Type4 a_Arg4))
|
---|
959 | /**
|
---|
960 | * For calling a C instruction implementation function taking five extra
|
---|
961 | * arguments.
|
---|
962 | *
|
---|
963 | * This special call macro adds default arguments to the call and allow us to
|
---|
964 | * change these later.
|
---|
965 | *
|
---|
966 | * @param a_fn The name of the function.
|
---|
967 | * @param a0 The name of the 1st argument.
|
---|
968 | * @param a1 The name of the 2nd argument.
|
---|
969 | * @param a2 The name of the 3rd argument.
|
---|
970 | * @param a3 The name of the 4th argument.
|
---|
971 | * @param a4 The name of the 5th argument.
|
---|
972 | */
|
---|
973 | # define IEM_CIMPL_CALL_5(a_fn, a0, a1, a2, a3, a4) a_fn(pIemCpu, cbInstr, (a0), (a1), (a2), (a3), (a4))
|
---|
974 |
|
---|
975 | /** @} */
|
---|
976 |
|
---|
977 |
|
---|
978 | /** @} */
|
---|
979 |
|
---|
980 | RT_C_DECLS_END
|
---|
981 |
|
---|
982 | #endif
|
---|
983 |
|
---|
984 |
|
---|