aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit972befb3f281f0f9ce08d7cf27b4e879327676b0 (patch)
treed586b61b885f9b28d473c087c1222bf5cdb77dbd /lib
parent449f64c69c8db6ac0b63078e1feb1f51b7b0549a (diff)
downloadexternal_llvm-972befb3f281f0f9ce08d7cf27b4e879327676b0.tar.gz
external_llvm-972befb3f281f0f9ce08d7cf27b4e879327676b0.tar.bz2
external_llvm-972befb3f281f0f9ce08d7cf27b4e879327676b0.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
index e01f14249d..b37a17933c 100644
--- a/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
+++ b/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;
}