mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
FMov.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
FMov
:
public
FUnaryOperator
{
19
public
:
20
FMov
(
Precision
precision
, std::shared_ptr<Register>
dst
, std::shared_ptr<Register>
src
)
21
:
FUnaryOperator
(
precision
, std::move(
dst
), std::move(
src
)) {}
22
23
bool
isCoalescent
()
const override
{
24
return
true
;
25
}
26
27
Register
*
coalescenceDst
()
const override
{
28
return
&*
dst
();
29
}
30
31
Register
*
coalescenceSrc
()
const override
{
32
return
&*
src
();
33
}
34
35
bool
hasSideEffects
()
const override
{
36
return
false
;
37
}
38
39
std::unique_ptr<Instruction>
clone
()
const override
{
40
return
std::make_unique<FMov>(
precision
(),
share
(*
dst
()),
share
(*
src
()));
41
}
42
43
void
accept
(
InstructionVisitor
&visitor)
override
{
44
visitor.
visitFMov
(*
this
);
45
}
46
47
void
accept
(
InstructionVisitor
&visitor)
const override
{
48
visitor.
visitFMov
(*
this
);
49
}
50
51
protected
:
52
const
char
*
mnemonic
()
const override
{
53
return
"FMOV"
;
54
}
55
};
56
57
}
// 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::FMov::clone
std::unique_ptr< Instruction > clone() const override
Definition
FMov.h:39
mini_llvm::mir::FMov::FMov
FMov(Precision precision, std::shared_ptr< Register > dst, std::shared_ptr< Register > src)
Definition
FMov.h:20
mini_llvm::mir::FMov::isCoalescent
bool isCoalescent() const override
Definition
FMov.h:23
mini_llvm::mir::FMov::hasSideEffects
bool hasSideEffects() const override
Definition
FMov.h:35
mini_llvm::mir::FMov::coalescenceSrc
Register * coalescenceSrc() const override
Definition
FMov.h:31
mini_llvm::mir::FMov::coalescenceDst
Register * coalescenceDst() const override
Definition
FMov.h:27
mini_llvm::mir::FMov::mnemonic
const char * mnemonic() const override
Definition
FMov.h:52
mini_llvm::mir::FMov::accept
void accept(InstructionVisitor &visitor) const override
Definition
FMov.h:47
mini_llvm::mir::FMov::accept
void accept(InstructionVisitor &visitor) override
Definition
FMov.h:43
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::visitFMov
virtual void visitFMov(FMov &I)
Definition
InstructionVisitor.h:105
mini_llvm::mir::Register
Definition
Register.h:14
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
FMov.h
Generated by
1.17.0