diff mbox

Support -mcpu=native on Solaris/SPARC

Message ID yddbow0t87k.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Aug. 8, 2011, 12:10 p.m. UTC
Eric Botcazou <ebotcazou@adacore.com> writes:

>> 2011-07-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>>
>> 	gcc:
>> 	* config/sparc/driver-sparc.c: New file.
>> 	* config/sparc/x-sparc: New file.
>> 	* config.host: Use driver-sparc.o, sparc/x-sparc on
>> 	sparc*-*-solaris2*.
>> 	* config/sparc/sparc.opt (native): New value for enum
>> 	processor_type.
>> 	* config/sparc/sparc-opts.h (PROCESSOR_NATIVE): Declare.
>> 	* config/sparc/sparc.c (sparc_option_override): Abort if
>> 	PROCESSOR_NATIVE gets here.
>> 	* config/sparc/sol2.h [__sparc__] (host_detect_local_cpu): Declare.
>> 	(EXTRA_SPEC_FUNCTIONS, MCPU_MTUNE_NATIVE_SPECS,
>> 	DRIVER_SELF_SPECS): Define.
>> 	* configure.ac (EXTRA_GCC_LIBS): Check for libkstat.
>> 	Substitute result.
>> 	* configure: Regenerate.
>> 	* Makefile.in (EXTRA_GCC_LIBS): Set.
>> 	(xgcc$(exeext)): Add $(EXTRA_GCC_LIBS).
>> 	(cpp$(exeext)): Likewise.
>
> OK if you document the new value in doc/invoke.texi, thanks in advance.

Sure, done as follows:

2011-07-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* doc/invoke.texi (SPARC Options, -mcpu): Document native.
	(SPARC Options, -mtune): Likewise.


Tested in a i386-pc-solaris2.11 bootstrap and visual inspection with
info.

Installed on mainline.

Thanks.
        Rainer
diff mbox

Patch

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -17263,6 +17263,11 @@  for machine type @var{cpu_type}.  Suppor
 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
 
+Native Solaris toolchains also support the value @samp{native},
+which selects the best architecture option for the host processor.
+@option{-mcpu=native} has no effect if GCC does not recognize
+the processor.
+
 Default instruction scheduling parameters are used for values that select
 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
@@ -17327,7 +17332,8 @@  The same values for @option{-mcpu=@var{c
 that select a particular CPU implementation.  Those are @samp{cypress},
 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
-@samp{niagara}, and @samp{niagara2}.
+@samp{niagara}, and @samp{niagara2}.  With native Solaris toolchains,
+@samp{native} can also be used.
 
 @item -mv8plus
 @itemx -mno-v8plus