[PATCH] Recognize recent x86 CPUs in string.h

Winfried Magerl winfried.magerl@t-online.de
Thu Oct 23 07:47:00 GMT 2014


Hi,

On Wed, Oct 22, 2014 at 10:48:00PM +0200, jb999@gmx.de wrote:
> If gcc is compiled --with-arch, recent CPUs won't be recognized.
> 
> 	* sysdeps/x86/bits/string.h: Add recent CPUs.
> 
> diff -Nur a/sysdeps/x86/bits/string.h b/sysdeps/x86/bits/string.h
> --- a/sysdeps/x86/bits/string.h	2014-10-22 22:31:44.000000000 +0200
> +++ b/sysdeps/x86/bits/string.h	2014-10-22 22:39:54.000000000 +0200
> @@ -29,6 +29,10 @@
>  			    || defined __pentiumpro__ || defined __pentium4__ \
>  			    || defined __nocona__ || defined __atom__ 	      \
>  			    || defined __core2__ || defined __corei7__	      \
> +			    || defined __nehalem__ || defined __westmere__    \
> +			    || defined __sandybridge__ || defined __ivybridge__ \
> +			    || defined __haswell__ || defined __broadwell__   \
> +			    || defined __bonnell__ || defined __silvermont__  \
>  			    || defined __k6__ || defined __geode__	      \
>  			    || defined __k8__ || defined __athlon__	      \
>  			    || defined __amdfam10__)

I miss the recent AMD-CPUs. Extracted from gcc/config/i386/i386-c.c (gcc-4.9.x):

        __bdver1__
        __bdver2__
        __bdver3__
        __bdver4__
        __btver1__
        __btver2__

And according to i386-c.c __nehalem__ is already recognized
as __corei7__:

    case PROCESSOR_NEHALEM:
      def_or_undef (parse_in, "__corei7");
      def_or_undef (parse_in, "__corei7__");
      def_or_undef (parse_in, "__nehalem");
      def_or_undef (parse_in, "__nehalem__");
      break;

regards

	winfried



More information about the Libc-alpha mailing list