[Gmp-commit] /var/hg/gmp: mpn/x86_64/fat/fat.c: abort if and only if longmode...

mercurial at gmplib.org mercurial at gmplib.org
Sat May 26 23:07:14 CEST 2012


details:   /var/hg/gmp/rev/e1f4512a775f
changeset: 15012:e1f4512a775f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat May 26 23:07:05 2012 +0200
description:
mpn/x86_64/fat/fat.c: abort if and only if longmode-capable-bit is turned off

diffstat:

 mpn/x86_64/fat/fat.c |  39 +++++++--------------------------------
 1 files changed, 7 insertions(+), 32 deletions(-)

diffs (74 lines):

diff -r 3c85b9edc71e -r e1f4512a775f mpn/x86_64/fat/fat.c
--- a/mpn/x86_64/fat/fat.c	Sat May 26 15:57:43 2012 +0200
+++ b/mpn/x86_64/fat/fat.c	Sat May 26 23:07:05 2012 +0200
@@ -204,6 +204,11 @@
   family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
   model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
 
+  /* Check extended feature flags */
+  __gmpn_cpuid (dummy_string, 0x80000001);
+  if ((dummy_string[4 + 29 / 8] & (1 << (29 - 3 * 8))) == 0)
+    abort (); /* longmode-capable-bit turned off! */
+
   /*********************************************************/
   /*** WARNING: keep this list in sync with config.guess ***/
   /*********************************************************/
@@ -211,30 +216,9 @@
     {
       switch (family)
 	{
-	case 4:
-	case 5:
-	  abort ();		/* 32-bit processors */
-
 	case 6:
 	  switch (model)
 	    {
-	    case 0x00:
-	    case 0x01:
-	    case 0x02:
-	    case 0x03:
-	    case 0x04:
-	    case 0x05:
-	    case 0x06:
-	    case 0x07:
-	    case 0x08:
-	    case 0x09:		/* Banias */
-	    case 0x0a:
-	    case 0x0b:
-	    case 0x0c:
-	    case 0x0d:		/* Dothan */
-	    case 0x0e:		/* Yonah */
-	      abort ();		/* 32-bit processors */
-
 	    case 0x0f:		/* Conroe Merom Kentsfield Allendale */
 	    case 0x10:
 	    case 0x11:
@@ -294,10 +278,6 @@
     {
       switch (family)
 	{
-	case 5:
-	case 6:
-	  abort ();
-
 	case 0x0f:		/* k8 */
 	case 0x11:		/* "fam 11h", mix of k8 and k10 */
 	case 0x13:
@@ -328,14 +308,9 @@
     {
       switch (family)
 	{
-	case 5:
-	  abort ();		/* 32-bit processors */
-
 	case 6:
-	  if (model < 15)
-	    abort ();		/* 32-bit processors */
-
-	  CPUVEC_SETUP_nano;
+	  if (model >= 15)
+	    CPUVEC_SETUP_nano;
 	  break;
 	}
     }


More information about the gmp-commit mailing list