diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2023-05-03 11:49:56 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2023-05-03 11:51:42 -0500 |
commit | 9e6946c2522a3ddc9157b48a9a8b4050c19450f5 (patch) | |
tree | de57e49cd529d2e4dd390377bca5c642c2bc0fad /libc/test | |
parent | 1cef77de1204c9d3e94c1f331d95476fc1413047 (diff) | |
download | llvm-9e6946c2522a3ddc9157b48a9a8b4050c19450f5.tar.gz |
[libc] Revert rounding mode changes for hermetic tests
We got rid of the rounding mode here so that the hermetic tests wouldn't
depend on the system fenv.h. But this seemed to cause some bots to
break. Getting rid of this change for now, it should be fine for the CPU
builds.
Differential Revision: https://reviews.llvm.org/D149767
Diffstat (limited to 'libc/test')
-rw-r--r-- | libc/test/UnitTest/RoundingModeUtils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/test/UnitTest/RoundingModeUtils.cpp b/libc/test/UnitTest/RoundingModeUtils.cpp index e2fde1d03de8..8cc6834d89ed 100644 --- a/libc/test/UnitTest/RoundingModeUtils.cpp +++ b/libc/test/UnitTest/RoundingModeUtils.cpp @@ -8,7 +8,7 @@ #include "RoundingModeUtils.h" -#include "src/__support/FPUtil/FEnvImpl.h" +#include <fenv.h> namespace __llvm_libc { namespace fputil { @@ -34,15 +34,15 @@ int get_fe_rounding(RoundingMode mode) { } ForceRoundingMode::ForceRoundingMode(RoundingMode mode) { - old_rounding_mode = fputil::get_round(); + old_rounding_mode = fegetround(); rounding_mode = get_fe_rounding(mode); if (old_rounding_mode != rounding_mode) - fputil::set_round(rounding_mode); + fesetround(rounding_mode); } ForceRoundingMode::~ForceRoundingMode() { if (old_rounding_mode != rounding_mode) - fputil::set_round(old_rounding_mode); + fesetround(old_rounding_mode); } } // namespace testing |