1 /* 2 * Copyright © 2018 Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 * 23 */ 24 25 #ifndef BRW_ASM_H 26 #define BRW_ASM_H 27 28 #include <inttypes.h> 29 #include <stdbool.h> 30 #include <assert.h> 31 32 #include "compiler/brw_reg.h" 33 #include "compiler/brw_reg_type.h" 34 #include "compiler/brw_eu_defines.h" 35 #include "compiler/brw_inst.h" 36 #include "compiler/brw_eu.h" 37 #include "dev/intel_device_info.h" 38 #include "util/list.h" 39 40 /* glibc < 2.27 defines OVERFLOW in /usr/include/math.h. */ 41 #undef OVERFLOW 42 43 int yyparse(void); 44 int yylex(void); 45 char *lex_text(void); 46 47 extern struct brw_codegen *p; 48 extern int errors; 49 extern char *input_filename; 50 51 extern struct list_head instr_labels; 52 extern struct list_head target_labels; 53 54 struct condition { 55 unsigned cond_modifier:4; 56 unsigned flag_reg_nr:1; 57 unsigned flag_subreg_nr:1; 58 }; 59 60 struct predicate { 61 unsigned pred_control:4; 62 unsigned pred_inv:1; 63 unsigned flag_reg_nr:1; 64 unsigned flag_subreg_nr:1; 65 }; 66 67 enum instoption_type { 68 INSTOPTION_FLAG, 69 INSTOPTION_DEP_INFO, 70 }; 71 72 struct instoption { 73 enum instoption_type type; 74 union { 75 unsigned uint_value; 76 struct tgl_swsb depinfo_value; 77 }; 78 }; 79 80 struct options { 81 unsigned access_mode:1; 82 unsigned compression_control:2; 83 unsigned thread_control:2; 84 unsigned no_dd_check:1; // Dependency control 85 unsigned no_dd_clear:1; // Dependency control 86 unsigned mask_control:1; 87 unsigned debug_control:1; 88 unsigned acc_wr_control:1; 89 unsigned end_of_thread:1; 90 unsigned compaction:1; 91 unsigned qtr_ctrl:2; 92 unsigned nib_ctrl:1; 93 unsigned is_compr:1; 94 struct tgl_swsb depinfo; 95 }; 96 97 struct msgdesc { 98 unsigned ex_bso:1; 99 unsigned src1_len:5; 100 }; 101 102 enum instr_label_type { 103 INSTR_LABEL_JIP, 104 INSTR_LABEL_UIP, 105 }; 106 107 struct instr_label { 108 struct list_head link; 109 110 char *name; 111 int offset; 112 enum instr_label_type type; 113 }; 114 115 struct target_label { 116 struct list_head link; 117 118 char *name; 119 int offset; 120 }; 121 122 #endif /* BRW_ASM_H */ 123