3

Is it possible to do it now in D out of the box ? I'm using LDC2 compiler if it can help. I'm interested using AVX intrinsics.

3 Answers 3

1

At the moment DMD has no AVX intrinsics. Considering that all D compilers use the DMD frontend, and the druntime and phobos, I would say that the only way to do what you want is to use the in-line assembly as suggested by BCS.

I would advise you to check from time to time the core.simd module and see if AVX intrinsics are added.

0
1

There is inline ASM. I think DMD supports the SIMD instructions. Not sure what the story for LDC is.

3
  • Inline ASM is totally impracticable because of register allocation by hand.
    – elmattic
    Commented Dec 23, 2012 at 0:30
  • If you don't want asm, then what are you wanting for 'explicit'? Something that's assured to use them? I assume you've checked the intrinsics list? All that's left is the compiler promising to use them on array operations.
    – BCS
    Commented Dec 23, 2012 at 5:24
  • By explicit I mean using intrinsics like _mm256_load_ps and declaring __m256 variables, etc as you do with gcc or clang. Thank you anyway.
    – elmattic
    Commented Dec 23, 2012 at 10:30
1

With LDC, module ldc.gccbuiltins_x86 contains GCC-style builtins like __builtin_ia32_vfnmaddps256.

(there is also ldc.gccbuiltins_arm, and ldc.gccbuiltins_ppc, ...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.