[Mesa-dev] [PATCH] Avoid mixing #ifdef USE_SSE41 and control flow

Matt Turner mattst88 at gmail.com
Tue Dec 30 16:01:14 PST 2014


On Tue, Dec 30, 2014 at 3:04 PM, Kristian Høgsberg <krh at bitplanet.net> wrote:
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index f815fbe..c471a76 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>  intel_miptree_map_s8(struct brw_context *brw,
> @@ -2319,10 +2319,8 @@ intel_miptree_map(struct brw_context *brw,
>                mt->bo->size >= brw->max_gtt_map_object_size) {
>        assert(can_blit_slice(mt, level, slice));
>        intel_miptree_map_blit(brw, mt, map, level, slice);
> -#if defined(USE_SSE41)
>     } else if (!(mode & GL_MAP_WRITE_BIT) && !mt->compressed && cpu_has_sse4_1) {
>        intel_miptree_map_movntdqa(brw, mt, map, level, slice);
> -#endif

I think this is perfectly readable as it is. I definitely don't see it
as a problem.

>From IRC yesterday, we're trying to reduce the complexity of this if
sequence. The logic involved in the compound conditionals and the
sequencing of the five ifs before this hunk are all of the
complication -- not an #ifdef. I think Ben and Ken are working on
refactoring that into something simpler.

+34 lines just to remove these #ifdefs doesn't seem like a trade I'd make.


More information about the mesa-dev mailing list