Path: blob/master/runtime/compiler/arm/codegen/Instruction.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 TRJ9_INSTRUCTION_INCL23#define TRJ9_INSTRUCTION_INCL2425#include "codegen/ARMConditionCode.hpp"26#include "codegen/J9Instruction.hpp"2728#include "codegen/RegisterDependency.hpp" // @@@@2930namespace TR31{32class Instruction;3334class OMR_EXTENSIBLE Instruction : public J9::InstructionConnector35{3637public:3839// TODO: need to fix the InstOpCode initialization40inline Instruction(TR::Node *node, TR::CodeGenerator *cg);4142inline Instruction(TR::InstOpCode::Mnemonic op, TR::Node *node, TR::CodeGenerator *cg);4344inline Instruction(TR::Instruction *precedingInstruction,45TR::InstOpCode::Mnemonic op,46TR::Node *node,47TR::CodeGenerator *cg);4849inline Instruction(TR::InstOpCode::Mnemonic op,50TR::Node *node,51TR::RegisterDependencyConditions *cond,52TR::CodeGenerator *cg);5354inline Instruction(TR::Instruction *precedingInstruction,55TR::InstOpCode::Mnemonic op,56TR::Node *node,57TR::RegisterDependencyConditions *cond,58TR::CodeGenerator *cg);59};6061}6263#include "codegen/J9Instruction_inlines.hpp"6465TR::Instruction::Instruction(TR::Node *node, TR::CodeGenerator *cg)66: J9::InstructionConnector(cg, InstOpCode::bad, node)67{68self()->setOpCodeValue(TR::InstOpCode::bad);69self()->setConditionCode(ARMConditionCodeAL);70self()->setDependencyConditions(NULL);71}7273TR::Instruction::Instruction(TR::InstOpCode::Mnemonic op, TR::Node *node, TR::CodeGenerator *cg)74: J9::InstructionConnector(cg, InstOpCode::bad, node)75{76self()->setOpCodeValue(op);77self()->setConditionCode(ARMConditionCodeAL);78self()->setDependencyConditions(NULL);79}8081TR::Instruction::Instruction(TR::Instruction *precedingInstruction,82TR::InstOpCode::Mnemonic op,83TR::Node *node,84TR::CodeGenerator *cg)85: J9::InstructionConnector(cg, precedingInstruction, InstOpCode::bad, node)86{87self()->setOpCodeValue(op);88self()->setConditionCode(ARMConditionCodeAL);89self()->setDependencyConditions(NULL);90}9192TR::Instruction::Instruction(TR::InstOpCode::Mnemonic op,93TR::Node *node,94TR::RegisterDependencyConditions *cond,95TR::CodeGenerator *cg)96: J9::InstructionConnector(cg, InstOpCode::bad, node)97{98self()->setOpCodeValue(op);99self()->setConditionCode(ARMConditionCodeAL);100self()->setDependencyConditions(cond);101if (cond)102cond->incRegisterTotalUseCounts(cg);103}104105106TR::Instruction::Instruction(TR::Instruction *precedingInstruction,107TR::InstOpCode::Mnemonic op,108TR::Node *node,109TR::RegisterDependencyConditions *cond,110TR::CodeGenerator *cg)111: J9::InstructionConnector(cg, precedingInstruction, InstOpCode::bad, node)112{113self()->setOpCodeValue(op);114self()->setConditionCode(ARMConditionCodeAL);115self()->setDependencyConditions(cond);116if (cond)117cond->incRegisterTotalUseCounts(cg);118}119120121//TODO: these downcasts everywhere need to be removed122inline uint32_t * toARMCursor(uint8_t *i) { return (uint32_t *)i; }123124#endif125126127