Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/x/codegen/J9X86Instruction.hpp
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2021 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#ifndef J9_X86INSTRUCTION_INCL
24
#define J9_X86INSTRUCTION_INCL
25
26
#include "codegen/OMRX86Instruction.hpp"
27
28
namespace TR { class Node; }
29
30
namespace TR { class MemoryReference; }
31
namespace TR { class CodeGenerator; }
32
namespace TR { class Snippet; }
33
namespace TR { class UnresolvedDataSnippet; }
34
35
namespace TR {
36
37
class X86MemImmSnippetInstruction : public TR::X86MemImmInstruction
38
{
39
TR::UnresolvedDataSnippet *_unresolvedSnippet;
40
41
public:
42
43
X86MemImmSnippetInstruction(TR::InstOpCode::Mnemonic op,
44
TR::Node *node,
45
TR::MemoryReference *mr,
46
int32_t imm,
47
TR::UnresolvedDataSnippet *us,
48
TR::CodeGenerator *cg);
49
50
X86MemImmSnippetInstruction(TR::Instruction *precedingInstruction,
51
TR::InstOpCode::Mnemonic op,
52
TR::MemoryReference *mr,
53
int32_t imm,
54
TR::UnresolvedDataSnippet *us,
55
TR::CodeGenerator *cg);
56
57
virtual char *description() { return "X86MemImmSnippet"; }
58
59
virtual Kind getKind() { return IsMemImmSnippet; }
60
61
TR::UnresolvedDataSnippet *getUnresolvedSnippet() {return _unresolvedSnippet;}
62
TR::UnresolvedDataSnippet *setUnresolvedSnippet(TR::UnresolvedDataSnippet *us)
63
{
64
return (_unresolvedSnippet = us);
65
}
66
67
virtual TR::Snippet *getSnippetForGC();
68
virtual void assignRegisters(TR_RegisterKinds kindsToBeAssigned);
69
virtual uint8_t *generateBinaryEncoding();
70
71
};
72
73
74
class X86CheckAsyncMessagesMemRegInstruction : public TR::X86MemRegInstruction
75
{
76
public:
77
78
X86CheckAsyncMessagesMemRegInstruction(TR::Node *node, TR::InstOpCode::Mnemonic op, TR::MemoryReference *mr, TR::Register *valueReg, TR::CodeGenerator *cg);
79
80
virtual char *description() { return "X86CheckAsyncMessagesMemReg"; }
81
82
virtual uint8_t *generateBinaryEncoding();
83
84
};
85
86
87
class X86CheckAsyncMessagesMemImmInstruction : public TR::X86MemImmInstruction
88
{
89
public:
90
91
X86CheckAsyncMessagesMemImmInstruction(TR::Node *node, TR::InstOpCode::Mnemonic op, TR::MemoryReference *mr, int32_t value, TR::CodeGenerator *cg);
92
93
virtual char *description() { return "X86CheckAsyncMessagesMemImm"; }
94
95
virtual uint8_t *generateBinaryEncoding();
96
97
};
98
99
100
class X86StackOverflowCheckInstruction : public TR::X86RegMemInstruction
101
{
102
public:
103
104
X86StackOverflowCheckInstruction(
105
TR::Instruction *precedingInstruction,
106
TR::InstOpCode::Mnemonic op,
107
TR::Register *cmpRegister,
108
TR::MemoryReference *mr,
109
TR::CodeGenerator *cg);
110
111
virtual char *description() { return "X86StackOverflowCheck"; }
112
113
virtual uint8_t *generateBinaryEncoding();
114
115
};
116
117
}
118
119
120
TR::X86MemImmSnippetInstruction * generateMemImmSnippetInstruction(TR::InstOpCode::Mnemonic op, TR::Node *, TR::MemoryReference *mr, int32_t imm, TR::UnresolvedDataSnippet *, TR::CodeGenerator *cg);
121
122
TR::X86CheckAsyncMessagesMemImmInstruction *generateCheckAsyncMessagesInstruction(
123
TR::Node *node,
124
TR::InstOpCode::Mnemonic op,
125
TR::MemoryReference *mr,
126
int32_t value,
127
TR::CodeGenerator *cg);
128
129
TR::X86CheckAsyncMessagesMemRegInstruction *generateCheckAsyncMessagesInstruction(
130
TR::Node *node,
131
TR::InstOpCode::Mnemonic op,
132
TR::MemoryReference *mr,
133
TR::Register *reg,
134
TR::CodeGenerator *cg);
135
136
TR::X86StackOverflowCheckInstruction *generateStackOverflowCheckInstruction(
137
TR::Instruction *precedingInstruction,
138
TR::InstOpCode::Mnemonic op,
139
TR::Register *cmpRegister,
140
TR::MemoryReference *mr,
141
TR::CodeGenerator *cg);
142
143
#endif
144
145