Skip to content

Commit 5b9cd16

Browse files
Partially revert fa7cd54.
The guessing of whether or not FTZ/DAZ mode would be enabled is insufficiently accurate.
1 parent d96c5ee commit 5b9cd16

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -842,25 +842,6 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList &Args,
842842
ToolChain::addProfileRTLibs(Args, CmdArgs);
843843
}
844844

845-
llvm::DenormalMode
846-
Linux::getDefaultDenormalModeForType(const llvm::opt::ArgList &DriverArgs,
847-
const JobAction &JA,
848-
const llvm::fltSemantics *FPType) const {
849-
switch (getTriple().getArch()) {
850-
case llvm::Triple::x86:
851-
case llvm::Triple::x86_64: {
852-
std::string Unused;
853-
// DAZ and FTZ are turned on in crtfastmath.o
854-
if (!DriverArgs.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles) &&
855-
isFastMathRuntimeAvailable(DriverArgs, Unused))
856-
return llvm::DenormalMode::getPreserveSign();
857-
return llvm::DenormalMode::getIEEE();
858-
}
859-
default:
860-
return llvm::DenormalMode::getIEEE();
861-
}
862-
}
863-
864845
void Linux::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {
865846
for (const auto &Opt : ExtraOpts)
866847
CmdArgs.push_back(Opt.c_str());

clang/lib/Driver/ToolChains/Linux.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF {
5959

6060
std::vector<std::string> ExtraOpts;
6161

62-
llvm::DenormalMode getDefaultDenormalModeForType(
63-
const llvm::opt::ArgList &DriverArgs, const JobAction &JA,
64-
const llvm::fltSemantics *FPType = nullptr) const override;
65-
6662
const char *getDefaultLinker() const override;
6763

6864
protected:

clang/test/Driver/default-denormal-fp-math.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33

44
// RUN: %clang -### -target x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_linux_tree -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-IEEE %s
55

6-
// crtfastmath enables ftz and daz
7-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -ffast-math --sysroot=%S/Inputs/basic_linux_tree -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-PRESERVESIGN %s
8-
9-
// crt not linked in with nostartfiles
10-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -ffast-math -nostartfiles --sysroot=%S/Inputs/basic_linux_tree -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-IEEE %s
11-
12-
// If there's no crtfastmath, don't assume ftz/daz
13-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -ffast-math --sysroot=/dev/null -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-IEEE %s
14-
156
// RUN: %clang -### -target x86_64-scei-ps4 -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-PRESERVESIGN %s
167

178
// Flag omitted for default

0 commit comments

Comments
 (0)