[PATCH 0/3] Fix xmm_t to rte_xmm_t scalar conversion
David Christensen
drc at linux.vnet.ibm.com
Tue Jun 21 00:54:48 CEST 2022
> On Thu, Jun 9, 2022 at 2:17 PM Stanislaw Kardach <kda at semihalf.com> wrote:
>>
>> 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.
>
> Copying other arch maintainers.
My read of the Altivec vector layout for LE systems says the existing
union operator rte_xmm_t is correct, though my C++ experience is
limited. How can I generate an error with C++ to expose this issue?
Dave
More information about the dev
mailing list