|
|
|
|
|
by garganzol
116 days ago
|
|
LLM writes a better ASM then a C compiler? From running the demo in the browser, it seems so performance-wise and size-wise, but the ultimate test should be performed on a real hardware that I have no direct access to. Anyone can validate the performance on a real PC of the era? If it's confirmed, LLMs may be one of the ways of creating highly optimizing compilers in the future. |
|
Take the irow loop in vga12.inc[1] (of course I'm going to look at the graphics code). Each iteration does push di; rep stosb; pop di; add di, ROW_BYTES (and some other stuff). Why not save the push/pop and add (ROW_BYTES - count), which could be stored in a register (dx is free here)? Just the push+pop is 15+12 cycles.
[1]: https://github.com/jggonz/os8088/blob/1f2fae44180fadaf85368c...