2

我的机器是 Core2 微架构,我尝试编译一些针对 SSE 指令集的算术代码。我在网上和官方手册上搜索,我相信我需要做的就是添加标志-march=native,因为我的芯片支持SSE。

但是当我 gcc -march=native -Q --help=target -v用来检查标志是否真的有效时,屏幕上显示的结果并不是我所期望的。例如:</p>

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

我发现所有 SSE(甚至 MMX)指令都被禁用。谁能告诉我为什么以及如何解决它?非常感谢!</p>

4

1 回答 1

4

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.

于 2014-08-26T20:50:22.060 回答