core.simd 3 operand instructions?
jerro
a at a.com
Thu Sep 6 22:56:42 PDT 2012
On Thursday, 6 September 2012 at 19:21:22 UTC, Benjamin Thaut
wrote:
> Looking at core.simd I noticed that all simd instructions that
> take 3 operands (usually two operands and some kind of constant
> third value), are commented out for the opcodes. Most likely
> because __simd() does not have a 4th parameter which could be
> used to pass in the additional value for some of the opcodes.
>
> Are there plans to fix this? Because for example the shuffle
> instructions are pretty important (try doing a cross product
> without simd shuffle instructions...)
>
> Kind Regards
> Benjamin Thaut
I can't answer your question, but if you are using GDC, you could
use gcc builtins . They have the same names as in GCC - take a
look at *mmintrin.h files to find out SSE builtin names). For
LDC, you could use pragma
intrinsic(http://www.dsource.org/projects/ldc/wiki/Docs) and
pragma shufflevector. You declare function that you want to
compile to llvm shufflevector instruction like this:
pragma(shufflevector)
float4 shufflevector(float4, float4, int, int, int, int);
Then shufflevector() is used in the same way as Clang's
__builtin_shufflevector
(http://clang.llvm.org/docs/LanguageExtensions.html#__builtin_shufflevector)
More information about the Digitalmars-d
mailing list