From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2555EA0543; Mon, 13 Jun 2022 11:29:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 143B3410DD; Mon, 13 Jun 2022 11:29:50 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A79D84067C for ; Mon, 13 Jun 2022 11:29:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655112588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=i0Jnw/HXBhXTOenfhr9HDiAiLWyVpvSYp/OktZXuwjE=; b=Z72ObIIq7eu4v1R8oiYhlDl2Il5No7FJVBxQCbhXUIU90Hgo6CL9R/L6/sChQ6CDywEjln z+LFtoYyeJTwnlEWjEqoUVvaJXgUiyQGLVzS4baYQkQTMQAuwIC/AwwEOzBicqZVTpovHe SZrNyBXeT8pYkQ8KQ4RyXNTdAS+TQ68= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-266-9pT6rm2zOsq3JWmKxhfd8g-1; Mon, 13 Jun 2022 05:29:45 -0400 X-MC-Unique: 9pT6rm2zOsq3JWmKxhfd8g-1 Received: by mail-lj1-f200.google.com with SMTP id b12-20020a2ebc0c000000b0025662e0a527so534420ljf.0 for ; Mon, 13 Jun 2022 02:29:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i0Jnw/HXBhXTOenfhr9HDiAiLWyVpvSYp/OktZXuwjE=; b=o5L+xRn63ErBQPCB6FS4atFeC9EKsR3ErY+/6Oef09PFXxoTqYAMkSguDjVT1KsabS 0Gbx9LaZHXA861Yyzky/TGZB61BNOYhdlTnh2DaSUjQrPSRRwLj4xV4WGFFcu9NFjhfL SNuUG9v8SwUFSbhQccRYQjNruN573mPMkGPhRJhiT5ggKOKnvvwfpuuiwVKxf4B8SP+8 xlsAjnElYYiU0tsBsomEsq+bEvjaVo9Bd+K+oaLqqnJrDJlHrhzImbpVNHihQmt2z9E6 n7JBXvxUNHKhZPBbSyhYdBNtD14evLtKIdSAquaq9pMBV3aHtKGSwijBv7S+EGglhpoY IotQ== X-Gm-Message-State: AOAM530xWcxeEr8UvHWi9wlU17Nh5xOH6u4k4TuQGJfkcZSxO9aCKzbr 5bGK+a3Jngy/Qlg2xP6ayBHv46YzyXlAfWTMPWB3/OEJ1pidt5jBsXWhZxW435ySOLgLdwZWvS4 puHRcCXT7XZpAevrkZgQ= X-Received: by 2002:a05:651c:a04:b0:255:bf2e:72b9 with SMTP id k4-20020a05651c0a0400b00255bf2e72b9mr14551231ljq.333.1655112583605; Mon, 13 Jun 2022 02:29:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgbQqGMCzqWd8mUUL0JIOGHas4XjO7ls2si8zMJAzo037WXYkDhdDa3if+MtFO+4xqDfd7HgUZXLXoBROKeFA= X-Received: by 2002:a05:651c:a04:b0:255:bf2e:72b9 with SMTP id k4-20020a05651c0a0400b00255bf2e72b9mr14551221ljq.333.1655112583420; Mon, 13 Jun 2022 02:29:43 -0700 (PDT) MIME-Version: 1.0 References: <20220609121701.716299-1-kda@semihalf.com> <20220609121701.716299-3-kda@semihalf.com> In-Reply-To: <20220609121701.716299-3-kda@semihalf.com> From: David Marchand Date: Mon, 13 Jun 2022 11:29:31 +0200 Message-ID: Subject: Re: [PATCH 2/3] lpm: fix xmm_t casting for C++ in scalar version To: Stanislaw Kardach Cc: Vladimir Medvedkin , dev , upstream@semihalf.com Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jun 9, 2022 at 2:17 PM Stanislaw Kardach wrote: > > rte_xmm_t is a union type which wraps around xmm_t and maps its contents > to scalar structures. Since C++ has stricter type conversion rules than > C, the rte_xmm_t::x has to be used instead of C-casting. > > The generated assembly is identical to the code without the fix (checked > both on x86 and RISC-V). Fixes: 406937f89ffd ("lpm: add scalar version of lookupx4") > > Signed-off-by: Stanislaw Kardach Reviewed-by: David Marchand > --- > lib/lpm/rte_lpm_scalar.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/lib/lpm/rte_lpm_scalar.h b/lib/lpm/rte_lpm_scalar.h > index f0d9f37894..161b40ff80 100644 > --- a/lib/lpm/rte_lpm_scalar.h > +++ b/lib/lpm/rte_lpm_scalar.h > @@ -15,18 +15,19 @@ extern "C" { > > static inline void > rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4], > - uint32_t defv) > + uint32_t defv) Nit: unrelated whitespace change. Besides, indent is supposed to be one tab. This can be dropped when applying. -- David Marchand