3 ms·
Hello, The introduction was meant to be tongue-and-cheek. There was a talk back in January which made headlines due to its claims. https://www.youtube.com/watc
by pavehawk2007 6y ago
Hello,
The introduction was meant to be tongue-and-cheek. There was a talk back in January which made headlines due to its claims. https://www.youtube.com/watch?v=8SoJR3sCaR4 https://www.youtube.com/watch?v=8SoJR3sCaR4
When I started learning the Nim programming language, the claims were that what you can do in C is what you can do in assembly... In other words, there was no more reason to learn or write assembly, unless you were making a C compiler yourself. I don't think they were ever taken seriously, but neither was my introduction supposed to be taken seriously. The point being that instead of having your brand new language compile to assembly, why not compile to C?
Regarding the intrinsics, you are correct if you optimize. Using your same link, you can turn off the optimizer and see that it follows C ABI conventions--mainly so the debugger can follow each step.
The point here is that we're still writing assembly, with a C marinade on top. _mm_haddps is wrapping an assembly instruction directly. However, to see what this is actually doing, we need to know a bit of assembly. In other words, we're writing C in syntax only.
Perhaps I can reword that part better. Thanks for the comment!
- tom_mellior 6y ago> There was a talk back in January which made headlines due to its claims. https://www.youtube.com/watch?v=8SoJR3sCaR4 https://www.youtube.com/watch?v=8SoJR3sCaR4 That talk has 3194 views at the moment. That's pretty obscure. > Using your same link, you can turn off the optimizer and see that it follows C calling conventions--mainly so the debugger can follow each step. If you change -O0 to -O3 you will see a lot of stack traffic, that's true. This has nothing to do with calling conventions -- there are no calls generated for the intrinsics. Rather, you just see stack traffic because GCC doesn't try to do proper register allocation at -O0. Nothing to do with intrinsics.
- kbenson 6y ago> That talk has 3194 views at the moment. That's pretty obscure. I guess it depends on the intended audience of this post? I might also find it hard to understand some of the context of a post poking fun as some trend in some knitting mailing list, if I wasn't a member of that list. I think by "made headlines" they might mean "made a stir in some of the communities I frequent". Given the idea of bloggers as news people, a "headline" is a blog post that gains traction in circles you care about...
- tom_mellior 6y agoYes, the video was probably passed around in a the Nim community. The featured article isn't directed at the Nim community, though. The author just misjudged the video's reach outside of their knitting mailing list.