1 /* 2 * Copyright © 2018 Intel Corporation 3 * SPDX-License-Identifier: MIT 4 */ 5 6 #pragma once 7 8 /* Assembler internal state and definitions used by the brw_gram/brw_lex. */ 9 10 #include <inttypes.h> 11 #include <stdbool.h> 12 #include <assert.h> 13 14 #include "compiler/brw_reg.h" 15 #include "compiler/brw_reg_type.h" 16 #include "compiler/brw_eu_defines.h" 17 #include "compiler/brw_eu_inst.h" 18 #include "compiler/brw_eu.h" 19 #include "dev/intel_device_info.h" 20 #include "util/list.h" 21 22 /* glibc < 2.27 defines OVERFLOW in /usr/include/math.h. */ 23 #undef OVERFLOW 24 25 int yyparse(void); 26 int yylex(void); 27 char *lex_text(void); 28 29 extern struct brw_codegen *p; 30 extern int errors; 31 extern const char *input_filename; 32 33 extern struct list_head instr_labels; 34 extern struct list_head target_labels; 35 36 struct condition { 37 unsigned cond_modifier:4; 38 unsigned flag_reg_nr:1; 39 unsigned flag_subreg_nr:1; 40 }; 41 42 struct predicate { 43 unsigned pred_control:4; 44 unsigned pred_inv:1; 45 unsigned flag_reg_nr:1; 46 unsigned flag_subreg_nr:1; 47 }; 48 49 enum instoption_type { 50 INSTOPTION_FLAG, 51 INSTOPTION_DEP_INFO, 52 INSTOPTION_CHAN_OFFSET, 53 }; 54 55 struct instoption { 56 enum instoption_type type; 57 union { 58 unsigned uint_value; 59 struct tgl_swsb depinfo_value; 60 }; 61 }; 62 63 struct options { 64 uint8_t chan_offset; 65 unsigned access_mode:1; 66 unsigned compression_control:2; 67 unsigned thread_control:2; 68 unsigned branch_control:1; 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