[PowerPC][Future] Prefixed Instructions 64 Byte Boundary Support
authorStefan Pintilie <stefanp@ca.ibm.com>
Tue, 28 Jan 2020 01:20:53 +0000 (19:20 -0600)
committerStefan Pintilie <stefanp@ca.ibm.com>
Thu, 30 Jan 2020 12:52:30 +0000 (06:52 -0600)
commitf00be8da62b8169c6548f32834f307bb520e8754
treef0bdd88a54603d25b4fb29094d54201d534b27c4
parent258d8dd76afd88a12539b182a53ff21dcba16a2d
[PowerPC][Future] Prefixed Instructions 64 Byte Boundary Support

A known limitation for Future CPU is that the new prefixed instructions may
not cross 64 Byte boundaries.

All instructions are already 4 byte aligned so the only situation where this
can occur is when the prefix is in one 64 byte block and the instruction that
is prefixed is at the top of the next 64 byte block. To fix this case
PPCELFStreamer was added to intercept EmitInstruction. When a prefixed
instruction is emitted we try to align it to 64 Bytes by adding a maximum of
4 bytes. If the prefixed instruction crosses the 64 Byte boundary then the
alignment would trigger and a 4 byte nop would be added to push the
instruction into the next 64 byte block.

Differential Revision: https://reviews.llvm.org/D72570
llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp [new file with mode: 0644]
llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.h [new file with mode: 0644]
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.h
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.h
llvm/test/MC/PowerPC/ppc64-prefix-align-labels.s [new file with mode: 0644]
llvm/test/MC/PowerPC/ppc64-prefix-align.s [new file with mode: 0644]