Jlm
Loading...
Searching...
No Matches
FloatingPointTestIntrinsicOperations.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2026 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_LLVM_IR_OPERATORS_FLOATINGPOINTTESTINTRINSICOPERATIONS_HPP
7#define JLM_LLVM_IR_OPERATORS_FLOATINGPOINTTESTINTRINSICOPERATIONS_HPP
8
9#include <jlm/llvm/ir/tac.hpp>
10#include <jlm/llvm/ir/types.hpp>
13
14namespace jlm::llvm
15{
16
24{
25public:
26 ~IsFPClassOperation() noexcept override;
27
28 explicit IsFPClassOperation(const std::shared_ptr<const rvsdg::Type> & type)
30 {
31 checkType(type);
32 }
33
34 bool
35 operator==(const Operation & other) const noexcept override;
36
37 std::string
38 debug_string() const override;
39
40 [[nodiscard]] std::unique_ptr<Operation>
41 copy() const override;
42
43 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
44 getType() const noexcept
45 {
46 return result(0);
47 }
48
49 static std::unique_ptr<ThreeAddressCode>
50 createTac(const Variable & operand1, const Variable & operand2)
51 {
52 auto operation = std::make_unique<IsFPClassOperation>(operand1.Type());
53 return ThreeAddressCode::create(std::move(operation), { &operand1, &operand2 });
54 }
55
56 static rvsdg::SimpleNode &
57 createNode(rvsdg::Output & operand1, rvsdg::Output & operand2)
58 {
59 return rvsdg::CreateOpNode<IsFPClassOperation>({ &operand1, &operand2 }, operand1.Type());
60 }
61
62private:
63 static void
64 checkType(const std::shared_ptr<const rvsdg::Type> & type);
65
66 static std::shared_ptr<const rvsdg::Type>
67 createResultType(const std::shared_ptr<const rvsdg::Type> & type);
68};
69
70}
71
72#endif
bool operator==(const Operation &other) const noexcept override
~IsFPClassOperation() noexcept override
std::unique_ptr< Operation > copy() const override
static void checkType(const std::shared_ptr< const rvsdg::Type > &type)
static std::unique_ptr< ThreeAddressCode > createTac(const Variable &operand1, const Variable &operand2)
static std::shared_ptr< const rvsdg::Type > createResultType(const std::shared_ptr< const rvsdg::Type > &type)
static rvsdg::SimpleNode & createNode(rvsdg::Output &operand1, rvsdg::Output &operand2)
std::shared_ptr< const rvsdg::Type > getType() const noexcept
static std::unique_ptr< llvm::ThreeAddressCode > create(std::unique_ptr< rvsdg::SimpleOperation > operation, const std::vector< const Variable * > &operands)
Definition tac.hpp:135
const std::shared_ptr< const jlm::rvsdg::Type > Type() const noexcept
Definition variable.hpp:62
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
Definition type.cpp:45
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
Definition node.hpp:366
const std::shared_ptr< const rvsdg::Type > & result(size_t index) const noexcept
Definition operation.cpp:36
SimpleOperation(std::vector< std::shared_ptr< const jlm::rvsdg::Type > > operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type > > results)
Definition operation.hpp:61
Global memory state passed between functions.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872