Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your comment surprised me as clang is regarded to be pretty competitive these days (compared to gcc). I don't know the current state of things but a quick search revealed at least one sentence, http://llvm.org/docs/Vectorizers.html, "the loop below will be vectorized on Intel x86 if the SSE4.1 roundps instruction is available." So it seems SSE4 is supported by LLVM?

I was going to say maybe it's a new thing, but the following post also talks about SSE4 and is from 2011: http://blog.llvm.org/2011/12/llvm-31-vector-changes.html

Maybe it only supports a subset of SSE4? Do you know the details, compared to other compilers?




The source of my confusion is that the last time I looked into LLVM's SIMD support was in the context of looking at Rust, a bit more than a year ago or so, and back then my conclusion was that neither (Rust or LLVM, then in version 3) are very good tools for that. It seems I was very wrong, at least on the LLVM side.

EDIT: Sorry, to reply to your question, my concern is not GCC vs. clang; If you want max out your vector ops, I would suggest you should compare to ICC as the "standard", at least on Intel CPUs.


Yep, I understand about icc. I actually wonder what is so difficult about optimising the way icc does, what does it actually do so much better than gcc? Anyone know of a good analysis?


I'd mostly attribute that to the MKL and their ability to just have to deal with their own instructions. But that's just an "educated guess".


Probably also having full time people working in the same company as the hardware guys who's job is to make the hardware look good.


I understand the social reasons, but I was wondering more about what compiler does in terms of technical achievements that goes beyond what gcc/clang can successfully generate. Surely this must be something that can be studied empirically.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: