From d40f0bc579fb8b10da7181d3a144cd3e9a0a0e59 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 29 Oct 2019 18:56:27 -0700 Subject: arch: Get rid of the (Big|Little)EndianGuest namespaces. These namespaces were used to set up an environment/context where there was an implicit guest namespace. This is an issue when there may be multiple guest endiannesses which might be different. In cases where we don't know what the guest endianness is, we can't rely on it being an implicit part of our context since that would be ambiguous. In cases where we do know, for instance in ISA specific code, we can just use the endianness specific version that's appropriate for that context. This also (somewhat) removes the assumption that there is a single endianness that applies for a particular ISA. Practically speaking this assumption will probably still stand though, since there would likely be a non-trivial performance penalty to apply a configurable endianness instead of a fixed one the compiler can optomize/remove. Change-Id: I2dff338b58726d724f387388efe32d9233885680 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22374 Reviewed-by: Jason Lowe-Power Reviewed-by: Giacomo Travaglini Maintainer: Gabe Black Tested-by: kokoro --- src/sim/byteswap.hh | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/sim') diff --git a/src/sim/byteswap.hh b/src/sim/byteswap.hh index 0b41c6779..6745e0060 100644 --- a/src/sim/byteswap.hh +++ b/src/sim/byteswap.hh @@ -169,37 +169,4 @@ inline T gtoh(T value, ByteOrder guest_byte_order) betoh(value) : letoh(value); } -namespace BigEndianGuest -{ - const ByteOrder GuestByteOrder = BigEndianByteOrder; - template - inline T gtole(T value) {return betole(value);} - template - inline T letog(T value) {return letobe(value);} - template - inline T gtobe(T value) {return value;} - template - inline T betog(T value) {return value;} - template - inline T htog(T value) {return htobe(value);} - template - inline T gtoh(T value) {return betoh(value);} -} - -namespace LittleEndianGuest -{ - const ByteOrder GuestByteOrder = LittleEndianByteOrder; - template - inline T gtole(T value) {return value;} - template - inline T letog(T value) {return value;} - template - inline T gtobe(T value) {return letobe(value);} - template - inline T betog(T value) {return betole(value);} - template - inline T htog(T value) {return htole(value);} - template - inline T gtoh(T value) {return letoh(value);} -} #endif // __SIM_BYTE_SWAP_HH__ -- cgit v1.2.3