From 80e3b09823a1d718664bc13704f3f7c19038a19e Mon Sep 17 00:00:00 2001 From: wanghongliang Date: Mon, 26 Feb 2024 02:12:28 +0800 Subject: [PATCH] loongarch64 __clone: align stack pointer mod 16 According to LoongArch ABI Specs, stack need to be 16 align to improve performance and compiler layout of stack frames. --- src/thread/loongarch64/clone.s | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thread/loongarch64/clone.s b/src/thread/loongarch64/clone.s index e971ab4b..a165b365 100644 --- a/src/thread/loongarch64/clone.s +++ b/src/thread/loongarch64/clone.s @@ -7,6 +7,7 @@ .hidden __clone .type __clone,@function __clone: + bstrins.d $a1, $zero, 3, 0 #stack to 16 align # Save function pointer and argument pointer on new thread stack addi.d $a1, $a1, -16 st.d $a0, $a1, 0 # save function pointer