diff options
author | Matt Turner <mattst88@gmail.com> | 2017-03-10 17:57:58 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2017-03-15 13:12:14 -0700 |
commit | aff9a1a539ace54ed9b8b8d56a6863d2eda96d55 (patch) | |
tree | 5842f5eb76ea72266b4041dec5ab9e220bd9252c | |
parent | e8e2463f8837c9c4c609780f7bc17fbea87f94dc (diff) |
-rw-r--r-- | src/intel/compiler/brw_fs.cpp | 4 | ||||
-rw-r--r-- | src/intel/compiler/brw_fs_nir.cpp | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index c410efc29d6..7c2f9933dac 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -890,6 +890,10 @@ fs_inst::flags_written() const opcode != BRW_OPCODE_WHILE)) || opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS) { return flag_mask(this); + } else if (dst.file == ARF && + (dst.nr == BRW_ARF_FLAG || + dst.nr == BRW_ARF_FLAG + 1)) { + return 0b11; } else { return 0; } diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 2ed99a0bbd1..3639be9b560 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -1019,7 +1019,9 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr) bld.AND(result, op[0], op[1]); break; - case nir_op_vote_any: + case nir_op_vote_any: { + const fs_builder ubld = bld.exec_all(); + ubld.MOV(brw_flag_reg(0, 0), brw_imm_uw(0)); bld.CMP(bld.null_reg_d(), op[0], brw_imm_d(0), BRW_CONDITIONAL_NZ); bld.MOV(result, brw_imm_d(-1)); set_predicate(dispatch_width == 8 @@ -1027,8 +1029,10 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr) : BRW_PREDICATE_ALIGN1_ANY16H, bld.SEL(result, result, brw_imm_d(0))); break; - - case nir_op_vote_all: + } + case nir_op_vote_all: { + const fs_builder ubld = bld.exec_all(); + ubld.MOV(brw_flag_reg(0, 0), brw_imm_uw(0xffff)); bld.CMP(bld.null_reg_d(), op[0], brw_imm_d(0), BRW_CONDITIONAL_NZ); bld.MOV(result, brw_imm_d(-1)); set_predicate(dispatch_width == 8 @@ -1036,8 +1040,10 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr) : BRW_PREDICATE_ALIGN1_ALL16H, bld.SEL(result, result, brw_imm_d(0))); break; - - case nir_op_vote_eq: + } + case nir_op_vote_eq: { + const fs_builder ubld = bld.exec_all(); + ubld.MOV(brw_flag_reg(0, 0), brw_imm_uw(0)); bld.CMP(bld.null_reg_d(), op[0], brw_imm_d(0), BRW_CONDITIONAL_NZ); bld.MOV(result, brw_imm_d(-1)); set_predicate(dispatch_width == 8 @@ -1050,7 +1056,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr) true, bld.SEL(result, result, brw_imm_d(0))); break; - + } case nir_op_fdot2: case nir_op_fdot3: case nir_op_fdot4: |