Skip to content

Implement 64-bit MachOps in i386 backend

Jaro Reinders requested to merge wip/T23576 into master

Fixes #23576 (closed)

The status quo is that we use callish ops for almost every 64-bit operation on i386. This MR changes that to only the "quottish" (signed / unsigned quot & rem) use callish ops. All other operations are now implemented directly in assembly instructions. For this purpose I've also added two new instructions SHLD and SHRD.

These changes improve performance and allow us to remove the workarounds in GHC.Utils.Unique and in the test for T22871.

TODO:

  • Fix comparisons
  • See what else breaks
  • Polish
  • Comments explaining the changes
  • Tests (test-primops)
  • Add changelog entry
Edited by Andreas Klebinger

Merge request reports