[llvm] r337755 - [AArch64] Use MCAsmInfoMicrosoft and MCAsmInfoGNUCOFF as base classes

Martin Storsjo via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 15:15:14 PDT 2018


Author: mstorsjo
Date: Mon Jul 23 15:15:14 2018
New Revision: 337755

URL: http://llvm.org/viewvc/llvm-project?rev=337755&view=rev
Log:
[AArch64] Use MCAsmInfoMicrosoft and MCAsmInfoGNUCOFF as base classes

This matches the structure used on X86 and ARM. This requires
a little bit of duplication of the parts that are equal in both
AArch64 COFF variants though.

Before SVN r335286, these classes didn't add anything that MCAsmInfoCOFF
didn't, but now they do.

This makes AArch64 match X86 in how comdat is used for float constants
for MinGW.

Differential Revision: https://reviews.llvm.org/D49637

Added:
    llvm/trunk/test/CodeGen/AArch64/win_cst_pool.ll
Modified:
    llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
    llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h

Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp?rev=337755&r1=337754&r2=337755&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp Mon Jul 23 15:15:14 2018
@@ -101,7 +101,7 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF
   HasIdentDirective = true;
 }
 
-AArch64MCAsmInfoCOFF::AArch64MCAsmInfoCOFF() {
+AArch64MCAsmInfoMicrosoftCOFF::AArch64MCAsmInfoMicrosoftCOFF() {
   PrivateGlobalPrefix = ".L";
   PrivateLabelPrefix = ".L";
 
@@ -112,14 +112,23 @@ AArch64MCAsmInfoCOFF::AArch64MCAsmInfoCO
   AlignmentIsInBytes = false;
   SupportsDebugInformation = true;
   CodePointerSize = 8;
-}
 
-AArch64MCAsmInfoMicrosoftCOFF::AArch64MCAsmInfoMicrosoftCOFF() {
   CommentString = ";";
   ExceptionsType = ExceptionHandling::WinEH;
 }
 
 AArch64MCAsmInfoGNUCOFF::AArch64MCAsmInfoGNUCOFF() {
+  PrivateGlobalPrefix = ".L";
+  PrivateLabelPrefix = ".L";
+
+  Data16bitsDirective = "\t.hword\t";
+  Data32bitsDirective = "\t.word\t";
+  Data64bitsDirective = "\t.xword\t";
+
+  AlignmentIsInBytes = false;
+  SupportsDebugInformation = true;
+  CodePointerSize = 8;
+
   CommentString = "//";
   ExceptionsType = ExceptionHandling::DwarfCFI;
 }

Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h?rev=337755&r1=337754&r2=337755&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h Mon Jul 23 15:15:14 2018
@@ -34,15 +34,11 @@ struct AArch64MCAsmInfoELF : public MCAs
   explicit AArch64MCAsmInfoELF(const Triple &T);
 };
 
-struct AArch64MCAsmInfoCOFF : public MCAsmInfoCOFF {
-  explicit AArch64MCAsmInfoCOFF();
-};
-
-struct AArch64MCAsmInfoMicrosoftCOFF : public AArch64MCAsmInfoCOFF {
+struct AArch64MCAsmInfoMicrosoftCOFF : public MCAsmInfoMicrosoft {
   explicit AArch64MCAsmInfoMicrosoftCOFF();
 };
 
-struct AArch64MCAsmInfoGNUCOFF : public AArch64MCAsmInfoCOFF {
+struct AArch64MCAsmInfoGNUCOFF : public MCAsmInfoGNUCOFF {
   explicit AArch64MCAsmInfoGNUCOFF();
 };
 

Added: llvm/trunk/test/CodeGen/AArch64/win_cst_pool.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/win_cst_pool.ll?rev=337755&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/win_cst_pool.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/win_cst_pool.ll Mon Jul 23 15:15:14 2018
@@ -0,0 +1,13 @@
+; RUN: llc < %s -mtriple=aarch64-win32-gnu | FileCheck -check-prefix=MINGW %s
+
+define double @double() {
+  ret double 0x0000000000800000
+}
+; MINGW:              .section        .rdata,"dr"
+; MINGW-NEXT:         .p2align  3
+; MINGW-NEXT: [[LABEL:\.LC.*]]:
+; MINGW-NEXT:         .xword   8388608
+; MINGW:      double:
+; MINGW:               adrp    x8, [[LABEL]]
+; MINGW-NEXT:          ldr     d0, [x8, [[LABEL]]]
+; MINGW-NEXT:          ret




More information about the llvm-commits mailing list