[Gmp-commit] /var/hg/gmp-6.1: Merge arm and ppc config changes from mainline.

mercurial at gmplib.org mercurial at gmplib.org
Fri Dec 2 17:15:10 UTC 2016


details:   /var/hg/gmp-6.1/rev/952bec6a61f3
changeset: 16962:952bec6a61f3
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Fri Dec 02 18:15:06 2016 +0100
description:
Merge arm and ppc config changes from mainline.

diffstat:

 ChangeLog    |   40 +++++++++++
 config.guess |  210 +++++++++++++++++++++++++++++-----------------------------
 config.sub   |    4 +-
 configure.ac |   98 +++++++++++++++++++++++----
 4 files changed, 230 insertions(+), 122 deletions(-)

diffs (truncated from 479 to 300 lines):

diff -r fca4931a7e96 -r 952bec6a61f3 ChangeLog
--- a/ChangeLog	Thu Dec 01 22:56:04 2016 +0100
+++ b/ChangeLog	Fri Dec 02 18:15:06 2016 +0100
@@ -1,3 +1,34 @@
+2016-12-02  Torbjörn Granlund  <tg at gmplib.org>
+
+	Merge configure changes from before 6.1.1:
+
+	2016-03-25  Torbjörn Granlund  <torbjorng at google.com>
+
+	* config.guess: Prefix all arm CPUs with "arm" to accommodate our
+	matchers.
+	* configure.ac (arm): Match arm CPUs consistently.
+
+	2016-03-21  Torbjörn Granlund  <torbjorng at google.com>
+
+	* configure.ac: Support many arm64 processors.
+
+	2016-03-20  Torbjörn Granlund  <torbjorng at google.com>
+
+	* config.guess (arm*): Handle big.LITTLE CPUs by extracting the
+	lexically largest id.
+	* config.guess (arm*): Add many aarch64 CPUs.
+	* config.guess (main): Corresponding changes.
+
+	* configure.ac (arm*): Support cortex-a5 better.
+
+	2016-01-15  Torbjörn Granlund  <torbjorng at google.com>
+
+	* config.guess (s390): Don't assume /proc/cpuinfo exists.
+
+	2016-01-13  Torbjörn Granlund  <torbjorng at google.com>
+
+	* config.guess: Reorder and generalise ppc code.
+
 2016-12-01  Torbjörn Granlund  <tg at gmplib.org>
 
 	* tests/misc.c (tests_rand_start): Make shift well-defined.
@@ -47,6 +78,15 @@
 
 	* config.guess: Recognise Itanium Poulson.
 
+2016-10-15  Torbjörn Granlund  <tg at gmplib.org>
+
+	* configure.ac (arm*-*-*): Amend last change.
+
+2016-10-14  Torbjörn Granlund  <tg at gmplib.org>
+
+	* configure.ac
+	(arm*-*-*): Rewrite arm support to handle armv8 CPUs in 32-bit mode.
+
 2016-08-24  Vlad Zakharov <vzakhar at synopsys.com>
 
 	* longlong.h (arc add_ssaaaa, sub_ddmmss): Replace obsolete 'J'
diff -r fca4931a7e96 -r 952bec6a61f3 config.guess
--- a/config.guess	Thu Dec 01 22:56:04 2016 +0100
+++ b/config.guess	Fri Dec 02 18:15:06 2016 +0100
@@ -3,7 +3,7 @@
 # GMP config.guess wrapper.
 
 
-# Copyright 2000-2006, 2008, 2011-2015 Free Software Foundation, Inc.
+# Copyright 2000-2006, 2008, 2011-2016 Free Software Foundation, Inc.
 #
 #  This file is part of the GNU MP Library.
 #
@@ -172,35 +172,49 @@
   fi
   ;;
 
-arm*-*-*)
-  cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | head -n 1 2>/dev/null`
-  case "$cpu_code" in
-      0xa10 | 0xa11 | 0xb11)			# v4 strongarm/sa1100
+arm*-*-* | aarch64-*-*)
+  cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | sort -r | head -n 1 2>/dev/null`
+  cpu_implementer=`sed -n 's/^CPU implementer.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | head -n 1 2>/dev/null`
+  case "${cpu_implementer}_${cpu_code}" in
+    0x53_0x001) exact_cpu=armexynosm1  ;;
+    0x51_0x800) exact_cpu=armcortexa57 ;;
+    0x43_0x0a1) exact_cpu=armthunderx  ;;
+    0x50_0x000) exact_cpu=armxgene1    ;;
+  esac
+  if test -z "$exact_cpu"; then
+    case "$cpu_code" in
+	0xa10 | 0xa11 | 0xb11)			# v4 strongarm/sa1100
 		exact_cpu="armsa1";;
-      0x915 | 0x925 | \
-      0x920 | 0x922 | 0x940)			# v4
+	0x915 | 0x925 | \
+	0x920 | 0x922 | 0x940)			# v4
 		exact_cpu="arm9tdmi";;
