diff options
author | Jason Ekstrand <[email protected]> | 2018-01-18 16:08:31 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-02-08 16:35:31 -0800 |
commit | 2cbfcb205ef777cb6e17ebca3ff658f9f2cb915f (patch) | |
tree | 213661425eb9f870817525c355e21df34aa679e7 /src/intel/vulkan | |
parent | 2e69045c4d37f5ddd56b284b225a7f11a374381c (diff) |
anv/cmd_buffer: Move the mi_alu helper higher up
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 6d2e282b514..e1a4d95e965 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -431,6 +431,25 @@ genX(set_image_needs_resolve)(struct anv_cmd_buffer *cmd_buffer, } } +#if GEN_IS_HASWELL || GEN_GEN >= 8 +static inline uint32_t +mi_alu(uint32_t opcode, uint32_t operand1, uint32_t operand2) +{ + struct GENX(MI_MATH_ALU_INSTRUCTION) instr = { + .ALUOpcode = opcode, + .Operand1 = operand1, + .Operand2 = operand2, + }; + + uint32_t dw; + GENX(MI_MATH_ALU_INSTRUCTION_pack)(NULL, &dw, &instr); + + return dw; +} +#endif + +#define CS_GPR(n) (0x2600 + (n) * 8) + static void genX(load_needs_resolve_predicate)(struct anv_cmd_buffer *cmd_buffer, const struct anv_image *image, @@ -2382,23 +2401,6 @@ void genX(CmdDrawIndexed)( /* MI_MATH only exists on Haswell+ */ #if GEN_IS_HASWELL || GEN_GEN >= 8 -static uint32_t -mi_alu(uint32_t opcode, uint32_t op1, uint32_t op2) -{ - struct GENX(MI_MATH_ALU_INSTRUCTION) instr = { - .ALUOpcode = opcode, - .Operand1 = op1, - .Operand2 = op2, - }; - - uint32_t dw; - GENX(MI_MATH_ALU_INSTRUCTION_pack)(NULL, &dw, &instr); - - return dw; -} - -#define CS_GPR(n) (0x2600 + (n) * 8) - /* Emit dwords to multiply GPR0 by N */ static void build_alu_multiply_gpr0(uint32_t *dw, unsigned *dw_count, uint32_t N) |