OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2011 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 * Defines the API to converting the recognized opcode (instruction), | |
9 * in the instruction state, to the corresponding opcode expression. | |
10 */ | |
11 | |
12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NC_INST_TRANS_H_ | |
13 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NC_INST_TRANS_H_ | |
14 | |
15 #include "native_client/src/trusted/validator/x86/decoder/ncopcode_desc.h" | |
16 | |
17 EXTERN_C_BEGIN | |
18 | |
19 /* Defines the state used to match an instruction, while walking | |
20 * instructions using the NaClInstIter. | |
21 */ | |
22 struct NaClInstState; | |
23 | |
24 /* Constructs the corresponding NaClExpVector from the matched | |
25 * NaClInst of the instruction state. | |
26 */ | |
27 void NaClBuildExpVector(struct NaClInstState* state); | |
28 | |
29 /* Returns true iff the given 32 bit register is the base part of the | |
30 * corresponding given 64-bit register. | |
31 */ | |
32 Bool NaClIs32To64RegPair(NaClOpKind reg32, NaClOpKind reg64); | |
33 | |
34 /* Returns true iff the given (non-64 bit) subregister is a subpart | |
35 * of the corresponding 64-bit register. Note: state is passed in | |
36 * because different look ups are used for 8 bit registers, depending | |
37 * on whether a REX prefix is found. | |
38 */ | |
39 Bool NaClIs64Subreg(struct NaClInstState* state, | |
40 NaClOpKind subreg, NaClOpKind reg64); | |
41 | |
42 /* Given a 32-bit register, return the corresponding 64-bit register. | |
43 * Returns RegUnknown if no such register exists. | |
44 */ | |
45 NaClOpKind NaClGet64For32BitReg(NaClOpKind reg32); | |
46 | |
47 /* Given a 64-bit register, return the corresponding 32-bit register. | |
48 * Returns RegUnknown if no such register exists. | |
49 */ | |
50 NaClOpKind NaClGet32For64BitReg(NaClOpKind reg64); | |
51 | |
52 EXTERN_C_END | |
53 | |
54 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NC_INST_TRANS_H_ */ | |
OLD | NEW |