-      0x210 | 0x290 | 0x2d0 | \
-      0x212 | 0x292 | 0x2d2 | \
-      0x411)	exact_cpu="armxscale";;		# v5 pxa2xx
-      0x926 | 0x946 | 0x966 | 0x968)		# v5te/v5tej
+	0x210 | 0x290 | 0x2d0 | \
+	0x212 | 0x292 | 0x2d2 | \
+	0x411)	exact_cpu="armxscale";;		# v5 pxa2xx
+	0x926 | 0x946 | 0x966 | 0x968)		# v5te/v5tej
 		exact_cpu="arm9te";;
-      0xa20 | 0xa22 | 0xa26)			# v5te
+	0xa20 | 0xa22 | 0xa26)			# v5te
 		exact_cpu="arm10";;
-      0xb02)	exact_cpu="arm11mpcore";;	# v6
-      0xb36)	exact_cpu="arm1136";;		# v6
-      0xb56)	exact_cpu="arm1156";;		# v6t2
-      0xb76)	exact_cpu="arm1176";;		# v6
-      0xc05)	exact_cpu="armcortexa5";;	# v7a
-      0xc07)	exact_cpu="armcortexa7";;	# v7a
-      0xc08)	exact_cpu="armcortexa8";;	# v7a
-      0xc09)	exact_cpu="armcortexa9";;	# v7a
-      0xc0f)	exact_cpu="armcortexa15";;	# v7a
-      0xc14)	exact_cpu="armcortexr4";;	# v7r
-      0xc15)	exact_cpu="armcortexr5";;	# v7r
-      0xc23)	exact_cpu="armcortexm3";;	# v7m
-      *)	exact_cpu=$guess_cpu;;
-  esac
+	0xb02)	exact_cpu="arm11mpcore";;	# v6
+	0xb36)	exact_cpu="arm1136";;		# v6
+	0xb56)	exact_cpu="arm1156";;		# v6t2
+	0xb76)	exact_cpu="arm1176";;		# v6
+	0xc05)	exact_cpu="armcortexa5";;	# v7a
+	0xc07)	exact_cpu="armcortexa7";;	# v7a
+	0xc08)	exact_cpu="armcortexa8";;	# v7a
+	0xc09)	exact_cpu="armcortexa9";;	# v7a
+	0xc0f)	exact_cpu="armcortexa15";;	# v7a
+	0xc14)	exact_cpu="armcortexr4";;	# v7r
+	0xc15)	exact_cpu="armcortexr5";;	# v7r
+	0xc23)	exact_cpu="armcortexm3";;	# v7m
+
+	0xd04)	exact_cpu="armcortexa35";;	# v8-32
+	0xd03)	exact_cpu="armcortexa53";;	# v8
+	0xd07)	exact_cpu="armcortexa57";;	# v8
+	0xd08)	exact_cpu="armcortexa72";;	# v8
+	*)	exact_cpu=$guess_cpu;;
+    esac
+  fi
   exact_cpu="${exact_cpu}`sed -n 's;^Features.*\(neon\).*;\1;p' /proc/cpuinfo 2>/dev/null | head -n 1 2>/dev/null`"
   ;;
 
@@ -378,73 +392,8 @@
   # (as noted below).  But the man page says the command is still "under
   # development", so it doesn't seem wise to use it just yet, not while
   # there's an alternative.
-  #
-  # Try to read the PVR.  mfpvr is a protected instruction, NetBSD, MacOS
-  # and AIX don't allow it in user mode, but the Linux kernel does.
-  #
-  # Using explicit bytes for mfpvr avoids worrying about assembler syntax
-  # and underscores.  "char"s are used instead of "int"s to avoid worrying
-  # whether sizeof(int)==4 or if it's the right endianness.
-  #
-  # Note this is no good on AIX, since a C function there is the address of
-  # a function descriptor, not actual code.  But this doesn't matter since
-  # AIX doesn't allow mfpvr anyway.
-  #
-  eval $set_cc_for_build
-  cat >$dummy.c <<\EOF
-#include <stdio.h>
-struct {
-  int   n;  /* force 4-byte alignment */
-  char  a[8];
-} getpvr = {
-  0,
-  {
-    0x7c, 0x7f, 0x42, 0xa6,  /* mfpvr r3 */
-    0x4e, 0x80, 0x00, 0x20,  /* blr      */
-  }
-};
-int
-main ()
-{
-  unsigned  (*fun)();
-  unsigned  pvr;
 
-  /* a separate "fun" variable is necessary for gcc 2.95.2 on MacOS,
-     it gets a compiler error on a combined cast and call */
-  fun = (unsigned (*)()) getpvr.a;
-  pvr = (*fun) ();
-
-  switch (pvr >> 16) {
-  case 0x0001: puts ("powerpc601");  break;
-  case 0x0003: puts ("powerpc603");  break;
-  case 0x0004: puts ("powerpc604");  break;
-  case 0x0006: puts ("powerpc603e"); break;
-  case 0x0007: puts ("powerpc603e"); break;  /* 603ev */
-  case 0x0008: puts ("powerpc750");  break;
-  case 0x0009: puts ("powerpc604e"); break;
-  case 0x000a: puts ("powerpc604e"); break;  /* 604ev5 */
-  case 0x000c: puts ("powerpc7400"); break;
-  case 0x0041: puts ("powerpc630");  break;
-  case 0x0050: puts ("powerpc860");  break;
-  case 0x8000: puts ("powerpc7450"); break;
-  case 0x8001: puts ("powerpc7455"); break;
-  case 0x8002: puts ("powerpc7457"); break;
-  case 0x8003: puts ("powerpc7447"); break; /* really 7447A */
-  case 0x800c: puts ("powerpc7410"); break;
-  }
-  return 0;
-}
-EOF
-  if ($CC_FOR_BUILD $dummy.c -o $dummy) >/dev/null 2>&1; then
-    # This style construct is needed on AIX 4.3 to suppress the SIGILL error
-    # from (*fun)().  Using $SHELL -c $dummy 2>/dev/null doesn't work.
-    { x=`$dummy`; } 2>/dev/null
-    if test -n "$x"; then
-      exact_cpu=$x
-    fi
-  fi
-
-  # Grep the linux kernel /proc/cpuinfo pseudo-file.
+  # Grep the /proc/cpuinfo pseudo-file.
   # Anything unrecognised is ignored, since of course we mustn't spit out
   # a cpu type config.sub doesn't know.
   if test -z "$exact_cpu" && test -f /proc/cpuinfo; then
