Skip to content

Conversation

@ApfelTeeSaft
Copy link

  1. test_recompiler.cpp:216 - Implement CR register checking

    • Added proper CR register validation that checks all 4 fields (lt, gt, eq, so)
    • Each field is extracted from the 4-bit CR value using bit shifts
  2. recompiler.h:55 - Create RecompileArgs struct

    • Introduced RecompileArgs struct to encapsulate the 7 function parameters
    • Improves code maintainability and reduces function signature complexity
    • Updated function signature and call site accordingly
  3. recompiler.cpp:366 - Add bounds checking for mmioStore

    • Added validation to ensure the next instruction (data + 1) is within function bounds
    • Prevents potential out-of-bounds memory access
  4. recompiler.cpp:1258 - Fix MFOCRF hardcoded CR field

    • Implemented proper FXM field mask decoding to determine which CR field to read
    • Removed hardcoded cr6 and now dynamically selects the correct CR field (cr0-cr7)
    • FXM is decoded as an 8-bit mask where bit 0 (0x80) = cr0, bit 1 (0x40) = cr1, etc.

1. test_recompiler.cpp:216 - Implement CR register checking
   - Added proper CR register validation that checks all 4 fields (lt, gt, eq, so)
   - Each field is extracted from the 4-bit CR value using bit shifts

2. recompiler.h:55 - Create RecompileArgs struct
   - Introduced RecompileArgs struct to encapsulate the 7 function parameters
   - Improves code maintainability and reduces function signature complexity
   - Updated function signature and call site accordingly

3. recompiler.cpp:366 - Add bounds checking for mmioStore
   - Added validation to ensure the next instruction (data + 1) is within function bounds
   - Prevents potential out-of-bounds memory access

4. recompiler.cpp:1258 - Fix MFOCRF hardcoded CR field
   - Implemented proper FXM field mask decoding to determine which CR field to read
   - Removed hardcoded cr6 and now dynamically selects the correct CR field (cr0-cr7)
   - FXM is decoded as an 8-bit mask where bit 0 (0x80) = cr0, bit 1 (0x40) = cr1, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant