bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] stack-direction: Add support for loongarch CPU
@ 2021-08-31  4:51 Sun Haiyong
  2021-09-04 13:16 ` Bruno Haible
  0 siblings, 1 reply; 5+ messages in thread
From: Sun Haiyong @ 2021-08-31  4:51 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Sun Haiyong

* m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch,
set "sv_cv_stack_direction" to "-1" .
---
 m4/stack-direction.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
index 93287254b..e6c3284ce 100644
--- a/m4/stack-direction.m4
+++ b/m4/stack-direction.m4
@@ -32,6 +32,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
       i?86 | x86_64 | \
       i860 | \
       ia64 | \
+      loongarch* | \
       m32r | \
       m68* | \
       m88k | \
-- 
2.17.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] stack-direction: Add support for loongarch CPU
  2021-08-31  4:51 Sun Haiyong
@ 2021-09-04 13:16 ` Bruno Haible
  2021-09-04 16:41   ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Haible @ 2021-09-04 13:16 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Sun Haiyong

Hi,

Sun Haiyong wrote:
> * m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch,
> set "sv_cv_stack_direction" to "-1" .

Thanks for the patch. Do you know a document which explains the ABI of this
architecture (I mean: register usage, max number of arguments passed in
registers, stack direction, stack alignment, etc.)?

For the moment, I am only able to guess, based on [1] which says that
LoongArch is basically a clone of mips64 with different encoding of the
instructions. So, I've applied your patch.

[1] https://www.phoronix.com/scan.php?page=news_item&px=LoongArch-MIPS-Copy-Kernel


2021-09-04  Sun Haiyong  <youbest@sina.com>  (tiny change)

	sigsegv: Improve cross-compilation support for LoongArch CPU.
	* m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows
	down on LoongArch.

diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
index 93287254b..e682be97d 100644
--- a/m4/stack-direction.m4
+++ b/m4/stack-direction.m4
@@ -1,4 +1,4 @@
-# stack-direction.m4 serial 7
+# stack-direction.m4 serial 8
 dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -32,6 +32,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
       i?86 | x86_64 | \
       i860 | \
       ia64 | \
+      loongarch* | \
       m32r | \
       m68* | \
       m88k | \





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] stack-direction: Add support for loongarch CPU
  2021-09-04 13:16 ` Bruno Haible
@ 2021-09-04 16:41   ` Paul Eggert
  2021-09-04 18:44     ` Bruno Haible
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2021-09-04 16:41 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib; +Cc: Sun Haiyong

On 9/4/21 6:16 AM, Bruno Haible wrote:
> Do you know a document which explains the ABI of this
> architecture (I mean: register usage, max number of arguments passed in
> registers, stack direction, stack alignment, etc.)?

Here is some documentation, which includes ABI documentation:

https://github.com/loongson/LoongArch-Documentation

I did see a disclaimer 
<https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_disclaimer> 
saying, "This document provides only periodic information, and the 
contents contained may be updated at any time without notice, depending 
on the actual situation of the product." and a translator's note saying 
"Due to the limited knowledge of the translators, there are some 
inevitable errors and omissions existing in this document, please feel 
free to correct."


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] stack-direction: Add support for loongarch CPU
  2021-09-04 16:41   ` Paul Eggert
@ 2021-09-04 18:44     ` Bruno Haible
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Haible @ 2021-09-04 18:44 UTC (permalink / raw)
  To: bug-gnulib, Paul Eggert; +Cc: Sun Haiyong

Paul Eggert wrote:
> Here is some documentation, which includes ABI documentation:
> 
> https://github.com/loongson/LoongArch-Documentation

Thanks; I already got these documents from
  https://loongson.github.io/LoongArch-Documentation/README-EN.html

But all it contains regarding the ABI is 1 page about register usage: $sp = $r3.
I can't port e.g. libsigsegv or libffcall with so little information.

Bruno





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] stack-direction: Add support for loongarch CPU
@ 2021-09-08 15:25 孙海勇
  0 siblings, 0 replies; 5+ messages in thread
From: 孙海勇 @ 2021-09-08 15:25 UTC (permalink / raw)
  To: 'Bruno Haible', bug-gnulib

> -----邮件原件-----
> 发件人: Bruno Haible <bruno@clisp.org>
> 发送时间: 2021年9月4日 21:17
> 收件人: bug-gnulib@gnu.org
> 抄送: Sun Haiyong <youbest@sina.com>
> 主题: Re: [PATCH] stack-direction: Add support for loongarch CPU
> 
> Hi,
> 
> Sun Haiyong wrote:
> > * m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is
> loongarch,
> > set "sv_cv_stack_direction" to "-1" .
> 
> Thanks for the patch. Do you know a document which explains the ABI of
this
> architecture (I mean: register usage, max number of arguments passed in
> registers, stack direction, stack alignment, etc.)?
> 
Thanks.

> For the moment, I am only able to guess, based on [1] which says that
> LoongArch is basically a clone of mips64 with different encoding of the
> instructions. So, I've applied your patch.
> 
> [1]
> https://www.phoronix.com/scan.php?page=news_item&px=LoongArch-MIPS
> -Copy-Kernel
> 

About LoongArch, see the link:
https://lore.kernel.org/linux-arch/20210903095213.797973-2-chenhuacai@loongs
on.cn/T/#u

> 
> 2021-09-04  Sun Haiyong  <youbest@sina.com>  (tiny change)
> 
> 	sigsegv: Improve cross-compilation support for LoongArch CPU.
> 	* m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack
> grows
> 	down on LoongArch.
> 
> diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
> index 93287254b..e682be97d 100644
> --- a/m4/stack-direction.m4
> +++ b/m4/stack-direction.m4
> @@ -1,4 +1,4 @@
> -# stack-direction.m4 serial 7
> +# stack-direction.m4 serial 8
>  dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
>  dnl This file is free software, distributed under the terms of the GNU
>  dnl General Public License.  As a special exception to the GNU General
> @@ -32,6 +32,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
>        i?86 | x86_64 | \
>        i860 | \
>        ia64 | \
> +      loongarch* | \
>        m32r | \
>        m68* | \
>        m88k | \
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-08 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 15:25 [PATCH] stack-direction: Add support for loongarch CPU 孙海勇
  -- strict thread matches above, loose matches on Subject: below --
2021-08-31  4:51 Sun Haiyong
2021-09-04 13:16 ` Bruno Haible
2021-09-04 16:41   ` Paul Eggert
2021-09-04 18:44     ` Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).