diff options
author | Torbjorn Granlund <tg@gmplib.org> | 2017-12-27 00:19:25 +0100 |
---|---|---|
committer | Torbjorn Granlund <tg@gmplib.org> | 2017-12-27 00:19:25 +0100 |
commit | eb0daaafad8ea80eee77ad1427e59754de2b25d9 (patch) | |
tree | 26eb80a559530154a9f47f06a00c6170d351972d /config.guess | |
parent | 8caf041bdf01c2013b571303b5728c0fe6f9ad66 (diff) | |
download | gmp-eb0daaafad8ea80eee77ad1427e59754de2b25d9.tar.gz |
Recognise POWER9 and more variants of POWER8.
Reorder recog code to favour PVR over proc/cpuinfo.
Diffstat (limited to 'config.guess')
-rwxr-xr-x | config.guess | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/config.guess b/config.guess index 73c7a2cc9..f04c2daf1 100755 --- a/config.guess +++ b/config.guess @@ -393,27 +393,9 @@ rs6000-*-* | powerpc*-*-*) # development", so it doesn't seem wise to use it just yet, not while # there's an alternative. - # 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 - x=`grep "^cpu[ ]" /proc/cpuinfo | head -n 1` - x=`echo $x | sed -n 's/^cpu[ ]*:[ ]*\([A-Za-z0-9]*\).*/\1/p'` - x=`echo $x | sed 's/PPC//'` - case $x in - 601) exact_cpu="power" ;; - 603ev) exact_cpu="powerpc603e" ;; - 604ev5) exact_cpu="powerpc604e" ;; - 970??) exact_cpu="powerpc970" ;; - 603 | 603e | 604 | 604e | 750 | 821 | 860) - exact_cpu="powerpc$x" ;; - POWER[4-9]*) - exact_cpu=`echo $x | sed -e "s;POWER;power;" -e "s;[a-zA-Z]*$;;"` ;; - 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. + # 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. We prefer this + # to /proc/cpuinfo since the latter lags for newer CPUs. # # 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 @@ -442,7 +424,10 @@ main () case 0x000c: puts ("powerpc7400"); break; case 0x0041: puts ("powerpc630"); break; case 0x003f: puts ("power7"); break; - case 0x004b: puts ("power8"); break; + case 0x004b: + case 0x004c: + case 0x004d: puts ("power8"); break; + case 0x004e: puts ("power9"); break; case 0x0050: puts ("powerpc860"); break; case 0x8000: puts ("powerpc7450"); break; case 0x8001: puts ("powerpc7455"); break; @@ -463,6 +448,27 @@ EOF fi fi + + # 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 + x=`grep "^cpu[ ]" /proc/cpuinfo | head -n 1` + x=`echo $x | sed -n 's/^cpu[ ]*:[ ]*\([A-Za-z0-9]*\).*/\1/p'` + x=`echo $x | sed 's/PPC//'` + case $x in + 601) exact_cpu="power" ;; + 603ev) exact_cpu="powerpc603e" ;; + 604ev5) exact_cpu="powerpc604e" ;; + 970??) exact_cpu="powerpc970" ;; + 603 | 603e | 604 | 604e | 750 | 821 | 860) + exact_cpu="powerpc$x" ;; + POWER[4-9]*) + exact_cpu=`echo $x | sed -e "s;POWER;power;" -e "s;[a-zA-Z]*$;;"` ;; + esac + fi + + if test -z "$exact_cpu"; then # On AIX, try looking at _system_configuration. This is present in # version 4 at least. @@ -514,6 +520,9 @@ main () #ifdef POWER_8 case POWER_8: puts ("power8"); break; #endif +#ifdef POWER_9 + case POWER_9: puts ("power9"); break; +#endif default: if (_system_configuration.architecture == POWER_RS) puts ("power"); |