mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
FNeg.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <memory>
6
#include <utility>
7
8
#include "
mini-llvm/common/Precision.h
"
9
#include "
mini-llvm/mir/Instruction.h
"
10
#include "
mini-llvm/mir/Instruction/FUnaryOperator.h
"
11
#include "
mini-llvm/mir/InstructionVisitor.h
"
12
#include "
mini-llvm/mir/Register.h
"
13
#include "
mini-llvm/utils/Compiler.h
"
14
#include "
mini-llvm/utils/Memory.h
"
15
16
namespace
mini_llvm::mir
{
17
18
class
MINI_LLVM_EXPORT
FNeg
:
public
FUnaryOperator
{
19
public
:
20
FNeg
(
Precision
precision
, std::shared_ptr<Register>
dst
, std::shared_ptr<Register>
src
)
21
:
FUnaryOperator
(
precision
, std::move(
dst
), std::move(
src
)) {}
22
23
bool
hasSideEffects
()
const override
{
24
return
true
;
25
}
26
27
std::unique_ptr<Instruction>
clone
()
const override
{
28
return
std::make_unique<FNeg>(
precision
(),
share
(*
dst
()),
share
(*
src
()));
29
}
30
31
void
accept
(
InstructionVisitor
&visitor)
override
{
32
visitor.
visitFNeg
(*
this
);
33
}
34
35
void
accept
(
InstructionVisitor
&visitor)
const override
{
36
visitor.
visitFNeg
(*
this
);
37
}
38
39
protected
:
40
const
char
*
mnemonic
()
const override
{
41
return
"FNEG"
;
42
}
43
};
44
45
}
// namespace mini_llvm::mir
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
FUnaryOperator.h
Memory.h
Precision.h
Register.h
mini_llvm::mir::FNeg::accept
void accept(InstructionVisitor &visitor) override
Definition
FNeg.h:31
mini_llvm::mir::FNeg::accept
void accept(InstructionVisitor &visitor) const override
Definition
FNeg.h:35
mini_llvm::mir::FNeg::mnemonic
const char * mnemonic() const override
Definition
FNeg.h:40
mini_llvm::mir::FNeg::hasSideEffects
bool hasSideEffects() const override
Definition
FNeg.h:23
mini_llvm::mir::FNeg::FNeg
FNeg(Precision precision, std::shared_ptr< Register > dst, std::shared_ptr< Register > src)
Definition
FNeg.h:20
mini_llvm::mir::FNeg::clone
std::unique_ptr< Instruction > clone() const override
Definition
FNeg.h:27
mini_llvm::mir::FUnaryOperator::precision
Precision precision() const
Definition
FUnaryOperator.h:25
mini_llvm::mir::FUnaryOperator::src
auto & src(this Self &&self)
Definition
FUnaryOperator.h:35
mini_llvm::mir::FUnaryOperator::dst
auto & dst(this Self &&self)
Definition
FUnaryOperator.h:30
mini_llvm::mir::FUnaryOperator::FUnaryOperator
FUnaryOperator(Precision precision, std::shared_ptr< Register > dst, std::shared_ptr< Register > src)
Definition
FUnaryOperator.h:64
mini_llvm::mir::InstructionVisitor
Definition
InstructionVisitor.h:70
mini_llvm::mir::InstructionVisitor::visitFNeg
virtual void visitFNeg(FNeg &I)
Definition
InstructionVisitor.h:109
InstructionVisitor.h
Instruction.h
mini_llvm::mir
Definition
BasicBlock.h:22
mini_llvm::share
std::shared_ptr< T > share(T &value)
Definition
Memory.h:25
mini_llvm::Precision
Precision
Definition
Precision.h:7
include
mini-llvm
mir
Instruction
FNeg.h
Generated by
1.17.0