From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by sourceware.org (Postfix) with ESMTPS id C2C123858426 for ; Sat, 7 Oct 2023 02:33:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C2C123858426 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-yw1-x1132.google.com with SMTP id 00721157ae682-59f57ad6126so32472927b3.3 for ; Fri, 06 Oct 2023 19:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696646005; x=1697250805; darn=gcc.gnu.org; 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=BGhglikpeXvOWQ4nq4q60qjpgdOiYd8C7JXaWVISBUA=; b=IubzVko4StGmVgI1Dkr+QYJ+HghHYWtBOzpS+GVWxGr5VKOU05V0JqEvRAAjTTTfNC 5osMD/ZTv7c/gKWRsVfCFJXbAK0xZCezbnBAeLJur623PnF9eGSaNirAq7MkO89K1EgZ jvE+ZmvpjjwaoZ0bn+BcBrCuNyUifyFR0SRSd4jk5Yd+PApGUFOseF6ht4ZBRBvuTeSo VL+8abRWtXl+sHmPtrJZq31p7J8OScWn0VlftUeiD+xXamE2ZhryxY3D3I2RvZdcsTf8 95N+loIPGZ/L/xacT7kRK/Jl67aMLygMbIN7BP7RE7F5BIYPx3+/p6c9QUEiER/9tIJK 0z0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696646005; x=1697250805; 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=BGhglikpeXvOWQ4nq4q60qjpgdOiYd8C7JXaWVISBUA=; b=T0z5bWYoj7S4zaVnwjyvox3q2iAcNcgV5wyGh4gasfsFB7B/BKb6WASPWcwcF1NVxJ toTGostBzhwUzeGM8WtWHWbHAjYLgTEQjFZI58L3wP5DXsRzu3Tcd27CydGU/QkfG0yR V/FyZlMJGSAb3F/pTL5aVyqZ/wLa7LxJTbf54n0KTVFEenQoO22QkyVHC6nr2qk4+AbY jlfcGNHgHmeqmbHjh9q9j69dhtZD9AIhaMEb34DhxPizq5VYbs0UHZPWJeGaCPYoK6dJ s4hwyBU1qNgvppsB2mrZdKGBpWBoBLkuaNRUvK1246hgLouruobRdgZH9+Rvmc0vS+/P a35g== X-Gm-Message-State: AOJu0YwJF40hNhYFMdGBJ2CMqbesBXRXMaSaiQpuO9ZipjocCiNpIMTa 4cjdnLAPD+boD1x2IeydxbayHNleqvvq+AWg9gI= X-Google-Smtp-Source: AGHT+IEnKCOhripQuvKEd74yWRpCIfQf6MEmXjKYuYzS+WMRwUK8aOAKc9RfTbYWsVXCUUfQsGvBlW8fZhXXmTVrE2U= X-Received: by 2002:a25:2f12:0:b0:d81:9241:1286 with SMTP id v18-20020a252f12000000b00d8192411286mr9029184ybv.39.1696646005057; Fri, 06 Oct 2023 19:33:25 -0700 (PDT) MIME-Version: 1.0 References: <20230921072013.2124750-1-lin1.hu@intel.com> In-Reply-To: From: Hongtao Liu Date: Sat, 7 Oct 2023 10:33:13 +0800 Message-ID: Subject: Re: [PATCH 00/18] Support -mevex512 for AVX512 To: ZiNgA BuRgA Cc: "Hu, Lin1" , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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, Sep 28, 2023 at 11:23=E2=80=AFAM ZiNgA BuRgA wrote: > > That sounds about right. The code I had in mind would perhaps look like: > > > #if defined(__AVX512BW__) && defined(__AVX512VL__) > #if defined(__EVEX256__) && !defined(__EVEX512__) > // compiled code is AVX10.1/256 and AVX512 compatible > #else > // compiled code is only AVX512 compatible > #endif > > // some code which only uses 256b instructions > __m256i... > #endif > > > The '__EVEX256__' define would avoid needing to check compiler versions. Sounds reasonable, regarding how to set __EVEX256__, I think it should be set/unset along with __AVX512VL__ and __EVEX512__ should not unset __EVEX256__. > Hopefully you can align it with whatever Clang does: > https://discourse.llvm.org/t/rfc-design-for-avx10-feature-support/72661/1= 8 > > Thanks! > > On 28/09/2023 12:26 pm, Hu, Lin1 wrote: > > Hi, > > > > Thanks for you reply. > > > > I'd like to verify that our understanding of your requirements is corre= ct, and that __EVEX256__ can be considered a default macro to determine whe= ther the compiler supports the __EVEX***__ series of switches. > > > > For example: > > > > I have a segment of code like: > > #if defined(__EVEX512__): > > __mm512.*__; > > #else > > __mm256.*__; > > #endif > > > > But __EVEX512__ is undefined that doesn't mean I only need 256bit, mayb= e I use gcc-13, so I can still use 512bit. > > > > So the code should be: > > #if defined(__EVEX512__): > > __mm512.*__; > > #elif defined(__EVEX256__): > > __mm256.*__; > > #else > > __mm512.*__; > > #endif > > > > If we understand correctly, we'll consider the request. But since we're= about to have a vacation, follow-up replies may be a bit slower. > > > > BRs, > > Lin > > > > -----Original Message----- > > From: ZiNgA BuRgA > > Sent: Thursday, September 28, 2023 8:32 AM > > To: Hu, Lin1 ; gcc-patches@gcc.gnu.org > > Subject: Re: [PATCH 00/18] Support -mevex512 for AVX512 > > > > Thanks for the new patch! > > > > I see that there's a new __EVEX512__ define. Will there be some __EVEX= 256__ (or maybe some max EVEX width) define, so that code can detect whethe= r the compiler supports AVX10.1/256 without resorting to version checks? > > > > > --=20 BR, Hongtao