public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lulu Cheng <chenglulu@loongson.cn>
To: gcc-patches@gcc.gnu.org
Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn,
	chenglulu@loongson.cn
Subject: [PATCH v2 0/2] When cmodel=extreme, add macro support and only support macros.
Date: Fri,  5 Jan 2024 11:40:19 +0800	[thread overview]
Message-ID: <20240105034021.30177-1-chenglulu@loongson.cn> (raw)

When cmodel=extreme, since the symbol address is obtained through four instructions,
errors may occur in some cases during linking. Therefore, in order to ensure that
the instructions for obtaining the symbol address are together, macro instructions
are used to obtain the symbol address when cmodel=extreme.

https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc#extreme-code-model

v1 -> v2:
  1. Use the temporarily allocated registers as intermediate registers to implement the extreme macro.
  2. Fixed bugs in v1 test cases.

Lulu Cheng (2):
  LoongArch: Add the macro implementation of mcmodel=extreme.
  LoongArch: When the code model is extreme, the symbol address is
    obtained through macro instructions regardless of the value of
    -mexplicit-relocs.

 gcc/config/loongarch/loongarch.cc             | 39 +++++++++------
 gcc/config/loongarch/loongarch.md             | 50 +++++++++++++++++++
 gcc/config/loongarch/predicates.md            | 14 ++++++
 .../gcc.target/loongarch/attr-model-1.c       |  2 +-
 .../gcc.target/loongarch/attr-model-2.c       |  2 +-
 .../gcc.target/loongarch/attr-model-3.c       |  2 +-
 .../gcc.target/loongarch/attr-model-4.c       |  2 +-
 .../loongarch/func-call-extreme-1.c           |  6 +--
 .../loongarch/func-call-extreme-2.c           |  6 +--
 .../loongarch/func-call-extreme-3.c           |  6 +--
 .../loongarch/func-call-extreme-4.c           |  6 +--
 .../loongarch/func-call-extreme-5.c           |  7 +++
 .../loongarch/func-call-extreme-6.c           |  7 +++
 13 files changed, 118 insertions(+), 31 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/loongarch/func-call-extreme-5.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/func-call-extreme-6.c

-- 
2.39.3


             reply	other threads:[~2024-01-05  3:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05  3:40 Lulu Cheng [this message]
2024-01-05  3:40 ` [PATCH v2 1/2] LoongArch: Add the macro implementation of mcmodel=extreme Lulu Cheng
2024-01-05  3:40 ` [PATCH v2 2/2] LoongArch: When the code model is extreme, the symbol address is obtained through macro instructions regardless of the value of -mexplicit-relocs Lulu Cheng
2024-01-05  8:37   ` Xi Ruoyao
2024-01-05  8:51     ` chenglulu
2024-01-05  9:57     ` chenglulu
2024-01-05 10:25       ` Xi Ruoyao
2024-01-05 11:55         ` Xi Ruoyao
2024-01-05 12:45           ` chenglulu
2024-01-05 14:16             ` Xi Ruoyao
2024-01-12  1:46               ` chenglulu
2024-01-12 11:42                 ` Xi Ruoyao
2024-01-13  7:01                   ` chenglulu
2024-01-13 13:05                     ` Xi Ruoyao
2024-01-13 14:05                       ` chenglulu
2024-01-17  9:38                       ` chenglulu
2024-01-17  9:50                         ` Xi Ruoyao
2024-01-17  9:57                           ` chenglulu
2024-01-19  5:46                             ` Xi Ruoyao
2024-01-19  8:51                               ` chenglulu
2024-01-22  7:27                                 ` chenglulu
2024-01-23 19:36                                   ` Xi Ruoyao
2024-01-25  0:48                                     ` chenglulu
2024-01-25  7:59                                       ` Xi Ruoyao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240105034021.30177-1-chenglulu@loongson.cn \
    --to=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).