util: Handling LP_FORCE_SSE2 in u_cpu_detect.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>
This commit is contained in:
Yonggang Luo 2022-08-24 00:20:52 +08:00 committed by Marge Bot
parent d80c5a7c71
commit 9546a09901
2 changed files with 6 additions and 16 deletions

View file

@ -438,22 +438,6 @@ lp_build_init(void)
lp_set_target_options();
/* For simulating less capable machines */
#ifdef DEBUG
if (debug_get_bool_option("LP_FORCE_SSE2", FALSE)) {
extern struct util_cpu_caps_t util_cpu_caps;
assert(util_cpu_caps.has_sse2);
util_cpu_caps.has_sse3 = 0;
util_cpu_caps.has_ssse3 = 0;
util_cpu_caps.has_sse4_1 = 0;
util_cpu_caps.has_sse4_2 = 0;
util_cpu_caps.has_avx = 0;
util_cpu_caps.has_avx2 = 0;
util_cpu_caps.has_f16c = 0;
util_cpu_caps.has_fma = 0;
}
#endif
if (util_get_cpu_caps()->has_avx2 || util_get_cpu_caps()->has_avx) {
lp_native_vector_width = 256;
} else {

View file

@ -797,6 +797,12 @@ util_cpu_detect_once(void)
if (debug_get_bool_option("GALLIUM_NOSSE", false)) {
util_cpu_caps.has_sse = 0;
}
#ifdef DEBUG
/* For simulating less capable machines */
if (debug_get_bool_option("LP_FORCE_SSE2", false)) {
util_cpu_caps.has_sse3 = 0;
}
#endif
#endif /* PIPE_ARCH_X86 || PIPE_ARCH_X86_64 */
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)