目前生成 X86 程序集的编译器状况如何?

发布于 2024-09-19 04:51:21 字数 180 浏览 5 评论 0原文

每当我与从事实时性能工作的人交谈时,他们往往会指出生成的 X86 汇编指令效率不高。

随着像 VMX 这样的东西即将出现,我不得不问,商业 C++ 编译器使用这些指令集的可能性有多大?我的感觉是,编译器供应商不会发布特别花哨的程序集,也不会专注于使编译器保持最新状态。

就此而言,好的 X86 组装首先由什么构成?

Whenever I talk to people that work with real-time preformance they tend to point out that the generated X86 assembly instructions are not that efficent.

With things like VMX on the horizon I have to ask, how likely is it that commercial C++ compilers will utilize these instruction sets? I get the feeling that compiler vendors don't emit particulary fancy assembly or focus on keeping ther compilers up to date.

And for that matter, what constitutes good X86 assembly in the first place?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁吢 2024-09-26 04:51:21

和你说话的人一定是性能狂。大多数现代编译器将生成非常高效的代码,这些代码利用分支预测和管道停顿表以及大量优化技术。他们通常会编写出比最聪明的程序员所能比拟的更好的代码。有一些奇怪的例外,这就是为什么让 __asm 和内在函数处于待命状态很好的原因,但是这些被证明是必要的(并且有用的)的情况现在已经很少了。

The guys you're talking to must be performance nuts. Most modern compilers will generate very efficient code that makes use of branch-prediction and pipeline-stall tables and a host of optimisation techniques. They will generally emit better code than all but the smartest programmers can match. There are oddball exceptions, which is why it's nice to have __asm and intrinsics on standby, but the situations in which these prove necessary (and helpful) are few and far between these days.

樱花落人离去 2024-09-26 04:51:21

“良好的汇编”意味着编译后的程序能够最佳地利用资源。有一种智慧“以清晰的方式编写代码,让编译器进行优化”。为了保持这种智慧,编译器会在很大程度上生成真正快速的代码。

根据我的经验,Visual C++ 通常会为复杂的 C++ 构造生成令人惊讶的简洁代码,因此编译器供应商不关心代码排放的想法并不正确。

"Good assembly" means that the compiled program utilizes resources optimally. There's a wisdom "write code in clear manner and let the compiler do the optimizations". For this wisdom to hold true compilers go to great extent to generate really fast code.

From my experience Visual C++ often produces surprisingly consice code for complex looking C++ construct, so the idea that compiler vendors don't care about code emisson is not that true.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文