Author: hev
Date: 2026-01-19T16:21:36+08:00
New Revision: 671f3bc8cdcfe62b1f76426b42a53ba8fa47aebb

URL: 
https://github.com/llvm/llvm-project/commit/671f3bc8cdcfe62b1f76426b42a53ba8fa47aebb
DIFF: 
https://github.com/llvm/llvm-project/commit/671f3bc8cdcfe62b1f76426b42a53ba8fa47aebb.diff

LOG: [clang][LoongArch] Guard FCSR intrinsics with __loongarch_hard_float 
(#176545)

Link:
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/703313.html

Added: 
    

Modified: 
    clang/lib/Headers/larchintrin.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/larchintrin.h b/clang/lib/Headers/larchintrin.h
index a1247d12e21f8..3f0fab2b570e0 100644
--- a/clang/lib/Headers/larchintrin.h
+++ b/clang/lib/Headers/larchintrin.h
@@ -120,10 +120,12 @@ extern __inline int
 
 #define __ibar(/*ui15*/ _1) __builtin_loongarch_ibar((_1))
 
+#ifdef __loongarch_hard_float
 #define __movfcsr2gr(/*ui5*/ _1) __builtin_loongarch_movfcsr2gr((_1));
 
 #define __movgr2fcsr(/*ui5*/ _1, _2)                                           
\
   __builtin_loongarch_movgr2fcsr((_1), (unsigned int)_2);
+#endif
 
 #define __syscall(/*ui15*/ _1) __builtin_loongarch_syscall((_1))
 


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to