core.simd woes
Manu
turkeyman at gmail.com
Wed Oct 10 01:16:43 PDT 2012
On 9 October 2012 21:56, F i L <witte2008 at gmail.com> wrote:
> On Tuesday, 9 October 2012 at 19:18:35 UTC, F i L wrote:
>
>> Manu wrote:
>>
>>> std.simd already does have a mammoth mess of static if(arch & compiler).
>>> The thing about std.simd is that it's designed to be portable, so it
>>> doesn't make sense to expose the low-level sse intrinsics directly there.
>>>
>>
>> Well, that's not really what I was suggesting. I was saying maybe
>> eventually matching the agnostic gdc builtins in a separate module:
>>
>> // core.builtins
>>
>> import core.simd;
>>
>> version (GNU)
>> import gcc.builtins;
>>
>> void madd(ref float4 r, float4 a, float4 b)
>> {
>> version (X86_OR_X64)
>> {
>> version (DigitalMars)
>> {
>> r = __simd(XMM.PMADDWD, a, b);
>> }
>> else version (GNU)
>> {
>> __builtin_ia32_fmaddpd(r, a, b)
>> }
>> }
>> }
>>
>> then std.simd can just use a single function (madd) and forget about all
>> the compiler-specific switches. This may be more work than it's worth and
>> std.simd should just contain all the platform specific switches... idk, i'm
>> just throwing out ideas.
>>
>
> You know... now that I think about it, this is pretty much EXACTLY what
> std.simd IS already... lol, forget all of that, please.
>
Yes, I was gonna say...
We're discussing providing convenient access to the arch intrinsics
directly, which may be useful in many situations, although I think use of
std.simd would be encouraged for the most part, for portability reasons.
I'll take some time this weekend to do some experiments with GDC and LDC...
actually, no I won't, I'm doing a 48 hour game jam (which I'll probably
write in D too), but I'll do it soon! ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121010/a96e3c5e/attachment.html>
More information about the Digitalmars-d
mailing list