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
4 declare i16 @llvm.bswap.i16(i16) nounwind readnone
5 declare i32 @llvm.bswap.i32(i32) nounwind readnone
6 declare i64 @llvm.bswap.i64(i64) nounwind readnone
8 define void @test1(ptr nocapture %x, i16 %y) nounwind {
9 %bswap = call i16 @llvm.bswap.i16(i16 %y)
10 store i16 %bswap, ptr %x, align 2
13 ; CHECK: movbew %si, (%rdi)
15 ; SLM: movbew %si, (%rdi)
18 define i16 @test2(ptr %x) nounwind {
19 %load = load i16, ptr %x, align 2
20 %bswap = call i16 @llvm.bswap.i16(i16 %load)
23 ; CHECK: movbew (%rdi), %ax
25 ; SLM: movbew (%rdi), %ax
28 define void @test3(ptr nocapture %x, i32 %y) nounwind {
29 %bswap = call i32 @llvm.bswap.i32(i32 %y)
30 store i32 %bswap, ptr %x, align 4
33 ; CHECK: movbel %esi, (%rdi)
35 ; SLM: movbel %esi, (%rdi)
38 define i32 @test4(ptr %x) nounwind {
39 %load = load i32, ptr %x, align 4
40 %bswap = call i32 @llvm.bswap.i32(i32 %load)
43 ; CHECK: movbel (%rdi), %eax
45 ; SLM: movbel (%rdi), %eax
48 define void @test5(ptr %x, i64 %y) nounwind {
49 %bswap = call i64 @llvm.bswap.i64(i64 %y)
50 store i64 %bswap, ptr %x, align 8
53 ; CHECK: movbeq %rsi, (%rdi)
55 ; SLM: movbeq %rsi, (%rdi)
58 define i64 @test6(ptr %x) nounwind {
59 %load = load i64, ptr %x, align 8
60 %bswap = call i64 @llvm.bswap.i64(i64 %load)
63 ; CHECK: movbeq (%rdi), %rax
65 ; SLM: movbeq (%rdi), %rax