From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 4628DA052E;
	Mon,  9 Mar 2020 17:40:05 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 3D9091C02D;
	Mon,  9 Mar 2020 17:40:04 +0100 (CET)
Received: from mail-io1-f65.google.com (mail-io1-f65.google.com
 [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id CF6131C011
 for <dev@dpdk.org>; Mon,  9 Mar 2020 17:40:01 +0100 (CET)
Received: by mail-io1-f65.google.com with SMTP id d8so9771048ion.7
 for <dev@dpdk.org>; Mon, 09 Mar 2020 09:40:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=XsYrt5nZ+CyjK2UlaLO3CZK9ndaSBpX+IZeSygcfPN4=;
 b=iWvYBcllKj3ZxKbMa9GYZy/eL1ujWCbCefmWKfc5Z0x8RbQT52y//xiwHrzxGgZNNX
 JQZ4Y4SsplLzI/tZS8aGItipmu6ykR///6V8gMOyHcQpDre93ge36s/+5du2hMoDm4ZJ
 r2KTN/gu4xSBo3OQlEtTGElt73a8V4DfvY0WUOQmYv/p63n9W3eimulwDCDmKSQvmRJG
 5IBuKZ+b8qIrOWFcbiJFYm5zhBT45B6jis3JMtrHIsVoaCwz03rYilDAEV4IzDAcrgma
 sgRXxxa9KYCuB2LO9i0aGcogHWV6Tb3S/cB58bTUOZFHqT97SUl34lnoQSKLcTubAcAy
 OXtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=XsYrt5nZ+CyjK2UlaLO3CZK9ndaSBpX+IZeSygcfPN4=;
 b=T7pfWg+7JjEPIRSbe8czk8N6gNXEgEo5dvJLKkmDtjO6ubbUz6T9+OShu9QS54MDwW
 ouUETIGxtf8dgV3Jx6DyRs1rtnUiR5U1/fTbNKgAflk3ebEQx/bEcX4C1M0BBh3laO1+
 UKU5odMut67Pscma0vlHk77S8SbKNB9+x9lllxy6T+oiE32J7oK4tYkYJG6Sbrmfqbrj
 /7a77jdHvnlHdzAZSEfWVq0NLb76GzY6loKBAtvxkFLOL1tqjqgvQiVHu8SISqacIjqa
 hXW1Invr8afhnNUdzwVn9j++BgVhBVq2bgdyQzaUK7H8icxvrymC6Hz1lnXhluEJ+/Rm
 jmQg==
X-Gm-Message-State: ANhLgQ3XUQPaejPfv3AL6eeLaUH5yFAj047Mawc6YZmCecdvQme7X+/Y
 EFUULIcgTOlE+AdFixPCqJ/ADe1V5eJHj43cyd0=
X-Google-Smtp-Source: ADFU+vuJ+cx62KB95L//osrEtoXYSCRNMAxwqhoc3BZbtGmIWfNnoFxqlJi3pqO0XxhAUu0Cj3KeQd266gH07n8jc7w=
X-Received: by 2002:a05:6638:517:: with SMTP id
 i23mr15501868jar.133.1583772000862; 
 Mon, 09 Mar 2020 09:40:00 -0700 (PDT)
MIME-Version: 1.0
References: <1583757826-375246-1-git-send-email-vladimir.medvedkin@intel.com>
 <1583757826-375246-2-git-send-email-vladimir.medvedkin@intel.com>
In-Reply-To: <1583757826-375246-2-git-send-email-vladimir.medvedkin@intel.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Mon, 9 Mar 2020 22:09:44 +0530
Message-ID: <CALBAE1Os08ZViN4Sm+24+Pv+v7Z2z3eu9gEg7aD4fVCx8NK3MQ@mail.gmail.com>
To: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Cc: dpdk-dev <dev@dpdk.org>, "Ananyev,
 Konstantin" <konstantin.ananyev@intel.com>, 
 "Richardson, Bruce" <bruce.richardson@intel.com>, Gavin Hu <gavin.hu@arm.com>
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH 1/6] eal: introduce zmm type for AVX 512-bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Mon, Mar 9, 2020 at 6:14 PM Vladimir Medvedkin
<vladimir.medvedkin@intel.com> wrote:
>
> New data type to manipulate 512 bit AVX values.
>
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> ---
>  lib/librte_eal/common/include/arch/x86/rte_vect.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/lib/librte_eal/common/include/arch/x86/rte_vect.h b/lib/librte_eal/common/include/arch/x86/rte_vect.h
> index df5a607..09f30e6 100644
> --- a/lib/librte_eal/common/include/arch/x86/rte_vect.h
> +++ b/lib/librte_eal/common/include/arch/x86/rte_vect.h
> @@ -90,6 +90,26 @@ __extension__ ({                 \
>  })
>  #endif /* (defined(__ICC) && __ICC < 1210) */
>
> +#ifdef __AVX512F__
> +
> +typedef __m512i zmm_t;
> +
> +#define        ZMM_SIZE        (sizeof(zmm_t))
> +#define        ZMM_MASK        (ZMM_SIZE - 1)
> +
> +typedef union rte_zmm {
> +       zmm_t    z;
> +       ymm_t    y[ZMM_SIZE / sizeof(ymm_t)];
> +       xmm_t    x[ZMM_SIZE / sizeof(xmm_t)];
> +       uint8_t  u8[ZMM_SIZE / sizeof(uint8_t)];
> +       uint16_t u16[ZMM_SIZE / sizeof(uint16_t)];
> +       uint32_t u32[ZMM_SIZE / sizeof(uint32_t)];
> +       uint64_t u64[ZMM_SIZE / sizeof(uint64_t)];
> +       double   pd[ZMM_SIZE / sizeof(double)];

Are we missing __attribute__((aligned(64))) here?

> +} rte_zmm_t;

IMO, Due to legacy reason, we have selected  rte_xmm_t, rte_ymm_t for
128 and 256 operations in public APIs[1]

# Not sure where xmm_t and ymm_t and new zmm_t come from? Is this name
x86 arch-specific? If so,
why not give the more generic name rte_512i_t or something?
# Currently, In every arch file, we are repeating the definition for
rte_xmm_t, Why not make, this generic definition
in common file. ie.  rte_zmm_t or rte_512i_t definition in common
file(./lib/librte_eal/common/include/generic/rte_vect.h)
# Currently ./lib/librte_eal/common/include/generic/rte_vect.h has
defintion for rte_vXsY_t for vector representation, would that
be enough for public API? Do we need to new type?


[1]
rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],
uint32_t defv)


> +
> +#endif /* __AVX512F__ */
> +
>  #ifdef __cplusplus
>  }
>  #endif
> --
> 2.7.4
>