https://github.com/pacak/cargo-show-asm is a nice helper for the Rust->asm part of this that has seen a decent amount of work for handling all the edge cases. (I've contributed a bit to it to handle some Windows issues.)
Maybe I should say Compiler Explorer instead of Godbolt.
This should be mandatory for any programming environment, along with a CPU emulator showing how data moves through the ALU, and all the ports, to which registers it goes to, and how everything works clock by clock.
I hope AI makes this possible, at least for VS Code and C++.
When I program, I imagine the registers and ports. Only the ones I use. I see the sequence of micro-ops moving like in a queue, the stack in a different column, and the L1 cache as neighboring lines. That could be drawn.
The parts not involved could be drawn in miniature, like the AVX2 hardware. More detail could be shown if the user clicks.
I try to push the computations involve in the critical path up as high as possible, and then just hope that between the compiler and hardware somebody’ll take advantage of that.
I haven’t tuned a ton of kernels though, I mostly do linear algebra stuff and good BLAS implementations do better than I could hope to.
uica.uops.info has been down for a long time, but it used to show graphically how many CPU cycles it takes to execute a small piece of code.
Modern x86 CPUs have multiple execution ports, with duplicated hardware for the same operations, and the exact same operation can be performed in different ways.
As a toy example, multiplying a number by 2 can be done using multiplication, a bit shift, addition (adding the value to itself), or the pointer calculator. On x86 CPUs, these instructions can execute simultaneously on different ports, allowing you to perform six or more operations in parallel. This means you can achieve higher throughput by using different implementations of the same operation instead of relying on a single instruction.
You can't leave this to the compiler. It chooses only one implementation, leaving other execution ports unused.
i don't think IHVs would give out the RTL required for this to be possible, and it would also require a ton of compute to simulate it. TDA will be the best you can get reasonably.
I've made this for my hobby projects where I still get to write the code manually. If you are using agentic coding then you don't need neovim to begin with.
Some of the code, some of the time, for some of the people.
Yet far from all of the code, all of the time, for all of the people.
People just like to talk it up, especially if they've been able to let it take over they're own coding. And some people work and chat in bubbles where they only know people working similarly to themselves.
19 comments
[ 0.22 ms ] story [ 351 ms ] threadThis should be mandatory for any programming environment, along with a CPU emulator showing how data moves through the ALU, and all the ports, to which registers it goes to, and how everything works clock by clock.
I hope AI makes this possible, at least for VS Code and C++.
I still write code out on paper as I think through algorithms.
The parts not involved could be drawn in miniature, like the AVX2 hardware. More detail could be shown if the user clicks.
It probably isn't as complex to draw.
I try to push the computations involve in the critical path up as high as possible, and then just hope that between the compiler and hardware somebody’ll take advantage of that.
I haven’t tuned a ton of kernels though, I mostly do linear algebra stuff and good BLAS implementations do better than I could hope to.
Modern x86 CPUs have multiple execution ports, with duplicated hardware for the same operations, and the exact same operation can be performed in different ways.
As a toy example, multiplying a number by 2 can be done using multiplication, a bit shift, addition (adding the value to itself), or the pointer calculator. On x86 CPUs, these instructions can execute simultaneously on different ports, allowing you to perform six or more operations in parallel. This means you can achieve higher throughput by using different implementations of the same operation instead of relying on a single instruction.
You can't leave this to the compiler. It chooses only one implementation, leaving other execution ports unused.
Yet far from all of the code, all of the time, for all of the people.
People just like to talk it up, especially if they've been able to let it take over they're own coding. And some people work and chat in bubbles where they only know people working similarly to themselves.
I don't think this extension is valuable for people who use agents to code.