any of the XMM opcodes; it must be a compile time constant
first operand
second operand
result of opcode
import core.simd; import core.stdc.stdio; void main() { float4 A = [2.34f, -70000.0f, 0.00001f, 345.5f]; float4 R = A; R = cast(float4) __simd(XMM.RCPSS, R, A); printf("%g %g %g %g\n", R.array[0], R.array[1], R.array[2], R.array[3]); }
Prints 0.427368 -70000 1e-05 345.5. The use of the two operand form for XMM.RCPSS is necessary because the result of the instruction contains elements of both operands.
double[2] A = [56.0, -75.0]; double2 R = cast(double2) __simd(XMM.LODUPD, *cast(double2*)A.ptr);
The cast to double2* is necessary because the type of *A.ptr is double.
float4 a; a = cast(float4)__simd(XMM.PXOR, a, a);
Generate two operand instruction with XMM 128 bit operands.
This is a compiler magic function - it doesn't behave like regular D functions.