From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by sourceware.org (Postfix) with ESMTPS id 93D433858D35 for ; Sun, 25 Jun 2023 07:13:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93D433858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-bfe97b3752bso2207982276.1 for ; Sun, 25 Jun 2023 00:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687677236; x=1690269236; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4O8LBBCVpa68vS5M0jaiX73RI4XXpSCTZM5eiUuk2HU=; b=KVGthXwR0o0m1v9+E4sDghdynOJYNhMvNQhwWa1405LId3wu/9EiliFmtjNdW/12BT ex5lAHtkoH9Wx3dCTZTLKQ0gZWlSXASWZt6rq/fjWYGY2PFqRXcd91iO8gDsggrKBtAB Z4ePmh7ffW9UaZsYU018DGXtL6mTiz7FysUbRy5GxArpxZTg6Wg5ZlydDbF993ATitSa MeD6LdjDjpJeuUKkragzVOOshq6WnbkeLSDjkZ6dzB6XshAxdL+4MHKaxSjoHUyObDdB 9j/DXYJdEiEWQ7ZUgl/GpoEb36gyszbKqq/XL8nQVHKLfdIdZ4XM5MmGfWDSsYHNviT/ e+kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687677236; x=1690269236; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4O8LBBCVpa68vS5M0jaiX73RI4XXpSCTZM5eiUuk2HU=; b=Udxt0w+2DvApv0iIFtlrCaHTTMvxBgAXa4H/Lrnesr0VmnOQXHaAqwq5P9/oEAEWKa qKxKzJNfMkFLNt4RXIlQVT/8UixXIWYSm3FWNp+Lx7M8ubXoaw3w2HFv/4nMwPhYumyD xhzFY4XUITc2eEXKBWnLviakkSc7WEeivFfqX+GUGR5J7Px3kJin3iCd2zIIQmGJ5Ydh Ee2nmzSQo+CYRZ3xLdft1zByVTXGxvgg+6cGCfJF7omJ/muPrcflsjJTnzTuNnPdyQmh GA3Y4v4s21WHREGycYxx7MsAQ0VxUxIWW2QIFZSpYA9AVj7wCjFyUJFBboR7DVgSYMfg M4fA== X-Gm-Message-State: AC+VfDykbI0bMnnCL4TUKA735+sQPnMPFzJ3yUVIDc5Qi+kTOeFyJg55 OAgr0OpYzf5bybz/JqHKt+QLLVmzEsA+816LDfs= X-Google-Smtp-Source: ACHHUZ4AHHSJGjs646uvoKNO1zFz4nIU7XI/0TnivJuyZuJ0ylHtDHcHntPoFHDE30Kci5GJ5xNQXhqw1l264x+OpN0= X-Received: by 2002:a0d:dd0d:0:b0:561:c9c1:ce with SMTP id g13-20020a0ddd0d000000b00561c9c100cemr26363784ywe.8.1687677235732; Sun, 25 Jun 2023 00:13:55 -0700 (PDT) MIME-Version: 1.0 References: <04f99abe-a563-d093-23b7-4abf0f91633d@suse.com> <457ffad0-9ecd-3e19-f5ab-6153ce4b8bad@suse.com> <615edb3e-3dda-4e3f-9b71-43738a268afd@suse.com> In-Reply-To: <615edb3e-3dda-4e3f-9b71-43738a268afd@suse.com> From: Hongtao Liu Date: Sun, 25 Jun 2023 15:13:44 +0800 Message-ID: Subject: Re: [PATCH 1/5] x86: use VPTERNLOG for further bitwise two-vector operations To: Jan Beulich Cc: "gcc-patches@gcc.gnu.org" , Hongtao Liu , Kirill Yukhin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: On Sun, Jun 25, 2023 at 1:52=E2=80=AFPM Jan Beulich wro= te: > > On 25.06.2023 06:42, Hongtao Liu wrote: > > On Wed, Jun 21, 2023 at 2:26=E2=80=AFPM Jan Beulich via Gcc-patches > > wrote: > >> > >> +(define_code_iterator andor [and ior]) > >> +(define_code_attr nlogic [(and "nor") (ior "nand")]) > >> +(define_code_attr ternlog_nlogic [(and "0x11") (ior "0x77")]) > >> + > >> +(define_insn "*3" > >> + [(set (match_operand:VI 0 "register_operand" "=3Dv,v") > >> + (andor:VI > >> + (not:VI (match_operand:VI 1 "bcst_vector_operand" "%v,v")) > >> + (not:VI (match_operand:VI 2 "bcst_vector_operand" "vBr,m")))= )] > > I'm thinking of doing it in simplify_rtx or gimple match.pd to transfor= m > > (and (not op1)) (not op2)) -> (not: (ior: op1 op2)) > > This wouldn't be a win (not + andn) -> (or + not), but what's > more important is ... > > > (ior (not op1) (not op2)) -> (not : (and op1 op2)) > > > > Even w/o avx512f, the transformation should also benefit since it > > takes less logic operations 3 -> 2.(or 2 -> 2 for pandn). > > ... that these transformations (from the, as per the doc, > canonical representation of nand and nor) are already occurring I see, there're already such simplifications in the gimple phase, so the question: is there any need for and/ior:not not pattern? Can you provide a testcase to demonstrate that and/ior: not not pattern is needed? > in common code, _if_ no suitable insn can be found. That was at > least the conclusion I drew from looking around a lot, supported > by the code that's generated prior to this change. > > Jan --=20 BR, Hongtao