Message ID | 20230905074452.3714603-1-lehua.ding@rivai.ai |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1522085vqo; Tue, 5 Sep 2023 00:46:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2w3DyZooqzpQdTZAvbjy8iqrujJca7ai8cvDxYV/ozjAwu1/IzdAaaueGjjmAUvQcRSSH X-Received: by 2002:a17:906:295:b0:9a1:c44d:7056 with SMTP id 21-20020a170906029500b009a1c44d7056mr9410978ejf.26.1693899962987; Tue, 05 Sep 2023 00:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693899962; cv=none; d=google.com; s=arc-20160816; b=SkwTGqFiTsJWfFv8cKLxYtt4vCdK7g2Y5gdbqQsUII7+mHolAMRkSTJDtf3yYP87Ax zjWYxvDf4Cr9kg55zRKcZMJbzyKsKMo1LahF0UKSasobjIXjHwMUxwJr0u76/LfaXnmg vTAn9/Isj0dES02hvQj0C9M2WKgUDs5j/neVVRKdtwIW8GYJK/prcifMNYPqGw9Gjgf6 nCZKrOyRZKkgWkg2vaePdVrf3vnPOiMtgh+XRmZl4W5kGVhIL/pD7S+JwHA/mZML833t ug3ss+PefQJwpa6VHsnLBPXmMqFMIVmIc33BWtrT9zcS3DOM9m5bk7Tu+J9yw7MSRBqY POHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:to :from:dmarc-filter:delivered-to; bh=8Ed7tpJFmoIeTJMFRXkfF8GimzwWyoteOijI0Zhgbso=; fh=z1Czm7N8XVhq5qJjafWBUpBTaSinYhfkdyGcUUXhnkM=; b=YM6W60UzrswPfuabG2ZarAeynAISBhahqul/Co8rM4b+xmzAlWtAHwAYthICWuKdWX R96jdxJkiYw0/1XgeJRcTYicPasnF4wGP3IMGTBz07GEdUhvR/k4j31YdEmw+8olcV3Z jSEWPAyTBOIp8bU/8sEUDBnyh7OLD8ttel/JdWduOrYQw4QR3tTnVKIdhyFqOhPkNwtZ ZjVl46bLlCwyVemPsM6ijQjw0DBkYS/nX7Ut8/pLEzuW58CWyzFfNOVQZxixiqxbyREV HGlCAnYNFUHclz0y7sl7tSGpkhGhPAbjGz37qADiVdeq9gUtQ5yCCtB8hf4vFQrHfZwc yuDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t16-20020a170906179000b009a5e3a23ac4si7054874eje.630.2023.09.05.00.46.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 00:46:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC39B385414F for <ouuuleilei@gmail.com>; Tue, 5 Sep 2023 07:45:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by sourceware.org (Postfix) with ESMTPS id E05383858D35 for <gcc-patches@gcc.gnu.org>; Tue, 5 Sep 2023 07:45:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E05383858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp69t1693899893tzqh8lc1 Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.9]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 05 Sep 2023 15:44:52 +0800 (CST) X-QQ-SSF: 01400000000000C0F000000A0000000 X-QQ-FEAT: mRz6/7wsmIhqjzeH+kQE9Rnjl8qbDcqFdEvPT/mL9iuPV9MXuqkp0HFJAiN+h FLhGRnUKvySTkQyeOCzp77UZ2CCzMjCBz5fRImrMEkc3WNt8cdc55CcJtSOJWj0Z6gTiSbo XvUEYRX9giAI+//MqVyRiiskcmuUFzKEDsCbJuwxda3X9rDkaQvOdFoxHZE5I5vcge3SFxO NlMKGY1o7RRMRaZ0rfzH1AxWbAbGZb/o6H8mpTF2rMEA0HFrqLqUyDo3BLLx1FddHebTmQE D85tMI/NXFTE7YpbrDcK9fKNqDhfan9lBnA2mXuPKoV4Nav9qYOdg6XPPE9MCT68pvFjY6o 2NSX/QSfyirSu2yCOpQshwBiF4/iq0Y3W51HWeCoM0vnOzsQ+/ucdtQvEEKtA== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 674236103801255807 From: Lehua Ding <lehua.ding@rivai.ai> To: gcc-patches@gcc.gnu.org Subject: [PATCH V5 0/3] RISC-V: Add an experimental vector calling convention Date: Tue, 5 Sep 2023 15:44:49 +0800 Message-Id: <20230905074452.3714603-1-lehua.ding@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz6a-0 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, KAM_ASCII_DIVIDERS, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Cc: lehua.ding@rivai.ai, kito.cheng@gmail.com, juzhe.zhong@rivai.ai Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776182847861377798 X-GMAIL-MSGID: 1776182847861377798 |
Series |
RISC-V: Add an experimental vector calling convention
|
|
Message
Lehua Ding
Sept. 5, 2023, 7:44 a.m. UTC
V5 change: Rebase and fix vsetvl testcase fail by change `(unspec [...] UNSPEC_CALLEE_CC)` to `(use (unspec [...] UNSPEC_CALLEE_CC))`. This change makes single_set function re-think call_insn as a single set pattern. Hi RISC-V folks, This patch implement the proposal of RISC-V vector calling convention[1] and this feature can be enabled by `--param=riscv-vector-abi` option. Currently, all vector type arguments and return values are pass by reference. With this patch, these arguments and return values can pass through vector registers. Currently only vector types defined in the RISC-V Vector Extension Intrinsic Document[2] are supported. GNU-ext vector types are unsupported for now since the corresponding proposal was not presented. The proposal introduce a new calling convention variant, functions which follow this variant need follow the bellow vector register convention. | Name | ABI Mnemonic | Meaning | Preserved across calls? ================================================================================= | v0 | | Argument register | No | v1-v7 | | Callee-saved registers | Yes | v8-v23 | | Argument registers | No | v24-v31 | | Callee-saved registers | Yes If a functions follow this vector calling convention, then the function symbole must be annotated with .variant_cc directive[3] (used to indicate that it is a calling convention variant). This implementation split into three parts, each part corresponds to a sub-patch. - Part-1: Select suitable vector regsiters for vector type arguments and return values according to the proposal. - Part-2: Allocate frame area for callee-saved vector registers and save/restore them in prologue and epilogue. - Part-3: Generate .variant_cc directive for vector function in assembly code. [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/389 [2] https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/master/rvv-intrinsic-rfc.md#type-system [3] https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md#pseudo-ops Best, Lehua Lehua Ding (3): RISC-V: Part-1: Select suitable vector registers for vector type args and returns RISC-V: Part-2: Save/Restore vector registers which need to be preversed RISC-V: Part-3: Output .variant_cc directive for vector function gcc/config/riscv/riscv-protos.h | 4 + gcc/config/riscv/riscv-sr.cc | 8 +- gcc/config/riscv/riscv-vector-builtins.cc | 10 + gcc/config/riscv/riscv.cc | 484 ++++++++++++++++-- gcc/config/riscv/riscv.h | 43 ++ gcc/config/riscv/riscv.md | 51 +- gcc/config/riscv/riscv.opt | 5 + .../riscv/rvv/base/abi-call-args-1-run.c | 127 +++++ .../riscv/rvv/base/abi-call-args-1.c | 197 +++++++ .../riscv/rvv/base/abi-call-args-2-run.c | 34 ++ .../riscv/rvv/base/abi-call-args-2.c | 27 + .../riscv/rvv/base/abi-call-args-3-run.c | 260 ++++++++++ .../riscv/rvv/base/abi-call-args-3.c | 116 +++++ .../riscv/rvv/base/abi-call-args-4-run.c | 145 ++++++ .../riscv/rvv/base/abi-call-args-4.c | 111 ++++ .../riscv/rvv/base/abi-call-error-1.c | 11 + .../riscv/rvv/base/abi-call-return-run.c | 127 +++++ .../riscv/rvv/base/abi-call-return.c | 197 +++++++ .../riscv/rvv/base/abi-call-variant_cc.c | 39 ++ .../rvv/base/abi-callee-saved-1-fixed-1.c | 86 ++++ .../rvv/base/abi-callee-saved-1-fixed-2.c | 86 ++++ .../base/abi-callee-saved-1-save-restore.c | 85 +++ .../riscv/rvv/base/abi-callee-saved-1-zcmp.c | 85 +++ .../riscv/rvv/base/abi-callee-saved-1.c | 88 ++++ .../base/abi-callee-saved-2-save-restore.c | 108 ++++ .../riscv/rvv/base/abi-callee-saved-2-zcmp.c | 107 ++++ .../riscv/rvv/base/abi-callee-saved-2.c | 117 +++++ 27 files changed, 2709 insertions(+), 49 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-1-run.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-2-run.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-2.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-3-run.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-3.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-4-run.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-4.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-error-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-return-run.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-return.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-variant_cc.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c
Comments
Thanks for fixing the issue! I guess I could find time tonight to do the final round review and test :P then we could land this patch this week. On Tue, Sep 5, 2023 at 3:45 PM Lehua Ding <lehua.ding@rivai.ai> wrote: > > V5 change: Rebase and fix vsetvl testcase fail by change > `(unspec [...] UNSPEC_CALLEE_CC)` to `(use (unspec [...] UNSPEC_CALLEE_CC))`. > This change makes single_set function re-think call_insn as a > single set pattern. > > Hi RISC-V folks, > > This patch implement the proposal of RISC-V vector calling convention[1] and > this feature can be enabled by `--param=riscv-vector-abi` option. Currently, > all vector type arguments and return values are pass by reference. With this > patch, these arguments and return values can pass through vector registers. > Currently only vector types defined in the RISC-V Vector Extension Intrinsic Document[2] > are supported. GNU-ext vector types are unsupported for now since the > corresponding proposal was not presented. > > The proposal introduce a new calling convention variant, functions which follow > this variant need follow the bellow vector register convention. > > | Name | ABI Mnemonic | Meaning | Preserved across calls? > ================================================================================= > | v0 | | Argument register | No > | v1-v7 | | Callee-saved registers | Yes > | v8-v23 | | Argument registers | No > | v24-v31 | | Callee-saved registers | Yes > > If a functions follow this vector calling convention, then the function symbole > must be annotated with .variant_cc directive[3] (used to indicate that it is a > calling convention variant). > > This implementation split into three parts, each part corresponds to a sub-patch. > > - Part-1: Select suitable vector regsiters for vector type arguments and return > values according to the proposal. > - Part-2: Allocate frame area for callee-saved vector registers and save/restore > them in prologue and epilogue. > - Part-3: Generate .variant_cc directive for vector function in assembly code. > > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/389 > [2] https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/master/rvv-intrinsic-rfc.md#type-system > [3] https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md#pseudo-ops > > Best, > Lehua > > Lehua Ding (3): > RISC-V: Part-1: Select suitable vector registers for vector type args > and returns > RISC-V: Part-2: Save/Restore vector registers which need to be > preversed > RISC-V: Part-3: Output .variant_cc directive for vector function > > gcc/config/riscv/riscv-protos.h | 4 + > gcc/config/riscv/riscv-sr.cc | 8 +- > gcc/config/riscv/riscv-vector-builtins.cc | 10 + > gcc/config/riscv/riscv.cc | 484 ++++++++++++++++-- > gcc/config/riscv/riscv.h | 43 ++ > gcc/config/riscv/riscv.md | 51 +- > gcc/config/riscv/riscv.opt | 5 + > .../riscv/rvv/base/abi-call-args-1-run.c | 127 +++++ > .../riscv/rvv/base/abi-call-args-1.c | 197 +++++++ > .../riscv/rvv/base/abi-call-args-2-run.c | 34 ++ > .../riscv/rvv/base/abi-call-args-2.c | 27 + > .../riscv/rvv/base/abi-call-args-3-run.c | 260 ++++++++++ > .../riscv/rvv/base/abi-call-args-3.c | 116 +++++ > .../riscv/rvv/base/abi-call-args-4-run.c | 145 ++++++ > .../riscv/rvv/base/abi-call-args-4.c | 111 ++++ > .../riscv/rvv/base/abi-call-error-1.c | 11 + > .../riscv/rvv/base/abi-call-return-run.c | 127 +++++ > .../riscv/rvv/base/abi-call-return.c | 197 +++++++ > .../riscv/rvv/base/abi-call-variant_cc.c | 39 ++ > .../rvv/base/abi-callee-saved-1-fixed-1.c | 86 ++++ > .../rvv/base/abi-callee-saved-1-fixed-2.c | 86 ++++ > .../base/abi-callee-saved-1-save-restore.c | 85 +++ > .../riscv/rvv/base/abi-callee-saved-1-zcmp.c | 85 +++ > .../riscv/rvv/base/abi-callee-saved-1.c | 88 ++++ > .../base/abi-callee-saved-2-save-restore.c | 108 ++++ > .../riscv/rvv/base/abi-callee-saved-2-zcmp.c | 107 ++++ > .../riscv/rvv/base/abi-callee-saved-2.c | 117 +++++ > 27 files changed, 2709 insertions(+), 49 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-1-run.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-1.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-2-run.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-2.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-3-run.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-3.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-4-run.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-4.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-error-1.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-return-run.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-return.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-variant_cc.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c > > -- > 2.36.3 >
Pushed to trunk with few testcase modifications, e.g. adding { target { riscv_vector } } to dg-run and adding -march / -mabi for compile tests. On Tue, Sep 5, 2023 at 4:18 PM Kito Cheng <kito.cheng@gmail.com> wrote: > > Thanks for fixing the issue! I guess I could find time tonight to do > the final round review and test :P then we could land this patch this > week. > > On Tue, Sep 5, 2023 at 3:45 PM Lehua Ding <lehua.ding@rivai.ai> wrote: > > > > V5 change: Rebase and fix vsetvl testcase fail by change > > `(unspec [...] UNSPEC_CALLEE_CC)` to `(use (unspec [...] UNSPEC_CALLEE_CC))`. > > This change makes single_set function re-think call_insn as a > > single set pattern. > > > > Hi RISC-V folks, > > > > This patch implement the proposal of RISC-V vector calling convention[1] and > > this feature can be enabled by `--param=riscv-vector-abi` option. Currently, > > all vector type arguments and return values are pass by reference. With this > > patch, these arguments and return values can pass through vector registers. > > Currently only vector types defined in the RISC-V Vector Extension Intrinsic Document[2] > > are supported. GNU-ext vector types are unsupported for now since the > > corresponding proposal was not presented. > > > > The proposal introduce a new calling convention variant, functions which follow > > this variant need follow the bellow vector register convention. > > > > | Name | ABI Mnemonic | Meaning | Preserved across calls? > > ================================================================================= > > | v0 | | Argument register | No > > | v1-v7 | | Callee-saved registers | Yes > > | v8-v23 | | Argument registers | No > > | v24-v31 | | Callee-saved registers | Yes > > > > If a functions follow this vector calling convention, then the function symbole > > must be annotated with .variant_cc directive[3] (used to indicate that it is a > > calling convention variant). > > > > This implementation split into three parts, each part corresponds to a sub-patch. > > > > - Part-1: Select suitable vector regsiters for vector type arguments and return > > values according to the proposal. > > - Part-2: Allocate frame area for callee-saved vector registers and save/restore > > them in prologue and epilogue. > > - Part-3: Generate .variant_cc directive for vector function in assembly code. > > > > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/389 > > [2] https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/master/rvv-intrinsic-rfc.md#type-system > > [3] https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md#pseudo-ops > > > > Best, > > Lehua > > > > Lehua Ding (3): > > RISC-V: Part-1: Select suitable vector registers for vector type args > > and returns > > RISC-V: Part-2: Save/Restore vector registers which need to be > > preversed > > RISC-V: Part-3: Output .variant_cc directive for vector function > > > > gcc/config/riscv/riscv-protos.h | 4 + > > gcc/config/riscv/riscv-sr.cc | 8 +- > > gcc/config/riscv/riscv-vector-builtins.cc | 10 + > > gcc/config/riscv/riscv.cc | 484 ++++++++++++++++-- > > gcc/config/riscv/riscv.h | 43 ++ > > gcc/config/riscv/riscv.md | 51 +- > > gcc/config/riscv/riscv.opt | 5 + > > .../riscv/rvv/base/abi-call-args-1-run.c | 127 +++++ > > .../riscv/rvv/base/abi-call-args-1.c | 197 +++++++ > > .../riscv/rvv/base/abi-call-args-2-run.c | 34 ++ > > .../riscv/rvv/base/abi-call-args-2.c | 27 + > > .../riscv/rvv/base/abi-call-args-3-run.c | 260 ++++++++++ > > .../riscv/rvv/base/abi-call-args-3.c | 116 +++++ > > .../riscv/rvv/base/abi-call-args-4-run.c | 145 ++++++ > > .../riscv/rvv/base/abi-call-args-4.c | 111 ++++ > > .../riscv/rvv/base/abi-call-error-1.c | 11 + > > .../riscv/rvv/base/abi-call-return-run.c | 127 +++++ > > .../riscv/rvv/base/abi-call-return.c | 197 +++++++ > > .../riscv/rvv/base/abi-call-variant_cc.c | 39 ++ > > .../rvv/base/abi-callee-saved-1-fixed-1.c | 86 ++++ > > .../rvv/base/abi-callee-saved-1-fixed-2.c | 86 ++++ > > .../base/abi-callee-saved-1-save-restore.c | 85 +++ > > .../riscv/rvv/base/abi-callee-saved-1-zcmp.c | 85 +++ > > .../riscv/rvv/base/abi-callee-saved-1.c | 88 ++++ > > .../base/abi-callee-saved-2-save-restore.c | 108 ++++ > > .../riscv/rvv/base/abi-callee-saved-2-zcmp.c | 107 ++++ > > .../riscv/rvv/base/abi-callee-saved-2.c | 117 +++++ > > 27 files changed, 2709 insertions(+), 49 deletions(-) > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-1-run.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-1.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-2-run.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-2.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-3-run.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-3.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-4-run.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-args-4.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-error-1.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-return-run.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-return.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-call-variant_cc.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c > > create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c > > > > -- > > 2.36.3 > >
> Pushed to trunk with few testcase modifications, e.g. adding { target > { riscv_vector } } to dg-run and adding -march / -mabi for compile > tests. Thank you so much Kito for your help :)