From patchwork Thu Aug 10 09:21:46 2023 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: 133788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp291295vqi; Thu, 10 Aug 2023 02:22:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8h/bT2Ql2BbwB5MtllunnQ3enH3TYZ/q2v/TFdiGU0RQqLVtYJRAX3CZ3jaKkmgg620so X-Received: by 2002:aa7:db54:0:b0:523:1a09:4e2b with SMTP id n20-20020aa7db54000000b005231a094e2bmr1315744edt.40.1691659372825; Thu, 10 Aug 2023 02:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691659372; cv=none; d=google.com; s=arc-20160816; b=bmYpOnjURV8JREltZicMfr43aLMGuncyIZXhvcrzJHzdv72nbgAmYhm5S/L3uEIvAT NA8DH0YVgF1+qGhh7sSPwkdVprxNDhUhtCPGz5SN9g4JiRHmaKWwoP0FTpK9JsAGkajK HRhn7682J2L0BpHD0AWVQKlsvamlQaYCfpVALiTpVUfXxkR1kcqkklwbvhj3rL9lSDQL QKiRNJ3IrTRXH3C2ed2RjrM8nJsFzR7YJlbbCp88Mrzb4Piug/Rl0tZuhhme0DzVWJd0 AjDjTDuVRgyq3HDW+QeupYvO8G4igC+1b5t8xTYl+qpQ3dJLJ5jEHd2R3ykDUlfCL3VM x7tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=NkmMf2dmGmZSpQhybl2ZF3xU6o3AC78XFeHiuX/eTzw=; fh=SuV1mxSfYh/fFJBV6FW8ZDQUWC7OLSIDYxyJSOKFLBQ=; b=VSOH6du86jIu9w21jf2xmakitv3ghpKvfqYzTYPIhJvgUsOvjZJmc5e05Tjx3WR2/q wQdg/rduC1E3+wd5549QJ3I/K0GUldEQw2VXc9u6/kh7IhntVG5B5DNaeq+NgrBooRM3 ktF+LaguwzKXIWokuahVl5vnmoHXML+eVzotroAucXLd1/K+E8/oN+Ojsq43DWQXmfFm 7QALiUZoLRgOD6q26cITYZpbo6usQNImOb51jHSS/pIP3qYEPCNBH5QZFzyEJ5RByGR1 /75Yf5GdLHSXXUyJ+qM8z4WEJEAlBPjgXS+i54hQfdbz/sSmV5efU/WMlw6MlH/QRUJg S9Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q13-20020a056402040d00b00522789dbee0si949996edv.204.2023.08.10.02.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 02:22:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 7A2CD3856243 for ; Thu, 10 Aug 2023 09:22:28 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg153.qq.com (smtpbg153.qq.com [13.245.218.24]) by sourceware.org (Postfix) with ESMTPS id 6AF153856DEA for ; Thu, 10 Aug 2023 09:21:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AF153856DEA 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: bizesmtp75t1691659310tdoi95vu Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 10 Aug 2023 17:21:49 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: swyrzWPvyR3os5BFB5MYxSUujiU44kg36y5EjofzJNxbGj6bokD98Iu66td20 wt0ESRYH9qFF5bUPbXPFNm8Fw1Vvw8FjI49bUR5AQm7A8iBBSHbGXkKPNLZ5/X+DXuBumtC i2SKXhdrHjuhvyrPlL7NPP705ilJ0lBLiAshfOd4EBXojtRuzyAMwtYFpGi/XopJIXMiwd8 oRzfJz7khupasDVMbGcUWGgCSfZsEJJfvh4fcLsaoNtTASkI9CoRMx7/HDZ8/OpubDr45xD 8FjthZJjlVsV89s6eLlSyDBr3usvEkeJ/tdLZ1gpBklfnDcysU4J36aeqluV596Moz7UupH kOfhIASH4weAV1eDRiM14quDiJ+9bjht/NhMnMpS2YHyeCv+KJer8Q9cY7Nq+bfjMjgDbDK IMoyi4fI8kY= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 5301276756534110705 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH] RISC-V: Support TU for integer ternary OP[PR110964] Date: Thu, 10 Aug 2023 17:21:46 +0800 Message-Id: <20230810092146.839668-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773833418266924811 X-GMAIL-MSGID: 1773833418266924811 PR target/110964 gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_cond_len_ternop): Add integer ternary. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr110964.c: New test. --- gcc/config/riscv/riscv-v.cc | 3 +-- .../gcc.target/riscv/rvv/autovec/pr110964.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc index c9f0a4a9e7b..a3062c90618 100644 --- a/gcc/config/riscv/riscv-v.cc +++ b/gcc/config/riscv/riscv-v.cc @@ -3604,8 +3604,7 @@ expand_cond_len_ternop (unsigned icode, rtx *ops) if (FLOAT_MODE_P (mode)) emit_nonvlmax_fp_ternary_tu_insn (icode, RVV_TERNOP_TU, ops, len); else - /* FIXME: Enable this case when we support it in the middle-end. */ - gcc_unreachable (); + emit_nonvlmax_tu_insn (icode, RVV_TERNOP_TU, ops, len); } else { diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c new file mode 100644 index 00000000000..cf2d1fb5f1d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr110964.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d --param=riscv-autovec-preference=scalable -Ofast" } */ + +int *a; +long b, c; + +int d () +{ + const int e; + for (; a < e; a++) /* { dg-warning "comparison between pointer and integer" } */ + c += *a * b; +} +