Any SIMD experts?

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 9 04:36:26 PST 2014


On Monday, 8 December 2014 at 22:10:09 UTC, Martin Nowak wrote:
> On 12/08/2014 06:05 PM, John Colvin wrote:
>> Well gcc gives me:
>
> Tried that with dmd, it gave me.
>
> bug.d(5): Error: incompatible types for ((a) >= (l)): 
> '__vector(ulong[4])' and '__vector(ulong[4])'
> bug.d(5): Error: incompatible types for ((a) < (h)): 
> '__vector(ulong[4])' and '__vector(ulong[4])'
>
> Yours looks better.

It's unfortunate it can't work it out automatically like gcc can.

Anyway, you can write it out manually:

auto foo(ulong2 a, ulong2 l, ulong h)
{
     static long2 shift = long.min; //-2^63
     long2 aS = cast(long2)(a - shift);
     long2 lS = cast(long2)(l - shift);
     long2 hS = cast(long2)(h - shift);
     return (hS > aS) & (lS > aS);
}

but that doesn't actually compile, the compiler just sits in 
semantic3 forever (see 
https://issues.dlang.org/show_bug.cgi?id=13841)


More information about the Digitalmars-d mailing list