On Freitag 29 Mai 2009, Graham Murray wrote:
> Stroller <[email protected]> writes:
> > But, surely "-march=" also instructs gcc to support the additional
> > instructions. Suggest you re-read Daniel's post that I was replying
> > to.
> >
> > What's the difference between supporting the "certain set of
> > instructions" with "-march=" and doing so with USEs?
> >
> > Or doesn't "-march=" support additional "certain sets of
> > instructions". What does it do, then?
>
> I am not sure,
>
> $ gcc -Q --help=target -march=core2
> The following options are target specific:
> -m128bit-long-double [disabled]
> -m32 [enabled]
> -m3dnow [disabled]
> -m3dnowa [disabled]
> -m64 [disabled]
> -m80387 [enabled]
> -m96bit-long-double [enabled]
> -mabm [disabled]
> -maccumulate-outgoing-args [disabled]
> -maes [disabled]
> -malign-double [disabled]
> -malign-functions=
> -malign-jumps=
> -malign-loops=
> -malign-stringops [enabled]
> -march= core2
> -masm=
> -mavx [disabled]
> -mbranch-cost=
> -mcld [disabled]
> -mcmodel=
> -mcx16 [disabled]
> -mfancy-math-387 [enabled]
> -mfma [disabled]
> -mforce-drap [disabled]
> -mfp-ret-in-387 [enabled]
> -mfpmath=
> -mfused-madd [enabled]
> -mglibc [enabled]
> -mhard-float [enabled]
> -mieee-fp [enabled]
> -mincoming-stack-boundary=
> -minline-all-stringops [disabled]
> -minline-stringops-dynamically [disabled]
> -mintel-syntax [disabled]
> -mlarge-data-threshold=
> -mmmx [disabled]
> -mms-bitfields [disabled]
> -mno-align-stringops [disabled]
> -mno-fancy-math-387 [disabled]
> -mno-fused-madd [disabled]
> -mno-push-args [disabled]
> -mno-red-zone [disabled]
> -mno-sse4 [enabled]
> -momit-leaf-frame-pointer [disabled]
> -mpc
> -mpclmul [disabled]
> -mpopcnt [disabled]
> -mpreferred-stack-boundary=
> -mpush-args [enabled]
> -mrecip [disabled]
> -mred-zone [enabled]
> -mregparm=
> -mrtd [disabled]
> -msahf [disabled]
> -msoft-float [disabled]
> -msse [disabled]
> -msse2 [disabled]
> -msse2avx [disabled]
> -msse3 [disabled]
> -msse4 [disabled]
> -msse4.1 [disabled]
> -msse4.2 [disabled]
> -msse4a [disabled]
> -msse5 [disabled]
> -msseregparm [disabled]
> -mssse3 [disabled]
> -mstack-arg-probe [disabled]
> -mstackrealign [enabled]
> -mstringop-strategy=
> -mtls-dialect=
> -mtls-direct-seg-refs [enabled]
> -mtune=
> -muclibc [disabled]
> -mveclibabi=
and man gcc says:
--help={class|[^]qualifier}[,...]
Print (on the standard output) a description of the command line
options understood by the compiler that fit into all specified
classes and qualifiers. These are the supported classes:
target
This will display target-specific options. Unlike the --target-help
option however, target-specific options of the linker
and assembler will not be displayed. This is because those
tools do not currently support the extended --help= syntax.
Which leads to the conclusion, that it only shows options that can be set. Not
options how they are really set (besides a few that are enabled by the
architecture). If you leave -march=core2 out. you will probably get the same
result.
for example:
-mfpmath=unit
Generate floating point arithmetics for selected unit unit. The
choices for unit are:
387 Use the standard 387 floating point coprocessor present
majority of chips and emulated otherwise. Code compiled with this
option will run almost everywhere. The temporary results are
computed in 80bit precision instead of precision specified by
the type resulting in slightly different results compared to
most of other chips. See -ffloat-store for more detailed
description.
This is the default choice for i386 compiler.
sse Use scalar floating point instructions present in the SSE
instruction set. This instruction set is supported by Pentium3
and newer chips, in the AMD line by Athlon-4, Athlon-xp and
Athlon-mp chips. The earlier version of SSE instruction set
supports only single precision arithmetics, thus the double and
extended precision arithmetics is still done using 387.
Later version, present only in Pentium4 and the future AMD
x86-64 chips supports double precision arithmetics too.
For the i386 compiler, you need to use -march=cpu-type, -msse
or -msse2 switches to enable SSE extensions and make this
option effective. For the x86-64 compiler, these extensions
are enabled by default.
The resulting code should be considerably faster in the
majority of cases and avoid the numerical instability problems of
387 code, but may break some existing code that expects
temporaries to be 80bit.
This is the default choice for the x86-64 compiler.
as you can see from the man excerpt, if the help showed enabled options,
mfpmath=sse should be there. It isn't.
...