[libc-commits] [libc] [libc][fenv] Use trivial place-holder implementation for i386 in FEnvImpl.h until it's fully supported. (PR #120253)

via libc-commits libc-commits at lists.llvm.org
Tue Dec 17 07:54:36 PST 2024


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

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


>From 0cab45533772a493bf4cb3414c8c5b36f881e080 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Tue, 17 Dec 2024 10:50:36 -0500
Subject: [PATCH] [libc][fenv] Use trivial place-holder implementation for i386
 in FEnvImpl.h until it's fully supported.

---
 libc/src/__support/FPUtil/FEnvImpl.h | 2 +-
 libc/test/UnitTest/FEnvSafeTest.cpp  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/src/__support/FPUtil/FEnvImpl.h b/libc/src/__support/FPUtil/FEnvImpl.h
index 1c5a1108ff9e0b..fc7393423df6f2 100644
--- a/libc/src/__support/FPUtil/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/FEnvImpl.h
@@ -27,7 +27,7 @@
 // The extra !defined(APPLE) condition is to cause x86_64 MacOS builds to use
 // the dummy implementations below. Once a proper x86_64 darwin fenv is set up,
 // the apple condition here should be removed.
-#elif defined(LIBC_TARGET_ARCH_IS_X86) && !defined(__APPLE__)
+#elif defined(LIBC_TARGET_ARCH_IS_X86_64) && !defined(__APPLE__)
 #include "x86_64/FEnvImpl.h"
 #elif defined(LIBC_TARGET_ARCH_IS_ARM) && defined(__ARM_FP)
 #include "arm/FEnvImpl.h"
diff --git a/libc/test/UnitTest/FEnvSafeTest.cpp b/libc/test/UnitTest/FEnvSafeTest.cpp
index 168b1d4159d8d4..03ed532774dc95 100644
--- a/libc/test/UnitTest/FEnvSafeTest.cpp
+++ b/libc/test/UnitTest/FEnvSafeTest.cpp
@@ -45,7 +45,7 @@ void FEnvSafeTest::expect_fenv_eq(const fenv_t &before_fenv,
   EXPECT_EQ(before_state.ControlWord, after_state.ControlWord);
   EXPECT_EQ(before_state.StatusWord, after_state.StatusWord);
 
-#elif defined(LIBC_TARGET_ARCH_IS_X86) && !defined(__APPLE__)
+#elif defined(LIBC_TARGET_ARCH_IS_X86_64) && !defined(__APPLE__)
   using LIBC_NAMESPACE::fputil::internal::FPState;
   const FPState &before_state = reinterpret_cast<const FPState &>(before_fenv);
   const FPState &after_state = reinterpret_cast<const FPState &>(after_fenv);



More information about the libc-commits mailing list