を使用するいくつかの C# コードを実行していますSystem.Numerics.Vector<T>
が、私が知る限り、SIMD 組み込み関数の利点を十分に活用できていません。Visual Studio Community 2015 と Update 1 を使用しています。私の clrjit.dll は v4.6.1063.1 です。
AVX 命令セット拡張を実装するIntel Core i5-3337U Processorで実行しています。したがって、256 ビット レジスタでほとんどの SIMD 命令を実行できるはずです。たとえば、逆アセンブリには、、、、などの命令が含まれている必要があり、8vmovups
を返す必要があり、4 になる必要があります...しかし、それは私が見ているものではありません。vmovupd
vaddups
Vector<float>.Count
Vector<double>.Count
代わりに、私の逆アセンブリには、、、などの命令と次のコードが含まれていmovups
ます。movupd
addups
WriteLine($"{Vector<byte>.Count} bytes per operation");
WriteLine($"{Vector<float>.Count} floats per operation");
WriteLine($"{Vector<int>.Count} ints per operation");
WriteLine($"{Vector<double>.Count} doubles per operation");
プロデュース:
16 bytes per operation
4 floats per operation
4 ints per operation
2 doubles per operation
どこが間違っていますか?すべてのプロジェクト設定などを確認するには、プロジェクトをここで入手できます。