1 /*BEGIN_LEGAL
2 
3 Copyright (c) 2018 Intel Corporation
4 
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8 
9       http://www.apache.org/licenses/LICENSE-2.0
10 
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 
17 END_LEGAL */
18 /// @file xed-decoded-inst-private.H
19 ///
20 
21 
22 #if !defined(XED_DECODED_INST_PRIVATE_H)
23 # define XED_DECODED_INST_PRIVATE_H
24 
25 #include "xed-types.h"
26 #include "xed-portability.h"
27 #include "xed-decoded-inst.h"
28 
29 static XED_INLINE xed_error_enum_t
xed_decoded_inst_get_error(xed_decoded_inst_t * p)30 xed_decoded_inst_get_error(xed_decoded_inst_t* p) {
31     return xed3_operand_get_error(p);
32 }
33 
34 static XED_INLINE void
xed_decoded_inst_set_inst(xed_decoded_inst_t * p,const xed_inst_t * inst)35 xed_decoded_inst_set_inst(xed_decoded_inst_t* p, const xed_inst_t* inst) {
36     p->_inst = inst;
37     xed3_operand_set_iclass(p,xed_inst_iclass(inst));
38 }
39 
40 unsigned int
41 xed_decoded_inst_compute_memory_operand_length(const xed_decoded_inst_t* p,
42                                                unsigned int memop_idx);
43 
44 // sets MEM_WIDTH
45 static XED_INLINE void
xed_decoded_inst_cache_memory_operand_length(xed_decoded_inst_t * p)46 xed_decoded_inst_cache_memory_operand_length(xed_decoded_inst_t* p) {
47     xed_uint16_t mem_width =
48         xed_decoded_inst_compute_memory_operand_length(p, 0);
49     xed3_operand_set_mem_width(p,mem_width);
50 }
51 
52 
53 static XED_INLINE xed_uint_t
xed_decoded_inst_set_length(xed_decoded_inst_t * p,unsigned char length)54 xed_decoded_inst_set_length(xed_decoded_inst_t* p,
55                             unsigned char length) {
56     return p->_decoded_length = length;
57 }
58 
59 
60 static XED_INLINE xed_uint_t
xed_decoded_inst_inc_length(xed_decoded_inst_t * p)61 xed_decoded_inst_inc_length(xed_decoded_inst_t* p) {
62     return p->_decoded_length++;
63 }
64 
65 static XED_INLINE xed_uint32_t
xed_phash_invalid(xed_decoded_inst_t * d)66 xed_phash_invalid(xed_decoded_inst_t* d) {
67     return 0;
68     (void) d;
69 }
70 static XED_INLINE xed_uint32_t
xed_phash_invalid_const(const xed_decoded_inst_t * d)71 xed_phash_invalid_const(const xed_decoded_inst_t* d) {
72     return 0;
73     (void) d;
74 }
75 
76 
77 #endif
78