Skip to content

Commit 0dc15c5

Browse files
committed
fix corner cases in fp32
Signed-off-by: jinge90 <[email protected]>
1 parent 427f4ca commit 0dc15c5

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

libdevice/msvc_math.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ short _FExp(float *px, float y,
193193
static const float invln2 = 1.4426950408889634073599246810018921F;
194194
short ret = 0;
195195
if (*px < -hugexp || y == 0.0F) { // certain underflow
196-
*px = 0.0F;
196+
*px = __spirv_ocl_copysign(0.0F, y);
197197
} else if (hugexp < *px) { // certain overflow
198-
*px = _FInf._Float * (y < 0.F ? -1.F : 1.F);
198+
*px = __spirv_ocl_copysign(_FInf._Float, y);
199199
ret = _INFCODE;
200200
} else { // xexp won't overflow
201201
float g = *px * invln2;

sycl/test-e2e/DeviceLib/exp/exp-std-complex-edge-cases.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,8 @@ template <typename T> bool test() {
290290
} else if (std::isfinite(testcases[i].imag()) &&
291291
std::abs(testcases[i].imag()) <= 1) {
292292
CHECK(!std::signbit(r.real()), passed, i);
293-
// TODO: This case fails on win. Need to investigate and remove this macro
294-
// check.
295-
// CMPLRLLVM-62905
296-
#ifndef _WIN32
297293
CHECK(std::signbit(r.imag()) == std::signbit(testcases[i].imag()),
298294
passed, i);
299-
#endif
300295
// Those tests were taken from oneDPL, not sure what is the corner case
301296
// they are covering here
302297
} else if (std::isinf(r.real()) && testcases[i].imag() == 0) {

0 commit comments

Comments
 (0)