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

nall: add support for LoongArch architecture #1356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

212dandan
Copy link

@212dandan 212dandan commented Dec 28, 2023

Compiling ares project failed in the my local loongarch64 environment.
There are 2 architecture-related errors are reported, for examples,

Q1: unknown arch, please specify manually.
root@localhost:/home/remine/ares/git/ares# make -j4
make[1]: Entering directory “/home/remine/ares/git/ares/desktop-ui”
../nall/GNUmakefile:137: *** unknown arch, please specify manually.。 停止。
make[1]: Leaving directory “/home/remine/ares/git/ares/desktop-ui”

Q2:error "unable to detect architecture".
In file included from ../nall/platform.hpp:3,
                 from ../thirdparty/sljitAllocator.cpp:3:
../nall/intrinsics.hpp:289:4: error: #error "unable to detect architecture"
  289 |   #error "unable to detect architecture"
      |    ^~~~~

Please review.
If you have any questions, you can contact me at any time.

@@ -3,7 +3,7 @@
#if defined(SLJIT)
namespace nall::recompiler {
struct generic {
static constexpr bool supported = Architecture::amd64 | Architecture::arm64 | Architecture::ppc64 | Architecture::rv64;
static constexpr bool supported = Architecture::amd64 | Architecture::arm64 | Architecture::loong64 | Architecture::ppc64 | Architecture::rv64;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our recompiler backend (sljit) doesn't appear to support the longarch architecture, so you should not include it in this supported variable.

See https://zherczeg.github.io/sljit/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I see the mips64 backend might be compatible due to the fact longarch is derived from it; were you able to test a recompiler based system (n64, ps1)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although inspired by MIPS (and RISC-V), LoongArch is not binary compatible. However, it seems like sljit has added a LoongArch backend, see https://github.com/zherczeg/sljit/blob/master/sljit_src/sljitNativeLOONGARCH_64.c. No idea how stable that backend is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants