简体   繁体   English

无法激活gcc中的“ -march = native”或Core2芯片中的任何其他标志设置的SSE指令

[英]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. 我的机器是Core2微体系结构,我尝试编译一些针对SSE指令集的算术代码。 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. 我在网上和官方手册中进行了搜索,我相信我所要做的就是添加标志-march=native ,因为我的芯片支持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. 但是,当我使用gcc -march=native -Q --help=target -v检查该标志是否真的有效时,屏幕上显示的结果不是我期望的。 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. 我发现所有SSE(甚至MMX)指令均被禁用。 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. gcc -march=native -Q --help=target -v的输出不包括-march定义的替代,因为gcc在运行处理特定于体系结构的替代的代码之前会返回输出。

See the bug report on this matter, and specifically that it keeps confusing users, such as myself. 请参阅有关此问题的错误报告 ,尤其是它会使用户(例如我自己)感到困惑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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