From: Philipp Tomsich Date: Thu, 27 May 2021 15:20:05 +0000 (+0200) Subject: riscv: bitmanip: add orc.b as an unspec X-Git-Tag: upstream/13.1.0~3212 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eab3d2d17dd8fedc856cf175a3f2174770ecb64d;p=platform%2Fupstream%2Fgcc.git 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 (orcb2): Add orc.b as an unspec. * config/riscv/riscv.md: Add UNSPEC_ORC_B. Signed-off-by: Philipp Tomsich --- diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index d26f356..48c249f 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 "orcb2" + [(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 "bswap2" [(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 798f737..532289d 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" [