MCSection *MergeableConst4Section;
MCSection *MergeableConst8Section;
MCSection *MergeableConst16Section;
+ MCSection *MergeableConst32Section;
// MachO specific sections.
const MCSection *getMergeableConst16Section() const {
return MergeableConst16Section;
}
+ const MCSection *getMergeableConst32Section() const {
+ return MergeableConst32Section;
+ }
// MachO specific sections.
const MCSection *getTLSTLVSection() const { return TLSTLVSection; }
/// for example, vectors.
MergeableConst16,
+ /// MergeableConst32 - This is a section used by 32-byte constants,
+ /// for example, vectors.
+ MergeableConst32,
+
/// Writeable - This is the base of all segments that need to be written
/// to during program runtime.
bool isMergeableConst() const {
return K == MergeableConst4 || K == MergeableConst8 ||
- K == MergeableConst16;
+ K == MergeableConst16 || K == MergeableConst32;
}
bool isMergeableConst4() const { return K == MergeableConst4; }
bool isMergeableConst8() const { return K == MergeableConst8; }
bool isMergeableConst16() const { return K == MergeableConst16; }
+ bool isMergeableConst32() const { return K == MergeableConst32; }
bool isWriteable() const {
return isThreadLocal() || isGlobalWriteableData();
static SectionKind getMergeableConst4() { return get(MergeableConst4); }
static SectionKind getMergeableConst8() { return get(MergeableConst8); }
static SectionKind getMergeableConst16() { return get(MergeableConst16); }
+ static SectionKind getMergeableConst32() { return get(MergeableConst32); }
static SectionKind getThreadBSS() { return get(ThreadBSS); }
static SectionKind getThreadData() { return get(ThreadData); }
static SectionKind getBSS() { return get(BSS); }
return SectionKind::getMergeableConst8();
case 16:
return SectionKind::getMergeableConst16();
+ case 32:
+ return SectionKind::getMergeableConst32();
default:
return SectionKind::getReadOnly();
}
EntrySize = 4;
} else if (Kind.isMergeableConst8()) {
EntrySize = 8;
- } else {
- assert(Kind.isMergeableConst16() && "unknown data width");
+ } else if (Kind.isMergeableConst16()) {
EntrySize = 16;
+ } else {
+ assert(Kind.isMergeableConst32() && "unknown data width");
+ EntrySize = 32;
}
}
return MergeableConst8Section;
if (Kind.isMergeableConst16() && MergeableConst16Section)
return MergeableConst16Section;
+ if (Kind.isMergeableConst32() && MergeableConst32Section)
+ return MergeableConst32Section;
if (Kind.isReadOnly())
return ReadOnlySection;
Ctx->getELFSection(".rodata.cst16", ELF::SHT_PROGBITS,
ELF::SHF_ALLOC | ELF::SHF_MERGE, 16, "");
+ MergeableConst32Section =
+ Ctx->getELFSection(".rodata.cst32", ELF::SHT_PROGBITS,
+ ELF::SHF_ALLOC | ELF::SHF_MERGE, 32, "");
+
StaticCtorSection = Ctx->getELFSection(".ctors", ELF::SHT_PROGBITS,
ELF::SHF_ALLOC | ELF::SHF_WRITE);
case 4: return SectionKind::getMergeableConst4();
case 8: return SectionKind::getMergeableConst8();
case 16: return SectionKind::getMergeableConst16();
+ case 32: return SectionKind::getMergeableConst32();
default:
return SectionKind::getReadOnly();
}
COMDATSymName = "__xmm@" + scalarConstantToHexString(C);
Align = 16;
}
+ } else if (Kind.isMergeableConst32()) {
+ if (Align <= 32) {
+ COMDATSymName = "__ymm@" + scalarConstantToHexString(C);
+ Align = 32;
+ }
}
if (!COMDATSymName.empty())
; WIN32-SECTIONS: .section .rdata,"dr",one_only,_G15
; WIN32-SECTIONS: _G15:
+
+@G16 = unnamed_addr constant i256 0
+
+; LINUX: .section .rodata.cst32,"aM",@progbits,32
+; LINUX: G16:
+
+; LINUX-SECTIONS: .section .rodata.cst32,"aM",@progbits,32
+; LINUX-SECTIONS: G16:
+
+; WIN32-SECTIONS: .section .rdata,"dr",one_only,_G16
+; WIN32-SECTIONS: _G16:
-; RUN: llc < %s -mtriple=x86_64-win32 -mattr=sse2 | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-win32 -mattr=sse2 -mattr=avx | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
; CHECK-NEXT: __real@bf8000003f800000:
; CHECK-NEXT: .long 1065353216
; CHECK-NEXT: .long 3212836864
+
+define <4 x i64> @ymm() {
+entry:
+ ret <4 x i64> <i64 8589934593, i64 17179869187, i64 8589934593, i64 17179869187>
+}
+
+; CHECK: .globl __ymm@0000000400000003000000020000000100000004000000030000000200000001
+; CHECK: .section .rdata,"dr",discard,__ymm@0000000400000003000000020000000100000004000000030000000200000001
+; CHECK: .p2align 5
+; CHECK: __ymm@0000000400000003000000020000000100000004000000030000000200000001:
+; CHECK: .quad 8589934593 # 0x200000001
+; CHECK: .quad 17179869187 # 0x400000003
+; CHECK: .quad 8589934593 # 0x200000001
+; CHECK: .quad 17179869187