OSDN Git Service

am d36d4a35: am 30dce365: am b2713ca8: am c27b99f0: am 95015e5c: Merge "Remove unused...
[android-x86/external-llvm.git] / test / CodeGen / X86 / movbe.ll
1 ; RUN: llc -mtriple=x86_64-linux -mcpu=atom < %s | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-linux -mcpu=slm < %s | FileCheck %s -check-prefix=SLM
3
4 declare i32 @llvm.bswap.i32(i32) nounwind readnone
5 declare i64 @llvm.bswap.i64(i64) nounwind readnone
6
7 define void @test1(i32* nocapture %x, i32 %y) nounwind {
8   %bswap = call i32 @llvm.bswap.i32(i32 %y)
9   store i32 %bswap, i32* %x, align 4
10   ret void
11 ; CHECK-LABEL: test1:
12 ; CHECK: movbel %esi, (%rdi)
13 ; SLM-LABEL: test1:
14 ; SLM: movbel   %esi, (%rdi)
15 }
16
17 define i32 @test2(i32* %x) nounwind {
18   %load = load i32* %x, align 4
19   %bswap = call i32 @llvm.bswap.i32(i32 %load)
20   ret i32 %bswap
21 ; CHECK-LABEL: test2:
22 ; CHECK: movbel (%rdi), %eax
23 ; SLM-LABEL: test2:
24 ; SLM: movbel   (%rdi), %eax
25 }
26
27 define void @test3(i64* %x, i64 %y) nounwind {
28   %bswap = call i64 @llvm.bswap.i64(i64 %y)
29   store i64 %bswap, i64* %x, align 8
30   ret void
31 ; CHECK-LABEL: test3:
32 ; CHECK: movbeq %rsi, (%rdi)
33 ; SLM-LABEL: test3:
34 ; SLM: movbeq   %rsi, (%rdi)
35 }
36
37 define i64 @test4(i64* %x) nounwind {
38   %load = load i64* %x, align 8
39   %bswap = call i64 @llvm.bswap.i64(i64 %load)
40   ret i64 %bswap
41 ; CHECK-LABEL: test4:
42 ; CHECK: movbeq (%rdi), %rax
43 ; SLM-LABEL: test4:
44 ; SLM: movbeq   (%rdi), %rax
45 }