Skip to content

[Clang] Remove NetBSD/i386 workaround for FP eval method with older versions #74025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Dec 1, 2023

NetBSD 6.x is long EoL. Make 7.x the minimum and even that is EoL.

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Dec 1, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 1, 2023

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-x86

Author: Brad Smith (brad0)

Changes

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 --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 \

@brad0 brad0 force-pushed the clang_targets_netbsd_i386 branch from 90064d3 to 00b44ae Compare December 1, 2023 02:06
@brad0 brad0 changed the title [Clang] Remove NetBSD workaround for FP eval method with older versions [Clang] Remove NetBSD/i386 workaround for FP eval method with older versions Dec 1, 2023
@RKSimon
Copy link
Collaborator

RKSimon commented Dec 1, 2023

This should be documented in the release notes in case somebody was still building for such an old netbsd. Should we emit any compile warnings/errors when building for this triple?

@brad0 brad0 force-pushed the clang_targets_netbsd_i386 branch 2 times, most recently from 68942fe to 70c105a Compare December 2, 2023 05:21
@brad0 brad0 requested a review from mgorny December 2, 2023 13:02
Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM but please add a note to the release notes, as was requested.

@brad0 brad0 force-pushed the clang_targets_netbsd_i386 branch from 70c105a to bfee80b Compare July 22, 2024 06:18
…ersions

NetBSD 6.x is long EoL. Make 7.x the minimum and even that is EoL.
@brad0 brad0 force-pushed the clang_targets_netbsd_i386 branch from bfee80b to efc4bab Compare July 22, 2024 10:43
@brad0 brad0 merged commit ab1722a into llvm:main Jul 22, 2024
8 checks passed
@brad0 brad0 deleted the clang_targets_netbsd_i386 branch July 22, 2024 23:31
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
…ersions (#74025)

Summary: NetBSD 6.x is long EoL. Make 7.x the minimum and even that is EoL.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants