summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-04 18:28:46 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-04 18:28:46 +0000
commitd3ac7c058bd4ee90e5df1619cde402819c26aa3c (patch)
tree55b3d47e869b7e28e76b90b3b25332064c27c126 /llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
parentbe0b55d1211a4b38d1e130c3e76d2bbb847c7110 (diff)
downloadbcm5719-llvm-d3ac7c058bd4ee90e5df1619cde402819c26aa3c.tar.gz
bcm5719-llvm-d3ac7c058bd4ee90e5df1619cde402819c26aa3c.zip
[PowerPC] Implement writeNopData
This implements a proper PPCAsmBackend::writeNopData routine that actually writes PowerPC nop instructions. This fixes the last remaining difference in object file output (text section) between the integrated assembler and GNU as that I've seen anywhere. llvm-svn: 185662
Diffstat (limited to 'llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
index e01f14249d6..b37a17933c1 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
@@ -148,10 +148,14 @@ public:
}
bool writeNopData(uint64_t Count, MCObjectWriter *OW) const {
- // FIXME: Zero fill for now. That's not right, but at least will get the
- // section size right.
- for (uint64_t i = 0; i != Count; ++i)
- OW->Write8(0);
+ // Can't emit NOP with size not multiple of 32-bits
+ if (Count % 4 != 0)
+ return false;
+
+ uint64_t NumNops = Count / 4;
+ for (uint64_t i = 0; i != NumNops; ++i)
+ OW->Write32(0x60000000);
+
return true;
}
OpenPOWER on IntegriCloud