Path: blob/master/runtime/compiler/x/codegen/J9X86Instruction.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2000, 2021 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122#ifndef J9_X86INSTRUCTION_INCL23#define J9_X86INSTRUCTION_INCL2425#include "codegen/OMRX86Instruction.hpp"2627namespace TR { class Node; }2829namespace TR { class MemoryReference; }30namespace TR { class CodeGenerator; }31namespace TR { class Snippet; }32namespace TR { class UnresolvedDataSnippet; }3334namespace TR {3536class X86MemImmSnippetInstruction : public TR::X86MemImmInstruction37{38TR::UnresolvedDataSnippet *_unresolvedSnippet;3940public:4142X86MemImmSnippetInstruction(TR::InstOpCode::Mnemonic op,43TR::Node *node,44TR::MemoryReference *mr,45int32_t imm,46TR::UnresolvedDataSnippet *us,47TR::CodeGenerator *cg);4849X86MemImmSnippetInstruction(TR::Instruction *precedingInstruction,50TR::InstOpCode::Mnemonic op,51TR::MemoryReference *mr,52int32_t imm,53TR::UnresolvedDataSnippet *us,54TR::CodeGenerator *cg);5556virtual char *description() { return "X86MemImmSnippet"; }5758virtual Kind getKind() { return IsMemImmSnippet; }5960TR::UnresolvedDataSnippet *getUnresolvedSnippet() {return _unresolvedSnippet;}61TR::UnresolvedDataSnippet *setUnresolvedSnippet(TR::UnresolvedDataSnippet *us)62{63return (_unresolvedSnippet = us);64}6566virtual TR::Snippet *getSnippetForGC();67virtual void assignRegisters(TR_RegisterKinds kindsToBeAssigned);68virtual uint8_t *generateBinaryEncoding();6970};717273class X86CheckAsyncMessagesMemRegInstruction : public TR::X86MemRegInstruction74{75public:7677X86CheckAsyncMessagesMemRegInstruction(TR::Node *node, TR::InstOpCode::Mnemonic op, TR::MemoryReference *mr, TR::Register *valueReg, TR::CodeGenerator *cg);7879virtual char *description() { return "X86CheckAsyncMessagesMemReg"; }8081virtual uint8_t *generateBinaryEncoding();8283};848586class X86CheckAsyncMessagesMemImmInstruction : public TR::X86MemImmInstruction87{88public:8990X86CheckAsyncMessagesMemImmInstruction(TR::Node *node, TR::InstOpCode::Mnemonic op, TR::MemoryReference *mr, int32_t value, TR::CodeGenerator *cg);9192virtual char *description() { return "X86CheckAsyncMessagesMemImm"; }9394virtual uint8_t *generateBinaryEncoding();9596};979899class X86StackOverflowCheckInstruction : public TR::X86RegMemInstruction100{101public:102103X86StackOverflowCheckInstruction(104TR::Instruction *precedingInstruction,105TR::InstOpCode::Mnemonic op,106TR::Register *cmpRegister,107TR::MemoryReference *mr,108TR::CodeGenerator *cg);109110virtual char *description() { return "X86StackOverflowCheck"; }111112virtual uint8_t *generateBinaryEncoding();113114};115116}117118119TR::X86MemImmSnippetInstruction * generateMemImmSnippetInstruction(TR::InstOpCode::Mnemonic op, TR::Node *, TR::MemoryReference *mr, int32_t imm, TR::UnresolvedDataSnippet *, TR::CodeGenerator *cg);120121TR::X86CheckAsyncMessagesMemImmInstruction *generateCheckAsyncMessagesInstruction(122TR::Node *node,123TR::InstOpCode::Mnemonic op,124TR::MemoryReference *mr,125int32_t value,126TR::CodeGenerator *cg);127128TR::X86CheckAsyncMessagesMemRegInstruction *generateCheckAsyncMessagesInstruction(129TR::Node *node,130TR::InstOpCode::Mnemonic op,131TR::MemoryReference *mr,132TR::Register *reg,133TR::CodeGenerator *cg);134135TR::X86StackOverflowCheckInstruction *generateStackOverflowCheckInstruction(136TR::Instruction *precedingInstruction,137TR::InstOpCode::Mnemonic op,138TR::Register *cmpRegister,139TR::MemoryReference *mr,140TR::CodeGenerator *cg);141142#endif143144145