From 48f50e057c3d5cf03a9aa279fadf21862336a338 Mon Sep 17 00:00:00 2001 From: Nicolas Roussel Date: Tue, 2 May 2023 13:14:24 +0200 Subject: [PATCH] Disable LLVM backend when the FMA3 instruction set is unavailable --- src/llvm_core.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/llvm_core.cpp b/src/llvm_core.cpp index 8aecb7ae..18dcf956 100644 --- a/src/llvm_core.cpp +++ b/src/llvm_core.cpp @@ -103,6 +103,14 @@ bool jitc_llvm_init() { } } + if (!strstr(jitc_llvm_target_features, "+fma")) { + jitc_log(Warn, "jit_llvm_init(): your CPU does not support the `fma` " + "instruction set, shutting down the LLVM " + "backend..."); + jitc_llvm_shutdown(); + return false; + } + jitc_llvm_vector_width = 1; if (strstr(jitc_llvm_target_features, "+sse4.2"))