Skip to content

Commit

Permalink
Migrate randomgen architecture disabling from OpenJ9 to OMR
Browse files Browse the repository at this point in the history
Issue: eclipse-openj9/openj9#3576

Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
  • Loading branch information
fjeremic committed Feb 13, 2019
1 parent 1010c5f commit dbbc27f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Expand Up @@ -583,6 +583,48 @@ OMR::Z::CodeGenerator::CodeGenerator()
_processorInfo.disableArch(TR_S390ProcessorInfo::TR_zNext);
}

// Randomly disable an architecture if we are in randomGen mode
if (comp->getOption(TR_Randomize))
{
switch (randomizer.randomInt(TR::Compiler->target.cpu.id() - TR_s370gp7))
{
case 1:
{
_processorInfo.disableArch(TR_S390ProcessorInfo::TR_z196);
traceMsg(comp, "RandomGen: Disabling z196 processor architecture.");
break;
}

case 2:
{
_processorInfo.disableArch(TR_S390ProcessorInfo::TR_zEC12);
traceMsg(comp, "RandomGen: Disabling zEC12 processor architecture.");
break;
}

case 3:
{
_processorInfo.disableArch(TR_S390ProcessorInfo::TR_z13);
traceMsg(comp, "RandomGen: Disabling z13 processor architecture.");
break;
}

case 3:
{
_processorInfo.disableArch(TR_S390ProcessorInfo::TR_z14);
traceMsg(comp, "RandomGen: Disabling z14 processor architecture.");
break;
}

case 4:
{
_processorInfo.disableArch(TR_S390ProcessorInfo::TR_zNext);
traceMsg(comp, "RandomGen: Disabling zNext processor architecture.");
break;
}
}
}

_unlatchedRegisterList =
(TR::RealRegister**)self()->trMemory()->allocateHeapMemory(sizeof(TR::RealRegister*)*(TR::RealRegister::NumRegisters));
_unlatchedRegisterList[0] = 0; // mark that list is empty
Expand Down

0 comments on commit dbbc27f

Please sign in to comment.