[clang] [Clang] Remove NetBSD workaround for FP eval method with older versions (PR #74025)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 18:00:16 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-x86

Author: Brad Smith (brad0)

<details>
<summary>Changes</summary>

NetBSD 7.x is long EoL. Make 8.x the minimum.

---
Full diff: https://github.com/llvm/llvm-project/pull/74025.diff


2 Files Affected:

- (modified) clang/lib/Basic/Targets/X86.h (-9) 
- (modified) clang/test/CodeGen/X86/fp-eval-method.c (+1-4) 


``````````diff
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 99a64501d263ce4..f03edccf7a13c57 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -507,15 +507,6 @@ class LLVM_LIBRARY_VISIBILITY NetBSDI386TargetInfo
 public:
   NetBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
       : NetBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
-
-  LangOptions::FPEvalMethodKind getFPEvalMethod() const override {
-    VersionTuple OsVersion = getTriple().getOSVersion();
-    // New NetBSD uses the default rounding mode.
-    if (OsVersion >= VersionTuple(6, 99, 26) || OsVersion.getMajor() == 0)
-      return X86_32TargetInfo::getFPEvalMethod();
-    // NetBSD before 6.99.26 defaults to "double" rounding.
-    return LangOptions::FPEvalMethodKind::FEM_Double;
-  }
 };
 
 class LLVM_LIBRARY_VISIBILITY OpenBSDI386TargetInfo
diff --git a/clang/test/CodeGen/X86/fp-eval-method.c b/clang/test/CodeGen/X86/fp-eval-method.c
index d74f88b9fe255a1..c1d8f617400d517 100644
--- a/clang/test/CodeGen/X86/fp-eval-method.c
+++ b/clang/test/CodeGen/X86/fp-eval-method.c
@@ -1,7 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-netbsd6 -emit-llvm -o - %s \
-// RUN: | FileCheck %s -check-prefixes=CHECK
-
-// RUN: %clang_cc1 -triple i386-unknown-netbsd7 -emit-llvm -o - %s \
+// RUN: %clang_cc1 -triple i386-unknown-netbsd -emit-llvm -o - %s \
 // RUN: | FileCheck %s -check-prefixes=CHECK-EXT
 
 // RUN: %clang_cc1 -triple i386--linux -emit-llvm -o - %s \

``````````

</details>


https://github.com/llvm/llvm-project/pull/74025


More information about the cfe-commits mailing list