ldc-developers/ldc — pull request #177 by jerro (2012-10-03 01:54:59+00:00)
Title: Extractelement

This adds pragmas insertelement and extractelement that enable the use of [the two LLVM instructions](http://llvm.org/docs/LangRef.html#i_extractelement). Here's a usage example:

```d
import std.stdio;
import core.simd;

pragma(extractelement)
float extractelement(float4, int);

pragma(insertelement)
float4 insertelement(float4, float, int);

void main()
{
float4 v;
int a;
v = insertelement(v, 3, 0);
v = insertelement(v, 4, 1);
v = insertelement(v, 5, 2);
v = insertelement(v, 6, 3);
writeln(extractelement(v, 0)); // prints 3
writeln(extractelement(v, 1)); // prints 4
writeln(extractelement(v, 2)); // prints 5
writeln(extractelement(v, 3)); // prints 6
}
```