diff mbox series

LoongArch: Allow s9 as a register alias

Message ID 20240229071549.58350-1-xry111@xry111.site
State New
Headers show
Series LoongArch: Allow s9 as a register alias | expand

Commit Message

Xi Ruoyao Feb. 29, 2024, 7:14 a.m. UTC
The psABI allows using s9 as an alias of r22.

gcc/ChangeLog:

	* config/loongarch/loongarch.h (ADDITIONAL_REGISTER_NAMES): Add
	s9 as an alias of r22.
---

Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?

 gcc/config/loongarch/loongarch.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Lulu Cheng March 1, 2024, 3:49 a.m. UTC | #1
在 2024/2/29 下午3:14, Xi Ruoyao 写道:
> The psABI allows using s9 as an alias of r22.
>
> gcc/ChangeLog:
>
> 	* config/loongarch/loongarch.h (ADDITIONAL_REGISTER_NAMES): Add
> 	s9 as an alias of r22.
> ---
>
> Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?

I think a test is needed.

Others LGTM.

Thanks!

>
>   gcc/config/loongarch/loongarch.h | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
> index 8b453ab3140..bf2351f0968 100644
> --- a/gcc/config/loongarch/loongarch.h
> +++ b/gcc/config/loongarch/loongarch.h
> @@ -931,6 +931,7 @@ typedef struct {
>     { "t8",	20 + GP_REG_FIRST },					\
>     { "x",	21 + GP_REG_FIRST },					\
>     { "fp",	22 + GP_REG_FIRST },					\
> +  { "s9",	22 + GP_REG_FIRST },					\
>     { "s0",	23 + GP_REG_FIRST },					\
>     { "s1",	24 + GP_REG_FIRST },					\
>     { "s2",	25 + GP_REG_FIRST },					\
diff mbox series

Patch

diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index 8b453ab3140..bf2351f0968 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -931,6 +931,7 @@  typedef struct {
   { "t8",	20 + GP_REG_FIRST },					\
   { "x",	21 + GP_REG_FIRST },					\
   { "fp",	22 + GP_REG_FIRST },					\
+  { "s9",	22 + GP_REG_FIRST },					\
   { "s0",	23 + GP_REG_FIRST },					\
   { "s1",	24 + GP_REG_FIRST },					\
   { "s2",	25 + GP_REG_FIRST },					\