core.simd woes

Manu turkeyman at gmail.com
Mon Oct 15 05:19:37 PDT 2012


On 15 October 2012 02:50, jerro <a at a.com> wrote:

> Speaking of test – are they available somewhere? Now that LDC at least
>> theoretically supports most of the GCC builtins, I'd like to throw some
>> tests at it to see what happens.
>>
>> David
>>
>
> I have a fork of std.simd with LDC support at https://github.com/jerro/**
> phobos/tree/std.simd <https://github.com/jerro/phobos/tree/std.simd> and
> some tests for it at https://github.com/jerro/std.**simd-tests<https://github.com/jerro/std.simd-tests>.
>

Awesome. Pull request plz! :)

That said, how did you come up with a lot of these implementations? Some
don't look particularly efficient, and others don't even look right.
xor for instance:
return cast(T) (cast(int4) v1 ^ cast(int4) v2);

This is wrong for float types. x86 has separate instructions for doing this
to floats, which make sure to do the right thing by the flags registers.
Most of the LDC blocks assume that it could be any architecture... I don't
think this will produce good portable code. It needs to be much more
cafully hand-crafted, but it's a nice working start.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121015/079c5d78/attachment.html>


More information about the Digitalmars-d mailing list