Go to the documentation of this file.
38 #ifndef __CPU_INST_RES_HH__
39 #define __CPU_INST_RES_HH__
42 #include <type_traits>
54 std::function<bool(
const std::any &
a,
const std::any &
b)>
equals;
63 return !
b.has_value();
74 if (
a.has_value() !=
b.has_value())
82 if (
a.type() !=
b.type())
85 return std::any_cast<const T&>(
a) == std::any_cast<const T&>(
b);
88 static_assert(!std::is_pointer_v<T>,
89 "InstResult shouldn't point to external data.");
92 static_assert(!std::is_floating_point_v<T>,
93 "Floating point values should be converted to/from ints.");
98 std::enable_if_t<std::is_floating_point_v<T>,
int> = 0>
102 template <
typename T,
103 std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, RegVal>,
134 template <
typename T>
138 static_assert(!std::is_floating_point_v<T>,
139 "Floating point values should be converted to/from ints.");
140 return result.type() ==
typeid(T);
143 template <
typename T>
144 std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, RegVal>,
bool>
156 template <
typename T>
161 return std::any_cast<T>(
result);
164 template <
typename T>
165 std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, RegVal>,
176 template <
typename T>
190 #endif // __CPU_INST_RES_HH__
bool operator!=(const InstResult &that) const
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, RegVal >, bool > is() const
bool operator==(const InstResult &that) const
Result comparison Two invalid results always differ.
InstResult()
Default constructor creates an invalid result.
T as() const
Explicit cast-like operations.
static uint64_t floatToBits(double val)
bool isValid() const
Is this a valid result?.
std::function< bool(const std::any &a, const std::any &b)> equals
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, RegVal >, RegVal > as() const
InstResult & operator=(const InstResult &that)
Overload hash function for BasicBlockRange type.
T asNoAssert() const
Cast to integer without checking type.
#define gem5_assert(cond,...)
The assert macro will function like a normal assert, but will use panic instead of straight abort().
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Generated on Sat Jun 18 2022 08:12:20 for gem5 by doxygen 1.8.17