26 Aralık 2019 Perşembe

Streaming SIMD Extensions 2 (SSE2) FPU

Giriş
Açıklaması şöyle. SSE2 FPU, geçici sonuçları da 32 veya 64 bit olarak saklar.
If you have SSE2, use it and live happily ever after. SSE2 supports both 32b and 64b operations and the intermediate results are of the size of the operands. BTW, mixed expressions like a+b where a is float and b is double don't create consistency problems on any platform because the C standard specifies the rules for promotion precisely and portably (a will be promoted to double). The gcc way of using SSE2 for FP is -mfpmath=sse -msse2.
C# kullanırken Platform = AnyCPU seçilir ve makinemiz 64 bit ise, SSE2 FPU kullanılır. Açıklaması şöyle.
Intel didn't make the same mistake when they designed the SSE instruction set. The XMM registers are freely addressable and don't store extra bits. If you want consistent results then compiling with the AnyCPU target, and a 64-bit operating system, is the quick solution. The x64 jitter uses SSE instead of FPU instructions for floating point math.
Vector API
Açıklaması şöyle
All modern processors have single instruction, multiple data (SIMD) capabilities.  Multiple elements of an array can be loaded into very wide registers, such as the 512-bit AVX-512 on specific Intel processors.  For example, a single operation, adding 10 to each value, can be performed in a single machine instruction cycle, significantly improving the performance of numerically intensive code.

Hiç yorum yok:

Yorum Gönder