public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] aarch64: Improve special-case handling in AdvSIMD double-precision libmvec routines
Date: Wed, 29 Nov 2023 15:04:06 +0000 (GMT)	[thread overview]
Message-ID: <20231129150406.0F8BF3888839@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7b12776584c51dbecb1033e107f6b9f45de47a1b

commit 7b12776584c51dbecb1033e107f6b9f45de47a1b
Author: Joe Ramsay <Joe.Ramsay@arm.com>
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,

                 reply	other threads:[~2023-11-29 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231129150406.0F8BF3888839@sourceware.org \
    --to=nsz@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).