News for hackers. Stuff that matters.
Re:KolibriOS – operating system written entirely in assembly... by spockz on Wednesday April 15, 2020 @06:28AM (#22876211)
I’m wondering if they time spent in writing asm for av1 could also be spend in writing an optimising pass for the c compiler? So that any optimisations can be applied by the compiler while the readability of the C language is retained.
Re:KolibriOS – operating system written entirely in assembly... by gridlockd on Wednesday April 15, 2020 @08:10AM (#22876774)
The compiler knows nothing about your program and its data layout, which is were all of that speedup comes from.

There are some SIMD constructs that you can efficiently express in C by writing intrinsics, but that isn't substantially different from writing ASM.

Then there are some trivial cases where a loop can be unrolled and packed into SIMD instructions automagically, which retains readability, but greatly limits what you can write. You'll need to read the generated machine code to make sure you didn't mess up.

The benefit of just writing ASM is to not have such a translation layer between you and the processor. That same code that you carefully wrote to make it through the optimization passes for one compiler will likely get messed up in another compiler.

Re:KolibriOS – operating system written entirely in assembly... by jbk on Wednesday April 15, 2020 @11:49AM (#22879191)
> I’m wondering if they time spent in writing asm for av1 could also be spend in writing an optimising pass for the c compiler?

Frankly, no.

Improving the compiler could get a few dozen of %, which is huge already. But 300%+, no.

Re:KolibriOS – operating system written entirely in assembly... by papermachete on Wednesday April 15, 2020 @11:17AM (#22878711)
You mean like intrinsics? Sure.