diff --git a/.pick_status.json b/.pick_status.json index f33632c7c28..ba38f7bd322 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -10764,7 +10764,7 @@ "description": "gallivm: break out native vector width calc for reuse", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index 1782f9dd189..d80ad9ea340 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -419,6 +419,15 @@ fail: return FALSE; } +unsigned +lp_build_get_native_width(void) +{ + // Default to 256 until we're confident llvmpipe with 512 is as correct and not slower than 256 + unsigned vector_width = MIN2(util_get_cpu_caps()->max_vector_bits, 256); + + vector_width = debug_get_num_option("LP_NATIVE_VECTOR_WIDTH", vector_width); + return vector_width; +} boolean lp_build_init(void) @@ -441,11 +450,7 @@ lp_build_init(void) lp_set_target_options(); - // Default to 256 until we're confident llvmpipe with 512 is as correct and not slower than 256 - lp_native_vector_width = MIN2(util_get_cpu_caps()->max_vector_bits, 256); - - lp_native_vector_width = debug_get_num_option("LP_NATIVE_VECTOR_WIDTH", - lp_native_vector_width); + lp_native_vector_width = lp_build_get_native_width(); #if DETECT_ARCH_PPC_64 /* Set the NJ bit in VSCR to 0 so denormalized values are handled as diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.h b/src/gallium/auxiliary/gallivm/lp_bld_init.h index ca267a36f92..d462c8c3fe5 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.h @@ -68,6 +68,8 @@ struct gallivm_state LLVMValueRef get_time_hook; }; +unsigned +lp_build_get_native_width(void); boolean lp_build_init(void); diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index c1e8ce5f28f..7abf42c6f33 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -1094,7 +1094,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys) snprintf(screen->renderer_string, sizeof(screen->renderer_string), "llvmpipe (LLVM " MESA_LLVM_VERSION_STRING ", %u bits)", - lp_native_vector_width ); + lp_build_get_native_width() ); list_inithead(&screen->ctx_list); (void) mtx_init(&screen->ctx_mutex, mtx_plain);