Message ID | 20230426214514.3355280-8-collison@rivosinc.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp524384vqo; Wed, 26 Apr 2023 14:51:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vkZIBu2TDY0A0OXrxGwNLnccxzKqtGPq4Jp7lFxbXnExzwuDBt902Zp4bXyiXAGeECpGf X-Received: by 2002:a17:907:6e11:b0:95f:4c5c:4eaf with SMTP id sd17-20020a1709076e1100b0095f4c5c4eafmr2774401ejc.46.1682545905835; Wed, 26 Apr 2023 14:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682545905; cv=none; d=google.com; s=arc-20160816; b=SkazOP5uidoX4OvsJ0YrexDDpXEY/N+HyNiPVUcucdCPYBop0v78dXTF3V1VghUuss EZA0pe7LpTh2C4uNXbam8C/qdzvTYa5fwunN0v7K9mCLvA5+7rJ62q9vfNzd7QtKWDQi z5DwuG4AKT129/XM96z5d4nev9ef2JFrBT9G3zyqFHg97zGHTjXzFNmXBcDcu+SVYNX9 X6pubyd4W6F9jr6hrC37BUA7qUJWkdntTYDmjCSEJavjId1XZI8esbn6xE5BbcIuXsNP mVq1mDVPBZ5ckg3lSwHXZuLiiEU2lGqZRcVzmI3f0HiEGyKn7xXUGtnlN9xfgaMT+JOd /wjw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:dmarc-filter:delivered-to; bh=kk2WGDXFeHiGM8032nSpYvQDeqnXR2eC4cAWeTz8dgE=; b=Zg5YXTwAAJ6yC9UCJ/z10h9PPjrwpLCiJjqsqkAFW9CfnbAG2265zItioh12QoixDS De73hQb7aaH2nf0TdFAhGHgnLxpkwz8nUs3H1AbDrpvbTkr9XgpzGvjYwsT6JDiZIfTv G+nJAWt9Qj8OPb1z37NYIarmRuOdeMCXPDlWDvxhq1F5yqlxIuXWLzyg7zDjBiET8IiL P2YFK4pUaG+8w5Foip7AYXue5F8W+K729/PKw80XfBSKmtALCRi3A1oLnzPUbXgeKUmo SHc0AmRLmkVM7o/WsdFRd9X8K8J+plHZ2bjTTLYtwCb/DE4XONUyzwqfcH6fTulUJuyi 1r/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b="CCGcA/SE"; 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 sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m7-20020a170906848700b009570d4d7068si10520777ejx.676.2023.04.26.14.51.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 14:51:45 -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; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b="CCGcA/SE"; 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 7797338708B9 for <ouuuleilei@gmail.com>; Wed, 26 Apr 2023 21:47:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by sourceware.org (Postfix) with ESMTPS id 9CBAD3858404 for <gcc-patches@gcc.gnu.org>; Wed, 26 Apr 2023 21:45:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9CBAD3858404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-552a6357d02so91897967b3.3 for <gcc-patches@gcc.gnu.org>; Wed, 26 Apr 2023 14:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1682545519; x=1685137519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kk2WGDXFeHiGM8032nSpYvQDeqnXR2eC4cAWeTz8dgE=; b=CCGcA/SEbMDQcx9rKOkDjQx1BF+C4wACBUD2j0JKEoQOB+3ziqOq8/SxXrxBvTzhXv l0Pi8ykeixcERJgWQi6TgXIKC7Qc4AFYyxMfIBRFRVSSaWnuYZp4mp/gF17gL9WBIE8a YPE7TZLSbo2Ua/j5mErvdgD5DoKaQtt/LgSF3bBNrO+76cCAksK0p0zerTafWij/Ol8I PIiVdRqMOq59opyWYhUTZV/QuqKIQseU+WWBa3JKuVFkQnOEh1pQvaC/u+gpMwqgW+6Q LKjSPO70h4ZDZQAe1f3NbxmSP4wS45P+WGxdHh8nGmxNopLHgCLkcL/3NZC1vvQ58nU1 hqEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682545519; x=1685137519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kk2WGDXFeHiGM8032nSpYvQDeqnXR2eC4cAWeTz8dgE=; b=Ogu2Tm9iEcCHmdwmMTOQl0XU7xtNPgOKrT8QibTBTIveCM/n/ZTOJtdoT7STjvUZ9k JOCfBwllPtdUUJuO/g1XTxiNGRp91z0T2j4/7kTMSPkKH1ZGfV3vOgiAqw/RMbACprQj uytBCPKr1y5fr9iB/N1RfBO3Uj3Gu3oxBaUZXdhMECdd3mwS3xUgXCcZyJ8jSxRVHenP 6PxO0jV2F2ejZAjL2kzBiAdGU04r+eni1ZL/7AbjRvCOGQm5/GfaKn4Usr6+UEJHSiEf 85Az5gxQUYN10GuuNYU2NDf/5kV2tPwarzG9bxD8xrhjG1z4RKYSla2icST2CrqLr2FC uJsQ== X-Gm-Message-State: AAQBX9cCyj87hdT0y9f3gM4940PhemJsm5Vam6jO/EJhtuChFs183ehT ZvqxGaMLpZbjYgRSWlt6hlWPut5g6KT8TBzwS+0= X-Received: by 2002:a0d:e893:0:b0:54f:a18e:cd1a with SMTP id r141-20020a0de893000000b0054fa18ecd1amr14949861ywe.47.1682545518946; Wed, 26 Apr 2023 14:45:18 -0700 (PDT) Received: from system76-pc.ba.rivosinc.com ([136.57.172.92]) by smtp.gmail.com with ESMTPSA id n12-20020a0dcb0c000000b00552e32354f8sm4469824ywd.32.2023.04.26.14.45.18 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 14:45:18 -0700 (PDT) From: Michael Collison <collison@rivosinc.com> To: gcc-patches@gcc.gnu.org Subject: [PATCH v5 07/10] vect: Verify that GET_MODE_NUNITS is a multiple of 2. Date: Wed, 26 Apr 2023 17:45:11 -0400 Message-Id: <20230426214514.3355280-8-collison@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426214514.3355280-1-collison@rivosinc.com> References: <20230426214514.3355280-1-collison@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764277255715018276?= X-GMAIL-MSGID: =?utf-8?q?1764277255715018276?= |
Series |
RISC-V: autovec: Add autovec support
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Michael Collison
April 26, 2023, 9:45 p.m. UTC
While working on autovectorizing for the RISCV port I encountered an issue where can_duplicate_and_interleave_p assumes that GET_MODE_NUNITS is a evenly divisible by two. The RISC-V target has vector modes (e.g. VNx1DImode), where GET_MODE_NUNITS is equal to one. Tested on RISCV and x86_64-linux-gnu. Okay? 2023-03-09 Michael Collison <collison@rivosinc.com> * tree-vect-slp.cc (can_duplicate_and_interleave_p): Check that GET_MODE_NUNITS is a multiple of 2. --- gcc/tree-vect-slp.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Comments
Michael Collison <collison@rivosinc.com> writes: > While working on autovectorizing for the RISCV port I encountered an issue > where can_duplicate_and_interleave_p assumes that GET_MODE_NUNITS is a > evenly divisible by two. The RISC-V target has vector modes (e.g. VNx1DImode), > where GET_MODE_NUNITS is equal to one. > > Tested on RISCV and x86_64-linux-gnu. Okay? > > 2023-03-09 Michael Collison <collison@rivosinc.com> > > * tree-vect-slp.cc (can_duplicate_and_interleave_p): > Check that GET_MODE_NUNITS is a multiple of 2. OK, thanks. Doesn't need to wait for any other of the other patches in the series. Richard > --- > gcc/tree-vect-slp.cc | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc > index d73deaecce0..a64fe454e19 100644 > --- a/gcc/tree-vect-slp.cc > +++ b/gcc/tree-vect-slp.cc > @@ -423,10 +423,13 @@ can_duplicate_and_interleave_p (vec_info *vinfo, unsigned int count, > (GET_MODE_BITSIZE (int_mode), 1); > tree vector_type > = get_vectype_for_scalar_type (vinfo, int_type, count); > + poly_int64 half_nelts; > if (vector_type > && VECTOR_MODE_P (TYPE_MODE (vector_type)) > && known_eq (GET_MODE_SIZE (TYPE_MODE (vector_type)), > - GET_MODE_SIZE (base_vector_mode))) > + GET_MODE_SIZE (base_vector_mode)) > + && multiple_p (GET_MODE_NUNITS (TYPE_MODE (vector_type)), > + 2, &half_nelts)) > { > /* Try fusing consecutive sequences of COUNT / NVECTORS elements > together into elements of type INT_TYPE and using the result > @@ -434,7 +437,7 @@ can_duplicate_and_interleave_p (vec_info *vinfo, unsigned int count, > poly_uint64 nelts = GET_MODE_NUNITS (TYPE_MODE (vector_type)); > vec_perm_builder sel1 (nelts, 2, 3); > vec_perm_builder sel2 (nelts, 2, 3); > - poly_int64 half_nelts = exact_div (nelts, 2); > + > for (unsigned int i = 0; i < 3; ++i) > { > sel1.quick_push (i);
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index d73deaecce0..a64fe454e19 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -423,10 +423,13 @@ can_duplicate_and_interleave_p (vec_info *vinfo, unsigned int count, (GET_MODE_BITSIZE (int_mode), 1); tree vector_type = get_vectype_for_scalar_type (vinfo, int_type, count); + poly_int64 half_nelts; if (vector_type && VECTOR_MODE_P (TYPE_MODE (vector_type)) && known_eq (GET_MODE_SIZE (TYPE_MODE (vector_type)), - GET_MODE_SIZE (base_vector_mode))) + GET_MODE_SIZE (base_vector_mode)) + && multiple_p (GET_MODE_NUNITS (TYPE_MODE (vector_type)), + 2, &half_nelts)) { /* Try fusing consecutive sequences of COUNT / NVECTORS elements together into elements of type INT_TYPE and using the result @@ -434,7 +437,7 @@ can_duplicate_and_interleave_p (vec_info *vinfo, unsigned int count, poly_uint64 nelts = GET_MODE_NUNITS (TYPE_MODE (vector_type)); vec_perm_builder sel1 (nelts, 2, 3); vec_perm_builder sel2 (nelts, 2, 3); - poly_int64 half_nelts = exact_div (nelts, 2); + for (unsigned int i = 0; i < 3; ++i) { sel1.quick_push (i);