OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2010 The Native Client Authors. All rights reserved. | |
3 * Use of this source code is governed by a BSD-style license that can be | |
4 * found in the LICENSE file. | |
5 */ | |
6 | |
7 /* | |
8 * Captures instructions that require CPUID bit 29 set, i.e. are | |
9 * a long mode instruction. | |
10 * | |
11 * Extracted from table D-1 in AMD document 25494 - AMD64 Architecture | |
12 * Programmer's Manual, Volume 3: General-Purpose and System Instructions. | |
13 */ | |
14 | |
15 #ifndef NACL_TRUSTED_BUT_NOT_TCB | |
16 #error("This file is not meant for use in the TCB") | |
17 #endif | |
18 | |
19 #include "native_client/src/trusted/validator/x86/decoder/generator/zero_extends
.h" | |
20 | |
21 #include "native_client/src/include/nacl_macros.h" | |
22 #include "native_client/src/trusted/validator/x86/decoder/generator/ncdecode_for
ms.h" | |
23 #include "native_client/src/trusted/validator/x86/decoder/generator/ncdecode_tab
legen.h" | |
24 | |
25 /* | |
26 * List of instruction mnemonics that define long mode instructions. | |
27 */ | |
28 static const NaClMnemonic kLongModeOp[] = { | |
29 /* Note: Commented out instructions have not yet been implemented. */ | |
30 InstCdqe, | |
31 InstCmpsq, | |
32 InstCqo, | |
33 InstIretq, | |
34 InstLodsq, | |
35 InstMovsq, | |
36 InstMovsxd, | |
37 InstPopfq, | |
38 /* InstPrefetchw */ | |
39 InstPushfq, | |
40 InstScasq, | |
41 InstStosq, | |
42 InstSwapgs | |
43 }; | |
44 | |
45 /* Add LongMode instruction flag if applicable. */ | |
46 void NaClAddLongModeIfApplicable(void) { | |
47 if (NaClInInstructionSet(kLongModeOp, NACL_ARRAY_SIZE(kLongModeOp), | |
48 NULL, 0)) { | |
49 NaClAddIFlags(NACL_IFLAG(LongMode)); | |
50 } | |
51 } | |
OLD | NEW |