by whizzter · 2w ago · 0 comments
1: Many tricks worked for outdated CPU's more or less weird instructions (and those haven't gotten equally much updated as modern C compilers to benefit, and the benefits of modern C compilers is more into control- and data-flow analysis rather than esoteric instruction selection, so even ports of modern compilers to old platforms probably won't use it).
2: Many x86 tricks would lead to slower code today, already with the Pentium Pro Intel started focusing on optimizing the CPU's so that they run code that compilers produce faster and kinda ignored and/or "failsafed" certain patterns with slower execution paths.
As someone writing software rendered graphics in the 90s you had the trick of 64k-aligning textures and then updating the 8bit parts of 32 bit registeres like AH/AL (or CH/CL,etc) before loading the texture from the corresponding address in a register (like EAX/ECX that contains all 32bits), code that ran fine on a Pentium 133 could behave like a slug on a Pentium Pro 200 if they did that.
The Pentium 2 actually added optimizations to handle those cases since some games,etc suffered on PPro, but I would be surprised if they've retained those fixes in CPU's after 2010 since it complicates CPU register tracking and software rendering went the way of the dodo (and software that still used those tricks would be handled by the enormous CPU power of today even if slightly slower), and anyone doing a software renderer after 2005 would probably support more than 256x256 textures and not spend too much optimizing for that particular case (256x256 textures was a very sweet spot, both due to registers but also ram sizes of the 90s).
Same thing with the x87 FPU code, it's wonderful for sizecoding since the stack based nature makes registers implicit, but the problems like stateful integer conversions (If you remember /QIfist) are done away with SSE/AVX (iirc modern MSVC doesn't even generate code using x87 FPU anymore, it's all SSE now).
3: I'd be very surprised to see a compiler use the stack-pointer based tricks mentioned in the article, a C compiler has to respect ABI promises so that stuff is simply too much pain to try to make work in a stable fashion so I really really doubt that any compiler writer has more than entertained the notion of using it before brushing it aside as a bottomless pit of compatbility fixes.
Sorry to move the goal post on you ;)