Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large-scale PowerPC recompiler rework #641

Open
wants to merge 64 commits into
base: main
Choose a base branch
from

Commits on Aug 29, 2024

  1. Configuration menu
    Copy the full SHA
    4c16397 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f523b21 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0265108 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b1b46f3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5b2bc7e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    625874a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    101a2ef View commit details
    Browse the repository at this point in the history
  8. PPCRec: Move IML optimizer file

    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    e53c6ad View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d1fe1a9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    27f70d5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    db60ea6 View commit details
    Browse the repository at this point in the history
  12. PPCRec: Reworked IML builder to work with basic-blocks

    Intermediate commit while I'm still fixing things but I didn't want to pile on too many changes in a single commit.
    New:
    Reworked PPC->IML converter to first create a graph of basic blocks and then turn those into IML segment(s). This was mainly done to decouple IML design from having PPC specific knowledge like branch target addresses. The previous design also didn't allow to preserve cycle counting properly in all cases since it was based on IML instruction counting.
    The new solution supports functions with non-continuous body. A pretty common example for this is when functions end with a trailing B instruction to some other place.
    
    Current limitations:
    - BL inlining not implemented
    - MFTB not implemented
    - BCCTR and BCLR are only partially implemented
    
    Undo vcpkg change
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    ce8dc55 View commit details
    Browse the repository at this point in the history
  13. PPCRec: Fix merge conflicts

    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    a5f6faa View commit details
    Browse the repository at this point in the history
  14. PPCRec: Unify BCCTR and BCLR code

    Instead of having fixed macros for BCCTR/BCCTRL/BCLR/BCLRL we now have only one single macro instruction that takes the jump destination as a register parameter.
    This also allows us to reuse an already loaded LR register (by something like MTLR) instead of loading it again from memory.
    
    As a necessary requirement for this: The register allocator now has support for read operations in suffix instructions
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    8d972d2 View commit details
    Browse the repository at this point in the history
  15. PPCRec: Fix single segment loop not being detected

    Also removed associatedPPCAddress field from IMLInstruction as it's no longer used
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    874e376 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    93f5615 View commit details
    Browse the repository at this point in the history
  17. PPCRec: Clean up unused flags

    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    9dc8207 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    d308252 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    832b761 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    53139cd View commit details
    Browse the repository at this point in the history
  21. PPCRec: New x86-64 code emitter

    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    ac22a38 View commit details
    Browse the repository at this point in the history
  22. PPCRec: New compare and cond jump instrs, update RA

    Storing the condition result in a register instead of imitating PPC CR lets us simplify the backend a lot. Only implemented as PoC for BDZ/BDNZ so far.
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    91f9727 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    2535cf4 View commit details
    Browse the repository at this point in the history
  24. PPCRec: Further unify CR code

    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    8df0281 View commit details
    Browse the repository at this point in the history
  25. PPCRec: Rework carry bit and generalize carry IML instructions

    Carry bit is now resident in a register-allocated GPR instead of being backed directly into IML instructions
    
    All the PowerPC carry ADD* and SUB* instructions as well as SRAW/SRAWI have been reworked to use more generalized IML instructions for handling carry
    
    IML instructions now support two named output registers instead of only one (easily extendable to arbitrary count)
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    37256ac View commit details
    Browse the repository at this point in the history
  26. PPCRec: Avoid complex optimizations in backend

    It's better to do it in a lowering pass so that the backend code can be kept as simple as possible
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    ff09940 View commit details
    Browse the repository at this point in the history
  27. PPCRec: Rework CR bit handling

    CR bits are now resident in registers instead of being baked into the instruction definitions. Same for XER SO, and LWARX reservation EA and value.
    
    Reworked LWARX/STWCX, CRxx ops, compare and branch instructions. As well as RC bit handling. Not all CR-related instructions are reimplemented yet.
    
    Introduced atomic_cmp_store operation to allow implementing STWCX in architecture agnostic IML
    
    Removed legacy CR-based compare and jump operations
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    c4b9fff View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    a1c8f6f View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    b4f2e02 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    3ba9460 View commit details
    Browse the repository at this point in the history
  31. PPCRec: Simplify PPC and IML logic instructions

    Also implement PPC NAND instruction
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    e86fa57 View commit details
    Browse the repository at this point in the history
  32. PPCRec: Unify code + misc RA preparation

    Whoopsie
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    b367689 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    0577eff View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    59bd84b View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    154aef0 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    df74b99 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    7c76738 View commit details
    Browse the repository at this point in the history
  38. PPCRec: Further work on support for typed registers in RA

    Additionally there is no more range limit for virtual RegIDs, making the entire uint16 space available in theory
    Exzap committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    b1c6646 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    b4f2f91 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    e5717fb View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    b685a08 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    cc730b4 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2024

  1. Configuration menu
    Copy the full SHA
    450c0a5 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. PPCRec: Add RA support for instructions with register constraints

    Also make interval tracking more fine grained and differentiate between input and output edges of each instruction
    Exzap committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    dcbaa5a View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2024

  1. PPCRec: Some fixes

    Exzap committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    a0ad48c View commit details
    Browse the repository at this point in the history
  2. PPCRec: Support for arbitrary function calls in the IR

    Used for MFTBU/MFTBL instruction
    Exzap committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    8614150 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    97ef952 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aa904b6 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2024

  1. Configuration menu
    Copy the full SHA
    002a03d View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. Configuration menu
    Copy the full SHA
    608757d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f1fa494 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e34a273 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2024

  1. Configuration menu
    Copy the full SHA
    5949e62 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70c99fd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    96d7c75 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2024

  1. Configuration menu
    Copy the full SHA
    636b63f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    126a682 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2024

  1. PPCRec: Code cleanup

    Exzap committed Oct 27, 2024
    Configuration menu
    Copy the full SHA
    f309d5d View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. PPCRec: Rework RLWIMI

    Exzap committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    099d1d4 View commit details
    Browse the repository at this point in the history
  2. PPCRec: Optimizations

    Exzap committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    e332726 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2024

  1. Configuration menu
    Copy the full SHA
    a05b655 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Configuration menu
    Copy the full SHA
    83569ae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8219a5f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9187044 View commit details
    Browse the repository at this point in the history