[libc-commits] [libc] [libc] Check if arm targets support FPSCR in FEnvImpl.h. (PR #72158)

via libc-commits libc-commits at lists.llvm.org
Mon Nov 13 12:48:49 PST 2023


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/72158

https://github.com/llvm/llvm-project/issues/72157

>From 5cb960cd149ddf9454e5d67dec2e4f7873702362 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Mon, 13 Nov 2023 15:42:08 -0500
Subject: [PATCH] [libc] Check if arm targets support FPSCR in FEnvImpl.h.

---
 libc/src/__support/FPUtil/FEnvImpl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/FPUtil/FEnvImpl.h b/libc/src/__support/FPUtil/FEnvImpl.h
index 6f2f3c75f512a3e..12f8a66508111fd 100644
--- a/libc/src/__support/FPUtil/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/FEnvImpl.h
@@ -28,7 +28,7 @@
 // the apple condition here should be removed.
 #elif defined(LIBC_TARGET_ARCH_IS_X86) && !defined(__APPLE__)
 #include "x86_64/FEnvImpl.h"
-#elif defined(LIBC_TARGET_ARCH_IS_ARM)
+#elif defined(LIBC_TARGET_ARCH_IS_ARM) && __has_builtin(__builtin_arm_get_fpscr)
 #include "arm/FEnvImpl.h"
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "riscv/FEnvImpl.h"



More information about the libc-commits mailing list