Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3e2bbb10-9a93-3fb3-a3e7-a37331ca2b3c@loongson.cn>
Date: Mon, 26 Feb 2024 16:42:30 +0800
From: Hongliang Wang <wanghongliang@...ngson.cn>
To: musl@...ts.openwall.com
Subject: LoongArch: __clone:adjust stack to 16 align.

Hi,

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
-- 
2.37.1


Regards,
Hongliang Wang


View attachment "0001-LoongArch-__clone-adjust-stack-to-16-align.patch" of type "text/x-patch" (928 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.