3 * Copyright (c) 2018-2019 Collabora LTD
5 * Author: Gert Wollny <gert.wollny@collabora.com>
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * on the rights to use, copy, modify, merge, publish, distribute, sub
11 * license, and/or sell copies of the Software, and to permit persons to whom
12 * the Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice (including the next
15 * paragraph) shall be included in all copies or substantial portions of the
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
30 #include "../r600_isa.h"
31 #include "amd_family.h"
42 /* CF ALU instructions [29:26], highest bit always set. */
46 cf_alu_push_before
= CF_OP_ALU_PUSH_BEFORE
,
47 cf_alu_pop_after
= CF_OP_ALU_POP_AFTER
,
48 cf_alu_pop2_after
= CF_OP_ALU_POP2_AFTER
,
49 cf_alu_extended
= CF_OP_ALU_EXT
,
50 cf_alu_continue
= CF_OP_ALU_CONTINUE
,
51 cf_alu_break
= CF_OP_ALU_BREAK
,
52 cf_alu_else_after
= CF_OP_ALU_ELSE_AFTER
,
56 eg_cf_alu_undefined
= 0,
58 eg_cf_alu_push_before
= 9,
59 eg_cf_alu_pop_after
= 10,
60 eg_cf_alu_pop2_after
= 11,
61 eg_cf_alu_extended
= 12,
62 eg_cf_alu_continue
= 13,
64 eg_cf_alu_else_after
= 15,
73 cf_loop_start
= CF_OP_LOOP_START
,
74 cf_loop_end
= CF_OP_LOOP_END
,
75 cf_loop_start_dx10
= CF_OP_LOOP_START_DX10
,
76 cf_loop_start_no_al
= CF_OP_LOOP_START_NO_AL
,
77 cf_loop_continue
= CF_OP_LOOP_CONTINUE
,
78 cf_loop_break
= CF_OP_LOOP_BREAK
,
83 /* 15 - 17 reserved */
85 cf_call_fs
= CF_OP_CALL_FS
,
86 cf_return
= CF_OP_RET
,
87 cf_emit_vertex
= CF_OP_EMIT_VERTEX
,
88 cf_emit_cut_vertex
= CF_OP_EMIT_CUT_VERTEX
,
89 cf_cut_vertex
= CF_OP_CUT_VERTEX
,
92 cf_wait_ack
= CF_OP_WAIT_ACK
,
93 cf_tc_ack
= CF_OP_TEX_ACK
,
94 cf_vc_ack
= CF_OP_VTX_ACK
,
95 cf_jump_table
= CF_OP_JUMPTABLE
,
96 cf_global_wave_sync
= CF_OP_WAVE_SYNC
,
99 cf_mem_stream0_buf0
= CF_OP_MEM_STREAM0_BUF0
,
100 cf_mem_stream0_buf1
= CF_OP_MEM_STREAM0_BUF1
,
101 cf_mem_stream0_buf2
= CF_OP_MEM_STREAM0_BUF2
,
102 cf_mem_stream0_buf3
= CF_OP_MEM_STREAM0_BUF3
,
104 cf_mem_stream1_buf0
= CF_OP_MEM_STREAM1_BUF0
,
105 cf_mem_stream1_buf1
= CF_OP_MEM_STREAM1_BUF1
,
106 cf_mem_stream1_buf2
= CF_OP_MEM_STREAM1_BUF2
,
107 cf_mem_stream1_buf3
= CF_OP_MEM_STREAM1_BUF3
,
109 cf_mem_stream2_buf0
= CF_OP_MEM_STREAM2_BUF0
,
110 cf_mem_stream2_buf1
= CF_OP_MEM_STREAM2_BUF1
,
111 cf_mem_stream2_buf2
= CF_OP_MEM_STREAM2_BUF2
,
112 cf_mem_stream2_buf3
= CF_OP_MEM_STREAM2_BUF3
,
114 cf_mem_stream3_buf0
= CF_OP_MEM_STREAM3_BUF0
,
115 cf_mem_stream3_buf1
= CF_OP_MEM_STREAM3_BUF1
,
116 cf_mem_stream3_buf2
= CF_OP_MEM_STREAM3_BUF2
,
117 cf_mem_stream3_buf3
= CF_OP_MEM_STREAM3_BUF3
,
119 cf_mem_write_scratch
= CF_OP_MEM_SCRATCH
,
121 cf_mem_ring
= CF_OP_MEM_RING
,
122 cf_export
= CF_OP_EXPORT
,
123 cf_export_done
= CF_OP_EXPORT_DONE
,
124 cf_mem_export
= CF_OP_MEM_EXPORT
,
125 cf_mem_rat
= CF_OP_MEM_RAT
,
126 cf_mem_rat_cacheless
= CF_OP_MEM_RAT_NOCACHE
,
128 cf_mem_ring1
= CF_OP_MEM_RING1
,
129 cf_mem_ring2
= CF_OP_MEM_RING2
,
130 cf_mem_ring3
= CF_OP_MEM_RING3
,
131 cf_mem_export_combined
= CF_OP_MEM_MEM_COMBINED
,
132 cf_mem_rat_combined_cacheless
= CF_OP_MEM_RAT_COMBINED_NOCACHE
141 eg_cf_loop_start
= 4,
143 eg_cf_loop_start_dx10
= 6,
144 eg_cf_loop_start_no_al
= 7,
145 eg_cf_loop_continue
= 8,
146 eg_cf_loop_break
= 9,
151 /* 15 - 17 reserved */
156 eg_cf_emit_cut_vertex
,
164 eg_cf_global_wave_sync
,
167 eg_cf_mem_stream0_buf0
= 64,
168 eg_cf_mem_stream0_buf1
,
169 eg_cf_mem_stream0_buf2
,
170 eg_cf_mem_stream0_buf3
,
172 eg_cf_mem_stream1_buf0
,
173 eg_cf_mem_stream1_buf1
,
174 eg_cf_mem_stream1_buf2
,
175 eg_cf_mem_stream1_buf3
,
177 eg_cf_mem_stream2_buf0
,
178 eg_cf_mem_stream2_buf1
,
179 eg_cf_mem_stream2_buf2
,
180 eg_cf_mem_stream2_buf3
,
182 eg_cf_mem_stream3_buf0
,
183 eg_cf_mem_stream3_buf1
,
184 eg_cf_mem_stream3_buf2
,
185 eg_cf_mem_stream3_buf3
,
187 eg_cf_mem_write_scratch
,
194 eg_cf_mem_rat_cacheless
,
199 eg_cf_mem_export_combined
,
200 eg_cf_mem_rat_combined_cacheless
205 vc_fetch
= FETCH_OP_VFETCH
,
206 vc_semantic
= FETCH_OP_SEMFETCH
,
207 vc_get_buf_resinfo
= FETCH_OP_GET_BUFFER_RESINFO
,
208 vc_read_scratch
= FETCH_OP_READ_SCRATCH
,
218 enum EVTXDataFormat
{
235 fmt_16_16_float
= 16,
241 fmt_10_11_11_float
= 22,
243 fmt_11_11_10_float
= 24,
247 fmt_x24_8_32_float
= 28,
249 fmt_32_32_float
= 30,
250 fmt_16_16_16_16
= 31,
251 fmt_16_16_16_16_float
= 32,
252 fmt_reserved_33
= 33,
253 fmt_32_32_32_32
= 34,
254 fmt_32_32_32_32_float
= 35,
255 fmt_reserved_36
= 36,
262 fmt_5_9_9_9_sharedexp
= 43,
265 fmt_16_16_16_float
= 46,
267 fmt_32_32_32_float
= 48,
285 enum EVFetchNumFormat
{
291 enum EVFetchEndianSwap
{
297 enum EVFetchFlagShift
{
298 vtx_fetch_whole_quad
,
300 vtx_format_comp_signed
,
309 enum EBufferIndexMode
{