Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add procedure calling convention #26

Closed
wants to merge 2 commits into from
Closed

Add procedure calling convention #26

wants to merge 2 commits into from

Conversation

Calring
Copy link

@Calring Calring commented Nov 4, 2021

Add procedure calling convention.

        docs/LoongArch-ELF-ABI-EN.adoc

.. A place to store the values of saved registers.
.. A place for local data storage.

. The stack grows downwards (towards lower addresses) and the stack pointer shall be aligned to a 128-bit boundary upon procedure entry. The first argument passed on the stack is located at offset zero of the stack pointer on function entry; following arguments are stored at correspondingly higher addresses.
Copy link
Contributor

Choose a reason for hiding this comment

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

目前的 gcc 代码中 ILP32 使用 64 位栈对齐,LP64 使用 128 位栈对齐:https://github.com/loongson/gcc/blob/loongarch-12/gcc/config/loongarch/loongarch.h#L703

要改为都使用 128 位对齐吗?

Copy link
Contributor

Choose a reason for hiding this comment

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

目前这块只包含lp64d的情况,而且也明确了在lp64d的情况下,这边写的。32位的还没成熟,暂不考虑包含在文档中。

@@ -316,7 +317,7 @@ v1.00 定义的指令集架构

|`ilp32s` / `default`
|GNU/Linux
|`loongarch32-linux-gnusfp`
|`loongarch32-linux-gnusf`
Copy link
Contributor

Choose a reason for hiding this comment

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

gnu后面加字符,这个感觉有点怪怪的,而且存在对现有工具的兼容性问题吧?比如一些类似*-linux-gnu这种匹配代码。

Copy link
Contributor

Choose a reason for hiding this comment

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

这块是 PR 作者带了 #25 的内容过来吧,需要在 #25 里讨论。

Copy link
Contributor

Choose a reason for hiding this comment

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

对,这些内容不在这讨论。

Choose a reason for hiding this comment

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

gnu后面加字符,这个感觉有点怪怪的,而且存在对现有工具的兼容性问题吧?比如一些类似*-linux-gnu这种匹配代码。

我感觉加在loongarch32更合适,loongarch32sf-linux-gnu loongarch32f32-linux-gnu loongarch32f64-linux-gnu

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@ChenghuaXu ChenghuaXu left a comment

Choose a reason for hiding this comment

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

ok.

@FreeFlyingSheep
Copy link
Collaborator

#25 已经合并了,请把重复的补丁去掉,重新提交一下。

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

Successfully merging this pull request may close these issues.

8 participants