| An Introduction to GCC - for the GNU compilers gcc and g++ by Brian J. Gough, foreword by Richard M. Stallman Paperback (6"x9"), 144 pages ISBN 0954161793 RRP £12.95 ($19.95) "An excellent introduction... fills a much-needed niche in the marketplace" --- Association of C and C++ Users book review (Issue 16-4, August 2004) Get a printed copy>>> |
8.1.1 x86 extensions
GCC can take advantage of the additional instructions in the MMX, SSE,
SSE2, SSE3 and 3dnow extensions of recent Intel and AMD processors. The
options -mmmx, -msse, -msse2, -msse3
and -m3dnow enable the use of these extra instructions, allowing
multiple words of data to be processed in parallel. The resulting
executables will only run on processors supporting the appropriate
extensions--on other systems they will crash with an Illegal
instruction error (or similar).(23)
The option -mfpmath=sse instructs GCC to use the SSE extensions
for floating-point arithmetic where possible. For this option to take
effect, the SSE or SSE2 extensions must first be enabled with
-msse or -msse2.
Note that the plain SSE extensions only support single precision
operations--double precision arithmetic is part of SSE2. Since most C
and C++ programs declare floating-point variables as double
rather than float, the combined options -msse2
-mfpmath=sse are usually needed. On 64-bit processors these
options are enabled by default.
| ISBN 0954161793 | An Introduction to GCC - for the GNU compilers gcc and g++ | See the print edition |