XED
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xed-decoded-inst.h
Go to the documentation of this file.
1 /*BEGIN_LEGAL
2 Intel Open Source License
3 
4 Copyright (c) 2002-2014 Intel Corporation. All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are
8 met:
9 
10 Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer. Redistributions
12 in binary form must reproduce the above copyright notice, this list of
13 conditions and the following disclaimer in the documentation and/or
14 other materials provided with the distribution. Neither the name of
15 the Intel Corporation nor the names of its contributors may be used to
16 endorse or promote products derived from this software without
17 specific prior written permission.
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
23 ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 END_LEGAL */
33 
34 #if !defined(_XED_DECODER_STATE_H_)
35 # define _XED_DECODER_STATE_H_
36 #include "xed-common-hdrs.h"
37 #include "xed-common-defs.h"
38 #include "xed-portability.h"
39 #include "xed-util.h"
40 #include "xed-types.h"
41 #include "xed-inst.h"
42 #include "xed-flags.h"
43 #if defined(XED_ENCODER)
44 # include "xed-encoder-gen-defs.h" //generated
45 #endif
46 #include "xed-chip-enum.h" //generated
47 #include "xed-operand-element-type-enum.h" // a generated file
48 #include "xed-operand-storage.h" // a generated file
49 
50 
51 struct xed_encoder_vars_s;
52 struct xed_decoder_vars_s;
58 typedef struct xed_decoded_inst_s {
62 
63 #if defined(XED_ENCODER)
67  xed_uint8_t _n_operand_order;
68 #endif
69  xed_uint8_t _decoded_length;
70 
74  const xed_inst_t* _inst;
75 
76  // decoder does not change it, encoder does
77  union {
78  xed_uint8_t* _enc;
79  const xed_uint8_t* _dec;
80  } _byte_array;
81 
82  // The ev field is stack allocated by xed_encode(). It is per-encode
83  // transitory data.
84  union {
85  /* user_data is available as a user data storage field after
86  * decoding. It does not live across re-encodes or re-decodes. */
87  xed_uint64_t user_data;
88 #if defined(XED_ENCODER)
89  struct xed_encoder_vars_s* ev;
90 #endif
91  } u;
92 
94 
96 
97 
99 #endif
100 
const xed_inst_t * _inst
when we decode an instruction, we set the _inst and get the properites of that instruction here...
The main container for instructions.
union xed_decoded_inst_s::@1 u
xed_operand_storage_t _operands
Storage for information discovered during decoding.
xed_uint64_t user_data
struct xed_encoder_vars_s * ev
xed_uint8_t * _enc
some pervasive defines
const xed_uint8_t * _dec
constant information about a decoded instruction form, including the pointer to the constant operand ...
Definition: xed-inst.h:257
xed_uint8_t _operand_order[XED_ENCODE_ORDER_MAX_OPERANDS]
Used for encode operand ordering. Not set by decode.
#define XED_ENCODE_ORDER_MAX_OPERANDS
xed_uint8_t _decoded_length
xed_decoded_inst_t xed_operand_values_t
struct xed_decoded_inst_s xed_decoded_inst_t
The main container for instructions.
xed_uint8_t _n_operand_order
Length of the _operand_order[] array.
union xed_decoded_inst_s::@0 _byte_array