38#ifndef __CPU_INST_RES_HH__
39#define __CPU_INST_RES_HH__
57 using BlobPtr = std::unique_ptr<const uint8_t[]>;
59 std::variant<BlobPtr, RegVal>
value;
62 bool blob()
const {
return std::holds_alternative<BlobPtr>(
value); }
67 const void *
getBlob()
const {
return std::get<BlobPtr>(
value).get(); }
73 uint8_t *temp =
nullptr;
76 temp =
new uint8_t[size];
77 std::memcpy(temp,
val, size);
130 const void *my_blob =
getBlob();
131 const void *their_blob = that.
getBlob();
134 if (!my_blob || !their_blob)
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
const RegClass & regClass() const
InstResult()
Default constructor creates an invalid result.
const void * getBlob() const
bool operator==(const InstResult &that) const
Result comparison Two invalid results always differ.
InstResult(const InstResult &other)
void set(const void *val)
void set(const InstResult &other)
std::variant< BlobPtr, RegVal > value
std::string asString(const int64_t &num_bytes) const
bool operator!=(const InstResult &that) const
const RegClass * _regClass
std::string asString() const
const void * asBlob() const
InstResult(const RegClass ®_class, const void *val)
std::unique_ptr< const uint8_t[]> BlobPtr
InstResult & operator=(const InstResult &that)
InstResult(const RegClass ®_class, RegVal val)
std::string valString(const void *val) const
constexpr size_t regBytes() const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.