News for hackers. Stuff that matters.
Re:Intel Clang-based C++ Compiler [pdf] by mikeash on Monday April 28, 2014 @08:27PM (#7664070)
Ignoring the results of feature checking when on a competitor's CPU is, though, and that's what they do.
Re:Intel Clang-based C++ Compiler [pdf] by garenp on Monday April 28, 2014 @08:37PM (#7664127)
So they should just then believe what another third-party vendor CPU says, and ship the compiler and hope for the best? Not what I would do. I would only enable specific optimizations when I could guarantee the output would be optimal or a given model. "Hope is not a plan."
Re:Intel Clang-based C++ Compiler [pdf] by hdevalence on Monday April 28, 2014 @09:06PM (#7664236)
Yes, they should.

If your CPU lies about its feature support, there are far, far, far bigger problems for the end user than whether a binary is optimal or not.

Re:Intel Clang-based C++ Compiler [pdf] by ponce on Tuesday April 29, 2014 @11:59AM (#7667856)
I remember earlier AMD processors, supporting SSE1 (with the CPUID bit on), but this was so slow to be unusable in practice, slower than general instructions.

In this case, the optimal thing to do was not to use these instructions despite the processors claiming support.

Re:Intel Clang-based C++ Compiler [pdf] by wmf on Tuesday April 29, 2014 @02:18PM (#7668937)
I'd argue that the optimal thing for a compiler to do is to use SSE when the processor supports it... and then the optimal thing for customers to do is not buy processors that run reasonable code slowly.
Re:Intel Clang-based C++ Compiler [pdf] by raverbashing on Monday April 28, 2014 @09:04PM (#7664228)
"So they should just then believe what another third-party vendor CPU says"

Of course. This is obvious, if you had any idea about what you were talking about.

" I would only enable specific optimizations when I could guarantee the output would be optimal or a given model."

You can do that with compiler flags, ever heard of them?

Re:Intel Clang-based C++ Compiler [pdf] by ori_b on Tuesday April 29, 2014 @12:10AM (#7664890)
> So they should just then believe what another third-party vendor CPU says,

They're already doing that by checking whether it says it's a genuine Intel. If you can't trust it when it says that it supports a feature, why trust it when it reports a manufacturer?

Re:Intel Clang-based C++ Compiler [pdf] by ginko on Tuesday April 29, 2014 @02:54AM (#7665417)
Because they would be breaking Intel's trademark if they claimed to be GenuineIntel.
Re:Intel Clang-based C++ Compiler [pdf] by zokier on Tuesday April 29, 2014 @04:35AM (#7665725)
It would be questionable if Intel could actually enforce their trademark there. The case would not be all too dissimilar to the Sega v. Accolade case, which Sega lost:

http://en.wikipedia.org/wiki/Sega_v._Accolade

Re:Intel Clang-based C++ Compiler [pdf] by mikeash on Tuesday April 29, 2014 @10:50AM (#7667314)
These are not "specific optimizations", they are things like "use SSE3 iff SSE3 is available on this CPU". Except that they actually code it as, "use SSE3 iff SSE3 is available on this CPU and it is an Intel CPU".