89344ae062ffc9e7e0dbbcf8fc324b40a5e24cfc
[mesa.git] / src / panfrost / bifrost / bifrost.h
1 /*
2 * Copyright (C) 2019 Connor Abbott <cwabbott0@gmail.com>
3 * Copyright (C) 2019 Lyude Paul <thatslyude@gmail.com>
4 * Copyright (C) 2019 Ryan Houdek <Sonicadvance1@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26 #ifndef __bifrost_h__
27 #define __bifrost_h__
28
29 #include <stdint.h>
30 #include <stdbool.h>
31
32 enum bifrost_clause_type {
33 BIFROST_CLAUSE_NONE = 0,
34 BIFROST_CLAUSE_LOAD_VARY = 1,
35 BIFROST_CLAUSE_UBO = 2,
36 BIFROST_CLAUSE_TEX = 3,
37 BIFROST_CLAUSE_SSBO_LOAD = 5,
38 BIFROST_CLAUSE_SSBO_STORE = 6,
39 BIFROST_CLAUSE_BLEND = 9,
40 BIFROST_CLAUSE_ATEST = 13,
41 BIFROST_CLAUSE_64BIT = 15
42 };
43
44 struct bifrost_header {
45 unsigned unk0 : 7;
46 // If true, convert any infinite result of any floating-point operation to
47 // the biggest representable number.
48 unsigned suppress_inf: 1;
49 // Convert any NaN results to 0.
50 unsigned suppress_nan : 1;
51 unsigned unk1 : 2;
52 // true if the execution mask of the next clause is the same as the mask of
53 // the current clause.
54 unsigned back_to_back : 1;
55 unsigned no_end_of_shader: 1;
56 unsigned unk2 : 2;
57 // Set to true for fragment shaders, to implement this bit of spec text
58 // from section 7.1.5 of the GLSL ES spec:
59 //
60 // "Stores to image and buffer variables performed by helper invocations
61 // have no effect on the underlying image or buffer memory."
62 //
63 // Helper invocations are threads (invocations) corresponding to pixels in
64 // a quad that aren't actually part of the triangle, but are included to
65 // make derivatives work correctly. They're usually turned on, but they
66 // need to be masked off for GLSL-level stores. This bit seems to be the
67 // only bit that's actually different between fragment shaders and other
68 // shaders, so this is probably what it's doing.
69 unsigned elide_writes : 1;
70 // If backToBack is off:
71 // - true for conditional branches and fallthrough
72 // - false for unconditional branches
73 // The blob seems to always set it to true if back-to-back is on.
74 unsigned branch_cond : 1;
75 // This bit is set when the next clause writes to the data register of some
76 // previous clause.
77 unsigned datareg_writebarrier: 1;
78 unsigned datareg : 6;
79 unsigned scoreboard_deps: 8;
80 unsigned scoreboard_index: 3;
81 enum bifrost_clause_type clause_type: 4;
82 unsigned unk3 : 1; // part of clauseType?
83 enum bifrost_clause_type next_clause_type: 4;
84 unsigned unk4 : 1; // part of nextClauseType?
85 } __attribute__((packed));
86
87 enum bifrost_packed_src {
88 BIFROST_SRC_PORT0 = 0,
89 BIFROST_SRC_PORT1 = 1,
90 BIFROST_SRC_PORT3 = 2,
91 BIFROST_SRC_STAGE = 3,
92 BIFROST_SRC_CONST_LO = 4,
93 BIFROST_SRC_CONST_HI = 5,
94 BIFROST_SRC_PASS_FMA = 6,
95 BIFROST_SRC_PASS_ADD = 7,
96 };
97
98 #define BIFROST_FMA_EXT (0xe0000)
99 #define BIFROST_FMA_OP_MOV BIFROST_FMA_EXT | (0x32d)
100 #define BIFROST_FMA_OP_FREXPE_LOG BIFROST_FMA_EXT | 0x3c5
101 #define BIFROST_FMA_OP_ADD_FREXPM ((BIFROST_FMA_EXT | 0x1e80) >> 3)
102
103 struct bifrost_fma_inst {
104 unsigned src0 : 3;
105 unsigned op : 20;
106 } __attribute__((packed));
107
108 struct bifrost_fma_2src {
109 unsigned src0 : 3;
110 unsigned src1 : 3;
111 unsigned op : 17;
112 } __attribute__((packed));
113
114 #define BIFROST_FMA_OP_MSCALE (0x50 >> 3)
115
116 struct bifrost_fma_mscale {
117 unsigned src0 : 3;
118 unsigned src1 : 3;
119 unsigned src2 : 3;
120 unsigned src3 : 3;
121
122 /* If mscale_mode is set - an MSCALE specific mode. If it is not set, a
123 * regular outmod */
124 unsigned mode : 2;
125 unsigned mscale_mode : 1;
126
127 unsigned src0_abs : 1;
128 unsigned src1_neg : 1;
129 unsigned src2_neg : 1;
130 unsigned op : 5;
131 } __attribute__((packed));
132
133 #define BIFROST_ADD_OP_BLEND (0x1952c)
134 #define BIFROST_ADD_OP_FRCP_FAST_F32 (0x0cc00)
135 #define BIFROST_ADD_OP_FRCP_FAST_F16_X (0x0ce10)
136 #define BIFROST_ADD_OP_FRCP_FAST_F16_Y (0x0ce30)
137 #define BIFROST_ADD_OP_FRSQ_FAST_F32 (0x0cc20)
138 #define BIFROST_ADD_OP_FRSQ_FAST_F16_X (0x0ce50)
139 #define BIFROST_ADD_OP_FRSQ_FAST_F16_Y (0x0ce70)
140 #define BIFROST_ADD_OP_LOG2_HELP (0x0cc68)
141 #define BIFROST_ADD_OP_FEXP2_FAST (0x0cd58)
142
143 struct bifrost_add_inst {
144 unsigned src0 : 3;
145 unsigned op : 17;
146 } __attribute__((packed));
147
148 #define BIFROST_ADD_OP_LD_UBO_1 (0x0c1a0 >> 3)
149 #define BIFROST_ADD_OP_LD_UBO_2 (0x0c1e0 >> 3)
150 #define BIFROST_ADD_OP_LD_UBO_3 (0x0caa0 >> 3)
151 #define BIFROST_ADD_OP_LD_UBO_4 (0x0c220 >> 3)
152
153 struct bifrost_add_2src {
154 unsigned src0 : 3;
155 unsigned src1 : 3;
156 unsigned op : 14;
157 } __attribute__((packed));
158
159 #define BIFROST_ADD_OP_FMAX32 (0x00)
160 #define BIFROST_ADD_OP_FMIN32 (0x01)
161 #define BIFROST_ADD_OP_FADD32 (0x02)
162
163 #define BIFROST_ADD_OP_FADD16 (0x0A)
164
165 struct bifrost_add_faddmin {
166 unsigned src0 : 3;
167 unsigned src1 : 3;
168 unsigned src1_abs : 1;
169 unsigned src0_neg : 1;
170 unsigned src1_neg : 1;
171 unsigned select : 2; /* swizzle_0 for fp16 */
172 unsigned outmod : 2; /* swizzle_1 for fp16 */
173 unsigned mode : 2;
174 unsigned src0_abs : 1;
175 unsigned op : 4;
176 } __attribute__((packed));
177
178 #define BIFROST_ADD_OP_FMAX16 (0x10)
179 #define BIFROST_ADD_OP_FMIN16 (0x12)
180
181 struct bifrost_add_fmin16 {
182 unsigned src0 : 3;
183 unsigned src1 : 3;
184 /* abs2 inferred as with FMA */
185 unsigned abs1 : 1;
186 unsigned src0_neg : 1;
187 unsigned src1_neg : 1;
188 unsigned src0_swizzle : 2;
189 unsigned src1_swizzle : 2;
190 unsigned mode : 2;
191 unsigned op : 5;
192 } __attribute__((packed));
193
194 #define BIFROST_ADD_OP_ST_VAR (0x19300 >> 8)
195
196 struct bifrost_st_vary {
197 unsigned src0 : 3;
198 unsigned src1 : 3;
199 unsigned src2 : 3;
200 unsigned channels : 2;
201 unsigned op : 9;
202 } __attribute__((packed));
203
204 #define BIFROST_ADD_OP_ATEST (0xc8f)
205
206 struct bifrost_add_atest {
207 /* gl_SampleMask (R60) */
208 unsigned src0 : 3;
209
210 /* Alpha value */
211 unsigned src1 : 3;
212
213 /* If half, X/Y select. If !half, always set */
214 unsigned component : 1;
215 unsigned half : 1;
216
217 unsigned op : 12;
218 } __attribute__((packed));
219
220 enum bifrost_outmod {
221 BIFROST_NONE = 0x0,
222 BIFROST_POS = 0x1,
223 BIFROST_SAT_SIGNED = 0x2,
224 BIFROST_SAT = 0x3,
225 };
226
227 enum bifrost_roundmode {
228 BIFROST_RTE = 0x0, /* round to even */
229 BIFROST_RTP = 0x1, /* round to positive */
230 BIFROST_RTN = 0x2, /* round to negative */
231 BIFROST_RTZ = 0x3 /* round to zero */
232 };
233
234 /* NONE: Same as fmax() and fmin() -- return the other
235 * number if any number is NaN. Also always return +0 if
236 * one argument is +0 and the other is -0.
237 *
238 * NAN_WINS: Instead of never returning a NaN, always return
239 * one. The "greater"/"lesser" NaN is always returned, first
240 * by checking the sign and then the mantissa bits.
241 *
242 * SRC1_WINS: For max, implement src0 > src1 ? src0 : src1.
243 * For min, implement src0 < src1 ? src0 : src1. This
244 * includes handling NaN's and signedness of 0 differently
245 * from above, since +0 and -0 compare equal and comparisons
246 * always return false for NaN's. As a result, this mode is
247 * *not* commutative.
248 *
249 * SRC0_WINS: For max, implement src0 < src1 ? src1 : src0
250 * For min, implement src0 > src1 ? src1 : src0
251 */
252
253
254 enum bifrost_minmax_mode {
255 BIFROST_MINMAX_NONE = 0x0,
256 BIFROST_NAN_WINS = 0x1,
257 BIFROST_SRC1_WINS = 0x2,
258 BIFROST_SRC0_WINS = 0x3,
259 };
260
261 #define BIFROST_FMA_OP_FADD32 (0x58 >> 2)
262 #define BIFROST_FMA_OP_FMAX32 (0x40 >> 2)
263 #define BIFROST_FMA_OP_FMIN32 (0x44 >> 2)
264
265 struct bifrost_fma_add {
266 unsigned src0 : 3;
267 unsigned src1 : 3;
268 unsigned src1_abs : 1;
269 unsigned src0_neg : 1;
270 unsigned src1_neg : 1;
271 unsigned unk : 3;
272 unsigned src0_abs : 1;
273 enum bifrost_roundmode roundmode : 2;
274 enum bifrost_outmod outmod : 2;
275 unsigned op : 6;
276 } __attribute__((packed));
277
278 #define BIFROST_FMA_OP_FMAX16 (0xC0 >> 2)
279 #define BIFROST_FMA_OP_FMIN16 (0xCC >> 2)
280 #define BIFROST_FMA_OP_FADD16 (0xD8 >> 2)
281
282 struct bifrost_fma_add_minmax16 {
283 unsigned src0 : 3;
284 unsigned src1 : 3;
285 /* abs2 inferred as (src1 < src0) */
286 unsigned abs1 : 1;
287 unsigned src0_neg : 1;
288 unsigned src1_neg : 1;
289 unsigned src0_swizzle : 2;
290 unsigned src1_swizzle : 2;
291 unsigned mode : 2;
292 enum bifrost_outmod outmod : 2;
293 /* roundmode for add, min/max mode for min/max */
294 unsigned op : 6;
295 } __attribute__((packed));
296
297 #define BIFROST_FMA_OP_FMA (0x00)
298
299 struct bifrost_fma_fma {
300 unsigned src0 : 3;
301 unsigned src1 : 3;
302 unsigned src2 : 3;
303 unsigned src_expand : 3;
304 unsigned src0_abs : 1;
305 enum bifrost_roundmode roundmode : 2;
306 enum bifrost_outmod outmod : 2;
307 unsigned src0_neg : 1; /* 14 */
308 unsigned src2_neg : 1;
309 unsigned src1_abs : 1;
310 unsigned src2_abs : 1; /* 17 */
311 unsigned op : 2;
312 } __attribute__((packed));
313
314 #define BIFROST_FMA_OP_FMA16 (0x2)
315
316 struct bifrost_fma_fma16 {
317 unsigned src0 : 3;
318 unsigned src1 : 3;
319 unsigned src2 : 3;
320 unsigned swizzle_0 : 2;
321 unsigned swizzle_1 : 2;
322 enum bifrost_roundmode roundmode : 2;
323 enum bifrost_outmod outmod : 2;
324 unsigned src0_neg : 1;
325 unsigned src2_neg : 1;
326 unsigned swizzle_2 : 2;
327 unsigned op : 2;
328 } __attribute__((packed));
329
330 enum bifrost_csel_cond {
331 BIFROST_FEQ_F = 0x0,
332 BIFROST_FGT_F = 0x1,
333 BIFROST_FGE_F = 0x2,
334 BIFROST_IEQ_F = 0x3,
335 BIFROST_IGT_I = 0x4,
336 BIFROST_IGE_I = 0x5,
337 BIFROST_UGT_I = 0x6,
338 BIFROST_UGE_I = 0x7
339 };
340
341 #define BIFROST_FMA_OP_CSEL4 (0x5c)
342 #define BIFROST_FMA_OP_CSEL4_V16 (0xdc)
343
344 struct bifrost_csel4 {
345 unsigned src0 : 3;
346 unsigned src1 : 3;
347 unsigned src2 : 3;
348 unsigned src3 : 3;
349 enum bifrost_csel_cond cond : 3;
350 unsigned op : 8;
351 } __attribute__((packed));
352
353 struct bifrost_shift_fma {
354 unsigned src0 : 3;
355 unsigned src1 : 3;
356 unsigned src2 : 3;
357 unsigned half : 3; /* 000 for i32, 100 for i8, 111 for v2i16 */
358 unsigned unk : 1; /* always set? */
359 unsigned invert_1 : 1; /* Inverts sources to combining op */
360 /* For XOR, switches RSHIFT to LSHIFT since only one invert needed */
361 unsigned invert_2 : 1;
362 unsigned op : 8;
363 } __attribute__((packed));
364
365 struct bifrost_shift_add {
366 unsigned src0 : 3;
367 unsigned src1 : 3;
368 unsigned src2 : 3;
369 unsigned zero : 2;
370
371 unsigned invert_1 : 1;
372 unsigned invert_2 : 1;
373
374 unsigned op : 7;
375 } __attribute__((packed));
376
377 /* Two sources for vectorization */
378 #define BIFROST_FMA_FLOAT32_TO_16 (0xdd000 >> 3)
379 #define BIFROST_ADD_FLOAT32_TO_16 (0x0EC00 >> 3)
380
381 enum bifrost_convert_mode {
382 BIFROST_CONV_UNK0 = 0,
383 BIFROST_CONV_F32_TO_I32 = 1,
384 BIFROST_CONV_F16_TO_I16 = 2,
385 BIFROST_CONV_I32_TO_F32 = 3,
386 BIFROST_CONV_I16_TO_X32 = 4,
387 BIFROST_CONV_F16_TO_F32 = 5,
388 BIFROST_CONV_I16_TO_F16 = 6,
389 BIFROST_CONV_UNK7 = 7
390 };
391
392 /* i16 to x32 */
393 #define BIFROST_CONVERT_4(is_unsigned, component, to_float) \
394 ((is_unsigned & 1) | ((component & 1) << 1) | ((to_float & 1) << 2) | \
395 ((0x3) << 3) | ((4) << 5) | 0x100)
396
397 /* f16 to f32 */
398 #define BIFROST_CONVERT_5(component) \
399 ((component & 1) | ((1) << 1) | ((5) << 5) | 0x100)
400
401 /* Other conversions */
402 #define BIFROST_CONVERT(is_unsigned, roundmode, swizzle, mode) \
403 ((is_unsigned & 1) | ((roundmode & 3) << 1) | ((swizzle & 3) << 3) | ((mode & 7) << 5))
404
405 #define BIFROST_FMA_CONVERT (0xe0000)
406 #define BIFROST_ADD_CONVERT (0x07800)
407
408 enum bifrost_ldst_type {
409 BIFROST_LDST_F16 = 0,
410 BIFROST_LDST_F32 = 1,
411 BIFROST_LDST_I32 = 2,
412 BIFROST_LDST_U32 = 3
413 };
414
415 #define BIFROST_ADD_OP_LD_VAR_ADDR (0x18000 >> 10)
416
417 struct bifrost_ld_var_addr {
418 unsigned src0 : 3;
419 unsigned src1 : 3;
420 unsigned location : 5;
421 enum bifrost_ldst_type type : 2;
422 unsigned op : 7;
423 } __attribute__((packed));
424
425 #define BIFROST_ADD_OP_LD_ATTR (0x08000 >> 12)
426
427 struct bifrost_ld_attr {
428 unsigned src0 : 3;
429 unsigned src1 : 3;
430 unsigned location : 5;
431 unsigned channels : 2; /* MALI_POSITIVE */
432 enum bifrost_ldst_type type : 2;
433 unsigned op : 5;
434 } __attribute__((packed));
435
436 enum bifrost_interp_mode {
437 BIFROST_INTERP_PER_FRAG = 0x0,
438 BIFROST_INTERP_CENTROID = 0x1,
439 BIFROST_INTERP_DEFAULT = 0x2,
440 BIFROST_INTERP_EXPLICIT = 0x3
441 };
442
443 #define BIFROST_ADD_OP_LD_VAR_16 (0x1a << 1)
444 #define BIFROST_ADD_OP_LD_VAR_32 (0x0a << 1)
445
446 struct bifrost_ld_var {
447 unsigned src0 : 3;
448
449 /* If top two bits set, indirect with src in bottom three */
450 unsigned addr : 5;
451
452 unsigned channels : 2; /* MALI_POSITIVE */
453 enum bifrost_interp_mode interp_mode : 2;
454 unsigned reuse : 1;
455 unsigned flat : 1;
456 unsigned op : 6;
457 } __attribute__((packed));
458
459 struct bifrost_tex_ctrl {
460 unsigned sampler_index : 4; // also used to signal indirects
461 unsigned tex_index : 7;
462 bool no_merge_index : 1; // whether to merge (direct) sampler & texture indices
463 bool filter : 1; // use the usual filtering pipeline (0 for texelFetch & textureGather)
464 unsigned unk0 : 2;
465 bool texel_offset : 1; // *Offset()
466 bool is_shadow : 1;
467 bool is_array : 1;
468 unsigned tex_type : 2; // 2D, 3D, Cube, Buffer
469 bool compute_lod : 1; // 0 for *Lod()
470 bool not_supply_lod : 1; // 0 for *Lod() or when a bias is applied
471 bool calc_gradients : 1; // 0 for *Grad()
472 unsigned unk1 : 1;
473 unsigned result_type : 4; // integer, unsigned, float TODO: why is this 4 bits?
474 unsigned unk2 : 4;
475 } __attribute__((packed));
476
477 struct bifrost_dual_tex_ctrl {
478 unsigned sampler_index0 : 2;
479 unsigned unk0 : 2;
480 unsigned tex_index0 : 2;
481 unsigned sampler_index1 : 2;
482 unsigned tex_index1 : 2;
483 unsigned unk1 : 22;
484 } __attribute__((packed));
485
486 #define BIFROST_ADD_OP_TEX_COMPACT_F32 (0x0b000 >> 10)
487 #define BIFROST_ADD_OP_TEX_COMPACT_F16 (0x1b000 >> 10)
488
489 struct bifrost_tex_compact {
490 unsigned src0 : 3;
491 unsigned src1 : 3;
492 unsigned tex_index : 3;
493 unsigned unknown : 1;
494 unsigned sampler_index : 3;
495 unsigned op : 7;
496 } __attribute__((packed));
497
498 enum branch_bit_size {
499 BR_SIZE_32 = 0,
500 BR_SIZE_16XX = 1,
501 BR_SIZE_16YY = 2,
502 // For the above combinations of bitsize and location, an extra bit is
503 // encoded via comparing the sources. The only possible source of ambiguity
504 // would be if the sources were the same, but then the branch condition
505 // would be always true or always false anyways, so we can ignore it. But
506 // this no longer works when comparing the y component to the x component,
507 // since it's valid to compare the y component of a source against its own
508 // x component. Instead, the extra bit is encoded via an extra bitsize.
509 BR_SIZE_16YX0 = 3,
510 BR_SIZE_16YX1 = 4,
511 BR_SIZE_32_AND_16X = 5,
512 BR_SIZE_32_AND_16Y = 6,
513 // Used for comparisons with zero and always-true, see below. I think this
514 // only works for integer comparisons.
515 BR_SIZE_ZERO = 7,
516 };
517
518 enum bifrost_reg_write_unit {
519 REG_WRITE_NONE = 0, // don't write
520 REG_WRITE_TWO, // write using reg2
521 REG_WRITE_THREE, // write using reg3
522 };
523
524 struct bifrost_regs {
525 unsigned uniform_const : 8;
526 unsigned reg2 : 6;
527 unsigned reg3 : 6;
528 unsigned reg0 : 5;
529 unsigned reg1 : 6;
530 unsigned ctrl : 4;
531 } __attribute__((packed));
532
533 enum bifrost_branch_cond {
534 BR_COND_LT = 0,
535 BR_COND_LE = 1,
536 BR_COND_GE = 2,
537 BR_COND_GT = 3,
538 // Equal vs. not-equal determined by src0/src1 comparison
539 BR_COND_EQ = 4,
540 // floating-point comparisons
541 // Becomes UNE when you flip the arguments
542 BR_COND_OEQ = 5,
543 // TODO what happens when you flip the arguments?
544 BR_COND_OGT = 6,
545 BR_COND_OLT = 7,
546 };
547
548 enum bifrost_branch_code {
549 BR_ALWAYS = 63,
550 };
551
552 struct bifrost_branch {
553 unsigned src0 : 3;
554
555 /* For BR_SIZE_ZERO, upper two bits become ctrl */
556 unsigned src1 : 3;
557
558 /* Offset source -- always uniform/const but
559 * theoretically could support indirect jumps? */
560 unsigned src2 : 3;
561
562 enum bifrost_branch_cond cond : 3;
563 enum branch_bit_size size : 3;
564
565 unsigned op : 5;
566 };
567
568 /* Clause packing */
569
570 #define BIFROST_FMA_NOP (0x701960 | BIFROST_SRC_STAGE)
571 #define BIFROST_ADD_NOP (0x3D960 | BIFROST_SRC_STAGE)
572
573 struct bifrost_fmt1 {
574 unsigned ins_0 : 3;
575 unsigned tag : 5;
576 uint64_t ins_1 : 64;
577 unsigned ins_2 : 11;
578 uint64_t header : 45;
579 } __attribute__((packed));
580
581 #define BIFROST_FMT1_INSTRUCTIONS 0b00101
582 #define BIFROST_FMT1_FINAL 0b01001
583 #define BIFROST_FMT1_CONSTANTS 0b00001
584
585 #define BIFROST_FMTC_CONSTANTS 0b0011
586 #define BIFROST_FMTC_FINAL 0b0111
587
588 struct bifrost_fmt_constant {
589 unsigned pos : 4;
590 unsigned tag : 4;
591 uint64_t imm_1 : 60;
592 uint64_t imm_2 : 60;
593 } __attribute__((packed));
594
595 enum bifrost_reg_control {
596 BIFROST_WRITE_FMA_P2 = 1,
597 BIFROST_WRITE_FMA_P2_READ_P3 = 2,
598 BIFROST_FIRST_WRITE_FMA_P2_READ_P3 = 3,
599 BIFROST_READ_P3 = 4,
600 BIFROST_WRITE_ADD_P2 = 5,
601 BIFROST_WRITE_ADD_P2_READ_P3 = 6,
602 BIFROST_WRITE_ADD_P2_FMA_P3 = 7,
603
604 BIFROST_FIRST_NONE = 8,
605 BIFROST_FIRST_WRITE_FMA_P2 = 9,
606 /* INSTR_INVALID_ENC */
607 BIFROST_REG_NONE = 11,
608 BIFROST_FIRST_READ_P3 = 12,
609 BIFROST_FIRST_WRITE_ADD_P2 = 13,
610 BIFROST_FIRST_WRITE_ADD_P2_READ_P3 = 14,
611 BIFROST_FIRST_WRITE_ADD_P2_FMA_P3 = 15
612 };
613
614 #endif