| 1 |
/*========================== begin_copyright_notice ============================ |
| 2 |
|
| 3 |
Copyright (C) 2017-2021 Intel Corporation |
| 4 |
|
| 5 |
SPDX-License-Identifier: MIT |
| 6 |
|
| 7 |
============================= end_copyright_notice ===========================*/ |
| 8 |
|
| 9 |
#ifndef GED_INTERNAL_API_H |
| 10 |
#define GED_INTERNAL_API_H |
| 11 |
|
| 12 |
#include "common/ged_base.h" |
| 13 |
#include "common/ged_ins_decoding_table.h" |
| 14 |
#include "common/ged_compact_mapping_table.h" |
| 15 |
#include "common/ged_ins_encoding_masks.h" |
| 16 |
#include "common/ged_interpreter_types.h" |
| 17 |
|
| 18 |
|
| 19 |
union SignedDNum |
| 20 |
{ |
| 21 |
int32_t _dw; // signed double-word |
| 22 |
float _f; // single-precision floating-point |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
union SignedQNum |
| 27 |
{ |
| 28 |
int64_t _qw; // signed quad-word |
| 29 |
double _df; // double-precision floating-point |
| 30 |
}; |
| 31 |
|
| 32 |
|
| 33 |
typedef const ged_ins_decoding_table_t (*InsFieldTableFunc)(uint32_t, GED_INS_TYPE); |
| 34 |
typedef const ged_compact_mapping_table_t (*MappingTableFunc)(uint32_t); |
| 35 |
typedef const ged_instruction_masks_table_t (*EncodingMasksTableFunc)(uint32_t, GED_INS_TYPE); |
| 36 |
|
| 37 |
struct OpcodeTables |
| 38 |
{ |
| 39 |
const ged_ins_decoding_table_t nativeDecoding; |
| 40 |
const ged_instruction_masks_table_t nativeEncodingMasks; |
| 41 |
const ged_ins_decoding_table_t compactDecoding; |
| 42 |
const ged_instruction_masks_table_t compactEncodingMasks; |
| 43 |
const ged_compact_mapping_table_t compactMapping; |
| 44 |
}; |
| 45 |
|
| 46 |
struct ModelData |
| 47 |
{ |
| 48 |
const OpcodeTables* opcodeTables; |
| 49 |
const char* modelVersion; |
| 50 |
const uint32_t numberOfInstructionFields; |
| 51 |
const ged_field_enum_table_t Opcodes; |
| 52 |
const uint32_t numberOfPseudoFields; |
| 53 |
const ged_ins_field_entry_t* pseudoFields; |
| 54 |
const uint32_t numberOfReinterpretedEnums; |
| 55 |
const ged_unsigned_table_t* reinterpretedEnums; |
| 56 |
const uint32_t numberOfCollectors; |
| 57 |
const ged_collector_info_t* collectionTables; |
| 58 |
}; |
| 59 |
|
| 60 |
|
| 61 |
extern ModelData ModelsArray[]; |
| 62 |
|
| 63 |
|
| 64 |
extern const unsigned int numOfSupportedModels; |
| 65 |
extern const char* modelNames[]; |
| 66 |
|
| 67 |
extern bool GetModelByName(const string& name, /* GED_MODEL */ unsigned int& model); |
| 68 |
|
| 69 |
|
| 70 |
extern GED_FIELD_TYPE fieldTypesByField[]; |
| 71 |
extern GED_FIELD_TYPE pseudoFieldTypesByField[]; |
| 72 |
|
| 73 |
|
| 74 |
# if GED_VALIDATION_API |
| 75 |
extern const char* fieldNameByField[]; |
| 76 |
extern const char* fieldNameByPseudoField[]; |
| 77 |
# endif |
| 78 |
|
| 79 |
#endif // GED_INTERNAL_API_H |