public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sergei Lewis <slewis@rivosinc.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH v2 0/3] RISC-V: vectorised memory operations
Date: Tue, 19 Dec 2023 09:53:45 +0000	[thread overview]
Message-ID: <20231219095348.356551-1-slewis@rivosinc.com> (raw)

This patchset permits generation of inlined vectorised code for movmem, 
setmem and cmpmem, if and only if the operation size is 
at least one and at most eight vector registers' worth of data.

Further vectorisation rapidly becomes debatable due to code size concerns;
however, for these simple cases we do have an unambiguous performance win 
without sacrificing too much code size compared to a libc call.

Changes in v2:

* run clang-format over the code in addition to the 
  contrib/check_GNU_style.sh that was used for v1

* remove string.h include and refer to __builtin_* memory functions 
  in multilib tests

* respect stringop_strategy (don't vectorise if it doesn't include VECTOR)

* use an integer constraint for movmem length parameter

* use TARGET_MAX_LMUL unless riscv-autovec-lmul=dynamic 
  to ensure we respect the user's wishes if they request specific lmul

* add new unit tests to check that riscv-autovec-lmul is respected

* PR target/112109 added to changelog for patch 1/3 as requested

Sergei Lewis (3):
  RISC-V: movmem for RISCV with V extension
  RISC-V: setmem for RISCV with V extension
  RISC-V: cmpmem for RISCV with V extension

 gcc/config/riscv/riscv-protos.h               |   2 +
 gcc/config/riscv/riscv-string.cc              | 190 ++++++++++++++++++
 gcc/config/riscv/riscv.md                     |  51 +++++
 .../gcc.target/riscv/rvv/base/cmpmem-1.c      |  88 ++++++++
 .../gcc.target/riscv/rvv/base/cmpmem-2.c      |  74 +++++++
 .../gcc.target/riscv/rvv/base/cmpmem-3.c      |  45 +++++
 .../gcc.target/riscv/rvv/base/cmpmem-4.c      |  62 ++++++
 .../gcc.target/riscv/rvv/base/movmem-1.c      |  60 ++++++
 .../gcc.target/riscv/rvv/base/setmem-1.c      | 103 ++++++++++
 .../gcc.target/riscv/rvv/base/setmem-2.c      |  51 +++++
 .../gcc.target/riscv/rvv/base/setmem-3.c      |  69 +++++++
 11 files changed, 795 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-3.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-4.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/movmem-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/setmem-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/setmem-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/setmem-3.c

-- 
2.34.1


             reply	other threads:[~2023-12-19  9:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  9:53 Sergei Lewis [this message]
2023-12-19  9:53 ` [PATCH v2 1/3] RISC-V: movmem for RISCV with V extension Sergei Lewis
2023-12-20  5:28   ` Jeff Law
2023-12-20  9:44     ` Sergei Lewis
2024-05-13 23:36     ` Jeff Law
2023-12-19  9:53 ` [PATCH v2 2/3] RISC-V: setmem " Sergei Lewis
2023-12-20  5:38   ` Jeff Law
2023-12-20  9:48     ` Sergei Lewis
2023-12-20 16:02       ` Jeff Law
2023-12-19  9:53 ` [PATCH v2 3/3] RISC-V: cmpmem " Sergei Lewis

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=20231219095348.356551-1-slewis@rivosinc.com \
    --to=slewis@rivosinc.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).