• Dork1234 2 days ago

    By going to godbolt Just realized how hard it is to generate x87 FPU code these days. Almost all supported compilers are outputing XMM? SSE instructions these days.

    • shawn_w 2 days ago

      Use a 32 bit x86 target?

      • burnt-resistor 2 days ago

        You're doing it wrong.

        GCC: -mfpmath=387

        Clang: -mfpmath=387 -mno-sse

      • DerekL 2 days ago

        Title has a typo, should say “framerate”.

        • chunkles 2 days ago

          The mods must have changed the title because I submitted it with the title "How Michael Abrash doubled Quakes framerate" matching the actual article title.

        • markus_zhang 3 days ago

          Just curious, given that Pentium arch might still be relevant, than 486/487. How much of this optimization is still relevant today?

          • mwkaufma 2 days ago

            Thinking about fpu pipeline parallelism/stalls still matter, though more often by hinting an optimizing compiler + verifying the output by inspection, than by inlining asm itself.

            • markus_zhang 2 days ago

              Gotcha, thanks!

            • burnt-resistor 2 days ago

              487 is a 486dx/dlc-compatible (FPU enabled) replacement for the 486sx/slc (FPU disabled).

              There are actually several flavors of x87 ISA: 8087, 80287, and 80387. Every 386+ chip supports the 387 ISA. The 287 is almost the same as the 387. The 8087 is almost a strict subset with some differences. There were also Weitek math coprocessors that were entirely different. The IIT 3C87 was an odd bird that supported the 387 ISA and some other instructions.