[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Tue Mar 20 14:00:24 CET 2012


details:   /var/hg/gmp/rev/5a978be0d6a6
changeset: 14774:5a978be0d6a6
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Mar 20 13:56:13 2012 +0100
description:
(__gmpn_cpuvec_init): Minor spacing cleanup.

details:   /var/hg/gmp/rev/5a954e695686
changeset: 14775:5a954e695686
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Mar 20 14:00:21 2012 +0100
description:
Overhaul of x86-32 fat builds.

diffstat:

 ChangeLog            |    8 ++
 configure.in         |   10 ++-
 mpn/x86/fat/fat.c    |  172 ++++++++++++++++++++++++++++++++++++++++++--------
 mpn/x86_64/fat/fat.c |   21 +++--
 4 files changed, 173 insertions(+), 38 deletions(-)

diffs (truncated from 308 to 300 lines):

diff -r 46f35c0ffc13 -r 5a954e695686 ChangeLog
--- a/ChangeLog	Tue Mar 20 05:18:08 2012 +0100
+++ b/ChangeLog	Tue Mar 20 14:00:21 2012 +0100
@@ -1,3 +1,11 @@
+2012-03-20  Torbjorn Granlund  <tege at gmplib.org>
+
+	* configure.in (x86 fat_path): Add many missing directories.
+	* mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Rewrite.
+	(fake_cpuid_table): Add many more CPUs.
+
+	* mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Minor spacing cleanup.
+
 2012-03-19  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86/x86-defs.m4 (CALL, PIC_WITH_EBX): New macros.
diff -r 46f35c0ffc13 -r 5a954e695686 configure.in
--- a/configure.in	Tue Mar 20 05:18:08 2012 +0100
+++ b/configure.in	Tue Mar 20 14:00:21 2012 +0100
@@ -1928,16 +1928,22 @@
 	fat_path="x86 x86/fat x86/i486
 		  x86/k6 x86/k6/mmx x86/k6/k62mmx
 		  x86/k7 x86/k7/mmx
+		  x86/k8 x86/k10 x86/bobcat
 		  x86/pentium x86/pentium/mmx
 		  x86/p6 x86/p6/mmx x86/p6/p3mmx x86/p6/sse2
-		  x86/pentium4 x86/pentium4/mmx x86/pentium4/sse2"
+		  x86/pentium4 x86/pentium4/mmx x86/pentium4/sse2
+		  x86/core2 x86/coreinhm x86/coreisbr
+		  x86/atom x86/atom/mmx x86/atom/sse2 x86/nano"
       fi
 
       if test "$abi" = 64; then
 	gcc_64_cflags=""
 	extra_functions_64="$extra_functions_64 fat fat_entry"
 	path_64="x86_64/fat x86_64"
-	fat_path="x86_64 x86_64/fat x86_64/k8 x86_64/k10 x86_64/bd1 x86_64/bobcat x86_64/pentium4 x86_64/core2 x86_64/coreinhm x86_64/coreisbr x86_64/atom x86_64/nano"
+	fat_path="x86_64 x86_64/fat
+		  x86_64/k8 x86_64/k10 x86_64/bd1 x86_64/bobcat
+		  x86_64/pentium4 x86_64/core2 x86_64/coreinhm x86_64/coreisbr
+		  x86_64/atom x86_64/nano"
 	fat_functions="$fat_functions addmul_2 addlsh1_n addlsh2_n sublsh1_n"
       fi
 
diff -r 46f35c0ffc13 -r 5a954e695686 mpn/x86/fat/fat.c
--- a/mpn/x86/fat/fat.c	Tue Mar 20 05:18:08 2012 +0100
+++ b/mpn/x86/fat/fat.c	Tue Mar 20 14:00:21 2012 +0100
@@ -4,7 +4,7 @@
    THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR
    COMPLETELY IN FUTURE GNU MP RELEASES.
 
-Copyright 2003, 2004, 2011 Free Software Foundation, Inc.
+Copyright 2003, 2004, 2011, 2012 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -64,17 +64,28 @@
   { "pentiumpro", "GenuineIntel", MAKE_FMS (6, 0) },
   { "pentium2",   "GenuineIntel", MAKE_FMS (6, 2) },
   { "pentium3",   "GenuineIntel", MAKE_FMS (6, 7) },
-  { "pentium4",   "GenuineIntel", MAKE_FMS (7, 0) },
+  { "pentium4",   "GenuineIntel", MAKE_FMS (15, 2) },
+  { "prescott",   "GenuineIntel", MAKE_FMS (15, 3) },
+  { "nocona",     "GenuineIntel", MAKE_FMS (15, 4) },
+  { "core2",      "GenuineIntel", MAKE_FMS (6, 0xf) },
+  { "coreinhm",   "GenuineIntel", MAKE_FMS (6, 0x1a) },
+  { "coreiwsm",   "GenuineIntel", MAKE_FMS (6, 0x25) },
+  { "coreisbr",   "GenuineIntel", MAKE_FMS (6, 0x2a) },
+  { "atom",       "GenuineIntel", MAKE_FMS (6, 0x1c) },
 
   { "k5",         "AuthenticAMD", MAKE_FMS (5, 0) },
   { "k6",         "AuthenticAMD", MAKE_FMS (5, 3) },
   { "k62",        "AuthenticAMD", MAKE_FMS (5, 8) },
   { "k63",        "AuthenticAMD", MAKE_FMS (5, 9) },
   { "athlon",     "AuthenticAMD", MAKE_FMS (6, 0) },
-  { "x86_64",     "AuthenticAMD", MAKE_FMS (15, 0) },
+  { "k8",         "AuthenticAMD", MAKE_FMS (15, 0) },
+  { "k10",        "AuthenticAMD", MAKE_FMS (16, 0) },
+  { "bobcat",     "AuthenticAMD", MAKE_FMS (20, 1) },
+  { "bulldozer",  "AuthenticAMD", MAKE_FMS (21, 1) },
 
   { "viac3",      "CentaurHauls", MAKE_FMS (6, 0) },
   { "viac32",     "CentaurHauls", MAKE_FMS (6, 9) },
+  { "nano",       "CentaurHauls", MAKE_FMS (6, 15) },
 };
 
 static int
@@ -234,21 +245,104 @@
             case 6:
               TRACE (printf ("  p6\n"));
               CPUVEC_SETUP_p6;
-              if (model >= 2)
-                {
-                  TRACE (printf ("  pentium2\n"));
+	      switch (model)
+		{
+		case 0x00:
+		case 0x01:
+		  TRACE (printf ("  pentiumpro\n"));
+		  break;
+
+		case 0x02:
+		case 0x03:
+		case 0x04:
+		case 0x05:
+		case 0x06:
+		  TRACE (printf ("  pentium2\n"));
                   CPUVEC_SETUP_p6_mmx;
-                }
-              if (model >= 7)
-                {
-                  TRACE (printf ("  pentium3\n"));
+		  break;
+
+		case 0x07:
+		case 0x08:
+		case 0x0a:
+		case 0x0b:
+		case 0x0c:
+		  TRACE (printf ("  pentium3\n"));
+                  CPUVEC_SETUP_p6_mmx;
                   CPUVEC_SETUP_p6_p3mmx;
-                }
-              if (model >= 0xD || model == 9)
-                {
-                  TRACE (printf ("  p6 with sse2\n"));
+		  break;
+
+		case 0x09:		/* Banias */
+		case 0x0d:		/* Dothan */
+		case 0x0e:		/* Yonah */
+		  TRACE (printf ("  Banias/Bothan/Yonah\n"));
+                  CPUVEC_SETUP_p6_mmx;
+                  CPUVEC_SETUP_p6_p3mmx;
                   CPUVEC_SETUP_p6_sse2;
-                }
+		  break;
+
+		case 0x0f:		/* Conroe Merom Kentsfield Allendale */
+		case 0x10:
+		case 0x11:
+		case 0x12:
+		case 0x13:
+		case 0x14:
+		case 0x15:
+		case 0x16:
+		case 0x17:		/* PNR Wolfdale Yorkfield */
+		case 0x18:
+		case 0x19:
+		case 0x1d:		/* PNR Dunnington */
+		  TRACE (printf ("  Conroe\n"));
+                  CPUVEC_SETUP_p6_mmx;
+                  CPUVEC_SETUP_p6_p3mmx;
+                  CPUVEC_SETUP_p6_sse2;
+		  CPUVEC_SETUP_core2;
+		  break;
+
+		case 0x1c:		/* Silverthorne */
+		case 0x26:		/* Lincroft */
+		case 0x27:		/* Saltwell */
+		  TRACE (printf ("  atom\n"));
+		  CPUVEC_SETUP_atom;
+		  CPUVEC_SETUP_atom_mmx;
+		  CPUVEC_SETUP_atom_sse2;
+		  break;
+
+		case 0x1a:		/* NHM Gainestown */
+		case 0x1b:
+		case 0x1e:		/* NHM Lynnfield/Jasper */
+		case 0x1f:
+		case 0x20:
+		case 0x21:
+		case 0x22:
+		case 0x23:
+		case 0x24:
+		case 0x25:		/* WSM Clarkdale/Arrandale */
+		case 0x28:
+		case 0x29:
+		case 0x2b:
+		case 0x2c:		/* WSM Gulftown */
+		case 0x2e:		/* NHM Beckton */
+		case 0x2f:		/* WSM Eagleton */
+		  TRACE (printf ("  nehalem/westmere\n"));
+                  CPUVEC_SETUP_p6_mmx;
+                  CPUVEC_SETUP_p6_p3mmx;
+                  CPUVEC_SETUP_p6_sse2;
+		  CPUVEC_SETUP_core2;
+		  CPUVEC_SETUP_coreinhm;
+		  break;
+
+		case 0x2a:		/* SBR */
+		case 0x2d:		/* SBR-EP */
+		  TRACE (printf ("  sandybridge\n"));
+                  CPUVEC_SETUP_p6_mmx;
+                  CPUVEC_SETUP_p6_p3mmx;
+                  CPUVEC_SETUP_p6_sse2;
+		  CPUVEC_SETUP_core2;
+		  CPUVEC_SETUP_coreinhm;
+		  CPUVEC_SETUP_coreisbr;
+		  break;
+		}
               break;
 
             case 15:
