Find the answer to your Linux question:
Results 1 to 3 of 3
When excute "gcc --target-help",it print Code: ... -march=CPU[,+EXTENSION...] generate code for CPU and EXTENSION, CPU is one of: i8086, i186, i286, i386, i486, pentium, pentiumpro, pentiumii, pentiumiii, pentium4, prescott, nocona, ...
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    3

    Question What's the use of "-march" & "-mtune" option in GCC?

    When excute "gcc --target-help",it print
    Code:
    ...
      -march=CPU[,+EXTENSION...]
                              generate code for CPU and EXTENSION, CPU is one of:
                               i8086, i186, i286, i386, i486, pentium, pentiumpro,
                               pentiumii, pentiumiii, pentium4, prescott, nocona,
                               core, core2, corei7, k6, k6_2, athlon, k8, amdfam10,
                               generic32, generic64
                              EXTENSION is combination of:
                               mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, sse4,
                               avx, vmx, smx, xsave, movbe, ept, aes, pclmul, fma,
                               clflush, syscall, rdtscp, 3dnow, 3dnowa, sse4a,
                               svme, abm, padlock, fma4
      -mtune=CPU              optimize for CPU, CPU is one of:
                               i8086, i186, i286, i386, i486, pentium, pentiumpro,
                               pentiumii, pentiumiii, pentium4, prescott, nocona,
                               core, core2, corei7, k6, k6_2, athlon, k8, amdfam10,
                               generic32, generic64
    ...
    Is that means it can compile a program run on above CPUs?
    But if it can do so, what's the differences among GCCs compiled for different targets(such as i386-linux-gnu,i486-linux-gnu...).

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Well yes and no. Yes the GCC compiler offers these options but you need GCC set up for the chip family to have them available as valid options...Gerard4143
    Make mine Arch Linux

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Posts
    3
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...