16 const auto operation =
dynamic_cast<const FShlOperation *
>(&other);
17 return operation && *operation->
getType() == *getType();
26std::unique_ptr<rvsdg::Operation>
29 return std::make_unique<FShlOperation>(*
this);
35 if (!is<const rvsdg::BitType>(type) && !isVectorOf<const rvsdg::BitType>(*type))
37 throw std::runtime_error(
"FShlOperation::checkType: Expected integer type.");
46 const auto operation =
dynamic_cast<const BSwapOperation *
>(&other);
47 return operation && *operation->
getType() == *getType();
56std::unique_ptr<rvsdg::Operation>
59 return std::make_unique<BSwapOperation>(*
this);
65 auto scalarType = type.get();
66 if (
const auto vectorType =
dynamic_cast<const VectorType *
>(scalarType))
68 scalarType = &vectorType->type();
71 const auto bitType =
dynamic_cast<const rvsdg::BitType *
>(scalarType);
74 throw std::runtime_error(
"BSwapOperation::checkType: Expected integer type.");
77 if (bitType->nbits() % 16 != 0)
79 throw std::runtime_error(
80 "BSwapOperation::checkType: Expected integer type with a multiple of 16 bits.");
89 const auto operation =
dynamic_cast<const CtlzOperation *
>(&other);
90 return operation && *operation->
getType() == *getType();
99std::unique_ptr<rvsdg::Operation>
102 return std::make_unique<CtlzOperation>(*
this);
108 if (!is<const rvsdg::BitType>(type) && !isVectorOf<const rvsdg::BitType>(*type))
110 throw std::runtime_error(
"CtlzOperation::checkType: Expected integer type.");
119 const auto operation =
dynamic_cast<const CttzOperation *
>(&other);
120 return operation && *operation->
getType() == *getType();
129std::unique_ptr<rvsdg::Operation>
132 return std::make_unique<CttzOperation>(*
this);
138 if (!is<const rvsdg::BitType>(type) && !isVectorOf<const rvsdg::BitType>(*type))
140 throw std::runtime_error(
"CttzOperation::checkType: Expected integer type.");
149 const auto operation =
dynamic_cast<const CtpopOperation *
>(&other);
150 return operation && *operation->
getType() == *getType();
159std::unique_ptr<rvsdg::Operation>
162 return std::make_unique<CtpopOperation>(*
this);
168 if (!is<const rvsdg::BitType>(type) && !isVectorOf<const rvsdg::BitType>(*type))
170 throw std::runtime_error(
"CtpopOperation::checkType: Expected integer type.");
std::unique_ptr< Operation > copy() const override
~BSwapOperation() noexcept override
std::string debug_string() const override
static void checkType(const std::shared_ptr< const rvsdg::Type > &type)
std::shared_ptr< const rvsdg::Type > getType() const noexcept
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
static void checkType(const std::shared_ptr< const rvsdg::Type > &type)
~CtlzOperation() noexcept override
std::shared_ptr< const rvsdg::Type > getType() const noexcept
std::shared_ptr< const rvsdg::Type > getType() const noexcept
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~CtpopOperation() noexcept override
static void checkType(const std::shared_ptr< const rvsdg::Type > &type)
std::unique_ptr< Operation > copy() const override
std::shared_ptr< const rvsdg::Type > getType() const noexcept
static void checkType(const std::shared_ptr< const rvsdg::Type > &type)
std::string debug_string() const override
~CttzOperation() noexcept override
~FShlOperation() noexcept override
std::unique_ptr< Operation > copy() const override
static void checkType(const std::shared_ptr< const rvsdg::Type > &type)
std::string debug_string() const override
std::shared_ptr< const rvsdg::Type > getType() const noexcept
Global memory state passed between functions.
static std::string strfmt(Args... args)