public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Philipp Tomsich <ptomsich@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4032] riscv: bitmanip: add orc.b as an unspec Date: Mon, 14 Nov 2022 19:04:09 +0000 (GMT) [thread overview] Message-ID: <20221114190409.1DE14384F037@sourceware.org> (raw) https://gcc.gnu.org/g:eab3d2d17dd8fedc856cf175a3f2174770ecb64d commit r13-4032-geab3d2d17dd8fedc856cf175a3f2174770ecb64d Author: Philipp Tomsich <philipp.tomsich@vrull.eu> Date: Thu May 27 17:20:05 2021 +0200 riscv: bitmanip: add orc.b as an unspec As a basis for optimized string functions (e.g., the by-pieces implementations), we need orc.b available. This adds orc.b as an unspec, so we can expand to it. gcc/ChangeLog: * config/riscv/bitmanip.md (orcb<mode>2): Add orc.b as an unspec. * config/riscv/riscv.md: Add UNSPEC_ORC_B. Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu> Diff: --- gcc/config/riscv/bitmanip.md | 8 ++++++++ gcc/config/riscv/riscv.md | 3 +++ 2 files changed, 11 insertions(+) diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index d26f3567182..48c249f2a68 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -255,6 +255,14 @@ "rolw\t%0,%1,%2" [(set_attr "type" "bitmanip")]) +;; orc.b (or-combine) is added as an unspec for the benefit of the support +;; for optimized string functions (such as strcmp). +(define_insn "orcb<mode>2" + [(set (match_operand:X 0 "register_operand" "=r") + (unspec:X [(match_operand:X 1 "register_operand" "r")] UNSPEC_ORC_B))] + "TARGET_ZBB" + "orc.b\t%0,%1") + (define_insn "bswap<mode>2" [(set (match_operand:X 0 "register_operand" "=r") (bswap:X (match_operand:X 1 "register_operand" "r")))] diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 798f7370a08..532289dd178 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -62,6 +62,9 @@ ;; Stack tie UNSPEC_TIE + + ;; OR-COMBINE + UNSPEC_ORC_B ]) (define_c_enum "unspecv" [
reply other threads:[~2022-11-14 19:04 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221114190409.1DE14384F037@sourceware.org \ --to=ptomsich@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).