Skip to content

Add initial support for LoongArch64#113

Open
heiher wants to merge 1 commit intoEmbarkStudios:mainfrom
heiher:loong64
Open

Add initial support for LoongArch64#113
heiher wants to merge 1 commit intoEmbarkStudios:mainfrom
heiher:loong64

Conversation

@heiher
Copy link
Copy Markdown

@heiher heiher commented Feb 11, 2026

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

Add initial support for LoongArch64 Linux to crash-context, crash-handler and sadness-generator.

Related Issues

None

Copy link
Copy Markdown

@xry111 xry111 left a comment

Choose a reason for hiding this comment

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

and should we also fill the FP or SIMD context?

Comment on lines +45 to +50
"li.w $t0, 0", // mcontext_t.__flags
"st.w $t0, $a0, 440",
"li.w $t0, 0", // sctx_info.magic
"st.w $t0, $a0, 448",
"li.w $t0, 0", // sctx_info.size
"st.w $t0, $a0, 452",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
"li.w $t0, 0", // mcontext_t.__flags
"st.w $t0, $a0, 440",
"li.w $t0, 0", // sctx_info.magic
"st.w $t0, $a0, 448",
"li.w $t0, 0", // sctx_info.size
"st.w $t0, $a0, 452",
"st.w $zero, $a0, 440", // mcontext_t.__flags
"st.d $zero, $a0, 448", // sctx_info.magic and sctx_info.size

@heiher
Copy link
Copy Markdown
Author

heiher commented Mar 4, 2026

and should we also fill the FP or SIMD context?

I think it's better to do it that way. The fact that LoongArch's struct mcontext_t doesn't reserved space for extcontext also exposes a drawback here, it prevents LoongArch from using the common allocation logic. Also, since LSX and LASX are both optional, we need to probe runtime support for them. I'll improve that part as well. Thanks!

@Jake-Shadle Jake-Shadle mentioned this pull request Mar 4, 2026
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