Skip to content

Commit

Permalink
Merge pull request #4722 from Akira1Saitoh/aarch64GenerateNop
Browse files Browse the repository at this point in the history
AArch64: Add generateNop to code generator
  • Loading branch information
knn-k authored Jan 16, 2020
2 parents 2bcc2ad + a32deed commit 8a8b562
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 10 additions & 1 deletion compiler/aarch64/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2019 IBM Corp. and others
* Copyright (c) 2018, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -534,3 +534,12 @@ OMR::ARM64::CodeGenerator::directCallRequiresTrampoline(intptrj_t targetAddress,
!self()->comp()->target().cpu.isTargetWithinUnconditionalBranchImmediateRange(targetAddress, sourceAddress) ||
self()->comp()->getOption(TR_StressTrampolines);
}

TR::Instruction *
OMR::ARM64::CodeGenerator::generateNop(TR::Node *node, TR::Instruction *preced)
{
if (preced)
return new (self()->trHeapMemory()) TR::Instruction(TR::InstOpCode::nop, node, preced, self());
else
return new (self()->trHeapMemory()) TR::Instruction(TR::InstOpCode::nop, node, self());
}
9 changes: 8 additions & 1 deletion compiler/aarch64/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2019 IBM Corp. and others
* Copyright (c) 2018, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -393,6 +393,13 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGenerator
*/
void generateBinaryEncodingPrePrologue(TR_ARM64BinaryEncodingData &data);

/**
* @brief Generates nop
* @param[in] node: node
* @param[in] preced : preceding instruction
*/
TR::Instruction *generateNop(TR::Node *node, TR::Instruction *preced = 0);

private:

enum // flags
Expand Down

0 comments on commit 8a8b562

Please sign in to comment.