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 #pragma once
10 ///
11 /// ISA IR Disassembler
12 ///
13 
14 #include "Common_ISA.h"
15 
16 #include <list>
17 #include <string>
18 
19 /// Looks up a GEN variable name
20 const char* getGenVarName(int id, const print_format_provider_t& header);
21 
22 ///
23 /// - Takes an isa header, a kernel/function header, and isa instruction and
24 ///   returns a string contraining the instruction's isaasm.
25 ///
26 std::string printInstruction(
27     const print_format_provider_t* header,
28     const CISA_INST* instruction,
29     const Options *opt);
30 
31 /// Exposing these declare print functions for use by verifier diagnostics code
32 /// or for disassembly output.
33 std::string printPredicateDecl(
34     const print_format_provider_t* header,
35     unsigned declID);
36 std::string printVariableDecl (
37     const print_format_provider_t* header,
38     unsigned declID,
39     const Options *options);
40 std::string printAddressDecl(
41     const common_isa_header& isaHeader,
42     const print_format_provider_t* header,
43     unsigned declID);
44 std::string printSamplerDecl(
45     const print_format_provider_t* header,
46     unsigned declID);
47 std::string printSurfaceDecl(
48     const print_format_provider_t* header,
49     unsigned declID,
50     unsigned numPredefinedSurfaces);
51 std::string printFuncInput(
52     const print_format_provider_t* header,
53     unsigned declID,
54     bool isKernel,
55     const Options* options);
56 const char* printAsmName(
57     const print_format_provider_t* header);
58 std::string printOneAttribute(
59     const print_format_provider_t* kernel,
60     const attribute_info_t* attr);
61 // Used for printing non-kernel attributes
62 // format:  attrs={attr0,attr1,......attrn}, where  each attr is AttrName|AttrName=<V>
63 std::string printAttributes(
64     const print_format_provider_t* header,
65     const int attr_count,
66     const attribute_info_t* attrs);
67 
68 /// Exposing these for inline asm code generation
69 std::string printVectorOperand(
70     const print_format_provider_t* header,
71     const VISA_opnd* opnd,
72     const Options *opt,
73     bool showRegion);
74 std::string printFunctionDecl(
75     const print_format_provider_t* header,
76     bool isKernel);
77 std::string printBuildVersion(
78     const common_isa_header& isaHeader);
79