mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
XorI.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/ExtensionMode.h
"
9
#include "
mini-llvm/mir/Immediate.h
"
10
#include "
mini-llvm/mir/Instruction.h
"
11
#include "
mini-llvm/mir/Instruction/BinaryOperatorI.h
"
12
#include "
mini-llvm/mir/InstructionVisitor.h
"
13
#include "
mini-llvm/mir/Register.h
"
14
#include "
mini-llvm/utils/Compiler.h
"
15
#include "
mini-llvm/utils/Memory.h
"
16
17
namespace
mini_llvm::mir
{
18
19
class
MINI_LLVM_EXPORT
XorI
:
public
BinaryOperatorI
{
20
public
:
21
XorI
(
int
width
,
22
std::shared_ptr<Register>
dst
,
23
std::shared_ptr<Register>
src1
,
24
std::unique_ptr<Immediate>
src2
,
25
ExtensionMode
extMode
=
ExtensionMode::kNo
)
26
:
BinaryOperatorI
(
width
, std::move(
dst
), std::move(
src1
), std::move(
src2
),
extMode
) {}
27
28
bool
hasSideEffects
()
const override
{
29
return
false
;
30
}
31
32
std::unique_ptr<Instruction>
clone
()
const override
{
33
return
std::make_unique<XorI>(
34
width
(),
share
(*
dst
()),
share
(*
src1
()),
src2
()->
clone
(),
extMode
());
35
}
36
37
void
accept
(
InstructionVisitor
&visitor)
override
{
38
visitor.
visitXorI
(*
this
);
39
}
40
41
void
accept
(
InstructionVisitor
&visitor)
const override
{
42
visitor.
visitXorI
(*
this
);
43
}
44
45
protected
:
46
const
char
*
mnemonic
()
const override
{
47
return
"XORI"
;
48
}
49
};
50
51
}
// namespace mini_llvm::mir
BinaryOperatorI.h
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
ExtensionMode.h
Immediate.h
Memory.h
Register.h
mini_llvm::mir::BinaryOperatorI::src2
auto & src2(this Self &&self)
Definition
BinaryOperatorI.h:38
mini_llvm::mir::BinaryOperatorI::BinaryOperatorI
BinaryOperatorI(int width, std::shared_ptr< Register > dst, std::shared_ptr< Register > src1, std::unique_ptr< Immediate > src2, ExtensionMode extMode)
Definition
BinaryOperatorI.h:69
mini_llvm::mir::BinaryOperatorI::extMode
ExtensionMode extMode() const
Definition
BinaryOperatorI.h:42
mini_llvm::mir::BinaryOperatorI::width
int width() const
Definition
BinaryOperatorI.h:23
mini_llvm::mir::BinaryOperatorI::src1
auto & src1(this Self &&self)
Definition
BinaryOperatorI.h:33
mini_llvm::mir::BinaryOperatorI::dst
auto & dst(this Self &&self)
Definition
BinaryOperatorI.h:28
mini_llvm::mir::InstructionVisitor
Definition
InstructionVisitor.h:70
mini_llvm::mir::InstructionVisitor::visitXorI
virtual void visitXorI(XorI &I)
Definition
InstructionVisitor.h:138
mini_llvm::mir::XorI::accept
void accept(InstructionVisitor &visitor) const override
Definition
XorI.h:41
mini_llvm::mir::XorI::accept
void accept(InstructionVisitor &visitor) override
Definition
XorI.h:37
mini_llvm::mir::XorI::XorI
XorI(int width, std::shared_ptr< Register > dst, std::shared_ptr< Register > src1, std::unique_ptr< Immediate > src2, ExtensionMode extMode=ExtensionMode::kNo)
Definition
XorI.h:21
mini_llvm::mir::XorI::clone
std::unique_ptr< Instruction > clone() const override
Definition
XorI.h:32
mini_llvm::mir::XorI::mnemonic
const char * mnemonic() const override
Definition
XorI.h:46
mini_llvm::mir::XorI::hasSideEffects
bool hasSideEffects() const override
Definition
XorI.h:28
InstructionVisitor.h
Instruction.h
mini_llvm::mir
Definition
BasicBlock.h:22
mini_llvm::ExtensionMode
ExtensionMode
Definition
ExtensionMode.h:7
mini_llvm::ExtensionMode::kNo
@ kNo
Definition
ExtensionMode.h:8
mini_llvm::share
std::shared_ptr< T > share(T &value)
Definition
Memory.h:25
include
mini-llvm
mir
Instruction
XorI.h
Generated by
1.17.0