Post #1944159
2026-03-02 21:12 UTC
@jcoglan @nicuveo for a start, the very-close-to-the-metal constructs don’t map really well to the C language. The C SDK is full of "Use this macro to do magic side effects", some areas of memory become locked or unlocked at specific points…
But the main thing is that the generated code is awfully bloated. Easily 10x the assembly version.
Replies (1)
-
@pmorinerie@mastodon.xyz 2026-03-02 21:15
@jcoglan @nicuveo All arguments are passed on the stack. No registers are ever used to pass arguments. The stack routines take dozens of instruction before calling a function, and dozens again in the function epilogue. A trivial function becomes a pile of mess. Plus, simply doing "complex" maths (e.g "x = 64 / 10") will generate a ton of instructions to divide by a non-power-of-two value. When writing assembly code, this is visible, and worked around. Not in C.