Skip to content

Improve MIPS floating-point lifting and calling conventions - #8500

Open
zznop wants to merge 5 commits into
devfrom
test_fix_mips_fp_load_store
Open

Improve MIPS floating-point lifting and calling conventions#8500
zznop wants to merge 5 commits into
devfrom
test_fix_mips_fp_load_store

Conversation

@zznop

@zznop zznop commented Sep 1, 2026

Copy link
Copy Markdown
Member

This PR includes the following:

  • Add o32 hard-float calling convention support.
  • Expand MIPS floating-point lifting for loads/stores, register transfers, comparisons, multiply-add, and conditional moves.
  • Correctly handle FR=0 register pairs, FR=1 registers, FCC conditions, endianness, and unpredictable cases.
  • Add regression tests (test_lifting.py) for fixed and newly lifted instructions

Closes #4010

After/Before:
Screenshot 2026-09-01 at 10 07 24 AM

Decode floating-point memory operands correctly and lift lwc1, swc1,
ldc1, and sdc1 using the appropriate FPR representation. Model MIPS32
FR=0 doublewords as register pairs and mark odd pair roots unknown.

Add lifting tests across endianness, MIPS64, and R5900.
Lift MFC1, MTC1, DMFC1, DMTC1, MFHC1, and MTHC1 directly where
supported by the modeled FPR layout.

Preserve known low-word dataflow for MTC1 while modeling the
unpredictable upper word, handle FR=0 register pairs, and add variant
lifting tests.
Implement the remaining C.cond.S, C.cond.D, and C.cond.PS predicates,
including unordered comparisons, explicit FCC destinations, FR=0 double
pairs, and paired-single lane results.
Add MADD.S/D lifting, use a compact intrinsic for MADD.PS, and lifting
integer and floating-point MOVF/MOVT variants with correct FCC polarity.

Handle FR=0 double pairs, FR=1 registers, unpredictable operand
combinations, and add regression coverage.
@zznop zznop added this to the L milestone Sep 1, 2026
@zznop
zznop requested a review from rssor September 1, 2026 14:31
@zznop zznop self-assigned this Sep 1, 2026
@zznop zznop added the Arch: MIPS Issues with the MIPS architecture plugin label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: MIPS Issues with the MIPS architecture plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sdc1/ldc1 not lifted on MIPS32

1 participant