OSDN Git Service

2008-08-08 Peter Bergner <bergner@vnet.ibm.com>
authorpthaugen <pthaugen@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Aug 2008 21:40:18 +0000 (21:40 +0000)
committerpthaugen <pthaugen@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Aug 2008 21:40:18 +0000 (21:40 +0000)
        * doc/invoke.texi: Add cpu_type power7.
        * config.in (HAVE_AS_VSX): New.
        * config.gcc: Add cpu_type power7.
        * configure.ac (HAVE_AS_VSX): Check for assembler support of the
        VSX instructions.
        * configure: Regenerate.
        * config/rs6000/rs6000.c (rs6000_override_options): Alias power7 to
        power5.
        * config/rs6000/rs6000.h (ASM_CPU_POWER7_SPEC): Define.
        (ASM_CPU_SPEC): Pass %(asm_cpu_power7) for -mcpu=power7.
        (EXTRA_SPECS): Add asm_cpu_power7 spec string.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138887 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config.gcc
gcc/config.in
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/configure
gcc/configure.ac
gcc/doc/invoke.texi

index 1558f03..ed2707a 100644 (file)
@@ -1,3 +1,17 @@
+2008-08-08  Peter Bergner  <bergner@vnet.ibm.com>
+
+        * doc/invoke.texi: Add cpu_type power7.
+        * config.in (HAVE_AS_VSX): New.
+        * config.gcc: Add cpu_type power7.
+        * configure.ac (HAVE_AS_VSX): Check for assembler support of the
+        VSX instructions.
+        * configure: Regenerate.
+        * config/rs6000/rs6000.c (rs6000_override_options): Alias power7 to
+        power5.
+        * config/rs6000/rs6000.h (ASM_CPU_POWER7_SPEC): Define.
+        (ASM_CPU_SPEC): Pass %(asm_cpu_power7) for -mcpu=power7.
+        (EXTRA_SPECS): Add asm_cpu_power7 spec string.
 2008-08-08  Dorit Nuzman  <dorit@il.ibm.com>
 
        * tree-vect-transform.c (vectorizable_conversion): Pass the integral
index c327547..d1381a4 100644 (file)
@@ -334,7 +334,7 @@ powerpc*-*-*)
        extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h"
        need_64bit_hwint=yes
        case x$with_cpu in
-           xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456]|xpower6x|xrs64a|xcell)
+           xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[34567]|xpower6x|xrs64a|xcell)
                cpu_is_64bit=yes
                ;;
        esac
@@ -2842,7 +2842,7 @@ case "${target}" in
                                eval "with_$which=405"
                                ;;
                        "" | common \
-                       | power | power[23456] | power6x | powerpc | powerpc64 \
+                       | power | power[234567] | power6x | powerpc | powerpc64 \
                        | rios | rios1 | rios2 | rsc | rsc1 | rs64a \
                        | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
                        | 505 | 601 | 602 | 603 | 603e | ec603e | 604 \
index 209da21..f4604d2 100644 (file)
 #undef HAVE_AS_TLS
 #endif
 
+/* Define if your assembler supports VSX instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_VSX
+#endif
 
 /* Define to 1 if you have the `atoll' function. */
 #ifndef USED_FOR_TARGET
index 38fb43c..0f2779e 100644 (file)
@@ -1507,6 +1507,9 @@ rs6000_override_options (const char *default_cpu)
         {"power6x", PROCESSOR_POWER6,
          POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF
          | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP | MASK_MFPGPR},
+        {"power7", PROCESSOR_POWER5,
+         POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF
+         | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP},
         {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK},
         {"powerpc64", PROCESSOR_POWERPC64,
          POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64},
index def3b53..1f6d07b 100644 (file)
 #define ASM_CPU_POWER6_SPEC "-mpower4 -maltivec"
 #endif
 
