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 20757A0555; Thu, 9 Jun 2022 14:17:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA4F540689; Thu, 9 Jun 2022 14:17:13 +0200 (CEST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mails.dpdk.org (Postfix) with ESMTP id 6CD8F40220 for ; Thu, 9 Jun 2022 14:17:12 +0200 (CEST) Received: by mail-lj1-f171.google.com with SMTP id l18so18607315lje.13 for ; Thu, 09 Jun 2022 05:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lZ8VMSZN/NyeSdXRgU4rwwaw25zE9lL1b4U9XufRCuk=; b=qcuFWeTkQqSkHfwM0WY+/PJkRaJwGX6JuMk7/TVoC9PsXbOro9slxQez8WzsKU3gew 88ibE6B966pve1/7I6MwIp4B8tvIiGOWSvOZW4b7uLQ6Fp1MJT/iWcyguwiWh0/ORPQv lA/qzwzKOpEIvb8vLW1toRj74G7ID6hBPVIRl4QMY4eqzT6cy5VRUXmWZw9O7bM6qU6P HR1sYlQQh+IlsfM9orYfwLvAn2lF0EKRYGH+lX4dUq/V+bVPBNlBQRCkcDCEk6o0Dz9H Na/EgxKrrt+Mkpqb4v+7HmjfadnU1DZ+QIPWe45l3nq0omToKw0XzgO4NwlERRh3hgnE yYkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lZ8VMSZN/NyeSdXRgU4rwwaw25zE9lL1b4U9XufRCuk=; b=ESoLke0lv2bPjil4J66wX3zcr9N8QqlJeFmbeBxddNpxrmvTe+ioeAdFedZqz41MT0 3CVIyTsNZ/FNMCjVi4cBOYiZbA2zkgMbGNPGVoLmDH8XEaUjEB/TZAybFBF7ggMGJInv W5IX2UC8fxml2QX40lF+phzCZgrjbHgC5Rf+46qh3OG/IpWZ82yC7i6Y65R/B/3A5bmy XqKI/DsGWzHkZGKmZOk4XdxzaoKrbOccbp+SQrBa/IEaBeo6Dhz/9AOwFpi4/A6sSLu9 KnmZmWNxCQpaGZZkNtCyHjuHU7rCWAmrGa5brt9oHD2l+MUPZYu8mboEkznJ3I6I9D0a xMNQ== X-Gm-Message-State: AOAM530f0bslX2Vdn3UI24+5aAYcYvsfdqXBKIi5Qo5vHUCDGGfpbK89 uLy6R9CrVGf8QpTn92uH+HilvA== X-Google-Smtp-Source: ABdhPJzYVpDGkYCZK6iRU1FUtMYif4C17V6ex/ZAw9ODr1hMHjhvff/yVYBQsmL3ssNSqgZLtyXwPw== X-Received: by 2002:a2e:3a18:0:b0:255:c053:1726 with SMTP id h24-20020a2e3a18000000b00255c0531726mr4647809lja.316.1654777031886; Thu, 09 Jun 2022 05:17:11 -0700 (PDT) Received: from toster.semihalf.net ([83.142.187.86]) by smtp.gmail.com with ESMTPSA id f6-20020a2eb5a6000000b00253da47cfbesm3706999ljn.80.2022.06.09.05.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 05:17:11 -0700 (PDT) From: Stanislaw Kardach To: David Marchand Cc: Stanislaw Kardach , dev@dpdk.org, upstream@semihalf.com Subject: [PATCH 0/3] Fix xmm_t to rte_xmm_t scalar conversion Date: Thu, 9 Jun 2022 14:16:58 +0200 Message-Id: <20220609121701.716299-1-kda@semihalf.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 As David noticed in [1] there is an issue with C++ compilation of the rte_vect.h header in RISC-V. Upon closer inspection, the problem appears on all architectures due to the type conversion rules in C++. More precisely a union type rte_xmm_t requires a conversion constructor from xmm_t type. The most obvious fix is to use a structure initializer for such copies (since rte_xmm_t union contains xmm_t anyway). The generated assembly at -O2 is exactly the same, so there's no real impact. The bigger question is whether accessing bits of the architecture specific xmm_t type in an array fashion is always correct? All current architectures define rte_xmm_t in the same manner implying that. Additionally change RISC-V CI settings to use crossbuild-essential-riscv64 package which provides tools that enable C++ checks. [1] http://mails.dpdk.org/archives/dev/2022-June/243683.html Stanislaw Kardach (3): eal/riscv: fix xmm_t casting for C++ lpm: fix xmm_t casting for C++ in scalar version ci: use crossbuild-essential-riscv64 for compiling .github/workflows/build.yml | 3 +-- lib/eal/riscv/include/rte_vect.h | 4 ++-- lib/lpm/rte_lpm_scalar.h | 11 ++++++----- 3 files changed, 9 insertions(+), 9 deletions(-) -- 2.30.2