Skip to content

Commit 2250004

Browse files
committed
avoid compiler runtime's conversion functions in smoke/asinpif16_test
1 parent c680de0 commit 2250004

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

libc/test/src/math/smoke/asinpif16_test.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "src/__support/libc_errno.h"
1010
#include "src/math/asinpif16.h"
11-
#include "src/math/fabs.h"
1211
#include "test/UnitTest/FPMatcher.h"
1312

1413
using LlvmLibcAsinpif16Test = LIBC_NAMESPACE::testing::FPTest<float16>;
@@ -75,10 +74,13 @@ TEST_F(LlvmLibcAsinpif16Test, SymmetryProperty) {
7574
0.9f16, 0.99f16, 1.0f16};
7675

7776
for (float16 x : TEST_VALS) {
77+
FPBits neg_x_bits(x);
78+
neg_x_bits.set_sign(Sign::NEG);
79+
float16 neg_x = neg_x_bits.get_val();
80+
7881
float16 pos_result = LIBC_NAMESPACE::asinpif16(x);
79-
float16 neg_result = LIBC_NAMESPACE::asinpif16(-x);
82+
float16 neg_result = LIBC_NAMESPACE::asinpif16(neg_x);
8083

81-
EXPECT_FP_EQ(pos_result,
82-
static_cast<float16>(LIBC_NAMESPACE::fabs(neg_result)));
84+
EXPECT_FP_EQ(pos_result, FPBits(neg_result).abs().get_val());
8385
}
8486
}

0 commit comments

Comments
 (0)