[Mesa-dev] [PATCH 03/12] nir/search: Propagate exactness into newly created expressions

Jason Ekstrand jason at jlekstrand.net
Fri Mar 18 00:51:47 UTC 2016


---
 src/compiler/nir/nir_search.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index 56d7e81..4cb2d4d 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -246,7 +246,7 @@ match_expression(const nir_search_expression *expr, nir_alu_instr *instr,
 
 static nir_alu_src
 construct_value(const nir_search_value *value, nir_alu_type type,
-                unsigned num_components, struct match_state *state,
+                unsigned num_components, bool exact, struct match_state *state,
                 nir_instr *instr, void *mem_ctx)
 {
    switch (value->type) {
@@ -257,6 +257,7 @@ construct_value(const nir_search_value *value, nir_alu_type type,
          num_components = nir_op_infos[expr->opcode].output_size;
 
       nir_alu_instr *alu = nir_alu_instr_create(mem_ctx, expr->opcode);
+      alu->exact = exact;
       nir_ssa_dest_init(&alu->instr, &alu->dest.dest, num_components, NULL);
       alu->dest.write_mask = (1 << num_components) - 1;
       alu->dest.saturate = false;
@@ -270,7 +271,7 @@ construct_value(const nir_search_value *value, nir_alu_type type,
 
          alu->src[i] = construct_value(expr->srcs[i],
                                        nir_op_infos[alu->op].input_types[i],
-                                       num_components,
+                                       num_components, exact,
                                        state, instr, mem_ctx);
       }
 
@@ -362,8 +363,8 @@ nir_replace_instr(nir_alu_instr *instr, const nir_search_expression *search,
                      instr->dest.dest.ssa.num_components, NULL);
 
    mov->src[0] = construct_value(replace, nir_op_infos[instr->op].output_type,
-                                 instr->dest.dest.ssa.num_components, &state,
-                                 &instr->instr, mem_ctx);
+                                 instr->dest.dest.ssa.num_components,
+                                 instr->exact, &state, &instr->instr, mem_ctx);
    nir_instr_insert_before(&instr->instr, &mov->instr);
 
    nir_ssa_def_rewrite_uses(&instr->dest.dest.ssa,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list