blob: dd030566f91e11737d42eca183034e947c54f56e [file] [log] [blame]
sewardjc9a65702004-07-07 16:32:57 +00001
2/*---------------------------------------------------------------*/
sewardj752f9062010-05-03 21:38:49 +00003/*--- begin guest_x86_defs.h ---*/
sewardjc9a65702004-07-07 16:32:57 +00004/*---------------------------------------------------------------*/
5
sewardjf8ed9d82004-11-12 17:40:23 +00006/*
sewardj752f9062010-05-03 21:38:49 +00007 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
sewardjf8ed9d82004-11-12 17:40:23 +00009
sewardj89ae8472013-10-18 14:12:58 +000010 Copyright (C) 2004-2013 OpenWorks LLP
sewardj752f9062010-05-03 21:38:49 +000011 info@open-works.net
sewardjf8ed9d82004-11-12 17:40:23 +000012
sewardj752f9062010-05-03 21:38:49 +000013 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
sewardjf8ed9d82004-11-12 17:40:23 +000017
sewardj752f9062010-05-03 21:38:49 +000018 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
sewardj7bd6ffe2005-08-03 16:07:36 +000026 02110-1301, USA.
27
sewardj752f9062010-05-03 21:38:49 +000028 The GNU General Public License is contained in the file COPYING.
sewardjf8ed9d82004-11-12 17:40:23 +000029
30 Neither the names of the U.S. Department of Energy nor the
31 University of California nor the names of its contributors may be
32 used to endorse or promote products derived from this software
33 without prior written permission.
sewardjf8ed9d82004-11-12 17:40:23 +000034*/
35
sewardjc9a65702004-07-07 16:32:57 +000036/* Only to be used within the guest-x86 directory. */
37
sewardjcef7d3e2009-07-02 12:21:59 +000038#ifndef __VEX_GUEST_X86_DEFS_H
39#define __VEX_GUEST_X86_DEFS_H
sewardjc9a65702004-07-07 16:32:57 +000040
florian58a637b2012-09-30 20:30:17 +000041#include "libvex_basictypes.h"
42#include "libvex_guest_x86.h" // VexGuestX86State
43#include "libvex_emnote.h" // VexEmNote
44#include "guest_generic_bb_to_IR.h" // DisResult
sewardjc9a65702004-07-07 16:32:57 +000045
46/*---------------------------------------------------------*/
47/*--- x86 to IR conversion ---*/
48/*---------------------------------------------------------*/
49
sewardj9e6491a2005-07-02 19:24:10 +000050/* Convert one x86 insn to IR. See the type DisOneInstrFn in
51 bb_to_IR.h. */
sewardjc9a65702004-07-07 16:32:57 +000052extern
sewardjdd40fdf2006-12-24 02:20:24 +000053DisResult disInstr_X86 ( IRSB* irbb,
sewardjc716aea2006-01-17 01:48:46 +000054 Bool (*resteerOkFn) ( void*, Addr64 ),
sewardj984d9b12010-01-15 10:53:21 +000055 Bool resteerCisOk,
sewardjc716aea2006-01-17 01:48:46 +000056 void* callback_opaque,
florian8462d112014-09-24 15:18:09 +000057 const UChar* guest_code,
sewardj9e6491a2005-07-02 19:24:10 +000058 Long delta,
59 Addr64 guest_IP,
sewardja5f55da2006-04-30 23:37:32 +000060 VexArch guest_arch,
sewardj9e6491a2005-07-02 19:24:10 +000061 VexArchInfo* archinfo,
sewardjdd40fdf2006-12-24 02:20:24 +000062 VexAbiInfo* abiinfo,
sewardj9b769162014-07-24 12:42:03 +000063 VexEndness host_endness,
sewardj442e51a2012-12-06 18:08:04 +000064 Bool sigill_diag );
sewardjc9a65702004-07-07 16:32:57 +000065
sewardj84ff0652004-08-23 16:16:08 +000066/* Used by the optimiser to specialise calls to helpers. */
67extern
florian1ff47562012-10-21 02:09:51 +000068IRExpr* guest_x86_spechelper ( const HChar* function_name,
sewardjbe917912010-08-22 12:38:53 +000069 IRExpr** args,
70 IRStmt** precedingStmts,
71 Int n_precedingStmts );
sewardj84ff0652004-08-23 16:16:08 +000072
sewardjb122d422005-03-10 19:40:41 +000073/* Describes to the optimiser which part of the guest state require
sewardj76bdc802004-10-25 15:33:26 +000074 precise memory exceptions. This is logically part of the guest
75 state description. */
76extern
77Bool guest_x86_state_requires_precise_mem_exns ( Int, Int );
78
sewardj49651f42004-10-28 22:11:04 +000079extern
sewardjeeac8412004-11-02 00:26:55 +000080VexGuestLayout x86guest_layout;
sewardj49651f42004-10-28 22:11:04 +000081
sewardjc9a65702004-07-07 16:32:57 +000082
83/*---------------------------------------------------------*/
sewardj8ea867b2004-10-30 19:03:02 +000084/*--- x86 guest helpers ---*/
85/*---------------------------------------------------------*/
86
87/* --- CLEAN HELPERS --- */
sewardj2a2ba8b2004-11-08 13:14:06 +000088
sewardj2a9ad022004-11-25 02:46:58 +000089extern UInt x86g_calculate_eflags_all (
90 UInt cc_op, UInt cc_dep1, UInt cc_dep2, UInt cc_ndep
91 );
sewardj2a2ba8b2004-11-08 13:14:06 +000092
sewardj03d91142011-03-14 12:35:18 +000093VEX_REGPARM(3)
sewardj2a9ad022004-11-25 02:46:58 +000094extern UInt x86g_calculate_eflags_c (
95 UInt cc_op, UInt cc_dep1, UInt cc_dep2, UInt cc_ndep
96 );
sewardj2a2ba8b2004-11-08 13:14:06 +000097
sewardj2a9ad022004-11-25 02:46:58 +000098extern UInt x86g_calculate_condition (
99 UInt/*X86Condcode*/ cond,
100 UInt cc_op,
101 UInt cc_dep1, UInt cc_dep2, UInt cc_ndep
102 );
sewardj2a2ba8b2004-11-08 13:14:06 +0000103
sewardj2a9ad022004-11-25 02:46:58 +0000104extern UInt x86g_calculate_FXAM ( UInt tag, ULong dbl );
sewardj2a2ba8b2004-11-08 13:14:06 +0000105
sewardj2eef7732005-08-23 15:41:14 +0000106extern ULong x86g_calculate_RCR (
107 UInt arg, UInt rot_amt, UInt eflags_in, UInt sz
108 );
109extern ULong x86g_calculate_RCL (
sewardj2a9ad022004-11-25 02:46:58 +0000110 UInt arg, UInt rot_amt, UInt eflags_in, UInt sz
111 );
sewardj8ea867b2004-10-30 19:03:02 +0000112
sewardj8edc36b2007-11-23 02:46:29 +0000113extern UInt x86g_calculate_daa_das_aaa_aas ( UInt AX_and_flags, UInt opcode );
114
sewardj321bbbf2011-01-17 12:32:25 +0000115extern UInt x86g_calculate_aad_aam ( UInt AX_and_flags, UInt opcode );
116
sewardj3bd6f3e2004-12-13 10:48:19 +0000117extern ULong x86g_check_fldcw ( UInt fpucw );
sewardj893aada2004-11-29 19:57:54 +0000118
sewardj38a3f862005-01-13 15:06:51 +0000119extern UInt x86g_create_fpucw ( UInt fpround );
sewardj7df596b2004-12-06 14:29:12 +0000120
sewardj3bd6f3e2004-12-13 10:48:19 +0000121extern ULong x86g_check_ldmxcsr ( UInt mxcsr );
sewardj7df596b2004-12-06 14:29:12 +0000122
sewardj38a3f862005-01-13 15:06:51 +0000123extern UInt x86g_create_mxcsr ( UInt sseround );
sewardj3bd6f3e2004-12-13 10:48:19 +0000124
sewardjfda10af2005-10-03 01:02:40 +0000125
sewardj3bd6f3e2004-12-13 10:48:19 +0000126/* Translate a guest virtual_addr into a guest linear address by
127 consulting the supplied LDT/GDT structures. Their representation
128 must be as specified in pub/libvex_guest_x86.h. To indicate a
129 translation failure, 1<<32 is returned. On success, the lower 32
130 bits of the returned result indicate the linear address.
131*/
132extern
133ULong x86g_use_seg_selector ( HWord ldt, HWord gdt,
134 UInt seg_selector, UInt virtual_addr );
sewardj893aada2004-11-29 19:57:54 +0000135
sewardj38a3f862005-01-13 15:06:51 +0000136extern ULong x86g_calculate_mmx_pmaddwd ( ULong, ULong );
137extern ULong x86g_calculate_mmx_psadbw ( ULong, ULong );
sewardj4340dac2004-11-20 13:17:04 +0000138
sewardj38a3f862005-01-13 15:06:51 +0000139
sewardj8ea867b2004-10-30 19:03:02 +0000140/* --- DIRTY HELPERS --- */
sewardj2a2ba8b2004-11-08 13:14:06 +0000141
sewardj8f40b072005-08-23 19:30:58 +0000142extern ULong x86g_dirtyhelper_loadF80le ( UInt );
sewardj2a2ba8b2004-11-08 13:14:06 +0000143
sewardj8f40b072005-08-23 19:30:58 +0000144extern void x86g_dirtyhelper_storeF80le ( UInt, ULong );
sewardj2a2ba8b2004-11-08 13:14:06 +0000145
sewardj9df271d2004-12-31 22:37:42 +0000146extern void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* );
mjw6c65c122013-08-27 10:19:03 +0000147extern void x86g_dirtyhelper_CPUID_mmxext ( VexGuestX86State* );
sewardj9df271d2004-12-31 22:37:42 +0000148extern void x86g_dirtyhelper_CPUID_sse1 ( VexGuestX86State* );
149extern void x86g_dirtyhelper_CPUID_sse2 ( VexGuestX86State* );
sewardj8ea867b2004-10-30 19:03:02 +0000150
sewardja0e83b02005-01-06 12:36:38 +0000151extern void x86g_dirtyhelper_FINIT ( VexGuestX86State* );
152
sewardjd24931d2005-03-20 12:51:39 +0000153extern void x86g_dirtyhelper_FXSAVE ( VexGuestX86State*, HWord );
154extern void x86g_dirtyhelper_FSAVE ( VexGuestX86State*, HWord );
155extern void x86g_dirtyhelper_FSTENV ( VexGuestX86State*, HWord );
156
sewardj4ed64292005-08-23 19:24:29 +0000157extern ULong x86g_dirtyhelper_RDTSC ( void );
158
sewardjd14c5702005-10-29 19:19:51 +0000159extern UInt x86g_dirtyhelper_IN ( UInt portno, UInt sz/*1,2 or 4*/ );
160extern void x86g_dirtyhelper_OUT ( UInt portno, UInt data,
161 UInt sz/*1,2 or 4*/ );
162
sewardjb9dc2432010-06-07 16:22:22 +0000163extern void x86g_dirtyhelper_SxDT ( void* address,
164 UInt op /* 0 or 1 */ );
165
florian6ef84be2012-08-26 03:20:07 +0000166extern VexEmNote
sewardj3800e2d2008-05-09 13:24:43 +0000167 x86g_dirtyhelper_FXRSTOR ( VexGuestX86State*, HWord );
168
florian6ef84be2012-08-26 03:20:07 +0000169extern VexEmNote
sewardj7df596b2004-12-06 14:29:12 +0000170 x86g_dirtyhelper_FRSTOR ( VexGuestX86State*, HWord );
171
florian6ef84be2012-08-26 03:20:07 +0000172extern VexEmNote
sewardj7df596b2004-12-06 14:29:12 +0000173 x86g_dirtyhelper_FLDENV ( VexGuestX86State*, HWord );
sewardj9fc9e782004-11-26 17:57:40 +0000174
sewardj8ea867b2004-10-30 19:03:02 +0000175
176/*---------------------------------------------------------*/
sewardjc9a65702004-07-07 16:32:57 +0000177/*--- Condition code stuff ---*/
178/*---------------------------------------------------------*/
179
180/* eflags masks */
sewardj2a9ad022004-11-25 02:46:58 +0000181#define X86G_CC_SHIFT_O 11
182#define X86G_CC_SHIFT_S 7
183#define X86G_CC_SHIFT_Z 6
184#define X86G_CC_SHIFT_A 4
185#define X86G_CC_SHIFT_C 0
186#define X86G_CC_SHIFT_P 2
sewardj9aebb0c2004-10-24 19:20:43 +0000187
sewardj2a9ad022004-11-25 02:46:58 +0000188#define X86G_CC_MASK_O (1 << X86G_CC_SHIFT_O)
189#define X86G_CC_MASK_S (1 << X86G_CC_SHIFT_S)
190#define X86G_CC_MASK_Z (1 << X86G_CC_SHIFT_Z)
191#define X86G_CC_MASK_A (1 << X86G_CC_SHIFT_A)
192#define X86G_CC_MASK_C (1 << X86G_CC_SHIFT_C)
193#define X86G_CC_MASK_P (1 << X86G_CC_SHIFT_P)
sewardjc9a65702004-07-07 16:32:57 +0000194
sewardjc4be80c2004-09-10 16:17:45 +0000195/* FPU flag masks */
sewardje128ea12005-03-25 22:33:54 +0000196#define X86G_FC_SHIFT_C3 14
197#define X86G_FC_SHIFT_C2 10
198#define X86G_FC_SHIFT_C1 9
199#define X86G_FC_SHIFT_C0 8
200
201#define X86G_FC_MASK_C3 (1 << X86G_FC_SHIFT_C3)
202#define X86G_FC_MASK_C2 (1 << X86G_FC_SHIFT_C2)
203#define X86G_FC_MASK_C1 (1 << X86G_FC_SHIFT_C1)
204#define X86G_FC_MASK_C0 (1 << X86G_FC_SHIFT_C0)
205
sewardjc4be80c2004-09-10 16:17:45 +0000206
sewardj2a2ba8b2004-11-08 13:14:06 +0000207/* %EFLAGS thunk descriptors. A four-word thunk is used to record
208 details of the most recent flag-setting operation, so the flags can
209 be computed later if needed. It is possible to do this a little
210 more efficiently using a 3-word thunk, but that makes it impossible
211 to describe the flag data dependencies sufficiently accurately for
212 Memcheck. Hence 4 words are used, with minimal loss of efficiency.
sewardj948d48b2004-11-05 19:49:09 +0000213
sewardj2a2ba8b2004-11-08 13:14:06 +0000214 The four words are:
sewardj948d48b2004-11-05 19:49:09 +0000215
sewardj2a2ba8b2004-11-08 13:14:06 +0000216 CC_OP, which describes the operation.
217
218 CC_DEP1 and CC_DEP2. These are arguments to the operation.
219 We want Memcheck to believe that the resulting flags are
220 data-dependent on both CC_DEP1 and CC_DEP2, hence the
221 name DEP.
222
223 CC_NDEP. This is a 3rd argument to the operation which is
224 sometimes needed. We arrange things so that Memcheck does
225 not believe the resulting flags are data-dependent on CC_NDEP
226 ("not dependent").
227
228 To make Memcheck believe that (the definedness of) the encoded
229 flags depends only on (the definedness of) CC_DEP1 and CC_DEP2
230 requires two things:
231
232 (1) In the guest state layout info (x86guest_layout), CC_OP and
233 CC_NDEP are marked as always defined.
234
235 (2) When passing the thunk components to an evaluation function
236 (calculate_condition, calculate_eflags, calculate_eflags_c) the
237 IRCallee's mcx_mask must be set so as to exclude from
238 consideration all passed args except CC_DEP1 and CC_DEP2.
239
240 Strictly speaking only (2) is necessary for correctness. However,
241 (1) helps efficiency in that since (2) means we never ask about the
242 definedness of CC_OP or CC_NDEP, we may as well not even bother to
243 track their definedness.
244
245 When building the thunk, it is always necessary to write words into
246 CC_DEP1 and CC_DEP2, even if those args are not used given the
247 CC_OP field (eg, CC_DEP2 is not used if CC_OP is CC_LOGIC1/2/4).
248 This is important because otherwise Memcheck could give false
249 positives as it does not understand the relationship between the
250 CC_OP field and CC_DEP1 and CC_DEP2, and so believes that the
251 definedness of the stored flags always depends on both CC_DEP1 and
252 CC_DEP2.
253
254 However, it is only necessary to set CC_NDEP when the CC_OP value
255 requires it, because Memcheck ignores CC_NDEP, and the evaluation
256 functions do understand the CC_OP fields and will only examine
257 CC_NDEP for suitable values of CC_OP.
258
259 A summary of the field usages is:
260
261 Operation DEP1 DEP2 NDEP
262 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263
264 add/sub/mul first arg second arg unused
265
266 adc/sbb first arg (second arg)
267 XOR old_carry old_carry
268
269 and/or/xor result zero unused
270
271 inc/dec result zero old_carry
272
273 shl/shr/sar result subshifted- unused
274 result
275
276 rol/ror result zero old_flags
277
278 copy old_flags zero unused.
279
280
281 Therefore Memcheck will believe the following:
282
283 * add/sub/mul -- definedness of result flags depends on definedness
284 of both args.
285
286 * adc/sbb -- definedness of result flags depends on definedness of
287 both args and definedness of the old C flag. Because only two
288 DEP fields are available, the old C flag is XOR'd into the second
289 arg so that Memcheck sees the data dependency on it. That means
290 the NDEP field must contain a second copy of the old C flag
291 so that the evaluation functions can correctly recover the second
292 arg.
293
294 * and/or/xor are straightforward -- definedness of result flags
295 depends on definedness of result value.
296
297 * inc/dec -- definedness of result flags depends only on
298 definedness of result. This isn't really true -- it also depends
299 on the old C flag. However, we don't want Memcheck to see that,
300 and so the old C flag must be passed in NDEP and not in DEP2.
301 It's inconceivable that a compiler would generate code that puts
302 the C flag in an undefined state, then does an inc/dec, which
303 leaves C unchanged, and then makes a conditional jump/move based
304 on C. So our fiction seems a good approximation.
305
306 * shl/shr/sar -- straightforward, again, definedness of result
307 flags depends on definedness of result value. The subshifted
308 value (value shifted one less) is also needed, but its
309 definedness is the same as the definedness of the shifted value.
310
311 * rol/ror -- these only set O and C, and leave A Z C P alone.
312 However it seems prudent (as per inc/dec) to say the definedness
313 of all resulting flags depends on the definedness of the result,
314 hence the old flags must go in as NDEP and not DEP2.
315
316 * rcl/rcr are too difficult to do in-line, and so are done by a
317 helper function. They are not part of this scheme. The helper
318 function takes the value to be rotated, the rotate amount and the
319 old flags, and returns the new flags and the rotated value.
320 Since the helper's mcx_mask does not have any set bits, Memcheck
321 will lazily propagate undefinedness from any of the 3 args into
322 both results (flags and actual value).
sewardj948d48b2004-11-05 19:49:09 +0000323*/
sewardjc9a65702004-07-07 16:32:57 +0000324enum {
sewardj63663e32005-01-22 11:00:07 +0000325 X86G_CC_OP_COPY=0, /* DEP1 = current flags, DEP2 = 0, NDEP = unused */
sewardj2a9ad022004-11-25 02:46:58 +0000326 /* just copy DEP1 to output */
sewardjc9a65702004-07-07 16:32:57 +0000327
sewardj2a9ad022004-11-25 02:46:58 +0000328 X86G_CC_OP_ADDB, /* 1 */
329 X86G_CC_OP_ADDW, /* 2 DEP1 = argL, DEP2 = argR, NDEP = unused */
330 X86G_CC_OP_ADDL, /* 3 */
sewardjc9a65702004-07-07 16:32:57 +0000331
sewardj2a9ad022004-11-25 02:46:58 +0000332 X86G_CC_OP_SUBB, /* 4 */
333 X86G_CC_OP_SUBW, /* 5 DEP1 = argL, DEP2 = argR, NDEP = unused */
334 X86G_CC_OP_SUBL, /* 6 */
sewardjc9a65702004-07-07 16:32:57 +0000335
sewardj2a9ad022004-11-25 02:46:58 +0000336 X86G_CC_OP_ADCB, /* 7 */
337 X86G_CC_OP_ADCW, /* 8 DEP1 = argL, DEP2 = argR ^ oldCarry, NDEP = oldCarry */
338 X86G_CC_OP_ADCL, /* 9 */
sewardjc9a65702004-07-07 16:32:57 +0000339
sewardj2a9ad022004-11-25 02:46:58 +0000340 X86G_CC_OP_SBBB, /* 10 */
341 X86G_CC_OP_SBBW, /* 11 DEP1 = argL, DEP2 = argR ^ oldCarry, NDEP = oldCarry */
342 X86G_CC_OP_SBBL, /* 12 */
sewardjc9a65702004-07-07 16:32:57 +0000343
sewardj2a9ad022004-11-25 02:46:58 +0000344 X86G_CC_OP_LOGICB, /* 13 */
345 X86G_CC_OP_LOGICW, /* 14 DEP1 = result, DEP2 = 0, NDEP = unused */
346 X86G_CC_OP_LOGICL, /* 15 */
sewardjc9a65702004-07-07 16:32:57 +0000347
sewardj2a9ad022004-11-25 02:46:58 +0000348 X86G_CC_OP_INCB, /* 16 */
349 X86G_CC_OP_INCW, /* 17 DEP1 = result, DEP2 = 0, NDEP = oldCarry (0 or 1) */
350 X86G_CC_OP_INCL, /* 18 */
sewardjc9a65702004-07-07 16:32:57 +0000351
sewardj2a9ad022004-11-25 02:46:58 +0000352 X86G_CC_OP_DECB, /* 19 */
353 X86G_CC_OP_DECW, /* 20 DEP1 = result, DEP2 = 0, NDEP = oldCarry (0 or 1) */
354 X86G_CC_OP_DECL, /* 21 */
sewardjc9a65702004-07-07 16:32:57 +0000355
sewardj2a9ad022004-11-25 02:46:58 +0000356 X86G_CC_OP_SHLB, /* 22 DEP1 = res, DEP2 = res', NDEP = unused */
357 X86G_CC_OP_SHLW, /* 23 where res' is like res but shifted one bit less */
358 X86G_CC_OP_SHLL, /* 24 */
sewardjc9a65702004-07-07 16:32:57 +0000359
sewardj2a9ad022004-11-25 02:46:58 +0000360 X86G_CC_OP_SHRB, /* 25 DEP1 = res, DEP2 = res', NDEP = unused */
361 X86G_CC_OP_SHRW, /* 26 where res' is like res but shifted one bit less */
362 X86G_CC_OP_SHRL, /* 27 */
sewardjc9a65702004-07-07 16:32:57 +0000363
sewardj2a9ad022004-11-25 02:46:58 +0000364 X86G_CC_OP_ROLB, /* 28 */
365 X86G_CC_OP_ROLW, /* 29 DEP1 = res, DEP2 = 0, NDEP = old flags */
366 X86G_CC_OP_ROLL, /* 30 */
sewardj1813dbe2004-07-28 17:09:04 +0000367
sewardj2a9ad022004-11-25 02:46:58 +0000368 X86G_CC_OP_RORB, /* 31 */
369 X86G_CC_OP_RORW, /* 32 DEP1 = res, DEP2 = 0, NDEP = old flags */
370 X86G_CC_OP_RORL, /* 33 */
sewardj1813dbe2004-07-28 17:09:04 +0000371
sewardj2a9ad022004-11-25 02:46:58 +0000372 X86G_CC_OP_UMULB, /* 34 */
373 X86G_CC_OP_UMULW, /* 35 DEP1 = argL, DEP2 = argR, NDEP = unused */
374 X86G_CC_OP_UMULL, /* 36 */
sewardjcf780b42004-07-13 18:42:17 +0000375
sewardj2a9ad022004-11-25 02:46:58 +0000376 X86G_CC_OP_SMULB, /* 37 */
377 X86G_CC_OP_SMULW, /* 38 DEP1 = argL, DEP2 = argR, NDEP = unused */
378 X86G_CC_OP_SMULL, /* 39 */
sewardjcf780b42004-07-13 18:42:17 +0000379
sewardj2a9ad022004-11-25 02:46:58 +0000380 X86G_CC_OP_NUMBER
sewardjc9a65702004-07-07 16:32:57 +0000381};
382
sewardj84ff0652004-08-23 16:16:08 +0000383typedef
384 enum {
sewardj2a9ad022004-11-25 02:46:58 +0000385 X86CondO = 0, /* overflow */
386 X86CondNO = 1, /* no overflow */
sewardj84ff0652004-08-23 16:16:08 +0000387
sewardj2a9ad022004-11-25 02:46:58 +0000388 X86CondB = 2, /* below */
389 X86CondNB = 3, /* not below */
sewardj84ff0652004-08-23 16:16:08 +0000390
sewardj2a9ad022004-11-25 02:46:58 +0000391 X86CondZ = 4, /* zero */
392 X86CondNZ = 5, /* not zero */
sewardj84ff0652004-08-23 16:16:08 +0000393
sewardj2a9ad022004-11-25 02:46:58 +0000394 X86CondBE = 6, /* below or equal */
395 X86CondNBE = 7, /* not below or equal */
sewardj84ff0652004-08-23 16:16:08 +0000396
sewardj2a9ad022004-11-25 02:46:58 +0000397 X86CondS = 8, /* negative */
398 X86CondNS = 9, /* not negative */
sewardj84ff0652004-08-23 16:16:08 +0000399
sewardj2a9ad022004-11-25 02:46:58 +0000400 X86CondP = 10, /* parity even */
401 X86CondNP = 11, /* not parity even */
sewardj84ff0652004-08-23 16:16:08 +0000402
sewardj2a9ad022004-11-25 02:46:58 +0000403 X86CondL = 12, /* jump less */
404 X86CondNL = 13, /* not less */
sewardj84ff0652004-08-23 16:16:08 +0000405
sewardj2a9ad022004-11-25 02:46:58 +0000406 X86CondLE = 14, /* less or equal */
407 X86CondNLE = 15, /* not less or equal */
sewardj84ff0652004-08-23 16:16:08 +0000408
sewardj2a9ad022004-11-25 02:46:58 +0000409 X86CondAlways = 16 /* HACK */
sewardj84ff0652004-08-23 16:16:08 +0000410 }
sewardj2a9ad022004-11-25 02:46:58 +0000411 X86Condcode;
sewardj84ff0652004-08-23 16:16:08 +0000412
sewardjcef7d3e2009-07-02 12:21:59 +0000413#endif /* ndef __VEX_GUEST_X86_DEFS_H */
sewardjc9a65702004-07-07 16:32:57 +0000414
415/*---------------------------------------------------------------*/
sewardjcef7d3e2009-07-02 12:21:59 +0000416/*--- end guest_x86_defs.h ---*/
sewardjc9a65702004-07-07 16:32:57 +0000417/*---------------------------------------------------------------*/