@@ -286,21 +380,40 @@
               break;
             case 6:
               TRACE (printf ("  athlon\n"));
-            athlon:
               CPUVEC_SETUP_k7;
               CPUVEC_SETUP_k7_mmx;
               break;
-            case 15:		/* k8 */
-            case 16:		/* k10 */
-            case 17:		/* "fam 11h", mix of k8 and k10 */
-            case 18:		/* k10 (llano) */
-            case 19:
-            case 20:		/* bobcat */
-            case 21:		/* bulldozer */
-            case 22:
-            case 23:
-              TRACE (printf ("  x86_64\n"));
-              goto athlon;
+
+            case 0x0f:		/* k8 */
+            case 0x11:		/* "fam 11h", mix of k8 and k10 */
+            case 0x13:		/* unknown, conservativeky assume k8  */
+            case 0x16:		/* unknown, conservativeky assume k8  */
+            case 0x17:		/* unknown, conservativeky assume k8  */
+              TRACE (printf ("  k8\n"));
+              CPUVEC_SETUP_k7;
+              CPUVEC_SETUP_k7_mmx;
+              CPUVEC_SETUP_k8;
+	      break;
+
+            case 0x10:		/* k10 */
+            case 0x12:		/* k10 (llano) */
+              TRACE (printf ("  k10\n"));
+              CPUVEC_SETUP_k7;
+              CPUVEC_SETUP_k7_mmx;
+	      break;
+
+            case 0x14:		/* bobcat */
+              TRACE (printf ("  bobcat\n"));
+              CPUVEC_SETUP_k7;
+              CPUVEC_SETUP_k7_mmx;
+              CPUVEC_SETUP_bobcat;
+	      break;
+
+            case 0x15:		/* bulldozer */
+              TRACE (printf ("  bulldozer\n"));
+              CPUVEC_SETUP_k7;
+              CPUVEC_SETUP_k7_mmx;
+	      break;
             }
         }
       else if (strcmp (vendor_string, "CentaurHauls") == 0)
@@ -313,6 +426,11 @@
                 {
                   TRACE (printf ("  viac32\n"));
                 }
+	      if (model >= 15)
+		{
+                  TRACE (printf ("  nano\n"));
+		  CPUVEC_SETUP_nano;
+		}
               break;
             }
         }
diff -r 46f35c0ffc13 -r 5a954e695686 mpn/x86_64/fat/fat.c
--- a/mpn/x86_64/fat/fat.c	Tue Mar 20 05:18:08 2012 +0100
+++ b/mpn/x86_64/fat/fat.c	Tue Mar 20 14:00:21 2012 +0100
@@ -297,24 +297,27 @@
 	case 6:
 	  abort ();
 
-	case 15:		/* k8 */
-	case 17:		/* "fam 11h", mix of k8 and k10 */
-	case 19:
-	case 22:
-	case 23:
+	case 0x0f:		/* k8 */
+	case 0x11:		/* "fam 11h", mix of k8 and k10 */
+	case 0x13:
+	case 0x16:
+	case 0x17:
 	  CPUVEC_SETUP_k8;
 	  break;
-	case 16:		/* k10 */
-	case 18:		/* k10 (llano) */
+
+	case 0x10:		/* k10 */
+	case 0x12:		/* k10 (llano) */
 	  CPUVEC_SETUP_k8;
 	  CPUVEC_SETUP_k10;
 	  break;
-	case 20:		/* bobcat */
+
+	case 0x14:		/* bobcat */
 	  CPUVEC_SETUP_k8;
 	  CPUVEC_SETUP_k10;


More information about the gmp-commit mailing list