From 09465e9be5f48bc6bbea269645ba0f9d8de4fa78 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 23 Jul 2018 22:15:14 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337755 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp | 15 ++++++++++++--- lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h | 8 ++------ test/CodeGen/AArch64/win_cst_pool.ll | 13 +++++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 test/CodeGen/AArch64/win_cst_pool.ll diff --git a/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp b/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp index 12b5a27b769..ebb49121c1b 100644 --- a/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp +++ b/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp @@ -101,7 +101,7 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(const Triple &T) { HasIdentDirective = true; } -AArch64MCAsmInfoCOFF::AArch64MCAsmInfoCOFF() { +AArch64MCAsmInfoMicrosoftCOFF::AArch64MCAsmInfoMicrosoftCOFF() { PrivateGlobalPrefix = ".L"; PrivateLabelPrefix = ".L"; @@ -112,14 +112,23 @@ AArch64MCAsmInfoCOFF::AArch64MCAsmInfoCOFF() { 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; } diff --git a/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h b/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h index afde87b4092..e8570b1c288 100644 --- a/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h +++ b/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h @@ -34,15 +34,11 @@ struct AArch64MCAsmInfoELF : public MCAsmInfoELF { 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(); }; diff --git a/test/CodeGen/AArch64/win_cst_pool.ll b/test/CodeGen/AArch64/win_cst_pool.ll new file mode 100644 index 00000000000..049e252a3a8 --- /dev/null +++ b/test/CodeGen/AArch64/win_cst_pool.ll @@ -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 -- 2.11.0