[Mesa-dev] [PATCH 2/2] gallivm: Return true from arch_rounding_available() if NEON is available
Roland Scheidegger
sroland at vmware.com
Wed Jan 23 00:39:17 UTC 2019
I have no clue on aarch64, but looks all good to me.
For the series:
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Am 23.01.19 um 00:12 schrieb Matt Turner:
> LLVM uses the single instruction "FRINTI" to implement llvm.nearbyint.
> Fixes the rounding tests of lp_test_arit.
>
> Bug: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.gentoo.org%2F665570&data=02%7C01%7Csroland%40vmware.com%7C3592bd2ab3a14996f0b208d680bf1f90%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636837955687364906&sdata=N0br4dLkbNwWMj4H%2FEq3VSYHUCmkLcJZAxAFId4jClQ%3D&reserved=0
> ---
> src/gallium/auxiliary/gallivm/lp_bld_arit.c | 4 +++-
> src/gallium/drivers/llvmpipe/lp_test_arit.c | 3 ++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> index c050bfdb936..057c50ed278 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> @@ -1992,6 +1992,8 @@ arch_rounding_available(const struct lp_type type)
> else if ((util_cpu_caps.has_altivec &&
> (type.width == 32 && type.length == 4)))
> return TRUE;
> + else if (util_cpu_caps.has_neon)
> + return TRUE;
>
> return FALSE;
> }
> @@ -2099,7 +2101,7 @@ lp_build_round_arch(struct lp_build_context *bld,
> LLVMValueRef a,
> enum lp_build_round_mode mode)
> {
> - if (util_cpu_caps.has_sse4_1) {
> + if (util_cpu_caps.has_sse4_1 || util_cpu_caps.has_neon) {
> LLVMBuilderRef builder = bld->gallivm->builder;
> const struct lp_type type = bld->type;
> const char *intrinsic_root;
> diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c
> index acba7ed44a8..eb3f67dc1fe 100644
> --- a/src/gallium/drivers/llvmpipe/lp_test_arit.c
> +++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c
> @@ -458,7 +458,8 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
> continue;
> }
>
> - if (test->ref == &nearbyintf && length == 2 &&
> + if (!util_cpu_caps.has_neon &&
> + test->ref == &nearbyintf && length == 2 &&
> ref != roundf(testval)) {
> /* FIXME: The generic (non SSE) path in lp_build_iround, which is
> * always taken for length==2 regardless of native round support,
>
More information about the mesa-dev
mailing list