mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
[SystemZ] Support RISBGN instruction on zEC12
So far, we do not yet support any instruction specific to zEC12. Most of the facilities added with zEC12 are indeed not very useful to compiler code generation, but there is one exception: the miscellaneous-extensions facility provides the RISBGN instruction, which is a variant of RISBG that does not set the condition code. Add support for this facility, MC support for RISBGN, and CodeGen support for prefering RISBGN over RISBG on zEC12, unless we can actually make use of the condition code set by RISBG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -723,9 +723,12 @@ SystemZInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
|
||||
unsigned Start, End;
|
||||
if (isRxSBGMask(Imm, And.RegSize, Start, End)) {
|
||||
unsigned NewOpcode;
|
||||
if (And.RegSize == 64)
|
||||
if (And.RegSize == 64) {
|
||||
NewOpcode = SystemZ::RISBG;
|
||||
else {
|
||||
// Prefer RISBGN if available, since it does not clobber CC.
|
||||
if (STI.hasMiscellaneousExtensions())
|
||||
NewOpcode = SystemZ::RISBGN;
|
||||
} else {
|
||||
NewOpcode = SystemZ::RISBMux;
|
||||
Start &= 31;
|
||||
End &= 31;
|
||||
@@ -1146,17 +1149,22 @@ unsigned SystemZInstrInfo::getOpcodeForOffset(unsigned Opcode,
|
||||
|
||||
unsigned SystemZInstrInfo::getLoadAndTest(unsigned Opcode) const {
|
||||
switch (Opcode) {
|
||||
case SystemZ::L: return SystemZ::LT;
|
||||
case SystemZ::LY: return SystemZ::LT;
|
||||
case SystemZ::LG: return SystemZ::LTG;
|
||||
case SystemZ::LGF: return SystemZ::LTGF;
|
||||
case SystemZ::LR: return SystemZ::LTR;
|
||||
case SystemZ::LGFR: return SystemZ::LTGFR;
|
||||
case SystemZ::LGR: return SystemZ::LTGR;
|
||||
case SystemZ::LER: return SystemZ::LTEBR;
|
||||
case SystemZ::LDR: return SystemZ::LTDBR;
|
||||
case SystemZ::LXR: return SystemZ::LTXBR;
|
||||
default: return 0;
|
||||
case SystemZ::L: return SystemZ::LT;
|
||||
case SystemZ::LY: return SystemZ::LT;
|
||||
case SystemZ::LG: return SystemZ::LTG;
|
||||
case SystemZ::LGF: return SystemZ::LTGF;
|
||||
case SystemZ::LR: return SystemZ::LTR;
|
||||
case SystemZ::LGFR: return SystemZ::LTGFR;
|
||||
case SystemZ::LGR: return SystemZ::LTGR;
|
||||
case SystemZ::LER: return SystemZ::LTEBR;
|
||||
case SystemZ::LDR: return SystemZ::LTDBR;
|
||||
case SystemZ::LXR: return SystemZ::LTXBR;
|
||||
// On zEC12 we prefer to use RISBGN. But if there is a chance to
|
||||
// actually use the condition code, we may turn it back into RISGB.
|
||||
// Note that RISBG is not really a "load-and-test" instruction,
|
||||
// but sets the same condition code values, so is OK to use here.
|
||||
case SystemZ::RISBGN: return SystemZ::RISBG;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user