blob: d77a7ed381651cf2daf04ef19da74119d898435c [file] [log] [blame]
Benjamin Kramer62934292012-11-14 20:08:40 +00001; Make sure that we realign the stack. Mingw32 uses 4 byte stack alignment, we
2; need 16 bytes for SSE and 32 bytes for AVX.
3
4; RUN: llc < %s -mtriple=i386-pc-mingw32 -mcpu=pentium2 | FileCheck %s -check-prefix=NOSSE
5; RUN: llc < %s -mtriple=i386-pc-mingw32 -mcpu=pentium3 | FileCheck %s -check-prefix=SSE1
6; RUN: llc < %s -mtriple=i386-pc-mingw32 -mcpu=yonah | FileCheck %s -check-prefix=SSE2
7; RUN: llc < %s -mtriple=i386-pc-mingw32 -mcpu=corei7-avx | FileCheck %s -check-prefix=AVX1
8; RUN: llc < %s -mtriple=i386-pc-mingw32 -mcpu=core-avx2 | FileCheck %s -check-prefix=AVX2
9
10define void @test1(i32 %t) nounwind {
11 %tmp1210 = alloca i8, i32 32, align 4
12 call void @llvm.memset.p0i8.i64(i8* %tmp1210, i8 0, i64 32, i32 4, i1 false)
13 %x = alloca i8, i32 %t
14 call void @dummy(i8* %x)
15 ret void
16
Stephen Linf799e3f2013-07-13 20:38:47 +000017; NOSSE-LABEL: test1:
Benjamin Kramer62934292012-11-14 20:08:40 +000018; NOSSE-NOT: and
19; NOSSE: movl $0
20
Stephen Linf799e3f2013-07-13 20:38:47 +000021; SSE1-LABEL: test1:
Benjamin Kramer62934292012-11-14 20:08:40 +000022; SSE1: andl $-16
23; SSE1: movl %esp, %esi
24; SSE1: movaps
25
Stephen Linf799e3f2013-07-13 20:38:47 +000026; SSE2-LABEL: test1:
Benjamin Kramer62934292012-11-14 20:08:40 +000027; SSE2: andl $-16
28; SSE2: movl %esp, %esi
29; SSE2: movaps
30
Stephen Linf799e3f2013-07-13 20:38:47 +000031; AVX1-LABEL: test1:
Benjamin Kramer62934292012-11-14 20:08:40 +000032; AVX1: andl $-32
33; AVX1: movl %esp, %esi
34; AVX1: vmovaps %ymm
35
Stephen Linf799e3f2013-07-13 20:38:47 +000036; AVX2-LABEL: test1:
Benjamin Kramer62934292012-11-14 20:08:40 +000037; AVX2: andl $-32
38; AVX2: movl %esp, %esi
39; AVX2: vmovaps %ymm
40
41}
42
43define void @test2(i32 %t) nounwind {
44 %tmp1210 = alloca i8, i32 16, align 4
45 call void @llvm.memset.p0i8.i64(i8* %tmp1210, i8 0, i64 16, i32 4, i1 false)
46 %x = alloca i8, i32 %t
47 call void @dummy(i8* %x)
48 ret void
49
Stephen Linf799e3f2013-07-13 20:38:47 +000050; NOSSE-LABEL: test2:
Benjamin Kramer62934292012-11-14 20:08:40 +000051; NOSSE-NOT: and
52; NOSSE: movl $0
53
Stephen Linf799e3f2013-07-13 20:38:47 +000054; SSE1-LABEL: test2:
Benjamin Kramer62934292012-11-14 20:08:40 +000055; SSE1: andl $-16
56; SSE1: movl %esp, %esi
57; SSE1: movaps
58
Stephen Linf799e3f2013-07-13 20:38:47 +000059; SSE2-LABEL: test2:
Benjamin Kramer62934292012-11-14 20:08:40 +000060; SSE2: andl $-16
61; SSE2: movl %esp, %esi
62; SSE2: movaps
63
Stephen Linf799e3f2013-07-13 20:38:47 +000064; AVX1-LABEL: test2:
Benjamin Kramer62934292012-11-14 20:08:40 +000065; AVX1: andl $-16
66; AVX1: movl %esp, %esi
67; AVX1: vmovaps %xmm
68
Stephen Linf799e3f2013-07-13 20:38:47 +000069; AVX2-LABEL: test2:
Benjamin Kramer62934292012-11-14 20:08:40 +000070; AVX2: andl $-16
71; AVX2: movl %esp, %esi
72; AVX2: vmovaps %xmm
73}
74
75declare void @dummy(i8*)
76
77declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind