config.gcc (sparc*-*-*): Support cpu_32, cpu_64, tune_32 and tune_64.
authorJose E. Marchesi <jose.marchesi@oracle.com>
Mon, 30 May 2016 19:33:34 +0000 (21:33 +0200)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 30 May 2016 19:33:34 +0000 (19:33 +0000)
2016-05-30  Jose E. Marchesi  <jose.marchesi@oracle.com>

* config.gcc (sparc*-*-*): Support cpu_32, cpu_64, tune_32 and
tune_64.
* doc/install.texi (--with-cpu-32, --with-cpu-64): Document
support on SPARC.
* config/sparc/linux64.h (OPTION_DEFAULT_SPECS): Add entries for
cpu_32, cpu_64, tune_32 and tune_64.
* config/sparc/sol2.h (OPTION_DEFAULT_SPECS): Likewise.

From-SVN: r236897

gcc/ChangeLog
gcc/config.gcc
gcc/config/sparc/linux64.h
gcc/config/sparc/sol2.h
gcc/doc/install.texi

index 537d79c11c8f102733ff270e6bca5bf76753b1b0..7c023ff32b07a95dfbc301db5db364de1807a683 100644 (file)
@@ -1,3 +1,13 @@
+2016-05-30  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+       * config.gcc (sparc*-*-*): Support cpu_32, cpu_64, tune_32 and
+       tune_64.
+       * doc/install.texi (--with-cpu-32, --with-cpu-64): Document
+       support on SPARC.
+       * config/sparc/linux64.h (OPTION_DEFAULT_SPECS): Add entries for
+       cpu_32, cpu_64, tune_32 and tune_64.
+       * config/sparc/sol2.h (OPTION_DEFAULT_SPECS): Likewise.
+
 2016-05-30  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/sync.md (mfence_nosse): Use "lock orl $0, -4(%esp)".
index 51af122aafbee74fd8fdc18ab041a9cfffc6d529..d0a388090b70d2e888803b978ee87a5aeb6c0a70 100644 (file)
@@ -4250,9 +4250,9 @@ case "${target}" in
                esac
                ;;
        sparc*-*-*)
-               supported_defaults="cpu float tune"
+               supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
 
-               for which in cpu tune; do
+               for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
                        eval "val=\$with_$which"
                        case ${val} in
                        "" | sparc | sparcv9 | sparc64 \
index a1ef3259469fc92a5cc8ce898b393de8e60b5284..9d53c29ede107afbf57bb8444782321926a91b33 100644 (file)
@@ -164,22 +164,42 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 #endif
 
 /* Support for a compile-time default CPU, et cetera.  The rules are:
-   --with-cpu is ignored if -mcpu is specified.
-   --with-tune is ignored if -mtune is specified.
+   --with-cpu is ignored if -mcpu is specified; likewise --with-cpu-32
+     and --with-cpu-64.
+   --with-tune is ignored if -mtune is specified; likewise --with-tune-32
+     and --with-tune-64.
    --with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu
      are specified.
    In the SPARC_BI_ARCH compiler we cannot pass %{!mcpu=*:-mcpu=%(VALUE)}
    here, otherwise say -mcpu=v7 would be passed even when -m64.
-   CC1_SPEC above takes care of this instead.  */
+   CC1_SPEC above takes care of this instead.
+
+   Note that the order of the cpu* and tune* options matters: the
+   config.gcc file always sets with_cpu to some value, even if the
+   user didn't use --with-cpu when invoking the configure script.
+   This value is based on the target name.  Therefore we have to make
+   sure that --with-cpu-32 takes precedence to --with-cpu in < v9
+   systems, and that --with-cpu-64 takes precedence to --with-cpu in
+   >= v9 systems.  As for the tune* options, in some platforms
+   config.gcc also sets a default value for it if the user didn't use
+   --with-tune when invoking the configure script.  */
 #undef OPTION_DEFAULT_SPECS
 #if DEFAULT_ARCH32_P
 #define OPTION_DEFAULT_SPECS \
+  {"cpu_32", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"cpu_64", "%{m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
   {"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"tune_32", "%{!m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \
+  {"tune_64", "%{m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \
   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
   {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
 #else
 #define OPTION_DEFAULT_SPECS \
+  {"cpu_32", "%{m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"cpu_64", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
   {"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"tune_32", "%{m32:%{!mtune=*:-mtune=%(VALUE)}}" },  \
+  {"tune_64", "%{!m32:%{!mtune=*:-mtune=%(VALUE)}}" }, \
   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
   {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
 #endif
index 07e6368caea73e0dce05ca36b2ca6c88ddce108b..a54e1ecb677a579ca8f475d9463794fde32e5f12 100644 (file)
@@ -231,22 +231,42 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 #endif
 
 /* Support for a compile-time default CPU, et cetera.  The rules are:
-   --with-cpu is ignored if -mcpu is specified.
-   --with-tune is ignored if -mtune is specified.
+   --with-cpu is ignored if -mcpu is specified; likewise --with-cpu-32
+     and --with-cpu-64.
+   --with-tune is ignored if -mtune is specified; likewise --with-tune-32
+     and --with-tune-64.
    --with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu
      are specified.
    In the SPARC_BI_ARCH compiler we cannot pass %{!mcpu=*:-mcpu=%(VALUE)}
    here, otherwise say -mcpu=v7 would be passed even when -m64.
-   CC1_SPEC above takes care of this instead.  */
+   CC1_SPEC above takes care of this instead.
+
+   Note that the order of the cpu* and tune* options matters: the
+   config.gcc file always sets with_cpu to some value, even if the
+   user didn't use --with-cpu when invoking the configure script.
+   This value is based on the target name.  Therefore we have to make
+   sure that --with-cpu-32 takes precedence to --with-cpu in < v9
+   systems, and that --with-cpu-64 takes precedence to --with-cpu in
+   >= v9 systems.  As for the tune* options, in some platforms
+   config.gcc also sets a default value for it if the user didn't use
+   --with-tune when invoking the configure script.  */
 #undef OPTION_DEFAULT_SPECS
 #if DEFAULT_ARCH32_P
 #define OPTION_DEFAULT_SPECS \
+  {"cpu_32", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"cpu_64", "%{m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
   {"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"tune_32", "%{!m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \
+  {"tune_64", "%{m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \
   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
   {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
 #else
 #define OPTION_DEFAULT_SPECS \
+  {"cpu_32", "%{m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"cpu_64", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
   {"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+  {"tune_32", "%{m32:%{!mtune=*:-mtune=%(VALUE)}}" },  \
+  {"tune_64", "%{!m32:%{!mtune=*:-mtune=%(VALUE)}}" }, \
   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
   {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
 #endif
index db8ea73bb15125126e1c1712dc038f82a4b45176..e4c7535208faf74c127911f0645db62a7a532b44 100644 (file)
@@ -1247,7 +1247,7 @@ This option is only supported on some targets, including ARC, ARM, i386, M68k,
 PowerPC, and SPARC@.  It is mandatory for ARC@.  The @option{--with-cpu-32} and
 @option{--with-cpu-64} options specify separate default CPUs for
 32-bit and 64-bit modes; these options are only supported for i386,
-x86-64 and PowerPC.
+x86-64, PowerPC, and SPARC@.
 
 @item --with-schedule=@var{cpu}
 @itemx --with-arch=@var{cpu}