@@ -463,6 +412,57 @@
     esac
   fi
 
+  # Try to read the PVR.  mfpvr is a protected instruction, NetBSD, MacOS
+  # and AIX don't allow it in user mode, but the Linux kernel does.
+  #
+  # Note this is no good on AIX, since a C function there is the address of
+  # a function descriptor, not actual code.  But this doesn't matter since
+  # AIX doesn't allow mfpvr anyway.
+  #
+  if test -z "$exact_cpu"; then
+    eval $set_cc_for_build
+    cat >$dummy.c <<\EOF
+#include <stdio.h>
+int
+main ()
+{
+  unsigned  pvr;
+
+  asm ("mfpvr	%0" : "=r" (pvr));
+
+  switch (pvr >> 16) {
+  case 0x0001: puts ("powerpc601");  break;
+  case 0x0003: puts ("powerpc603");  break;
+  case 0x0004: puts ("powerpc604");  break;
+  case 0x0006: puts ("powerpc603e"); break;
+  case 0x0007: puts ("powerpc603e"); break;  /* 603ev */
+  case 0x0008: puts ("powerpc750");  break;
+  case 0x0009: puts ("powerpc604e"); break;
+  case 0x000a: puts ("powerpc604e"); break;  /* 604ev5 */
+  case 0x000c: puts ("powerpc7400"); break;
+  case 0x0041: puts ("powerpc630");  break;
+  case 0x003f: puts ("power7");      break;
+  case 0x004b: puts ("power8");      break;
+  case 0x0050: puts ("powerpc860");  break;
+  case 0x8000: puts ("powerpc7450"); break;
+  case 0x8001: puts ("powerpc7455"); break;
+  case 0x8002: puts ("powerpc7457"); break;
+  case 0x8003: puts ("powerpc7447"); break; /* really 7447A */
+  case 0x800c: puts ("powerpc7410"); break;
+  }
+  return 0;
+}
+EOF
+    if ($CC_FOR_BUILD $dummy.c -o $dummy) >/dev/null 2>&1; then
+      # This style construct is needed on AIX 4.3 to suppress the SIGILL error
+      # from (*fun)().  Using $SHELL -c $dummy 2>/dev/null doesn't work.
+      { x=`$dummy`; } 2>/dev/null
+      if test -n "$x"; then
+	exact_cpu=$x
+      fi
+    fi
+  fi
+
   if test -z "$exact_cpu"; then
     # On AIX, try looking at _system_configuration.  This is present in
     # version 4 at least.
@@ -1068,18 +1068,20 @@
   ;;
 
 s390*-*-*)
-  model=`grep "^processor 0: version =" /proc/cpuinfo | sed -e 's/.*machine = //'`
-  case $model in
-    2064 | 2066) zcpu="z900" ;;
-    2084 | 2086) zcpu="z990" ;;
-    2094 | 2096) zcpu="z9"   ;;
-    2097 | 2098) zcpu="z10"  ;;
-    2817 | 2818 | *) zcpu="z196" ;;
-  esac
-  case "$guess_full" in
-    s390x-*-*) exact_cpu=${zcpu}    ;;
-    s390-*-*)  exact_cpu=${zcpu}esa ;;
-  esac
+  if test -f /proc/cpuinfo; then
+    model=`grep "^processor 0: version =" /proc/cpuinfo | sed -e 's/.*machine = //'`
+    case $model in
+      2064 | 2066) zcpu="z900" ;;
+      2084 | 2086) zcpu="z990" ;;
+      2094 | 2096) zcpu="z9"   ;;
+      2097 | 2098) zcpu="z10"  ;;
+      2817 | 2818 | *) zcpu="z196" ;;
+    esac
+    case "$guess_full" in


More information about the gmp-commit mailing list