+#ifdef HAVE_AS_VSX
+#define ASM_CPU_POWER7_SPEC "-mpower7"
+#else
+#define ASM_CPU_POWER7_SPEC "-mpower4 -maltivec"
+#endif
+
 /* Common ASM definitions used by ASM_SPEC among the various targets
    for handling -mcpu=xxx switches.  */
 #define ASM_CPU_SPEC \
@@ -92,6 +98,7 @@
 %{mcpu=power5+: %(asm_cpu_power5)} \
 %{mcpu=power6: %(asm_cpu_power6) -maltivec} \
 %{mcpu=power6x: %(asm_cpu_power6) -maltivec} \
+%{mcpu=power7: %(asm_cpu_power7)} \
 %{mcpu=powerpc: -mppc} \
 %{mcpu=rios: -mpwr} \
 %{mcpu=rios1: -mpwr} \
   { "cc1_cpu",                 CC1_CPU_SPEC },                         \
   { "asm_cpu_power5",          ASM_CPU_POWER5_SPEC },                  \
   { "asm_cpu_power6",          ASM_CPU_POWER6_SPEC },                  \
+  { "asm_cpu_power7",          ASM_CPU_POWER7_SPEC },                  \
   SUBTARGET_EXTRA_SPECS
 
 /* -mcpu=native handling only makes sense with compiler running on
index 3625898..f136d57 100755 (executable)
@@ -22623,6 +22623,52 @@ _ACEOF
 
 fi
 
+    case $target in
+      *-*-aix*) conftest_s='   .machine "pwr7"
+       .csect .text[PR]
+       lxvd2x 1,2,3';;
+      *) conftest_s='  .machine power7
+       .text
+       lxvd2x 1,2,3';;
+    esac
+
+    echo "$as_me:$LINENO: checking assembler for vector-scalar support" >&5
+echo $ECHO_N "checking assembler for vector-scalar support... $ECHO_C" >&6
+if test "${gcc_cv_as_powerpc_vsx+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  gcc_cv_as_powerpc_vsx=no
+    if test $in_tree_gas = yes; then
+    if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0`
+  then gcc_cv_as_powerpc_vsx=yes
+fi
+  elif test x$gcc_cv_as != x; then
+    echo "$conftest_s" > conftest.s
+    if { ac_try='$gcc_cv_as -a32 -o conftest.o conftest.s >&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+    then
+       gcc_cv_as_powerpc_vsx=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_vsx" >&5
+echo "${ECHO_T}$gcc_cv_as_powerpc_vsx" >&6
+if test $gcc_cv_as_powerpc_vsx = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_VSX 1
+_ACEOF
+
+fi
+
     echo "$as_me:$LINENO: checking assembler for .gnu_attribute support" >&5
 echo $ECHO_N "checking assembler for .gnu_attribute support... $ECHO_C" >&6
 if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then
index a79107f..a0e3f56 100644 (file)
@@ -3031,6 +3031,21 @@ LCF0:
       [AC_DEFINE(HAVE_AS_DFP, 1,
          [Define if your assembler supports DFP instructions.])])
 
+    case $target in
+      *-*-aix*) conftest_s='   .machine "pwr7"
+       .csect .text[[PR]]
+       lxvd2x 1,2,3';;
+      *) conftest_s='  .machine power7
+       .text
+       lxvd2x 1,2,3';;
+    esac
+
+    gcc_GAS_CHECK_FEATURE([vector-scalar support],
+      gcc_cv_as_powerpc_vsx, [9,99,0], -a32,
+      [$conftest_s],,
+      [AC_DEFINE(HAVE_AS_VSX, 1,
+         [Define if your assembler supports VSX instructions.])])
+
     gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
       gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
       [.gnu_attribute 4,1],,
index 1cc7984..cb02995 100644 (file)
@@ -13024,7 +13024,7 @@ Supported values for @var{cpu_type} are @samp{401}, @samp{403},
 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
-@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
+@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.