From patchwork Mon Oct 24 02:03:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 8116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp209932wru; Sun, 23 Oct 2022 19:04:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM705/Cw7o3sHwzjzBcean72O/osmysYCpfEuUbzr0HtipoOkX0PCCcNFywaeNs77uh5GuDn X-Received: by 2002:a17:907:8a23:b0:78d:b042:eece with SMTP id sc35-20020a1709078a2300b0078db042eecemr24508935ejc.494.1666577082212; Sun, 23 Oct 2022 19:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666577082; cv=none; d=google.com; s=arc-20160816; b=Ezw4yUJUTl2i98NoD0MBTm5WGVXlO6j0Hp0wkcyVOE2gT9edoGTLw+ab43xi3RYulY sPmv6vvBcK0TOQe1LyraamoQNR3z33mzzezmaMgi8wM/R9fsycsPGAE77sObDsBQGael alCm0Pu79akX5weDhoE6rG2FGAVAorxyLSEqvtUjXOWCnaXwhT3N+kUJ3h6uO6w++9LQ MLAvzhNL+0evhQGecNjC7pVO31FfIXNQl8RadXHWV4Vt8rfz62tjP9zUFnssisoRjim7 EeJ2woOMb95QsI6tSq33iVMfTcnvW4LyM7W2ff+6BWU86z3VyEaHYnYJtiNag6H93D5j k7bQ== 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=/2XpR8A5qefZA+WP0F3sF9AWbLSb0Y4oQAKvstqCnpc=; b=A89+2pwJqJyf0oxxebOArtLo6gcdWpwxQsYW/mkmKW73ONQ4CsxfwkVTPS9tLLKhZO qAUa4GZdQBE2B+CAKm4pynRYYqYxm8CSUxj5qAo7iS5wzVq37+fe8wK7PoC6a/VyGdOx K0BmXN21MxNLQvPpwEmpXksH/n1gWm8ofx2cWipZxanE04hqqt7nUz11QDvP2auSijmC c+34oCHJ12VGBfcI4N4EvxmDdPEa2h/hu3hGPvrAJalk7u8f2kZAj+oBkiw3lkFSDZ+E XsyGDsC6ZrDzOypf4gM/rK4OITVVE6XId1w9N5aLmdPAt+cXI1s+18pV/iceNLlcboo8 NBfQ== 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 sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id go13-20020a1709070d8d00b0078e31b05896si24253431ejc.766.2022.10.23.19.04.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 19:04:42 -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 D66B03857401 for ; Mon, 24 Oct 2022 02:04:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by sourceware.org (Postfix) with ESMTPS id 1F19C385840A for ; Mon, 24 Oct 2022 02:03:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F19C385840A 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: bizesmtp80t1666576994t21q40hq Received: from server1.localdomain ( [42.247.22.65]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 24 Oct 2022 10:03:13 +0800 (CST) X-QQ-SSF: 01400000000000D0K000000A0000000 X-QQ-FEAT: cn5tBnJDrK+iI4nr5eMuCr0JdS4hUmogmp7EEh/dYu2wbRU8jGQRZm3GHfZjA qzN+rETl7eKLM0wre3W8xVZ75f8SloOrqkDC47nIW1mgtQ1hGxKbCDPbKdz3jgOzEVcSAw+ Qp7qYEcYonO3DYWrKSbD3fzvUgypAruRqquEcHudUFtNxNaia5Be3Cy7STsEzBCDiPynhKM boBrPyjU6BromannUihj1dEgrUEhQm0H+RUDaItugHxvwTxp8pTbblnAk/GpJ/66WLk9AAQ ck/prUYgWUwjbQnJEGh8rhn559RrKRXVjpj2BNs8nB78pD1gggfZfHtux3gHfraH+tAaHLb w7aQ46kmnV/B9uxkce1aAqHaZuGxNi0d6Kak3KwZofK3+CEchY6mjcBZm2a28aJwtYBDUAu LlJqnTCBB5c= X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Subject: [PATCH] RISC-V: Support (set (mem) (const_poly_int)) Date: Mon, 24 Oct 2022 10:03:12 +0800 Message-Id: <20221024020312.26851-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kito.cheng@gmail.com, Ju-Zhe Zhong Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747532730356748262?= X-GMAIL-MSGID: =?utf-8?q?1747532730356748262?= From: Ju-Zhe Zhong gcc/ChangeLog: * config/riscv/riscv.cc (riscv_legitimize_move): Support (set (mem) (const_poly_int)). --- gcc/config/riscv/riscv.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 90a39047dd7..f7694ba043c 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -1958,6 +1958,20 @@ riscv_legitimize_move (machine_mode mode, rtx dest, rtx src) { if (CONST_POLY_INT_P (src)) { + /* + Handle: + (insn 183 182 184 6 (set (mem:QI (plus:DI (reg/f:DI 156) + (const_int 96 [0x60])) [0 S1 A8]) + (const_poly_int:QI [8, 8])) + "../../../../riscv-gcc/libgcc/unwind-dw2.c":1579:3 -1 (nil)) + */ + if (MEM_P (dest)) + { + rtx tmp = gen_reg_rtx (mode); + emit_move_insn (tmp, src); + emit_move_insn (dest, tmp); + return true; + } poly_int64 value = rtx_to_poly_int64 (src); if (!value.is_constant () && !TARGET_VECTOR) {