Michael Abrash's hand-crafted x86 assembly optimizations doubled Quake's framerate from 22.7fps to 42.2fps on a Pentium MMX 233MHz. The biggest gains came from D_DrawSpans8 (wall rendering), R_DrawSurfaceBlock8 (lightmap baking), and polyset functions (model drawing). Key techniques included loop unrolling, self-modifying code, overlapping FPU and integer pipeline execution, hiding FDIV latency by issuing divisions early, and leveraging free FXCH instructions on Pentium to use FPU registers efficiently. The optimizations exploited Pentium-specific architectural features like dual U/V pipelines and pipelined floating-point operations.

14m read timeFrom fabiensanglard.net
Post cover image

Sort: