util/cpu_detect, gallium: use cpu_family CPU_S390X instead of separate flag

to also get rid of the additional function that I introduced before.

Fixes: 82b261417e ("util/cpu_detect: Add flag for IBM Z (s390x)")

Signed-off-by: Marius Hillenbrand <mhillen@linux.ibm.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13958>
This commit is contained in:
Marius Hillenbrand 2021-11-25 12:48:27 +01:00 committed by Marge Bot
parent a78c36ecc6
commit a46d155329
4 changed files with 9 additions and 13 deletions

View File

@ -1887,7 +1887,7 @@ arch_rounding_available(const struct lp_type type)
return TRUE;
else if (util_get_cpu_caps()->has_neon)
return TRUE;
else if (util_cpu_caps_has_zarch())
else if (util_get_cpu_caps()->family == CPU_S390X)
return TRUE;
return FALSE;
@ -1997,7 +1997,7 @@ lp_build_round_arch(struct lp_build_context *bld,
enum lp_build_round_mode mode)
{
if (util_get_cpu_caps()->has_sse4_1 || util_get_cpu_caps()->has_neon ||
util_cpu_caps_has_zarch()) {
util_get_cpu_caps()->family == CPU_S390X) {
LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type;
const char *intrinsic_root;

View File

@ -480,7 +480,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
}
if (!util_get_cpu_caps()->has_neon &&
!util_cpu_caps_has_zarch() &&
util_get_cpu_caps()->family != CPU_S390X &&
test->ref == &nearbyintf && length == 2 &&
ref != roundf(testval)) {
/* FIXME: The generic (non SSE) path in lp_build_iround, which is

View File

@ -813,6 +813,10 @@ util_cpu_detect_once(void)
check_os_mips64_support();
#endif /* PIPE_ARCH_MIPS64 */
#if defined(PIPE_ARCH_S390)
util_cpu_caps.family = CPU_S390X;
#endif
get_cpu_topology();
if (debug_get_option_dump_cpu()) {

View File

@ -53,6 +53,8 @@ enum cpu_family {
CPU_AMD_ZEN3,
CPU_AMD_ZEN_NEXT,
CPU_AMD_LAST,
CPU_S390X,
};
typedef uint32_t util_affinity_mask[UTIL_MAX_CPUS / 32];
@ -140,16 +142,6 @@ util_get_cpu_caps(void)
void util_cpu_detect(void);
static inline bool
util_cpu_caps_has_zarch(void)
{
#if defined(PIPE_ARCH_S390)
return true;
#else
return false;
#endif
}
#ifdef __cplusplus
}