Why are SIMD instructions not used in the kernel?

I could not find much use of SIMD instructions (for example, SSE / AVX) in the kernel (except for one place where they were used to speed up RAID6 parity calculation).

Q1) Any specific reason for this, or simply lack of precedent?

Q2) What should I do today if I want to use a SIMD instruction, for example, a device driver?

Q3) How difficult will it be to include the framework as an ISPC in the kernel (only for experiments)?

+4
source share
1 answer

Saving / restoring FPUs (including SIMD register registers) is more expensive than just the integer state of the GP register. It is simply not worth the cost in most cases.

Linux , , kernel_fpu_begin()/kernel_fpu_end() . , RAID. . http://yarchive.net/comp/linux/kernel_fp.html.


x86 / . ( / xmm SSE, SSE/AVX SSE/AVX Intel, ymm/zmm ).

SSE , Windows , Intel AVX, , SSE 128b ymm. ( . .) , Windows- SSE/AVX .

IDK , x86, SIMD / , . ARM32 , 32- FP . (, q2 s8 s11.) , / q , 256- NEON 2 q 256b . .

+5

Source: https://habr.com/ru/post/1687265/


All Articles