diff --git a/ggml.c b/ggml.c
index beb7f46..2374287 100644
--- a/ggml.c
+++ b/ggml.c
@@ -299,7 +299,7 @@ typedef double ggml_float;
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #include <intrin.h>
 #else
-#if !defined(__riscv)
+#if !defined(__riscv) && !defined(__loongarch64)
 #include <immintrin.h>
 #endif
 #endif
diff --git a/k_quants.c b/k_quants.c
index 6348fce..6816121 100644
--- a/k_quants.c
+++ b/k_quants.c
@@ -26,7 +26,7 @@
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #include <intrin.h>
 #else
-#if !defined(__riscv)
+#if !defined(__riscv) && !defined(__loongarch64)
 #include <immintrin.h>
 #endif
 #endif
