From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 0F8BF3888839; Wed, 29 Nov 2023 15:04:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F8BF3888839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701270246; bh=5DtPToPP0pZu3c4WGuDvyNu0hUufgPIHHwd8fPaTR4o=; h=From:To:Subject:Date:From; b=uTM8kIWzoqQkbHvx4YvEqY4HZazzta+h4WUpnIH9pb9Z2G5kDZy5m7Eg+gQenOIpp XJ89YskcUUQC0bZ9KpfREN5+TTpLiYbIzwKWe559znqd26xZ3mMzGiETrujeIx+moq 84m5nuHGhu4ddb5lVrm3hcs9a94oQuhTmjWDUyZI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc] aarch64: Improve special-case handling in AdvSIMD double-precision libmvec routines X-Act-Checkin: glibc X-Git-Author: Joe Ramsay X-Git-Refname: refs/heads/master X-Git-Oldrev: bc6d79f4ae99206e7ec7d6a8c5abf26cdefc8bff X-Git-Newrev: 7b12776584c51dbecb1033e107f6b9f45de47a1b Message-Id: <20231129150406.0F8BF3888839@sourceware.org> Date: Wed, 29 Nov 2023 15:04:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7b12776584c51dbecb1033e107f6b9f45de47a1b commit 7b12776584c51dbecb1033e107f6b9f45de47a1b Author: Joe Ramsay Date: Mon Nov 27 17:02:55 2023 +0000 aarch64: Improve special-case handling in AdvSIMD double-precision libmvec routines Avoids emitting many saves/restores of vector registers, reduces the amount of code generated around the scalar fallback. Diff: --- sysdeps/aarch64/fpu/v_math.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sysdeps/aarch64/fpu/v_math.h b/sysdeps/aarch64/fpu/v_math.h index cfc87f8dd0..d286eb81b3 100644 --- a/sysdeps/aarch64/fpu/v_math.h +++ b/sysdeps/aarch64/fpu/v_math.h @@ -137,7 +137,13 @@ v_lookup_u64 (const uint64_t *tab, uint64x2_t idx) static inline float64x2_t v_call_f64 (double (*f) (double), float64x2_t x, float64x2_t y, uint64x2_t p) { - return (float64x2_t){ p[0] ? f (x[0]) : y[0], p[1] ? f (x[1]) : y[1] }; + double p1 = p[1]; + double x1 = x[1]; + if (__glibc_likely (p[0])) + y[0] = f (x[0]); + if (__glibc_likely (p1)) + y[1] = f (x1); + return y; } static inline float64x2_t v_call2_f64 (double (*f) (double, double), float64x2_t x1, float64x2_t x2,