diff options
author | Rob Clark <[email protected]> | 2018-11-07 13:22:12 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-12-07 13:49:21 -0500 |
commit | e37351fa5713aab95bc5a6af78866388d5eda70b (patch) | |
tree | 99da7d02ae7d51aee7f2b9c6068dd0ab6fe86fb5 /src/freedreno/ir3/instr-a3xx.h | |
parent | 0d240c22141d9f5d387b8a3b6d18dfd9688b136d (diff) |
freedreno/ir3: sync instr/disasm
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/instr-a3xx.h')
-rw-r--r-- | src/freedreno/ir3/instr-a3xx.h | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/src/freedreno/ir3/instr-a3xx.h b/src/freedreno/ir3/instr-a3xx.h index 7f60ee5fd4c..eff720dacd5 100644 --- a/src/freedreno/ir3/instr-a3xx.h +++ b/src/freedreno/ir3/instr-a3xx.h @@ -413,13 +413,13 @@ typedef struct PACKED { uint32_t dst : 8; uint32_t repeat : 2; uint32_t sat : 1; - uint32_t src1_r : 1; + uint32_t src1_r : 1; /* doubles as nop0 if repeat==0 */ uint32_t ss : 1; uint32_t ul : 1; /* dunno */ uint32_t dst_half : 1; /* or widen/narrow.. ie. dst hrN <-> rN */ uint32_t ei : 1; uint32_t cond : 3; - uint32_t src2_r : 1; + uint32_t src2_r : 1; /* doubles as nop1 if repeat==0 */ uint32_t full : 1; /* not half */ uint32_t opc : 6; uint32_t jmp_tgt : 1; @@ -435,7 +435,7 @@ typedef struct PACKED { uint32_t must_be_zero1: 2; uint32_t src2_c : 1; uint32_t src1_neg : 1; - uint32_t src2_r : 1; + uint32_t src2_r : 1; /* doubles as nop1 if repeat==0 */ }; struct PACKED { uint32_t src1 : 10; @@ -477,7 +477,7 @@ typedef struct PACKED { uint32_t dst : 8; uint32_t repeat : 2; uint32_t sat : 1; - uint32_t src1_r : 1; + uint32_t src1_r : 1; /* doubles as nop0 if repeat==0 */ uint32_t ss : 1; uint32_t ul : 1; uint32_t dst_half : 1; /* or widen/narrow.. ie. dst hrN <-> rN */ @@ -727,6 +727,44 @@ typedef union PACKED { }; } instr_cat6_t; +/** + * For atomic ops (which return a value): + * + * pad1=1, pad2=c, pad3=0, pad4=3 + * src1 - vecN offset/coords + * src2.x - is actually dest register + * src2.y - is 'data' except for cmpxchg where src2.y is 'compare' + * and src2.z is 'data' + * + * For stib (which does not return a value): + * pad1=0, pad2=c, pad3=0, pad4=2 + * src1 - vecN offset/coords + * src2 - value to store + * + * for ldc (load from UBO using descriptor): + * pad1=0, pad2=8, pad3=0, pad4=2 + */ +typedef struct PACKED { + /* dword0: */ + uint32_t pad1 : 9; + uint32_t d : 2; + uint32_t typed : 1; + uint32_t type_size : 2; + uint32_t opc : 5; + uint32_t pad2 : 5; + uint32_t src1 : 8; /* coordinate/offset */ + + /* dword1: */ + uint32_t src2 : 8; + uint32_t pad3 : 1; //mustbe0 ?? or zero means imm vs reg for ssbo?? + uint32_t ssbo : 8; /* ssbo/image binding point */ + uint32_t type : 3; + uint32_t pad4 : 7; + uint32_t jmp_tgt : 1; + uint32_t sync : 1; + uint32_t opc_cat : 3; +} instr_cat6_a6xx_t; + typedef struct PACKED { /* dword0: */ uint32_t pad1 : 32; @@ -753,6 +791,7 @@ typedef union PACKED { instr_cat4_t cat4; instr_cat5_t cat5; instr_cat6_t cat6; + instr_cat6_a6xx_t cat6_a6xx; instr_cat7_t cat7; struct PACKED { /* dword0: */ @@ -792,7 +831,7 @@ static inline bool instr_sat(instr_t *instr) } } -static inline uint32_t instr_opc(instr_t *instr) +static inline uint32_t instr_opc(instr_t *instr, unsigned gpu_id) { switch (instr->opc_cat) { case 0: return instr->cat0.opc; @@ -801,7 +840,13 @@ static inline uint32_t instr_opc(instr_t *instr) case 3: return instr->cat3.opc; case 4: return instr->cat4.opc; case 5: return instr->cat5.opc; - case 6: return instr->cat6.opc; + case 6: + // TODO not sure if this is the best way to figure + // out if new vs old encoding, but it kinda seems + // to work: + if ((gpu_id >= 600) && (instr->cat6.opc == 0)) + return instr->cat6_a6xx.opc; + return instr->cat6.opc; case 7: return instr->cat7.opc; default: return 0; } @@ -867,6 +912,6 @@ static inline bool is_ssbo(opc_t opc) } } -int disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out); +int disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out, unsigned gpu_id); #endif /* INSTR_A3XX_H_ */ |