core.simd.simd
- multiple declarations
Function simd
Generate two operand instruction with XMM 128 bit operands.
V1 simd(XMM opcode, V1, V2)
(
V1 op1,
V2 op2
) pure @safe
if (is(V1 == __vector) && is(V2 == __vector));
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
Example
float4 a;
a = simd!(XMM .PXOR)(a, a);
Function simd
Unary SIMD instructions.
Function simd
Function simd
Example
float4 a;
a = simd!(XMM .LODSS)(a);
Function simd
For instructions: CMPPD, CMPSS, CMPSD, CMPPS, PSHUFD, PSHUFHW, PSHUFLW, BLENDPD, BLENDPS, DPPD, DPPS, MPSADBW, PBLENDW, ROUNDPD, ROUNDPS, ROUNDSD, ROUNDSS
V1 simd(XMM opcode, ubyte imm8, V1, V2)
(
V1 op1,
V2 op2
) pure @safe
if (is(V1 == __vector) && is(V2 == __vector));
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
Example
float4 a;
a = simd!(XMM .CMPPD, 0x7A)(a, a);
Function simd
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
Example
float4 a;
a = simd!(XMM .PSRLQ, 0x7A)(a);