Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/44065 )

Change subject: Revert "arch-arm: Use src/base/fenv.hh instead of raw fenv.h."
......................................................................

Revert "arch-arm: Use src/base/fenv.hh instead of raw fenv.h."

This reverts commit 8ff1dd9c9bcaf06f231f17c6427a017adf6d5c16.

Reason for revert: gerrit allowed rebasing this out of the original order, but it doesn't build without another uncommitted change going in first.

Change-Id: I678a22154b539691a962b4a686333cacf98731de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44065
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/arm/isa/includes.isa
M src/arch/arm/isa/insts/fp.isa
2 files changed, 11 insertions(+), 14 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/arm/isa/includes.isa b/src/arch/arm/isa/includes.isa
index a09655b..16d4c1c 100644
--- a/src/arch/arm/isa/includes.isa
+++ b/src/arch/arm/isa/includes.isa
@@ -108,12 +108,17 @@
 #include "arch/generic/memhelpers.hh"
 #include "base/condcodes.hh"
 #include "base/crc.hh"
-#include "base/fenv.hh"
 #include "cpu/base.hh"
+#include "sim/pseudo_inst.hh"
+
+#if defined(linux)
+#include <fenv.h>
+
+#endif
+
 #include "debug/Arm.hh"
 #include "mem/packet.hh"
 #include "mem/packet_access.hh"
-#include "sim/pseudo_inst.hh"
 #include "sim/sim_exit.hh"

 using namespace ArmISA;
diff --git a/src/arch/arm/isa/insts/fp.isa b/src/arch/arm/isa/insts/fp.isa
index a32b396..07be0e1 100644
--- a/src/arch/arm/isa/insts/fp.isa
+++ b/src/arch/arm/isa/insts/fp.isa
@@ -1106,13 +1106,11 @@
         FPSCR fpscr = (FPSCR) FpscrExc;
         vfpFlushToZero(fpscr, FpOp1);
         VfpSavedState state = prepFpState(fpscr.rMode);
-        Gem5::RoundingMode old_rm = Gem5::getFpRound();
-        Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
+        fesetround(FeRoundZero);
         __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
         FpDest_uw = vfpFpToFixed<float>(
             FpOp1, false, 32, 0, true, {round_mode});
         __asm__ __volatile__("" :: "m" (FpDest_uw));
-        Gem5::setFpRound(old_rm);
         finishVfp(fpscr, state, fpscr.fz);
         FpscrExc = fpscr;
     '''
@@ -1124,13 +1122,11 @@
         double cOp1 = dbl(FpOp1P0_uw, FpOp1P1_uw);
         vfpFlushToZero(fpscr, cOp1);
         VfpSavedState state = prepFpState(fpscr.rMode);
-        Gem5::RoundingMode old_rm = Gem5::getFpRound();
-        Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
+        fesetround(FeRoundZero);
         __asm__ __volatile__("" : "=m" (cOp1) : "m" (cOp1));
         uint64_t result = vfpFpToFixed<double>(
             cOp1, false, 32, 0, true, {round_mode});
         __asm__ __volatile__("" :: "m" (result));
-        Gem5::setFpRound(old_rm);
         finishVfp(fpscr, state, fpscr.fz);
         FpDestP0_uw = result;
         FpscrExc = fpscr;
@@ -1142,13 +1138,11 @@
         FPSCR fpscr = (FPSCR) FpscrExc;
         vfpFlushToZero(fpscr, FpOp1);
         VfpSavedState state = prepFpState(fpscr.rMode);
-        Gem5::RoundingMode old_rm = Gem5::getFpRound();
-        Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
+        fesetround(FeRoundZero);
         __asm__ __volatile__("" : "=m" (FpOp1) : "m" (FpOp1));
         FpDest_sw = vfpFpToFixed<float>(
             FpOp1, true, 32, 0, true, {round_mode});
         __asm__ __volatile__("" :: "m" (FpDest_sw));
-        Gem5::setFpRound(old_rm);
         finishVfp(fpscr, state, fpscr.fz);
         FpscrExc = fpscr;
     '''
@@ -1160,13 +1154,11 @@
         double cOp1 = dbl(FpOp1P0_uw, FpOp1P1_uw);
         vfpFlushToZero(fpscr, cOp1);
         VfpSavedState state = prepFpState(fpscr.rMode);
-        Gem5::RoundingMode old_rm = Gem5::getFpRound();
-        Gem5::setFpRound(Gem5::RoundingMode::TowardZero);
+        fesetround(FeRoundZero);
         __asm__ __volatile__("" : "=m" (cOp1) : "m" (cOp1));
         int64_t result = vfpFpToFixed<double>(
             cOp1, true, 32, 0, true, {round_mode});
         __asm__ __volatile__("" :: "m" (result));
-        Gem5::setFpRound(old_rm);
         finishVfp(fpscr, state, fpscr.fz);
         FpDestP0_uw = result;
         FpscrExc = fpscr;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44065
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I678a22154b539691a962b4a686333cacf98731de
Gerrit-Change-Number: 44065
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to