| 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 IGA_NATIVE_INTERFACE_HPP |
| 10 |
#define IGA_NATIVE_INTERFACE_HPP |
| 11 |
//////////////////////////////////////////// |
| 12 |
// NATIVE ENCODER USERS USE THIS INTERFACE |
| 13 |
#include "../../ErrorHandler.hpp" |
| 14 |
#include "../../IR/Kernel.hpp" |
| 15 |
#include "../DecoderOpts.hpp" |
| 16 |
#include "../EncoderOpts.hpp" |
| 17 |
#include "Field.hpp" |
| 18 |
#include "InstEncoder.hpp" |
| 19 |
|
| 20 |
#include <set> |
| 21 |
#include <string> |
| 22 |
#include <utility> |
| 23 |
#include <vector> |
| 24 |
|
| 25 |
namespace iga { |
| 26 |
typedef std::pair<Fragment, std::string> FragmentListElem; |
| 27 |
typedef std::vector<FragmentListElem> FragmentList; |
| 28 |
struct FieldPtrCmp { |
| 29 |
bool operator()(const Fragment *f1, const Fragment *f2) const { |
| 30 |
return *f1 < *f2; |
| 31 |
} |
| 32 |
}; |
| 33 |
typedef std::set<const Fragment *, FieldPtrCmp> FieldSet; |
| 34 |
} // namespace iga |
| 35 |
|
| 36 |
namespace iga { |
| 37 |
namespace native { |
| 38 |
bool IsEncodeSupported(const Model &m, const EncoderOpts &opts); |
| 39 |
void Encode(const Model &m, const EncoderOpts &opts, ErrorHandler &eh, |
| 40 |
Kernel &k, void *&bits, size_t &bitsLen); |
| 41 |
|
| 42 |
bool IsDecodeSupported(const Model &m, const DecoderOpts &opts); |
| 43 |
Kernel *Decode(const Model &m, const DecoderOpts &dopts, ErrorHandler &eh, |
| 44 |
const void *bits, size_t bitsLen); |
| 45 |
|
| 46 |
// for -Xifs and -Xdcmp |
| 47 |
void DecodeFields(Loc loc, const Model &model, const void *bits, |
| 48 |
FragmentList &fields, ErrorHandler &errHandler); |
| 49 |
CompactionResult DebugCompaction(const Model &m, |
| 50 |
const void *uncompactedBits, // native bits |
| 51 |
void *compactedOutput, // optional param |
| 52 |
CompactionDebugInfo &cbdi); |
| 53 |
|
| 54 |
} // namespace native |
| 55 |
} // namespace iga |
| 56 |
|
| 57 |
#endif |