简体   繁体   中英

Unable to activate the SSE instruction set by “-march=native” in gcc or any other flags in Core2 chip

My machine is Core2 microarchitecture and I tried to compile some arithmetic code targeting the SSE instruction set. I searched on the web and official manual, and I believe that all I need to do is to add the flag -march=native , because my chip supports SSE.

But when I use gcc -march=native -Q --help=target -v to check if the flag really works, the result displayed on-screen is not what I expected. For example:

-msse                               [disabled]
-msse2                              [disabled]
-msse2avx                           [disabled]
-msse3                              [disabled]
-msse4                              [disabled]
-msse4.1                            [disabled]
-msse4.2                            [disabled]
-msse4a                             [disabled]
-msse5                              
-msseregparm                        [disabled]
-mssse3                             [disabled]

I find all the SSE (and even MMX) instructions are disabled. Can anybody tell me why and how to solve it? Many thanks!

The output of gcc -march=native -Q --help=target -v does not include the overrides defined by -march , as gcc returns the output prior to running the code which handles the architecture specific overrides.

See the bug report on this matter, and specifically that it keeps confusing users, such as myself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM