Skip to content

Add LoongArch64 support#3703

Open
ksco wants to merge 7 commits intostenzek:masterfrom
ksco:loongarch64
Open

Add LoongArch64 support#3703
ksco wants to merge 7 commits intostenzek:masterfrom
ksco:loongarch64

Conversation

@ksco
Copy link
Contributor

@ksco ksco commented Mar 3, 2026

This PR adds native support for the LoongArch64 CPU architecture, with the following changes:

  • A LoongArch64 recompiler
  • Architecture detection, fastjmp support, and page fault handling for LoongArch64
  • Build system updates to include LoongArch64 support
  • A fix in non-SIMD blend32()
  • Dependencies changes
    • lagoon: Adds the lagoon library. It is a generic assembler and disassembler library for LoongArch64, made for this port but also released as a standalone library here: https://github.com/loongson-community/lagoon.
    • imgui: Fixes LoongArch64 compilation
    • rapidyaml: Fixes LoongArch compilation

@ksco
Copy link
Contributor Author

ksco commented Mar 3, 2026

Note that this is needed to build the dependencies for the LoongArch64 platform: ksco/dependencies@d4458c0. Please feel free to commit this to https://github.com/duckstation/dependencies if it looks fine.

@stenzek
Copy link
Owner

stenzek commented Mar 3, 2026

Will need some time to review this, but in the meantime, probably want to pull the change from 26fda0b.

ksco and others added 7 commits March 3, 2026 14:05
The mask-based blend32() was incorrectly selecting components only from the input vector using mask bits as indices, rather than blending between this and the input vector based on mask bits. Fix the logic to properly select each component from either this or v based on the corresponding mask bit.

Add tests covering this.

Co-Authored-By: phorcys <phorcys@126.com>
This is mostly a direct translation from the RISC-V backend.

Co-Authored-By: phorcys <phorcys@126.com>
@ksco
Copy link
Contributor Author

ksco commented Mar 3, 2026

Will need some time to review this, but in the meantime, probably want to pull the change from 26fda0b.

Sure, take your time! And the port from 26fda0b is done.

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.

2 participants