From f6486a1bbe7714850980b9669d44ef8dec343a2a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 13 Dec 2017 00:53:34 -0800 Subject: arm,sparc,x86,base,cpu,sim: Replace the Twin(32|64)_t types with. Replace them with std::array<>s. Change-Id: I76624c87a1cd9b21c386a96147a18de92b8a8a34 Reviewed-on: https://gem5-review.googlesource.com/6602 Maintainer: Gabe Black Reviewed-by: Andreas Sandberg Reviewed-by: Jason Lowe-Power --- src/sim/byteswap.hh | 17 ----------------- src/sim/insttracer.hh | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 21 deletions(-) (limited to 'src/sim') diff --git a/src/sim/byteswap.hh b/src/sim/byteswap.hh index 02a053308..2c3517f24 100644 --- a/src/sim/byteswap.hh +++ b/src/sim/byteswap.hh @@ -37,7 +37,6 @@ #ifndef __SIM_BYTE_SWAP_HH__ #define __SIM_BYTE_SWAP_HH__ -#include "base/bigint.hh" #include "base/types.hh" // This lets us figure out what the byte order of the host system is @@ -123,22 +122,6 @@ inline T swap_byte(T x) { panic("Can't byte-swap values larger than 64 bits"); } -template<> -inline Twin64_t swap_byte(Twin64_t x) -{ - x.a = swap_byte(x.a); - x.b = swap_byte(x.b); - return x; -} - -template<> -inline Twin32_t swap_byte(Twin32_t x) -{ - x.a = swap_byte(x.a); - x.b = swap_byte(x.b); - return x; -} - template inline std::array swap_byte(std::array a) diff --git a/src/sim/insttracer.hh b/src/sim/insttracer.hh index caeee520d..d57f5a04d 100644 --- a/src/sim/insttracer.hh +++ b/src/sim/insttracer.hh @@ -44,7 +44,6 @@ #ifndef __INSTRECORD_HH__ #define __INSTRECORD_HH__ -#include "base/bigint.hh" #include "base/types.hh" #include "cpu/inst_seq.hh" #include "cpu/static_inst.hh" @@ -113,7 +112,7 @@ class InstRecord /** @ingroup data * What size of data was written? */ - enum { + enum DataStatus { DataInvalid = 0, DataInt8 = 1, // set to equal number of bytes DataInt16 = 2, @@ -159,8 +158,17 @@ class InstRecord addr = a; size = s; flags = f; mem_valid = true; } - void setData(Twin64_t d) { data.as_int = d.a; data_status = DataInt64; } - void setData(Twin32_t d) { data.as_int = d.a; data_status = DataInt32; } + template + void + setData(std::array d) + { + data.as_int = d[0]; + data_status = (DataStatus)sizeof(T); + static_assert(sizeof(T) == DataInt8 || sizeof(T) == DataInt16 || + sizeof(T) == DataInt32 || sizeof(T) == DataInt64, + "Type T has an unrecognized size."); + } + void setData(uint64_t d) { data.as_int = d; data_status = DataInt64; } void setData(uint32_t d) { data.as_int = d; data_status = DataInt32; } void setData(uint16_t d) { data.as_int = d; data_status = DataInt16; } -- cgit v1.2.3