xref: /aosp_15_r20/external/mesa3d/src/intel/compiler/brw_asm_internal.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2018 Intel Corporation
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #ifndef BRW_ASM_INTERNAL_H
7 #define BRW_ASM_INTERNAL_H
8 
9 /* Assembler internal state and definitions used by the brw_gram/brw_lex. */
10 
11 #include <inttypes.h>
12 #include <stdbool.h>
13 #include <assert.h>
14 
15 #include "compiler/brw_reg.h"
16 #include "compiler/brw_reg_type.h"
17 #include "compiler/brw_eu_defines.h"
18 #include "compiler/brw_inst.h"
19 #include "compiler/brw_eu.h"
20 #include "dev/intel_device_info.h"
21 #include "util/list.h"
22 
23 /* glibc < 2.27 defines OVERFLOW in /usr/include/math.h. */
24 #undef OVERFLOW
25 
26 int yyparse(void);
27 int yylex(void);
28 char *lex_text(void);
29 
30 extern struct brw_codegen *p;
31 extern int errors;
32 extern const char *input_filename;
33 
34 extern struct list_head instr_labels;
35 extern struct list_head target_labels;
36 
37 struct condition {
38    unsigned cond_modifier:4;
39    unsigned flag_reg_nr:1;
40    unsigned flag_subreg_nr:1;
41 };
42 
43 struct predicate {
44    unsigned pred_control:4;
45    unsigned pred_inv:1;
46    unsigned flag_reg_nr:1;
47    unsigned flag_subreg_nr:1;
48 };
49 
50 enum instoption_type {
51    INSTOPTION_FLAG,
52    INSTOPTION_DEP_INFO,
53    INSTOPTION_CHAN_OFFSET,
54 };
55 
56 struct instoption {
57    enum instoption_type type;
58    union {
59       unsigned uint_value;
60       struct tgl_swsb depinfo_value;
61    };
62 };
63 
64 struct options {
65    uint8_t chan_offset;
66    unsigned access_mode:1;
67    unsigned compression_control:2;
68    unsigned thread_control:2;
69    unsigned no_dd_check:1; // Dependency control
70    unsigned no_dd_clear:1; // Dependency control
71    unsigned mask_control:1;
72    unsigned debug_control:1;
73    unsigned acc_wr_control:1;
74    unsigned end_of_thread:1;
75    unsigned compaction:1;
76    unsigned is_compr:1;
77    struct tgl_swsb depinfo;
78 };
79 
80 struct msgdesc {
81    unsigned ex_bso:1;
82    unsigned src1_len:5;
83 };
84 
85 enum instr_label_type {
86    INSTR_LABEL_JIP,
87    INSTR_LABEL_UIP,
88 };
89 
90 struct instr_label {
91    struct list_head link;
92 
93    char *name;
94    int offset;
95    enum instr_label_type type;
96 };
97 
98 struct target_label {
99    struct list_head link;
100 
101    char *name;
102    int offset;
103 };
104 
105 #endif /* BRW_ASM_H */
106 
107