1bf215546Sopenharmony_ci/* -*- mesa-c++ -*- 2bf215546Sopenharmony_ci * 3bf215546Sopenharmony_ci * Copyright (c) 2018-2019 Collabora LTD 4bf215546Sopenharmony_ci * 5bf215546Sopenharmony_ci * Author: Gert Wollny <gert.wollny@collabora.com> 6bf215546Sopenharmony_ci * 7bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 8bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 9bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 10bf215546Sopenharmony_ci * on the rights to use, copy, modify, merge, publish, distribute, sub 11bf215546Sopenharmony_ci * license, and/or sell copies of the Software, and to permit persons to whom 12bf215546Sopenharmony_ci * the Software is furnished to do so, subject to the following conditions: 13bf215546Sopenharmony_ci * 14bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next 15bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the 16bf215546Sopenharmony_ci * Software. 17bf215546Sopenharmony_ci * 18bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 21bf215546Sopenharmony_ci * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 22bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 23bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 24bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE. 25bf215546Sopenharmony_ci */ 26bf215546Sopenharmony_ci 27bf215546Sopenharmony_ci#ifndef sfn_defines_h 28bf215546Sopenharmony_ci#define sfn_defines_h 29bf215546Sopenharmony_ci 30bf215546Sopenharmony_ci#include "../r600_isa.h" 31bf215546Sopenharmony_ci#include "amd_family.h" 32bf215546Sopenharmony_cinamespace r600 { 33bf215546Sopenharmony_ci 34bf215546Sopenharmony_ci 35bf215546Sopenharmony_cienum EGWSOpCode { 36bf215546Sopenharmony_ci cf_sema_v = 0, 37bf215546Sopenharmony_ci cf_sema_p = 1, 38bf215546Sopenharmony_ci cf_gws_barrier = 2, 39bf215546Sopenharmony_ci cf_gws_init = 3, 40bf215546Sopenharmony_ci}; 41bf215546Sopenharmony_ci 42bf215546Sopenharmony_ci/* CF ALU instructions [29:26], highest bit always set. */ 43bf215546Sopenharmony_cienum ECFAluOpCode { 44bf215546Sopenharmony_ci cf_alu_undefined = 0, 45bf215546Sopenharmony_ci cf_alu = CF_OP_ALU, 46bf215546Sopenharmony_ci cf_alu_push_before = CF_OP_ALU_PUSH_BEFORE, 47bf215546Sopenharmony_ci cf_alu_pop_after = CF_OP_ALU_POP_AFTER, 48bf215546Sopenharmony_ci cf_alu_pop2_after = CF_OP_ALU_POP2_AFTER, 49bf215546Sopenharmony_ci cf_alu_extended = CF_OP_ALU_EXT, 50bf215546Sopenharmony_ci cf_alu_continue = CF_OP_ALU_CONTINUE, 51bf215546Sopenharmony_ci cf_alu_break = CF_OP_ALU_BREAK, 52bf215546Sopenharmony_ci cf_alu_else_after = CF_OP_ALU_ELSE_AFTER, 53bf215546Sopenharmony_ci}; 54bf215546Sopenharmony_ci 55bf215546Sopenharmony_cienum ECFAluOpCodeEG { 56bf215546Sopenharmony_ci eg_cf_alu_undefined = 0, 57bf215546Sopenharmony_ci eg_cf_alu = 8, 58bf215546Sopenharmony_ci eg_cf_alu_push_before = 9, 59bf215546Sopenharmony_ci eg_cf_alu_pop_after = 10, 60bf215546Sopenharmony_ci eg_cf_alu_pop2_after = 11, 61bf215546Sopenharmony_ci eg_cf_alu_extended = 12, 62bf215546Sopenharmony_ci eg_cf_alu_continue = 13, 63bf215546Sopenharmony_ci eg_cf_alu_break = 14, 64bf215546Sopenharmony_ci eg_cf_alu_else_after = 15, 65bf215546Sopenharmony_ci}; 66bf215546Sopenharmony_ci 67bf215546Sopenharmony_ci 68bf215546Sopenharmony_cienum ECFOpCode { 69bf215546Sopenharmony_ci cf_nop = CF_OP_NOP, 70bf215546Sopenharmony_ci cf_tc = CF_OP_TEX, 71bf215546Sopenharmony_ci cf_vc = CF_OP_VTX, 72bf215546Sopenharmony_ci cf_gds = CF_OP_GDS, 73bf215546Sopenharmony_ci cf_loop_start = CF_OP_LOOP_START, 74bf215546Sopenharmony_ci cf_loop_end = CF_OP_LOOP_END, 75bf215546Sopenharmony_ci cf_loop_start_dx10 = CF_OP_LOOP_START_DX10, 76bf215546Sopenharmony_ci cf_loop_start_no_al = CF_OP_LOOP_START_NO_AL, 77bf215546Sopenharmony_ci cf_loop_continue = CF_OP_LOOP_CONTINUE, 78bf215546Sopenharmony_ci cf_loop_break = CF_OP_LOOP_BREAK, 79bf215546Sopenharmony_ci cf_jump = CF_OP_JUMP, 80bf215546Sopenharmony_ci cf_push = CF_OP_PUSH, 81bf215546Sopenharmony_ci cf_else = CF_OP_ELSE, 82bf215546Sopenharmony_ci cf_pop = CF_OP_POP, 83bf215546Sopenharmony_ci /* 15 - 17 reserved */ 84bf215546Sopenharmony_ci cf_call = CF_OP_CALL, 85bf215546Sopenharmony_ci cf_call_fs = CF_OP_CALL_FS, 86bf215546Sopenharmony_ci cf_return = CF_OP_RET, 87bf215546Sopenharmony_ci cf_emit_vertex = CF_OP_EMIT_VERTEX, 88bf215546Sopenharmony_ci cf_emit_cut_vertex = CF_OP_EMIT_CUT_VERTEX, 89bf215546Sopenharmony_ci cf_cut_vertex = CF_OP_CUT_VERTEX, 90bf215546Sopenharmony_ci cf_kill = CF_OP_KILL, 91bf215546Sopenharmony_ci /* 25 reserved */ 92bf215546Sopenharmony_ci cf_wait_ack = CF_OP_WAIT_ACK, 93bf215546Sopenharmony_ci cf_tc_ack = CF_OP_TEX_ACK, 94bf215546Sopenharmony_ci cf_vc_ack = CF_OP_VTX_ACK, 95bf215546Sopenharmony_ci cf_jump_table = CF_OP_JUMPTABLE, 96bf215546Sopenharmony_ci cf_global_wave_sync = CF_OP_WAVE_SYNC, 97bf215546Sopenharmony_ci cf_halt = CF_OP_HALT, 98bf215546Sopenharmony_ci /* gap 32-63*/ 99bf215546Sopenharmony_ci cf_mem_stream0_buf0 = CF_OP_MEM_STREAM0_BUF0, 100bf215546Sopenharmony_ci cf_mem_stream0_buf1 = CF_OP_MEM_STREAM0_BUF1, 101bf215546Sopenharmony_ci cf_mem_stream0_buf2 = CF_OP_MEM_STREAM0_BUF2, 102bf215546Sopenharmony_ci cf_mem_stream0_buf3 = CF_OP_MEM_STREAM0_BUF3, 103bf215546Sopenharmony_ci 104bf215546Sopenharmony_ci cf_mem_stream1_buf0 = CF_OP_MEM_STREAM1_BUF0, 105bf215546Sopenharmony_ci cf_mem_stream1_buf1 = CF_OP_MEM_STREAM1_BUF1, 106bf215546Sopenharmony_ci cf_mem_stream1_buf2 = CF_OP_MEM_STREAM1_BUF2, 107bf215546Sopenharmony_ci cf_mem_stream1_buf3 = CF_OP_MEM_STREAM1_BUF3, 108bf215546Sopenharmony_ci 109bf215546Sopenharmony_ci cf_mem_stream2_buf0 = CF_OP_MEM_STREAM2_BUF0, 110bf215546Sopenharmony_ci cf_mem_stream2_buf1 = CF_OP_MEM_STREAM2_BUF1, 111bf215546Sopenharmony_ci cf_mem_stream2_buf2 = CF_OP_MEM_STREAM2_BUF2, 112bf215546Sopenharmony_ci cf_mem_stream2_buf3 = CF_OP_MEM_STREAM2_BUF3, 113bf215546Sopenharmony_ci 114bf215546Sopenharmony_ci cf_mem_stream3_buf0 = CF_OP_MEM_STREAM3_BUF0, 115bf215546Sopenharmony_ci cf_mem_stream3_buf1 = CF_OP_MEM_STREAM3_BUF1, 116bf215546Sopenharmony_ci cf_mem_stream3_buf2 = CF_OP_MEM_STREAM3_BUF2, 117bf215546Sopenharmony_ci cf_mem_stream3_buf3 = CF_OP_MEM_STREAM3_BUF3, 118bf215546Sopenharmony_ci 119bf215546Sopenharmony_ci cf_mem_write_scratch = CF_OP_MEM_SCRATCH , 120bf215546Sopenharmony_ci /* reserved 81 */ 121bf215546Sopenharmony_ci cf_mem_ring = CF_OP_MEM_RING, 122bf215546Sopenharmony_ci cf_export = CF_OP_EXPORT, 123bf215546Sopenharmony_ci cf_export_done = CF_OP_EXPORT_DONE, 124bf215546Sopenharmony_ci cf_mem_export = CF_OP_MEM_EXPORT, 125bf215546Sopenharmony_ci cf_mem_rat = CF_OP_MEM_RAT, 126bf215546Sopenharmony_ci cf_mem_rat_cacheless = CF_OP_MEM_RAT_NOCACHE, 127bf215546Sopenharmony_ci 128bf215546Sopenharmony_ci cf_mem_ring1 = CF_OP_MEM_RING1, 129bf215546Sopenharmony_ci cf_mem_ring2 = CF_OP_MEM_RING2, 130bf215546Sopenharmony_ci cf_mem_ring3 = CF_OP_MEM_RING3, 131bf215546Sopenharmony_ci cf_mem_export_combined = CF_OP_MEM_MEM_COMBINED, 132bf215546Sopenharmony_ci cf_mem_rat_combined_cacheless = CF_OP_MEM_RAT_COMBINED_NOCACHE 133bf215546Sopenharmony_ci 134bf215546Sopenharmony_ci}; 135bf215546Sopenharmony_ci 136bf215546Sopenharmony_cienum ECFOpCodeEG { 137bf215546Sopenharmony_ci eg_cf_nop = 0, 138bf215546Sopenharmony_ci eg_cf_tc = 1, 139bf215546Sopenharmony_ci eg_cf_vc = 2, 140bf215546Sopenharmony_ci eg_cf_gds = 3, 141bf215546Sopenharmony_ci eg_cf_loop_start = 4, 142bf215546Sopenharmony_ci eg_cf_loop_end = 5, 143bf215546Sopenharmony_ci eg_cf_loop_start_dx10 = 6, 144bf215546Sopenharmony_ci eg_cf_loop_start_no_al = 7, 145bf215546Sopenharmony_ci eg_cf_loop_continue = 8, 146bf215546Sopenharmony_ci eg_cf_loop_break = 9, 147bf215546Sopenharmony_ci eg_cf_jump = 10, 148bf215546Sopenharmony_ci eg_cf_push = 11, 149bf215546Sopenharmony_ci eg_cf_else = 13, 150bf215546Sopenharmony_ci eg_cf_pop = 14, 151bf215546Sopenharmony_ci /* 15 - 17 reserved */ 152bf215546Sopenharmony_ci eg_cf_call = 18, 153bf215546Sopenharmony_ci eg_cf_call_fs, 154bf215546Sopenharmony_ci eg_cf_return, 155bf215546Sopenharmony_ci eg_cf_emit_vertex, 156bf215546Sopenharmony_ci eg_cf_emit_cut_vertex, 157bf215546Sopenharmony_ci eg_cf_cut_vertex, 158bf215546Sopenharmony_ci eg_cf_kill, 159bf215546Sopenharmony_ci /* 25 reserved */ 160bf215546Sopenharmony_ci eg_cf_wait_ack = 26, 161bf215546Sopenharmony_ci eg_cf_tc_ack, 162bf215546Sopenharmony_ci eg_cf_vc_ack, 163bf215546Sopenharmony_ci eg_cf_jump_table, 164bf215546Sopenharmony_ci eg_cf_global_wave_sync, 165bf215546Sopenharmony_ci eg_cf_halt, 166bf215546Sopenharmony_ci /* gap 32-63*/ 167bf215546Sopenharmony_ci eg_cf_mem_stream0_buf0 = 64, 168bf215546Sopenharmony_ci eg_cf_mem_stream0_buf1, 169bf215546Sopenharmony_ci eg_cf_mem_stream0_buf2, 170bf215546Sopenharmony_ci eg_cf_mem_stream0_buf3, 171bf215546Sopenharmony_ci 172bf215546Sopenharmony_ci eg_cf_mem_stream1_buf0, 173bf215546Sopenharmony_ci eg_cf_mem_stream1_buf1, 174bf215546Sopenharmony_ci eg_cf_mem_stream1_buf2, 175bf215546Sopenharmony_ci eg_cf_mem_stream1_buf3, 176bf215546Sopenharmony_ci 177bf215546Sopenharmony_ci eg_cf_mem_stream2_buf0, 178bf215546Sopenharmony_ci eg_cf_mem_stream2_buf1, 179bf215546Sopenharmony_ci eg_cf_mem_stream2_buf2, 180bf215546Sopenharmony_ci eg_cf_mem_stream2_buf3, 181bf215546Sopenharmony_ci 182bf215546Sopenharmony_ci eg_cf_mem_stream3_buf0, 183bf215546Sopenharmony_ci eg_cf_mem_stream3_buf1, 184bf215546Sopenharmony_ci eg_cf_mem_stream3_buf2, 185bf215546Sopenharmony_ci eg_cf_mem_stream3_buf3, 186bf215546Sopenharmony_ci 187bf215546Sopenharmony_ci eg_cf_mem_write_scratch, 188bf215546Sopenharmony_ci /* reserved 81 */ 189bf215546Sopenharmony_ci eg_cf_mem_ring = 82, 190bf215546Sopenharmony_ci eg_cf_export, 191bf215546Sopenharmony_ci eg_cf_export_done, 192bf215546Sopenharmony_ci eg_cf_mem_export, 193bf215546Sopenharmony_ci eg_cf_mem_rat, 194bf215546Sopenharmony_ci eg_cf_mem_rat_cacheless, 195bf215546Sopenharmony_ci 196bf215546Sopenharmony_ci eg_cf_mem_ring1, 197bf215546Sopenharmony_ci eg_cf_mem_ring2, 198bf215546Sopenharmony_ci eg_cf_mem_ring3, 199bf215546Sopenharmony_ci eg_cf_mem_export_combined, 200bf215546Sopenharmony_ci eg_cf_mem_rat_combined_cacheless 201bf215546Sopenharmony_ci}; 202bf215546Sopenharmony_ci 203bf215546Sopenharmony_ci 204bf215546Sopenharmony_cienum EVFetchInstr { 205bf215546Sopenharmony_ci vc_fetch = FETCH_OP_VFETCH, 206bf215546Sopenharmony_ci vc_semantic = FETCH_OP_SEMFETCH, 207bf215546Sopenharmony_ci vc_get_buf_resinfo = FETCH_OP_GET_BUFFER_RESINFO, 208bf215546Sopenharmony_ci vc_read_scratch = FETCH_OP_READ_SCRATCH, 209bf215546Sopenharmony_ci vc_unknown 210bf215546Sopenharmony_ci}; 211bf215546Sopenharmony_ci 212bf215546Sopenharmony_cienum EVFetchType { 213bf215546Sopenharmony_ci vertex_data = 0, 214bf215546Sopenharmony_ci instance_data = 1, 215bf215546Sopenharmony_ci no_index_offset = 2 216bf215546Sopenharmony_ci}; 217bf215546Sopenharmony_ci 218bf215546Sopenharmony_cienum EVTXDataFormat { 219bf215546Sopenharmony_ci fmt_invalid = 0, 220bf215546Sopenharmony_ci fmt_8 = 1, 221bf215546Sopenharmony_ci fmt_4_4 = 2, 222bf215546Sopenharmony_ci fmt_3_3_2 = 3, 223bf215546Sopenharmony_ci fmt_reserved_4 = 4, 224bf215546Sopenharmony_ci fmt_16 = 5, 225bf215546Sopenharmony_ci fmt_16_float = 6, 226bf215546Sopenharmony_ci fmt_8_8 = 7, 227bf215546Sopenharmony_ci fmt_5_6_5 = 8, 228bf215546Sopenharmony_ci fmt_6_5_5 = 9, 229bf215546Sopenharmony_ci fmt_1_5_5_5 = 10, 230bf215546Sopenharmony_ci fmt_4_4_4_4 = 11, 231bf215546Sopenharmony_ci fmt_5_5_5_1 = 12, 232bf215546Sopenharmony_ci fmt_32 = 13, 233bf215546Sopenharmony_ci fmt_32_float = 14, 234bf215546Sopenharmony_ci fmt_16_16 = 15, 235bf215546Sopenharmony_ci fmt_16_16_float = 16, 236bf215546Sopenharmony_ci fmt_8_24 = 17, 237bf215546Sopenharmony_ci fmt_8_24_float = 18, 238bf215546Sopenharmony_ci fmt_24_8 = 19, 239bf215546Sopenharmony_ci fmt_24_8_float = 20, 240bf215546Sopenharmony_ci fmt_10_11_11 = 21, 241bf215546Sopenharmony_ci fmt_10_11_11_float = 22, 242bf215546Sopenharmony_ci fmt_11_11_10 = 23, 243bf215546Sopenharmony_ci fmt_11_11_10_float = 24, 244bf215546Sopenharmony_ci fmt_2_10_10_10 = 25, 245bf215546Sopenharmony_ci fmt_8_8_8_8 = 26, 246bf215546Sopenharmony_ci fmt_10_10_10_2 = 27, 247bf215546Sopenharmony_ci fmt_x24_8_32_float = 28, 248bf215546Sopenharmony_ci fmt_32_32 = 29, 249bf215546Sopenharmony_ci fmt_32_32_float = 30, 250bf215546Sopenharmony_ci fmt_16_16_16_16 = 31, 251bf215546Sopenharmony_ci fmt_16_16_16_16_float = 32, 252bf215546Sopenharmony_ci fmt_reserved_33 = 33, 253bf215546Sopenharmony_ci fmt_32_32_32_32 = 34, 254bf215546Sopenharmony_ci fmt_32_32_32_32_float = 35, 255bf215546Sopenharmony_ci fmt_reserved_36 = 36, 256bf215546Sopenharmony_ci fmt_1 = 37, 257bf215546Sopenharmony_ci fmt_1_reversed = 38, 258bf215546Sopenharmony_ci fmt_gb_gr = 39, 259bf215546Sopenharmony_ci fmt_bg_rg = 40, 260bf215546Sopenharmony_ci fmt_32_as_8 = 41, 261bf215546Sopenharmony_ci fmt_32_as_8_8 = 42, 262bf215546Sopenharmony_ci fmt_5_9_9_9_sharedexp = 43, 263bf215546Sopenharmony_ci fmt_8_8_8 = 44, 264bf215546Sopenharmony_ci fmt_16_16_16 = 45, 265bf215546Sopenharmony_ci fmt_16_16_16_float = 46, 266bf215546Sopenharmony_ci fmt_32_32_32 = 47, 267bf215546Sopenharmony_ci fmt_32_32_32_float = 48, 268bf215546Sopenharmony_ci fmt_bc1 = 49, 269bf215546Sopenharmony_ci fmt_bc2 = 50, 270bf215546Sopenharmony_ci fmt_bc3 = 51, 271bf215546Sopenharmony_ci fmt_bc4 = 52, 272bf215546Sopenharmony_ci fmt_bc5 = 53, 273bf215546Sopenharmony_ci fmt_apc0 = 54, 274bf215546Sopenharmony_ci fmt_apc1 = 55, 275bf215546Sopenharmony_ci fmt_apc2 = 56, 276bf215546Sopenharmony_ci fmt_apc3 = 57, 277bf215546Sopenharmony_ci fmt_apc4 = 58, 278bf215546Sopenharmony_ci fmt_apc5 = 59, 279bf215546Sopenharmony_ci fmt_apc6 = 60, 280bf215546Sopenharmony_ci fmt_apc7 = 61, 281bf215546Sopenharmony_ci fmt_ctx1 = 62, 282bf215546Sopenharmony_ci fmt_reserved_63 = 63 283bf215546Sopenharmony_ci}; 284bf215546Sopenharmony_ci 285bf215546Sopenharmony_cienum EVFetchNumFormat { 286bf215546Sopenharmony_ci vtx_nf_norm = 0, 287bf215546Sopenharmony_ci vtx_nf_int = 1, 288bf215546Sopenharmony_ci vtx_nf_scaled = 2 289bf215546Sopenharmony_ci}; 290bf215546Sopenharmony_ci 291bf215546Sopenharmony_cienum EVFetchEndianSwap { 292bf215546Sopenharmony_ci vtx_es_none = 0, 293bf215546Sopenharmony_ci vtx_es_8in16 = 1, 294bf215546Sopenharmony_ci vtx_es_8in32 = 2 295bf215546Sopenharmony_ci}; 296bf215546Sopenharmony_ci 297bf215546Sopenharmony_cienum EVFetchFlagShift { 298bf215546Sopenharmony_ci vtx_fetch_whole_quad, 299bf215546Sopenharmony_ci vtx_use_const_field, 300bf215546Sopenharmony_ci vtx_format_comp_signed, 301bf215546Sopenharmony_ci vtx_srf_mode, 302bf215546Sopenharmony_ci vtx_buf_no_stride, 303bf215546Sopenharmony_ci vtx_alt_const, 304bf215546Sopenharmony_ci vtx_use_tc, 305bf215546Sopenharmony_ci vtx_vpm, 306bf215546Sopenharmony_ci vtx_is_mega_fetch, 307bf215546Sopenharmony_ci vtx_uncached, 308bf215546Sopenharmony_ci vtx_indexed, 309bf215546Sopenharmony_ci vtx_unknown 310bf215546Sopenharmony_ci}; 311bf215546Sopenharmony_ci 312bf215546Sopenharmony_cienum EBufferIndexMode { 313bf215546Sopenharmony_ci bim_none, 314bf215546Sopenharmony_ci bim_zero, 315bf215546Sopenharmony_ci bim_one, 316bf215546Sopenharmony_ci bim_invalid 317bf215546Sopenharmony_ci}; 318bf215546Sopenharmony_ci 319bf215546Sopenharmony_ci} 320bf215546Sopenharmony_ci 321bf215546Sopenharmony_ci#endif // DEFINES_H 322