Disable SIMD (Extra Post) #1001
Replies: 6 comments 1 reply
-
Should this SSE be MMX? As is mentioned above,
and
|
Beta Was this translation helpful? Give feedback.
-
SSE is correct. In 64-bit mode, SSE instructions and registers are used for performing floating point operations by default. I don't know the exact reason why, but I assume that SSE allows more efficient code. |
Beta Was this translation helpful? Give feedback.
-
SSE is used by default by clang (and apparently rustc) when targeting x86_64 because being able to execute some level of SSE instruction (i think SSE2) is a requirement for x86_64 compatibility. Floating point math without SSE has severe performance issues, mostly because of a bad design of the original x87 coprocessor instruction set (which was designed when optimizations of modern cpus did not exist yet). For example, converting a floating point number to an integer without SSE (discarding the decimal part) is a slow operation that flushes pipelines and causes a lot of other bad things. |
Beta Was this translation helpful? Give feedback.
-
@pqnet Thanks for the info! We're using software implementations for floating point operations in our kernel, so I assume that it will be even slower than using the x87 coprocessor. However, the performance penalty of saving and restoring the SSE registers on each kernel entry is much higher AFAIK. |
Beta Was this translation helpful? Give feedback.
-
@phil-opp I agree with you. I can't think of any part of the kernel which would require usage of floating point math anyway, and not using SSE registers in kernel code makes system calls faster, and that affects the performance of a system as a whole a lot (which is also the reason for high half kernel design, which allows kernel memory to be always mapped in). |
Beta Was this translation helpful? Give feedback.
-
I suppose if there was a calling convention that makes these registers callee-saved, you could opt into that, instead of disabling SIMD in the kernel entirely. |
Beta Was this translation helpful? Give feedback.
-
This is a general purpose comment thread for the “Disable SIMD” extra post.
Beta Was this translation helpful? Give feedback.
All reactions