John Leidegren
John Leidegren

Reputation: 61037

What's the state of compilers that generate X86 assembly today?

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?

Upvotes: 1

Views: 141

Answers (2)

Marcelo Cantos
Marcelo Cantos

Reputation: 185962

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.

Upvotes: 2

sharptooth
sharptooth

Reputation: 170509

"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.

Upvotes: 1

Related Questions