On Saturday 07 November 2009 00:06 Mike Farnsworth wrote:
> What support, if any, does ldc have for SSE intrinsics, such as those
> found in the gcc/vc++/etc headers *mmintrin.h ?  The llvm gcc frontend
> supports them, and I believe clang does as well.  I could only find a
> few pragmas for llvm intrinsics in the ldc part of the std lib.
>
> If this is something that could (relatively) easily be added, let me
> know what to do and I'll see if I can muster up a patch sometime.  It
> may also be that there needs to be a little extra knowledge about some
> __m128- and __m64-like types in order to have the llvm backend
> actually prefer putting them in SSE registers?

Hi Mike,

LDC can bind LLVM intrinsics to D functions if their signature is expressable 
in D. Like for memcpy:

pragma(intrinsic, "llvm.memcpy.i32")
void llvm_memcpy_i32(void* dst, void* src, uint len, uint alignment);

As far as I remember, the problem with the SSE intrinsics is that there's no D 
type that matches llvm's vector types 
(http://www.llvm.org/docs/LangRef.html#t_vector). And that means getting 
explicit access to the intrinsic from D code will not be easy.

I think Tomas looked into this at some point, maybe he can offer some advice 
to get you started.

Note that the LLVM optimizer should already make use of the intrinsics.

Regards,
Christian

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to