[PATCH] D68815: [AIX] Use .space instead of .zero in assembly

David Tenty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 10:13:34 PDT 2019


daltenty created this revision.
Herald added subscribers: llvm-commits, jsji, MaskRay, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
daltenty added reviewers: Xiangling_L, jasonliu, sfertile, DiggerLin.
Herald added a subscriber: wuzish.

The AIX system assembler does not understand .zero, so we should prefer
emitting .space.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68815

Files:
  llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
  llvm/test/CodeGen/PowerPC/aix-space.ll


Index: llvm/test/CodeGen/PowerPC/aix-space.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/aix-space.ll
@@ -0,0 +1,17 @@
+; RUN: llc -verify-machineinstrs -O0 -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s
+
+ at a = common global double 0.000000e+00, align 8
+
+; Get some constants into the constant pool that need spacing for alignment
+define void @e() {
+entry:
+  %0 = load double, double* @a, align 8
+  %mul = fmul double 1.500000e+00, %0
+  store double %mul, double* @a, align 8
+  %mul1 = fmul double 0x3F9C71C71C71C71C, %0
+  store double %mul1, double* @a, align 8
+  ret void
+}
+
+; CHECK:      .space 4
+; CHECK-NOT:  .zero
Index: llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
===================================================================
--- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
+++ llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
@@ -86,4 +86,5 @@
 PPCXCOFFMCAsmInfo::PPCXCOFFMCAsmInfo(bool Is64Bit, const Triple &T) {
   assert(!IsLittleEndian && "Little-endian XCOFF not supported.");
   CodePointerSize = CalleeSaveStackSlotSize = Is64Bit ? 8 : 4;
+  ZeroDirective = "\t.space\t";
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68815.224397.patch
Type: text/x-patch
Size: 1221 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/419c5a25/attachment.bin>


More information about the llvm-commits mailing list