What is the better signature for this?

Guillaume Piolat first.last at spam.org
Mon Oct 10 12:44:18 UTC 2022


On Monday, 10 October 2022 at 12:31:04 UTC, Bruce Carneal wrote:
> On Sunday, 9 October 2022 at 19:44:13 UTC, Guillaume Piolat 
> wrote:
>> Consider the following "intrinsic" signature.
>>
>> ...
>>
>> What do you think is the better signature?
>> I'd prefer to go A > B > C, but figured I might be missing 
>> something.
>
> Could using the static array representation type of the vector 
> (.array) be a useful idiom here?  I ask because I don't know 
> the constraints/preferences of veteran intrinsic programmers.  
> That idiom does work well in other SIMD formulations but may 
> not be well suited here.

That is solution C.
It could work.

The slight problem is that function that takes __m128i* use that 
as "any packed integer taking 128-bit" space, and it's not 
immediately obvious that __m128i is int4 and __m256i is long4, 
it's rather counterintuitive. Smenatically, it could be short8 or 
byte16...

GCC vectors can be unaligned, and there are types for it (eg: 
__m128i_u), but I don't think the other compilers can do that. 
That would be a prime contender.



More information about the Digitalmars-d mailing list