Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/12616 )
Change subject: systemc: Ensure SC_LONG_64 is defined and available.
......................................................................
systemc: Ensure SC_LONG_64 is defined and available.
The datatype code was checking if SC_LONG_64 was defined to determine
if a long was 64 bits. The code that would define that value was
dropped when porting over from the Accellera implementation, and so
the wrong code was being included. This change both makes those checks
look at the *value* of SC_LONG_64 to ensure that it's not missing by
accident, and assigns it a value in sc_fxdefs.hh.
Change-Id: Ie9bb1146452a3db1d9d99c0db575098bb06463ff
Reviewed-on: https://gem5-review.googlesource.com/c/12616
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/dt/fx/scfx_rep.cc
M src/systemc/ext/dt/bit/sc_proxy.hh
M src/systemc/ext/dt/fx/sc_fxdefs.hh
M src/systemc/ext/dt/fx/scfx_utils.hh
4 files changed, 14 insertions(+), 7 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
diff --git a/src/systemc/dt/fx/scfx_rep.cc b/src/systemc/dt/fx/scfx_rep.cc
index 3d10fb3..ae19fab 100644
--- a/src/systemc/dt/fx/scfx_rep.cc
+++ b/src/systemc/dt/fx/scfx_rep.cc
@@ -147,7 +147,7 @@
a = -a;
m_sign = -1;
}
-# if defined(SC_LONG_64)
+# if SC_LONG_64
m_wp = 1;
m_mant[1] = static_cast<word>(a);
m_mant[2] = static_cast<word>(a >> bits_in_word);
@@ -171,7 +171,7 @@
m_mant.clear();
m_wp = m_msw = m_lsw = 2;
m_state = normal;
-# if defined(SC_LONG_64)
+# if SC_LONG_64
m_wp = 1;
m_mant[1] = static_cast<word>(a);
m_mant[2] = static_cast<word>(a >> bits_in_word);
@@ -1057,6 +1057,7 @@
lsb = (b.m_lsw - b.m_wp) * bits_in_word +
scfx_find_lsb(b.m_mant[b.m_lsw]);
+
}
}
diff --git a/src/systemc/ext/dt/bit/sc_proxy.hh
b/src/systemc/ext/dt/bit/sc_proxy.hh
index cf7bcbf..12e1072 100644
--- a/src/systemc/ext/dt/bit/sc_proxy.hh
+++ b/src/systemc/ext/dt/bit/sc_proxy.hh
@@ -816,7 +816,7 @@
return x;
}
-#if defined(SC_LONG_64)
+#if SC_LONG_64
template <class X>
inline X &
sc_proxy<X>::assign_(unsigned long a)
diff --git a/src/systemc/ext/dt/fx/sc_fxdefs.hh
b/src/systemc/ext/dt/fx/sc_fxdefs.hh
index 8acfabf..c72a45a 100644
--- a/src/systemc/ext/dt/fx/sc_fxdefs.hh
+++ b/src/systemc/ext/dt/fx/sc_fxdefs.hh
@@ -50,6 +50,12 @@
#include "../../utils/sc_report_handler.hh"
#include "../int/sc_nbutils.hh"
+#if ULONG_MAX > 0xffffffffUL
+# define SC_LONG_64 1
+#else
+# define SC_LONG_64 0
+#endif
+
namespace sc_dt
{
diff --git a/src/systemc/ext/dt/fx/scfx_utils.hh
b/src/systemc/ext/dt/fx/scfx_utils.hh
index 37c5784..ec186c6 100644
--- a/src/systemc/ext/dt/fx/scfx_utils.hh
+++ b/src/systemc/ext/dt/fx/scfx_utils.hh
@@ -67,9 +67,9 @@
scfx_find_msb(unsigned long x)
{
int i = 0;
-# if defined(SC_LONG_64)
+# if SC_LONG_64
MSB_STATEMENT(32);
-# endif // defined(SC_LONG_64)
+# endif // SC_LONG_64
MSB_STATEMENT(16);
MSB_STATEMENT(8);
MSB_STATEMENT(4);
@@ -86,12 +86,12 @@
scfx_find_lsb(unsigned long x)
{
int i;
-# if defined(SC_LONG_64)
+# if SC_LONG_64
i = 63;
LSB_STATEMENT(32);
# else
i = 31;
-# endif // defined(SC_LONG_64)
+# endif // SC_LONG_64
LSB_STATEMENT(16);
LSB_STATEMENT(8);
LSB_STATEMENT(4);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12616
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ie9bb1146452a3db1d9d99c0db575098bb06463ff
Gerrit-Change-Number: 12616
Gerrit-PatchSet: 7
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: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev