Skip to content

Commit 23f3651

Browse files
authored
[libc] Remove workaround for fmin / fmax after being fixed in LLVM (#83421)
Summary: These hacks can be removed now that #83376 fixed the underlying problem.
1 parent 4d525f2 commit 23f3651

File tree

8 files changed

+0
-44
lines changed

8 files changed

+0
-44
lines changed

libc/src/math/amdgpu/fmax.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
namespace LIBC_NAMESPACE {
1616

1717
LLVM_LIBC_FUNCTION(double, fmax, (double x, double y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<double>(cpp::bit_cast<uint64_t>(x) &
21-
cpp::bit_cast<uint64_t>(y));
2218
return __builtin_fmax(x, y);
2319
}
2420

libc/src/math/amdgpu/fmaxf.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88

99
#include "src/math/fmaxf.h"
1010

11-
#include "src/__support/CPP/bit.h"
1211
#include "src/__support/common.h"
13-
#include "src/__support/macros/optimization.h"
1412

1513
namespace LIBC_NAMESPACE {
1614

1715
LLVM_LIBC_FUNCTION(float, fmaxf, (float x, float y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<float>(cpp::bit_cast<uint32_t>(x) &
21-
cpp::bit_cast<uint32_t>(y));
2216
return __builtin_fmaxf(x, y);
2317
}
2418

libc/src/math/amdgpu/fmin.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88

99
#include "src/math/fmin.h"
1010

11-
#include "src/__support/CPP/bit.h"
1211
#include "src/__support/common.h"
13-
#include "src/__support/macros/optimization.h"
1412

1513
namespace LIBC_NAMESPACE {
1614

1715
LLVM_LIBC_FUNCTION(double, fmin, (double x, double y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<double>(cpp::bit_cast<uint64_t>(x) |
21-
cpp::bit_cast<uint64_t>(y));
2216
return __builtin_fmin(x, y);
2317
}
2418

libc/src/math/amdgpu/fminf.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88

99
#include "src/math/fminf.h"
1010

11-
#include "src/__support/CPP/bit.h"
1211
#include "src/__support/common.h"
13-
#include "src/__support/macros/optimization.h"
1412

1513
namespace LIBC_NAMESPACE {
1614

1715
LLVM_LIBC_FUNCTION(float, fminf, (float x, float y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<float>(cpp::bit_cast<uint32_t>(x) |
21-
cpp::bit_cast<uint32_t>(y));
2216
return __builtin_fminf(x, y);
2317
}
2418

libc/src/math/nvptx/fmax.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88

99
#include "src/math/fmax.h"
1010

11-
#include "src/__support/CPP/bit.h"
1211
#include "src/__support/common.h"
13-
#include "src/__support/macros/optimization.h"
1412

1513
namespace LIBC_NAMESPACE {
1614

1715
LLVM_LIBC_FUNCTION(double, fmax, (double x, double y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<double>(cpp::bit_cast<uint64_t>(x) &
21-
cpp::bit_cast<uint64_t>(y));
2216
return __builtin_fmax(x, y);
2317
}
2418

libc/src/math/nvptx/fmaxf.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
namespace LIBC_NAMESPACE {
1616

1717
LLVM_LIBC_FUNCTION(float, fmaxf, (float x, float y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<float>(cpp::bit_cast<uint32_t>(x) &
21-
cpp::bit_cast<uint32_t>(y));
2218
return __builtin_fmaxf(x, y);
2319
}
2420

libc/src/math/nvptx/fmin.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88

99
#include "src/math/fmin.h"
1010

11-
#include "src/__support/CPP/bit.h"
1211
#include "src/__support/common.h"
13-
#include "src/__support/macros/optimization.h"
1412

1513
namespace LIBC_NAMESPACE {
1614

1715
LLVM_LIBC_FUNCTION(double, fmin, (double x, double y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<double>(cpp::bit_cast<uint64_t>(x) |
21-
cpp::bit_cast<uint64_t>(y));
2216
return __builtin_fmin(x, y);
2317
}
2418

libc/src/math/nvptx/fminf.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88

99
#include "src/math/fminf.h"
1010

11-
#include "src/__support/CPP/bit.h"
1211
#include "src/__support/common.h"
13-
#include "src/__support/macros/optimization.h"
1412

1513
namespace LIBC_NAMESPACE {
1614

1715
LLVM_LIBC_FUNCTION(float, fminf, (float x, float y)) {
18-
// FIXME: The builtin function does not correctly handle the +/-0.0 case.
19-
if (LIBC_UNLIKELY(x == y))
20-
return cpp::bit_cast<float>(cpp::bit_cast<uint32_t>(x) |
21-
cpp::bit_cast<uint32_t>(y));
2216
return __builtin_fminf(x, y);
2317
}
2418

0 commit comments

Comments
 (0)