Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full support for calls on z/OS and enable corresponding tests #4907

Merged
merged 17 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions compiler/z/codegen/OMRLinkage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2035,31 +2035,13 @@ OMR::Z::Linkage::buildArgs(TR::Node * callNode, TR::RegisterDependencyConditions
argSize += gprSize;
}

bool isXPLinkToPureOSLinkageCall = false;
if (!self()->isFirstParmAtFixedOffset())
{
stackOffset = argSize;
}
else
{
stackOffset = self()->getOffsetToFirstParm();
Leonardo2718 marked this conversation as resolved.
Show resolved Hide resolved

if (isXPLinkToPureOSLinkageCall)
{
// Load argument list (GPR1) pointer here in XPLink to OS linkage call
// The OS linkage argument list is embedded in the XPLink outbound argument area
// at offset 8 instead of 0 (to bypass collision with long displacement slot)
TR::Register *r1Reg = self()->cg()->allocateRegister();
if (stackOffset == self()->getOffsetToLongDispSlot())
{
stackOffset += 8; // avoid first parm at long displacement slot
}
TR::RealRegister * stackPtr = self()->getNormalStackPointerRealRegister();
generateRXInstruction(self()->cg(), TR::InstOpCode::LA, callNode, r1Reg,
generateS390MemoryReference(stackPtr, stackOffset, self()->cg()));
dependencies->addPreCondition(r1Reg, TR::RealRegister::GPR1);
self()->cg()->stopUsingRegister(r1Reg);
}
}

//store env register
Expand Down Expand Up @@ -2114,28 +2096,24 @@ OMR::Z::Linkage::buildArgs(TR::Node * callNode, TR::RegisterDependencyConditions

if (self()->isSkipGPRsForFloatParms())
{
if (numIntegerArgs < self()->getNumIntegerArgumentRegisters())
{
numIntegerArgs++;
}
numIntegerArgs++;
}
break;
}
case TR::Double:
#ifdef J9_PROJECT_SPECIFIC
case TR::DecimalDouble:
#endif
argRegister = self()->pushArg(callNode, child, numIntegerArgs, numFloatArgs, &stackOffset, dependencies);

numFloatArgs++;

if (self()->isSkipGPRsForFloatParms())
{
if (numIntegerArgs < self()->getNumIntegerArgumentRegisters())
{
numIntegerArgs += (self()->cg()->comp()->target().is64Bit()) ? 1 : 2;
}
numIntegerArgs += (self()->cg()->comp()->target().is64Bit()) ? 1 : 2;
}
break;
#ifdef J9_PROJECT_SPECIFIC
case TR::DecimalLongDouble:
if (numFloatArgs%2 == 1)
{ // need to skip fp arg 'hole' for long double arg
Expand Down
2,650 changes: 2,406 additions & 244 deletions fvtest/compilertriltest/LinkageTest.cpp

Large diffs are not rendered by default.

42 changes: 28 additions & 14 deletions fvtest/compilertriltest/MinimalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ TEST_F(MinimalTest, MeaningOfLife)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand All @@ -331,8 +333,10 @@ TEST_F(MinimalTest, ReturnArgI32)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand All @@ -348,8 +352,10 @@ TEST_F(MinimalTest, MaxIfThen)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand All @@ -366,8 +372,10 @@ TEST_F(MinimalTest, AddArgConst)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand All @@ -382,8 +390,10 @@ TEST_F(MinimalTest, SubArgArg)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand All @@ -400,8 +410,10 @@ TEST_F(MinimalTest, Factorial)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand All @@ -423,8 +435,10 @@ TEST_F(MinimalTest, RecursiveFibonnaci)
SKIP_ON_PPC(MissingImplementation) << "Test is skipped on POWER because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64(MissingImplementation) << "Test is skipped on POWER 64 because calls are not currently supported (see issue #1645)";
SKIP_ON_PPC64LE(MissingImplementation) << "Test is skipped on POWER 64le because calls are not currently supported (see issue #1645)";
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
if ("z/OS" != omrsysinfo_get_OS_type()) {
SKIP_ON_S390(MissingImplementation) << "Test is skipped on S390 because calls are not currently supported (see issue #1645)";
SKIP_ON_S390X(MissingImplementation) << "Test is skipped on S390x because calls are not currently supported (see issue #1645)";
}
SKIP_ON_ARM(MissingImplementation) << "Test is skipped on ARM because calls are not currently supported (see issue #1645)";
SKIP_ON_AARCH64(MissingImplementation) << "Test is skipped on AArch64 because calls are not currently supported (see issue #1645)";

Expand Down
5 changes: 2 additions & 3 deletions jitbuilder/release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,5 @@ endif()


# Additional Tests: These may not run properly on all platforms
# Mandelbrot takes arguments for its test
# so will require we enhance create_jitbuilder_target.
#create_jitbuilder_target(mandelbrot cpp/samples/Mandelbrot.cpp)
# Mandelbrot takes arguments for its test so will require we enhance create_jitbuilder_test
#create_jitbuilder_test(mandelbrot cpp/samples/Mandelbrot.cpp)
Loading