Add an env var to turn off use of SIMD instructions

This commit is contained in:
Kovid Goyal 2024-01-21 15:19:40 +05:30
parent eee14ae148
commit 23a4012aeb
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 0 deletions

View file

@ -230,3 +230,8 @@ Variables that kitty sets when running child programs
Set to ``1`` when kitty is running a shell because of the ``--hold`` flag. Can
be used to specialize shell behavior in the shell rc files as desired.
.. envvar:: KITTY_NO_SIMD
Set it to any value to prevent kitty from using SIMD CPU vector
instructions.

View file

@ -143,6 +143,9 @@ init_simd(void *x) {
do_check();
#endif
#endif
if (getenv("KITTY_NO_SIMD")) {
has_avx2 = false; has_sse4_2 = false;
}
#undef do_check
if (has_avx2) {