3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-12 02:05:54 +00:00

22 lines
456 B
C

#ifndef _COMPAT_ASM_SIMD_H
#define _COMPAT_ASM_SIMD_H
#if defined(CONFIG_X86_64)
#include <asm/fpu/api.h>
#endif
static __must_check inline bool may_use_simd(void)
{
#if defined(CONFIG_X86_64)
return irq_fpu_usable();
#elif defined(CONFIG_ARM64) && defined(CONFIG_KERNEL_MODE_NEON)
return true;
#elif defined(CONFIG_ARM) && defined(CONFIG_KERNEL_MODE_NEON)
return !in_nmi() && !in_irq() && !in_serving_softirq();
#else
return false;
#endif
}
#endif