diff options
author | Topi Pohjolainen <[email protected]> | 2013-11-30 17:11:41 +0200 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2014-01-23 08:45:28 +0200 |
commit | 250494f742b7301876c6426ab8c77d541ce5b57f (patch) | |
tree | 88c6b4a48ac73f0f51c7d820bde1a0a27b35c79f /src/mesa | |
parent | 9e9617f797a59ccfb7e7173d2ec5cb8fec38b859 (diff) |
i965/blorp: wrap emission of if-equal-assignment
Signed-off-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 30 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h | 6 |
2 files changed, 12 insertions, 24 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 356bb9207c6..da10cf0ecbd 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1682,34 +1682,16 @@ brw_blorp_blit_program::manual_blend_bilinear(unsigned num_samples) brw_IF(&func, BRW_EXECUTE_16); { brw_MOV(&func, vec16(t2), brw_imm_d(5)); - brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_EQ, - S, brw_imm_d(1)); - brw_MOV(&func, vec16(t2), brw_imm_d(2)); - brw_set_predicate_control(&func, BRW_PREDICATE_NONE); - brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_EQ, - S, brw_imm_d(2)); - brw_MOV(&func, vec16(t2), brw_imm_d(4)); - brw_set_predicate_control(&func, BRW_PREDICATE_NONE); - brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_EQ, - S, brw_imm_d(3)); - brw_MOV(&func, vec16(t2), brw_imm_d(6)); - brw_set_predicate_control(&func, BRW_PREDICATE_NONE); + emit_if_eq_mov(S, 1, vec16(t2), 2); + emit_if_eq_mov(S, 2, vec16(t2), 4); + emit_if_eq_mov(S, 3, vec16(t2), 6); } brw_ELSE(&func); { brw_MOV(&func, vec16(t2), brw_imm_d(0)); - brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_EQ, - S, brw_imm_d(5)); - brw_MOV(&func, vec16(t2), brw_imm_d(3)); - brw_set_predicate_control(&func, BRW_PREDICATE_NONE); - brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_EQ, - S, brw_imm_d(6)); - brw_MOV(&func, vec16(t2), brw_imm_d(7)); - brw_set_predicate_control(&func, BRW_PREDICATE_NONE); - brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_EQ, - S, brw_imm_d(7)); - brw_MOV(&func, vec16(t2), brw_imm_d(1)); - brw_set_predicate_control(&func, BRW_PREDICATE_NONE); + emit_if_eq_mov(S, 5, vec16(t2), 3); + emit_if_eq_mov(S, 6, vec16(t2), 7); + emit_if_eq_mov(S, 7, vec16(t2), 1); } brw_ENDIF(&func); brw_MOV(&func, vec16(S), t2); diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h index 555b6d34827..34e8da901cf 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h @@ -68,6 +68,12 @@ protected: brw_set_predicate_control(&func, BRW_PREDICATE_NONE); } + inline void emit_if_eq_mov(const struct brw_reg &x, unsigned y, + const struct brw_reg &dst, unsigned src) + { + emit_cond_mov(x, brw_imm_d(y), BRW_CONDITIONAL_EQ, dst, brw_imm_d(src)); + } + void *mem_ctx; struct brw_compile func; }; |