Skip to content

Commit

Permalink
AArch64: Add a variant of helper method for creating constant data sn…
Browse files Browse the repository at this point in the history
…ippet

This commit adds `findOrCreate4ByteConstant()` helper method
which finds or creates ConstantDataSnippet with 4byte data.

Signed-off-by: Akira Saitoh <saiaki@jp.ibm.com>
  • Loading branch information
Akira Saitoh committed Dec 18, 2020
1 parent adb322c commit 37c5210
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/aarch64/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ TR::ARM64ConstantDataSnippet *OMR::ARM64::CodeGenerator::findOrCreateConstantDat
return snippet;
}

TR::ARM64ConstantDataSnippet *OMR::ARM64::CodeGenerator::findOrCreate4ByteConstant(TR::Node * n, int32_t c)
{
return self()->findOrCreateConstantDataSnippet(n, &c, 4);
}

TR::ARM64ConstantDataSnippet *OMR::ARM64::CodeGenerator::findOrCreate8ByteConstant(TR::Node * n, int64_t c)
{
return self()->findOrCreateConstantDataSnippet(n, &c, 8);
Expand Down
10 changes: 10 additions & 0 deletions compiler/aarch64/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGenerator
*/
void apply32BitLabelRelativeRelocation(int32_t *cursor, TR::LabelSymbol *label);

/**
* @brief find or create a constant data snippet for 4 byte constant.
*
* @param[in] node : the node which this constant data snippet belongs to
* @param[in] c : 4 byte constant
*
* @return : a constant data snippet
*/
TR::ARM64ConstantDataSnippet *findOrCreate4ByteConstant(TR::Node *node, int32_t c);

/**
* @brief find or create a constant data snippet for 8 byte constant.
*
Expand Down

0 comments on commit 37c5210

Please sign in to comment.