diff options
author | Rhys Perry <[email protected]> | 2019-12-04 20:18:05 +0000 |
---|---|---|
committer | Daniel Schürmann <[email protected]> | 2020-04-03 23:13:15 +0100 |
commit | b84d59af50a53959fcde232ee2682e77569a7da2 (patch) | |
tree | 3995f677855421458587159651c26eddb9270c38 /src/amd/compiler/aco_ir.h | |
parent | 00312f3c95d9ef2f545a8479d6ad289bc791974b (diff) |
aco: add SDWA_instruction
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Reviewed-By: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002>
Diffstat (limited to 'src/amd/compiler/aco_ir.h')
-rw-r--r-- | src/amd/compiler/aco_ir.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 05a9754c6b1..c8b5c00e1f2 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -169,6 +169,11 @@ constexpr Format asVOP3(Format format) { return (Format) ((uint32_t) Format::VOP3 | (uint32_t) format); }; +constexpr Format asSDWA(Format format) { + assert(format == Format::VOP1 || format == Format::VOP2 || format == Format::VOPC); + return (Format) ((uint32_t) Format::SDWA | (uint32_t) format); +} + enum class RegType { none = 0, sgpr, @@ -841,6 +846,55 @@ struct DPP_instruction : public Instruction { bool bound_ctrl : 1; }; +enum sdwa_sel : uint8_t { + /* masks */ + sdwa_wordnum = 0x1, + sdwa_bytenum = 0x3, + sdwa_asuint = 0x7, + + /* flags */ + sdwa_isword = 0x4, + sdwa_sext = 0x8, + + /* specific values */ + sdwa_ubyte0 = 0, + sdwa_ubyte1 = 1, + sdwa_ubyte2 = 2, + sdwa_ubyte3 = 3, + sdwa_uword0 = sdwa_isword | 0, + sdwa_uword1 = sdwa_isword | 1, + sdwa_udword = 6, + + sdwa_sbyte0 = sdwa_ubyte0 | sdwa_sext, + sdwa_sbyte1 = sdwa_ubyte1 | sdwa_sext, + sdwa_sbyte2 = sdwa_ubyte2 | sdwa_sext, + sdwa_sbyte3 = sdwa_ubyte3 | sdwa_sext, + sdwa_sword0 = sdwa_uword0 | sdwa_sext, + sdwa_sword1 = sdwa_uword1 | sdwa_sext, + sdwa_sdword = sdwa_udword | sdwa_sext, +}; + +/** + * Sub-Dword Addressing Format: + * This format can be used for VOP1, VOP2 or VOPC instructions. + * + * omod and SGPR/constant operands are only available on GFX9+. For VOPC, + * the definition doesn't have to be VCC on GFX9+. + * + */ +struct SDWA_instruction : public Instruction { + /* these destination modifiers aren't available with VOPC except for + * clamp on GFX8 */ + unsigned dst_sel:4; + bool dst_preserve:1; + bool clamp:1; + unsigned omod:2; /* GFX9+ */ + + unsigned sel[2]; + bool neg[2]; + bool abs[2]; +}; + struct Interp_instruction : public Instruction { uint8_t attribute; uint8_t component; |