Jlm
Loading...
Searching...
No Matches
comparison.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2011 2012 2014 Nico Reißmann <nico.reissmann@gmail.com>
3 * Copyright 2014 2024 Helge Bahmann <hcb@chaoticmind.net>
4 * See COPYING for terms of redistribution.
5 */
6
7#ifndef JLM_RVSDG_BITSTRING_COMPARISON_HPP
8#define JLM_RVSDG_BITSTRING_COMPARISON_HPP
9
12
13namespace jlm::rvsdg
14{
15
16template<typename reduction, const char * name, enum BinaryOperation::flags opflags>
18{
19public:
20 ~MakeBitComparisonOperation() noexcept override;
21
22 explicit MakeBitComparisonOperation(std::size_t nbits) noexcept
24 {}
25
26 bool
27 operator==(const Operation & other) const noexcept override;
28
31
35
36 std::string
38
41
43 create(size_t nbits) const override;
44
46 create(size_t nbits, Output * op1, Output * op2)
47 {
48 return CreateOpNode<MakeBitComparisonOperation>({ op1, op2 }, nbits).output(0);
49 }
50};
51
52struct reduce_eq;
53extern const char BitEqLabel[];
54using biteq_op =
56extern template class MakeBitComparisonOperation<
60
61struct reduce_ne;
62extern const char BitNeLabel[];
63using bitne_op =
65extern template class MakeBitComparisonOperation<
69
70struct reduce_sge;
71extern const char BitSgeLabel[];
73extern template class MakeBitComparisonOperation<
77
78struct reduce_sgt;
79extern const char BitSgtLabel[];
81extern template class MakeBitComparisonOperation<
85
86struct reduce_sle;
87extern const char BitSleLabel[];
89extern template class MakeBitComparisonOperation<
93
94struct reduce_slt;
95extern const char BitSltLabel[];
97extern template class MakeBitComparisonOperation<
101
102struct reduce_uge;
103extern const char BitUgeLabel[];
105extern template class MakeBitComparisonOperation<
109
110struct reduce_ugt;
111extern const char BitUgtLabel[];
113extern template class MakeBitComparisonOperation<
117
118struct reduce_ule;
119extern const char BitUleLabel[];
121extern template class MakeBitComparisonOperation<
125
126struct reduce_ult;
127extern const char BitUltLabel[];
129extern template class MakeBitComparisonOperation<
133
134}
135
136#endif
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
Definition type.cpp:45
enum BinaryOperation::flags flags() const noexcept override
MakeBitComparisonOperation(std::size_t nbits) noexcept
std::string debug_string() const override
compare_result reduce_constants(const BitValueRepresentation &arg1, const BitValueRepresentation &arg2) const override
std::unique_ptr< BitCompareOperation > create(size_t nbits) const override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
const char BitNeLabel[]
const char BitUleLabel[]
const char BitSleLabel[]
const char BitEqLabel[]
const char BitUgeLabel[]
const char BitSltLabel[]
const char BitUgtLabel[]
const char BitSgtLabel[]
const char BitSgeLabel[]
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872
const char BitUltLabel[]