llvmpipe: Use lp_build_round_arch on IBM Z (s390x)

LLVM has all the required intrinsics available on IBM Z, so use them for
rounding operations (they will be implemented as a single instruction).
This change makes the test case lp_test_arit pass, because it avoids
using the buggy generic code.

v2: update .gitlab-ci/cross-xfail-s390x to reflect passing lp_test_arit

Signed-off-by: Marius Hillenbrand <mhillen@linux.ibm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13927>
This commit is contained in:
Marius Hillenbrand 2021-11-18 18:27:35 +01:00 committed by Marge Bot
parent 82b261417e
commit c5d6e57e42
3 changed files with 5 additions and 2 deletions

View File

@ -1,2 +1 @@
lp_test_arit
lp_test_format lp_test_format

View File

@ -1887,6 +1887,8 @@ arch_rounding_available(const struct lp_type type)
return TRUE; return TRUE;
else if (util_get_cpu_caps()->has_neon) else if (util_get_cpu_caps()->has_neon)
return TRUE; return TRUE;
else if (util_cpu_caps_has_zarch())
return TRUE;
return FALSE; return FALSE;
} }
@ -1994,7 +1996,8 @@ lp_build_round_arch(struct lp_build_context *bld,
LLVMValueRef a, LLVMValueRef a,
enum lp_build_round_mode mode) enum lp_build_round_mode mode)
{ {
if (util_get_cpu_caps()->has_sse4_1 || util_get_cpu_caps()->has_neon) { if (util_get_cpu_caps()->has_sse4_1 || util_get_cpu_caps()->has_neon ||
util_cpu_caps_has_zarch()) {
LLVMBuilderRef builder = bld->gallivm->builder; LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type; const struct lp_type type = bld->type;
const char *intrinsic_root; const char *intrinsic_root;

View File

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