public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@hack.frob.com>
To: libc-ports@sourceware.org
Subject: [PATCH roland/arm-ifunc-test] ARM: Clean up __libc_ifunc_impl_list
Date: Mon, 17 Jun 2013 20:55:00 -0000	[thread overview]
Message-ID: <20130617205540.06E142C09B@topped-with-meat.com> (raw)

This cleans up the test code for memcpy so that it does not refer to hwcap
bits when the actual memcpy code will not.


Thanks,
Roland


ports/ChangeLog.arm
2013-06-17  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/arm/armv7/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list)
	[__ARM_NEON__]: Do not refer to HWCAP_ARM_NEON.
	[!__SOFTFP__]: Do not refer to HWCAP_ARM_VFP.

--- a/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
+++ b/ports/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #include <string.h>
 #include <ldsodefs.h>
 #include <sysdep.h>
@@ -29,21 +30,22 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			size_t max)
 {
   size_t i = 0;
-  int hwcap;
 
-  hwcap = GLRO(dl_hwcap);
+  bool use_neon = true;
+#ifndef __ARM_NEON__
+  use_neon = (GLRO(dl_hwcap) & HWCAP_ARM_NEON) != 0;
+# define __memcpy_neon	memcpy
+#endif
 
-  IFUNC_IMPL (i, name, memcpy,
-	      IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_NEON,
-#ifdef __ARM_NEON__
-                              memcpy
-#else
-			      __memcpy_neon
+  bool use_vfp = true;
+#ifdef __SOFTFP__
+  use_neon = (GLRO(dl_hwcap) & HWCAP_ARM_VFP) != 0;
 #endif
-                              )
+
+  IFUNC_IMPL (i, name, memcpy,
+	      IFUNC_IMPL_ADD (array, i, memcpy, use_neon, __memcpy_neon)
 #ifndef __ARM_NEON__
-	      IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_ARM_VFP,
-			      __memcpy_vfp)
+	      IFUNC_IMPL_ADD (array, i, memcpy, use_vfp, __memcpy_vfp)
 #endif
 	      IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_arm));
 

             reply	other threads:[~2013-06-17 20:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 20:55 Roland McGrath [this message]
2013-06-17 21:36 ` Joseph S. Myers
2013-06-17 22:06   ` Roland McGrath
2013-06-17 22:59     ` Joseph S. Myers
2013-06-18 17:12       ` Roland McGrath
2013-06-18 21:41         ` Joseph S. Myers

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=20130617205540.06E142C09B@topped-with-meat.com \
    --to=roland@hack.frob.com \
    --cc=libc-ports@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).