llvm.org GIT mirror llvm / bfc4c98
test/CodeGen/X86: FileCheck-ize and add actions for x86_64-linux and x86_64-win32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127734 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 8 years ago
10 changed file(s) with 54 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc %s -o - -march=x86-64 | grep {(%rdi,%rax,8)}
1 ; RUN: llc %s -o - -march=x86-64 | not grep {addq.*8}
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
2 ; CHECK-NOT: {{addq.*8}}
3 ; CHECK: ({{%rdi|%rcx}},%rax,8)
4 ; CHECK-NOT: {{addq.*8}}
25
36 define void @foo(double* %y) nounwind {
47 entry:
None ; RUN: llc < %s -march=x86-64 -mattr=+sse | grep {movq (%rdi), %rax}
1 ; RUN: llc < %s -march=x86-64 -mattr=+sse | grep {movq 8(%rdi), %rax}
0 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=+sse | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+sse | FileCheck %s
2 ; CHECK: movq ([[A0:%rdi|%rcx]]), %rax
3 ; CHECK: movq 8([[A0]]), %rax
24 define i64 @foo_0(<2 x i64>* %val) {
35 entry:
46 %val12 = getelementptr <2 x i64>* %val, i32 0, i32 0 ; [#uses=1]
None ; RUN: llc < %s -march=x86-64 | grep {leal.*-2(\[%\]rdi,\[%\]rdi)}
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
2 ; CHECK: leal -2({{%rdi,%rdi|%rcx,%rcx}})
13
24 define i32 @foo(i32 %x) nounwind readnone {
35 %t0 = shl i32 %x, 1
None ; RUN: llc < %s -march=x86-64 -o %t -stats -info-output-file - | \
1 ; RUN: grep {asm-printer} | grep {Number of machine instrs printed} | grep 9
2 ; RUN: grep {leal 1(\%rsi),} %t
0 ; RUN: llc < %s -mtriple=x86_64-linux -o /dev/null -stats |& FileCheck %s -check-prefix=STATS
1 ; RUN: llc < %s -mtriple=x86_64-win32 -o /dev/null -stats |& FileCheck %s -check-prefix=STATS
2 ; STATS: 9 asm-printer
3
4 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
5 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
6 ; CHECK: leal 1({{%rsi|%rdx}}),
37
48 define fastcc zeroext i8 @fullGtU(i32 %i1, i32 %i2, i8* %ptr) nounwind optsize {
59 entry:
None ; RUN: llc < %s -march=x86-64 | grep {movq.*(%rsi), %rax}
1 ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep {movsd.*(%eax),}
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s -check-prefix=X64
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s -check-prefix=X64
2 ; X64: movq ({{%rsi|%rdx}}), %r
3
4 ; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s -check-prefix=X32
5 ; X32: movsd (%eax), %xmm
26
37 ; Uses movsd to load / store i64 values if sse2 is available.
48
None ; RUN: llc < %s -march=x86-64 | grep {leal (%rdi,%rdi,2), %eax}
1 define i32 @test(i32 %a) {
2 %tmp2 = mul i32 %a, 3 ; [#uses=1]
3 ret i32 %tmp2
4 }
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
52
6 ; RUN: llc < %s -march=x86-64 | grep {leaq (,%rdi,4), %rax}
3 ; CHECK: leaq (,[[A0:%rdi|%rcx]],4), %rax
74 define i64 @test2(i64 %a) {
85 %tmp2 = shl i64 %a, 2
96 %tmp3 = or i64 %tmp2, %a
107 ret i64 %tmp3
8 }
9
10 ; CHECK: leal ([[A0]],[[A0]],2), %eax
11 define i32 @test(i32 %a) {
12 %tmp2 = mul i32 %a, 3 ; [#uses=1]
13 ret i32 %tmp2
1114 }
1215
1316 ;; TODO! LEA instead of shift + copy.
None ; RUN: llc < %s -march=x86-64 | grep {movq.*(%rsi), %rax}
1 ; RUN: llc < %s -march=x86 -mattr=-sse2 | grep {movl.*4(%eax),}
2 ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep {movsd.(%eax),}
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s -check-prefix=X64
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s -check-prefix=X64
2 ; X64: movq ({{%rsi|%rdx}}), %rax
3 ; RUN: llc < %s -march=x86 -mattr=-sse2 | FileCheck %s -check-prefix=X32
4 ; X32: movl 4(%eax),
5 ; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s -check-prefix=XMM
6 ; XMM: movsd (%eax),
37
48 ; This test should use GPRs to copy the mmx value, not MMX regs. Using mmx regs,
59 ; increases the places that need to use emms.
None ; RUN: llc < %s -march=x86-64 | not grep movsd
1 ; RUN: llc < %s -march=x86-64 | grep {movd.*%rdi,.*%xmm0}
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
2 ; CHECK-NOT: movsd
3 ; CHECK: movd {{%rdi|%rcx}}, %xmm0
4 ; CHECK-NOT: movsd
25
36 define <2 x i64> @test(i64 %i) nounwind {
47 entry:
None ; RUN: llc < %s -march=x86-64 | grep {movd.*%rdi, %xmm0}
1 ; RUN: llc < %s -march=x86-64 | not grep xor
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
2 ; CHECK-NOT: xor
3 ; CHECK: movd {{%rdi|%rcx}}, %xmm0
4 ; CHECK-NOT: xor
25 ; PR2108
36
47 define <2 x i64> @doload64(i64 %x) nounwind {
None ; RUN: llc < %s -march=x86-64 | grep {shll.*3, %edi}
0 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
2 ; CHECK: shll $3, {{%edi|%ecx}}
13 ; PR3829
24 ; The generated code should multiply by 3 (sizeof i8*) as an i32,
35 ; not as an i64!