core.simd

Builtin SIMD intrinsics

Source:


License:
Boost License 1.0.

Authors:
,

template Vector(T)
Create a vector type.

Parameters:
T = one of double[2], float[4], void[16], byte[16], ubyte[16], short[8], ushort[8], int[4], uint[4], long[2], ulong[2]. For 256 bit vectors, one of double[4], float[8], void[32], byte[32], ubyte[32], short[16], ushort[16], int[8], uint[8], long[4], ulong[4]

alias __vector(void[16LU]) void16;


alias __vector(double[2LU]) double2;


alias __vector(float[4LU]) float4;


alias __vector(byte[16LU]) byte16;


alias __vector(ubyte[16LU]) ubyte16;


alias __vector(short[8LU]) short8;


alias __vector(ushort[8LU]) ushort8;


alias __vector(int[4LU]) int4;


alias __vector(uint[4LU]) uint4;


alias __vector(long[2LU]) long2;


alias __vector(ulong[2LU]) ulong2;


alias __vector(void[32LU]) void32;


alias __vector(double[4LU]) double4;


alias __vector(float[8LU]) float8;


alias __vector(byte[32LU]) byte32;


alias __vector(ubyte[32LU]) ubyte32;


alias __vector(short[16LU]) short16;


alias __vector(ushort[16LU]) ushort16;


alias __vector(int[8LU]) int8;


alias __vector(uint[8LU]) uint8;


alias __vector(long[4LU]) long4;


alias __vector(ulong[4LU]) ulong4;


enum XMM;
XMM opcodes that conform to the following:

opcode xmm1,xmm2/mem

and do not have side effects (i.e. do not write to memory).

pure nothrow @safe void16 __simd(XMM opcode, void16 op1, void16 op2);
Generate two operand instruction with XMM 128 bit operands.

This is a compiler magic function - it doesn't behave like regular D functions.

Parameters:
opcode any of the XMM opcodes; it must be a compile time constant op1 first operand op2 second operand

Returns:
result of opcode

pure nothrow @safe void16 __simd(XMM opcode, void16 op1);
Unary SIMD instructions.

pure nothrow @safe void16 __simd(XMM opcode, double d);


pure nothrow @safe void16 __simd(XMM opcode, float f);


pure nothrow @safe void16 __simd(XMM opcode, void16 op1, void16 op2, ubyte imm8);
For instructions: CMPPD, CMPSS, CMPSD, CMPPS, PSHUFD, PSHUFHW, PSHUFLW, BLENDPD, BLENDPS, DPPD, DPPS, MPSADBW, PBLENDW, ROUNDPD, ROUNDPS, ROUNDSD, ROUNDSS

Parameters:
opcode any of the above XMM opcodes; it must be a compile time constant op1 first operand op2 second operand imm8 third operand; must be a compile time constant

Returns:
result of opcode

pure nothrow @safe void16 __simd_ib(XMM opcode, void16 op1, ubyte imm8);
For instructions with the imm8 version: PSLLD, PSLLQ, PSLLW, PSRAD, PSRAW, PSRLD, PSRLQ, PSRLW, PSRLDQ, PSLLDQ

Parameters:
opcode any of the XMM opcodes; it must be a compile time constant op1 first operand imm8 second operand; must be a compile time constant

Returns:
result of opcode

pure nothrow @safe void16 __simd_sto(XMM opcode, void16 op1, void16 op2);
For "store" operations of the form: op1 op= op2

Returns:
op2 These cannot be market as pure, as semantic() doesn't check them.

pure nothrow @safe void16 __simd_sto(XMM opcode, double op1, void16 op2);


pure nothrow @safe void16 __simd_sto(XMM opcode, float op1, void16 op2);



Page generated by Ddoc. Copyright Digital Mars 2012.