This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Provide 32-bit inline string functions for >= i486
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 4 Jun 2012 13:15:51 -0700 (PDT)
- Subject: Re: PATCH: Provide 32-bit inline string functions for >= i486
- References: <20120604200818.GA8604@intel.com>
> @@ -21,28 +20,36 @@
> # error "Never use <bits/string.h> directly; include <string.h> instead."
> #endif
>
> -/* The ix86 processors can access unaligned multi-byte variables. */
> +/* Currently the only purpose of this file is to tell the generic inline
> + macros that unaligned memory access is possible for x86-64. */
> #define _STRING_ARCH_unaligned 1
I think the old comment is more usefully informative. Leave it.
> +#if !defined __x86_64__ && (defined __i486__ || defined __pentium__ \
> + || defined __pentiumpro__ || defined __pentium4__ \
> + || defined __nocona__ || defined __atom__ \
> + || defined __core2__ || defined __corei7__ \
> + || defined __k6__ || defined __geode__ \
> + || defined __k8__ || defined __athlon__ \
> + || defined __amdfam10__)
Where did you get this selection of macros? How do we verify that this
covers all compilers (and -march= settings) that we'd call ">= i486"?
There should be a comment saying that what we mean to test for is
"i486 or better" and that this long list is the best proxy available.
I think the change is fine with any even slightly better comments.
We can continue to improve the comments after the unification/move.
Thanks,
Roland