diff options
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/instr-a3xx.h')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/instr-a3xx.h | 77 |
1 files changed, 71 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/instr-a3xx.h b/src/gallium/drivers/freedreno/ir3/instr-a3xx.h index 0d369b605f7..b429b3b9ffc 100644 --- a/src/gallium/drivers/freedreno/ir3/instr-a3xx.h +++ b/src/gallium/drivers/freedreno/ir3/instr-a3xx.h @@ -189,10 +189,10 @@ typedef enum { OPC_ATOMIC_AND = _OPC(6, 24), OPC_ATOMIC_OR = _OPC(6, 25), OPC_ATOMIC_XOR = _OPC(6, 26), - OPC_LDGB_TYPED_4D = _OPC(6, 27), - OPC_STGB_4D_4 = _OPC(6, 28), + OPC_LDGB = _OPC(6, 27), + OPC_STGB = _OPC(6, 28), OPC_STIB = _OPC(6, 29), - OPC_LDC_4 = _OPC(6, 30), + OPC_LDC = _OPC(6, 30), OPC_LDLV = _OPC(6, 31), /* meta instructions (category -1): */ @@ -639,18 +639,63 @@ typedef struct PACKED { uint32_t dst : 8; uint32_t mustbe0 : 1; - uint32_t pad0 : 23; + uint32_t idx : 8; + uint32_t pad0 : 15; } instr_cat6d_t; -/* I think some of the other cat6 instructions use additional - * sub-encodings.. +/* ldgb and atomics.. atomics use 3rd src and pad0=1, pad3=3. For + * ldgb pad0=0, pad3=2 */ +typedef struct PACKED { + /* dword0: */ + uint32_t pad0 : 1; + uint32_t src3 : 8; + uint32_t d : 2; + uint32_t typed : 1; + uint32_t type_size : 2; + uint32_t src1 : 8; + uint32_t src1_im : 1; + uint32_t src2_im : 1; + uint32_t src2 : 8; + + /* dword1: */ + uint32_t dst : 8; + uint32_t mustbe0 : 1; + uint32_t src_ssbo : 8; + uint32_t pad2 : 3; // type + uint32_t pad3 : 2; + uint32_t pad4 : 10; // opc/jmp_tgt/sync/opc_cat +} instr_cat6ldgb_t; + +/* stgb, pad0=0, pad3=2 + */ +typedef struct PACKED { + /* dword0: */ + uint32_t mustbe1 : 1; // ??? + uint32_t src1 : 8; + uint32_t d : 2; + uint32_t typed : 1; + uint32_t type_size : 2; + uint32_t pad0 : 9; + uint32_t src2_im : 1; + uint32_t src2 : 8; + + /* dword1: */ + uint32_t src3 : 8; + uint32_t src3_im : 1; + uint32_t dst_ssbo : 8; + uint32_t pad2 : 3; // type + uint32_t pad3 : 2; + uint32_t pad4 : 10; // opc/jmp_tgt/sync/opc_cat +} instr_cat6stgb_t; typedef union PACKED { instr_cat6a_t a; instr_cat6b_t b; instr_cat6c_t c; instr_cat6d_t d; + instr_cat6ldgb_t ldgb; + instr_cat6stgb_t stgb; struct PACKED { /* dword0: */ uint32_t src_off : 1; @@ -733,4 +778,24 @@ static inline bool is_madsh(opc_t opc) } } +static inline bool is_atomic(opc_t opc) +{ + switch (opc) { + case OPC_ATOMIC_ADD: + case OPC_ATOMIC_SUB: + case OPC_ATOMIC_XCHG: + case OPC_ATOMIC_INC: + case OPC_ATOMIC_DEC: + case OPC_ATOMIC_CMPXCHG: + case OPC_ATOMIC_MIN: + case OPC_ATOMIC_MAX: + case OPC_ATOMIC_AND: + case OPC_ATOMIC_OR: + case OPC_ATOMIC_XOR: + return true; + default: + return false; + } +} + #endif /* INSTR_A3XX_H_ */ |