util: Add ssse3 and avx cpu caps override option

llvmpipe can use these options to testing ssse3 and avx on cpus that support for avx512

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/17813>
This commit is contained in:
Yonggang Luo
2022-08-27 14:32:48 +08:00
committed by Marge Bot
parent 5b18b46cfe
commit 33b29ecdc9
2 changed files with 11 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ int main(int argc, char** argv)
else
{
const char *translate_options[] = {
"nosse", "sse", "sse2", "sse3", "sse4.1",
"nosse", "sse", "sse2", "sse3", "ssse3", "sse4.1", "avx",
NULL
};
const char **option;
@@ -99,7 +99,7 @@ int main(int argc, char** argv)
if (!create_fn)
{
printf("Usage: ./translate_test [default|generic|x86|nosse|sse|sse2|sse3|sse4.1]\n");
printf("Usage: ./translate_test [default|generic|x86|nosse|sse|sse2|sse3|ssse3|sse4.1|avx]\n");
return 2;
}

View File

@@ -615,9 +615,13 @@ void check_cpu_caps_override(void)
} else if (!strcmp(override_cpu_caps, "sse2")) {
util_cpu_caps.has_sse3 = 0;
} else if (!strcmp(override_cpu_caps, "sse3")) {
util_cpu_caps.has_ssse3 = 0;
} else if (!strcmp(override_cpu_caps, "ssse3")) {
util_cpu_caps.has_sse4_1 = 0;
} else if (!strcmp(override_cpu_caps, "sse4.1")) {
util_cpu_caps.has_avx = 0;
} else if (!strcmp(override_cpu_caps, "avx")) {
util_cpu_caps.has_avx512f = 0;
}
#endif /* PIPE_ARCH_X86 || PIPE_ARCH_X86_64 */
}
@@ -631,6 +635,8 @@ void check_cpu_caps_override(void)
}
if (!util_cpu_caps.has_sse3) {
util_cpu_caps.has_ssse3 = 0;
}
if (!util_cpu_caps.has_ssse3) {
util_cpu_caps.has_sse4_1 = 0;
}
if (!util_cpu_caps.has_sse4_1) {
@@ -641,9 +647,10 @@ void check_cpu_caps_override(void)
util_cpu_caps.has_avx2 = 0;
util_cpu_caps.has_f16c = 0;
util_cpu_caps.has_fma = 0;
util_cpu_caps.has_avx512f = 0;
}
if (!util_cpu_caps.has_avx512f) {
/* avx512 are cleared */
util_cpu_caps.has_avx512f = 0;
util_cpu_caps.has_avx512dq = 0;
util_cpu_caps.has_avx512ifma = 0;
util_cpu_caps.has_avx512pf = 0;