3 ms·
It's not obvious. If it was then GCC would not do it. Please don't use the word 'obvious' when it is to you but not to the majority of population.
by wereHamster 9y ago
It's not obvious. If it was then GCC would not do it. Please don't use the word 'obvious' when it is to you but not to the majority of population.
- raverbashing 9y agoIt is obvious, though I meant "obvious and correct" not "obviously correct"
- zrth 9y agoWho can clarify? Google says: Qbvious - easily perceived or understood; clear, self-evident, or apparent.
- lmm 9y agoThe confusion is between "the assembly clang generates is the obviously correct assembly for this operation" (true) and "the obviously correct behaviour for a compiler is to generate the assembly that clang does" (disputable, as while the assembly GCC generates is less clear, there may be advantages to doing it that way in e.g. performance). "Clang does the obvious, correct thing." is ambiguous between these two meanings.
- qb45 9y agoI disagree with "ambiguous", you sneakily changed "obvious" to "obviously" in the second sentence. obvious, correct != obviously correct
- shawnz 9y agoSounds like by "obvious" the parent means that Clang uses the most trivial approach.
- acdha 9y agoHave you looked at the actual GCC codebase? It's very easy to say something is obvious when you're looking at a problem which someone else has nicely isolated; it's much harder to dive into a complex codebase which has a very wide support matrix and say it's worth the effort to change working code instead of so many other things. More bluntly, before now wouldn't most people have said it was “obvious” that Intel would support their own documented features?
- raverbashing 9y agoThe code produced by Clang is a direct translation of the C code. That's the obvious part of it Most people here are not familiar with x86 assembly and its caveats it seems. Reading the Intel and AMD optimization manuals might be a good start (and yes, the bug is not in GCC it's on the Intel processor)
- acdha 9y ago> Most people here are not familiar with x86 assembly and its caveats it seems. Reading the Intel and AMD optimization manuals might be a good start. Please don't make unsupported assertions that everyone but you is speaking out ignorance. It doesn't add anything to the conversation, especially when dealing with older codebases unless you can prove that this is and never has been the correct way to write that code. Otherwise it's just another way to say “CPU optimizations change over time and an open-source project doesn't have a team of experts tracking microbenchmarks to decide when to switch”.
- raverbashing 9y agoShould be easy to prove me wrong if it's as easy as you say, I don't see why you're so annoyed by it > “CPU optimizations change over time and an open-source project doesn't have a team of experts tracking microbenchmarks to decide when to switch” Yes, that's what's happening, but the problem comes from the P6 architecture (though Netburst doesn't have those problems), this problem has been known for around 20 years
- wyldfire 9y ago