From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by sourceware.org (Postfix) with ESMTPS id EC4793858002 for ; Thu, 15 Jun 2023 08:33:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC4793858002 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-qk1-x733.google.com with SMTP id af79cd13be357-75d4dd6f012so299043585a.2 for ; Thu, 15 Jun 2023 01:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686818015; x=1689410015; 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=zUz1H26fYcDxZrG3O9d0HKMZ/fM6GqItYBPF3VV+3K4=; b=g703PompPua/MtV921lYYvt6+3kqUdyBi1FMtI44b/jjG7XqYK6mb+XsldPbhCgFFh R8fbPmphNlxKGu6LjfhNcbbru8cvo8KBcK77fbH8oD0DfYihq86xnultm0+TAIAdEqGB IFguWqAmRz6V1/L8IM9MSjBGrv2mMk8BczcjNxtBlbrKXBRZOxMu0lLq7t/JoEJltsBT +qQgQ6FK65C5MvgOMpQa4lK6d1ZfRethipmklVAbEQ5QjEkacyXfvO/hN88s2CY/RScL dfCTwsWqe/wOufP5h7b5ZbdQ1QMShvZJO6n1kzd3Hvp1KKJpb+1waGCF8esAioUj24oa O8nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686818015; x=1689410015; 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=zUz1H26fYcDxZrG3O9d0HKMZ/fM6GqItYBPF3VV+3K4=; b=CMCOA5FNmTE9uKVPOifvScT/zB3YRTeiX3xp9dg70y5hYnqyGvr9NKcN4u44p+cF+t O9o9ke4qYcRSHIKVzHQkaddE8FcBsRkJkbNlxJ7Escp0chYKZB/dhQJsT0ECut1gK0OI gjQBbbn9EdL338njCK2nqBrPU6k9XqNiCXRPJdspuXqOZauaxWj1ZJRVgLBgtQxdHMyx k7r4PDtqyfbRz+CGbiETEzXwYzsTSSWx3DbMRkiREvrxpEyKCreLBsEB4ErA27GdnMVJ 3/qQqC1P3G/DGHnpB+9gz6D92Zt7U1jZhFBPfSYJxEjaYeTAyr8PGywTT4Cwe7Shgn2B A6Rw== X-Gm-Message-State: AC+VfDwPCxrhY4DoPjUoqCrZdQvNcNBiQTCKXVBuJSQa1junjSIc+g7S hmV9ruzaflY3tdADoPeuaVNV/a0rDf/twYZF8hY= X-Google-Smtp-Source: ACHHUZ4CxQ9OzjXbfl52I8OIP0hNe0BDUegoaJkbAz+waol9/W++DCqUEB0hwjwZxF1rz/HzQlSEjD3XgI3bki262Mw= X-Received: by 2002:a05:6214:2428:b0:62a:f634:882a with SMTP id gy8-20020a056214242800b0062af634882amr22564825qvb.33.1686818015150; Thu, 15 Jun 2023 01:33:35 -0700 (PDT) MIME-Version: 1.0 References: <614c258d-9168-a67e-eb51-00bb2060ded4@suse.com> In-Reply-To: <614c258d-9168-a67e-eb51-00bb2060ded4@suse.com> From: Uros Bizjak Date: Thu, 15 Jun 2023 10:33:23 +0200 Message-ID: Subject: Re: [PATCH] x86: correct and improve "*vec_dupv2di" To: Jan Beulich Cc: Hongtao Liu , "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=-2.0 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 Thu, Jun 15, 2023 at 10:15=E2=80=AFAM Jan Beulich wr= ote: > > On 15.06.2023 09:45, Hongtao Liu wrote: > > On Thu, Jun 15, 2023 at 3:07=E2=80=AFPM Uros Bizjak via Gcc-patches > > wrote: > >> On Thu, Jun 15, 2023 at 8:03=E2=80=AFAM Jan Beulich via Gcc-patches > >> wrote: > >>> + case 3: > >>> + return "%vmovddup\t{%1, %0|%0, %1}"; > >>> + case 4: > >>> + return "movlhps\t%0, %0"; > >>> + default: > >>> + gcc_unreachable (); > >>> + } > >>> +} > >>> + [(set_attr "isa" "sse2_noavx,avx,avx512f,sse3,noavx") > >>> + (set_attr "type" "sselog1,sselog1,ssemov,sselog1,ssemov") > >>> + (set_attr "prefix" "orig,maybe_evex,evex,maybe_vex,orig") > >>> + (set_attr "mode" "TI,TI,TI,DF,V4SF") > > alternative 2 should be XImode when !TARGET_AVX512VL. > > This gives me a chance to actually raise a related question I stumbled > across several times: Which operand does the mode attribute actually > describe? I've seen places where it's the source, but I've also seen > places where it's the destination. Because of this mix I wasn't really > sure that getting this attribute entirely correct is actually > necessary, and hence I hoped it would be okay to not further complicate > the attribute here. It should be the mode the insn is operating in. So, zero-extended SImode add is still operating in SImode, even if its output is DImode, and TARGET_MMX_WITH_SSE are V4SFmode, even if their operands are all V2SFmode. Uros.