diff options
author | Mathias Fröhlich <[email protected]> | 2016-08-02 08:46:04 +0200 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2016-08-09 21:20:46 +0200 |
commit | 027cbf00f248bda325521db8f56a3718898da46b (patch) | |
tree | 5e5cce2c268223053e4504f921c5143277f51b3c /src/mesa/drivers | |
parent | e4cb3af524cb02ec7cd23a64da033cfb7193a3cb (diff) |
util: Move _mesa_fsl/util_last_bit into util/bitscan.h
As requested with the initial creation of util/bitscan.h
now move other bitscan related functions into util.
v2: Split into two patches.
Signed-off-by: Mathias Fröhlich <[email protected]>
Tested-by: Brian Paul <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_cs.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c index 655adc14622..6685acde9d6 100644 --- a/src/mesa/drivers/dri/i965/brw_cs.c +++ b/src/mesa/drivers/dri/i965/brw_cs.c @@ -220,7 +220,7 @@ brw_upload_cs_prog(struct brw_context *brw) return; brw->cs.base.sampler_count = - _mesa_fls(ctx->ComputeProgram._Current->Base.SamplersUsed); + util_last_bit(ctx->ComputeProgram._Current->Base.SamplersUsed); brw_cs_populate_key(brw, &key); diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index d7a1ba35740..9b1e18c51cf 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -452,15 +452,15 @@ brw_try_draw_prims(struct gl_context *ctx, * index. */ brw->wm.base.sampler_count = - _mesa_fls(ctx->FragmentProgram._Current->Base.SamplersUsed); + util_last_bit(ctx->FragmentProgram._Current->Base.SamplersUsed); brw->gs.base.sampler_count = ctx->GeometryProgram._Current ? - _mesa_fls(ctx->GeometryProgram._Current->Base.SamplersUsed) : 0; + util_last_bit(ctx->GeometryProgram._Current->Base.SamplersUsed) : 0; brw->tes.base.sampler_count = ctx->TessEvalProgram._Current ? - _mesa_fls(ctx->TessEvalProgram._Current->Base.SamplersUsed) : 0; + util_last_bit(ctx->TessEvalProgram._Current->Base.SamplersUsed) : 0; brw->tcs.base.sampler_count = ctx->TessCtrlProgram._Current ? - _mesa_fls(ctx->TessCtrlProgram._Current->Base.SamplersUsed) : 0; + util_last_bit(ctx->TessCtrlProgram._Current->Base.SamplersUsed) : 0; brw->vs.base.sampler_count = - _mesa_fls(ctx->VertexProgram._Current->Base.SamplersUsed); + util_last_bit(ctx->VertexProgram._Current->Base.SamplersUsed); intel_prepare_render(brw); brw_predraw_set_aux_buffers(brw); diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index e1655a4c141..134cd0173d2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -1845,7 +1845,7 @@ fs_visitor::emit_gs_control_data_bits(const fs_reg &vertex_count) fs_reg prev_count = bld.vgrf(BRW_REGISTER_TYPE_UD, 1); abld.ADD(prev_count, vertex_count, brw_imm_ud(0xffffffffu)); unsigned log2_bits_per_vertex = - _mesa_fls(gs_compile->control_data_bits_per_vertex); + util_last_bit(gs_compile->control_data_bits_per_vertex); abld.SHR(dword_index, prev_count, brw_imm_ud(6u - log2_bits_per_vertex)); if (per_slot_offset.file != BAD_FILE) { @@ -2789,7 +2789,7 @@ fs_visitor::nir_emit_tcs_intrinsic(const fs_builder &bld, if (mask == 0) break; - unsigned num_components = _mesa_fls(mask); + unsigned num_components = util_last_bit(mask); enum opcode opcode; /* We can only pack two 64-bit components in a single message, so send @@ -4523,7 +4523,7 @@ fs_visitor::nir_emit_texture(const fs_builder &bld, nir_tex_instr *instr) nir_ssa_def_components_read(&instr->dest.ssa): (1 << dest_size) - 1; assert(write_mask != 0); /* dead code should have been eliminated */ - inst->regs_written = _mesa_fls(write_mask) * dispatch_width / 8; + inst->regs_written = util_last_bit(write_mask) * dispatch_width / 8; } else { inst->regs_written = 4 * dispatch_width / 8; } diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 778549082fc..0e55c7ba18e 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -674,7 +674,7 @@ brw_setup_tex_for_precompile(struct brw_context *brw, struct gl_program *prog) { const bool has_shader_channel_select = brw->is_haswell || brw->gen >= 8; - unsigned sampler_count = _mesa_fls(prog->SamplersUsed); + unsigned sampler_count = util_last_bit(prog->SamplersUsed); for (unsigned i = 0; i < sampler_count; i++) { if (!has_shader_channel_select && (prog->ShadowSamplers & (1 << i))) { /* Assume DEPTH_TEXTURE_MODE is the default: X, X, X, 1 */ diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 559e44c3627..62bad9bbd9f 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -1157,7 +1157,7 @@ brw_assign_common_binding_table_offsets(gl_shader_stage stage, uint32_t next_binding_table_offset) { const struct gl_linked_shader *shader = NULL; - int num_textures = _mesa_fls(prog->SamplersUsed); + int num_textures = util_last_bit(prog->SamplersUsed); if (shader_prog) shader = shader_prog->_LinkedShaders[stage]; diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp index 927438f9345..c5886d4fd0f 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp @@ -334,7 +334,7 @@ vec4_gs_visitor::emit_control_data_bits() emit(ADD(dst_reg(prev_count), this->vertex_count, brw_imm_ud(0xffffffffu))); unsigned log2_bits_per_vertex = - _mesa_fls(c->control_data_bits_per_vertex); + util_last_bit(c->control_data_bits_per_vertex); emit(SHR(dst_reg(dword_index), prev_count, brw_imm_ud(6 - log2_bits_per_vertex))); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 9bee7dddbf8..a53f9da2498 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -998,7 +998,7 @@ update_stage_texture_surfaces(struct brw_context *brw, else surf_offset += stage_state->prog_data->binding_table.plane_start[plane]; - unsigned num_samplers = _mesa_fls(prog->SamplersUsed); + unsigned num_samplers = util_last_bit(prog->SamplersUsed); for (unsigned s = 0; s < num_samplers; s++) { surf_offset[s] = 0; |