Home | History | Annotate | Download | only in X86
      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 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
      7 
      8 define void @test1(i16* nocapture %x, i16 %y) nounwind {
      9   %bswap = call i16 @llvm.bswap.i16(i16 %y)
     10   store i16 %bswap, i16* %x, align 2
     11   ret void
     12 ; CHECK-LABEL: test1:
     13 ; CHECK: movbew %si, (%rdi)
     14 ; SLM-LABEL: test1:
     15 ; SLM: movbew   %si, (%rdi)
     16 }
     17 
     18 define i16 @test2(i16* %x) nounwind {
     19   %load = load i16, i16* %x, align 2
     20   %bswap = call i16 @llvm.bswap.i16(i16 %load)
     21   ret i16 %bswap
     22 ; CHECK-LABEL: test2:
     23 ; CHECK: movbew (%rdi), %ax
     24 ; SLM-LABEL: test2:
     25 ; SLM: movbew   (%rdi), %ax
     26 }
     27 
     28 define void @test3(i32* nocapture %x, i32 %y) nounwind {
     29   %bswap = call i32 @llvm.bswap.i32(i32 %y)
     30   store i32 %bswap, i32* %x, align 4
     31   ret void
     32 ; CHECK-LABEL: test3:
     33 ; CHECK: movbel	%esi, (%rdi)
     34 ; SLM-LABEL: test3:
     35 ; SLM: movbel	%esi, (%rdi)
     36 }
     37 
     38 define i32 @test4(i32* %x) nounwind {
     39   %load = load i32, i32* %x, align 4
     40   %bswap = call i32 @llvm.bswap.i32(i32 %load)
     41   ret i32 %bswap
     42 ; CHECK-LABEL: test4:
     43 ; CHECK: movbel	(%rdi), %eax
     44 ; SLM-LABEL: test4:
     45 ; SLM: movbel	(%rdi), %eax
     46 }
     47 
     48 define void @test5(i64* %x, i64 %y) nounwind {
     49   %bswap = call i64 @llvm.bswap.i64(i64 %y)
     50   store i64 %bswap, i64* %x, align 8
     51   ret void
     52 ; CHECK-LABEL: test5:
     53 ; CHECK: movbeq	%rsi, (%rdi)
     54 ; SLM-LABEL: test5:
     55 ; SLM: movbeq	%rsi, (%rdi)
     56 }
     57 
     58 define i64 @test6(i64* %x) nounwind {
     59   %load = load i64, i64* %x, align 8
     60   %bswap = call i64 @llvm.bswap.i64(i64 %load)
     61   ret i64 %bswap
     62 ; CHECK-LABEL: test6:
     63 ; CHECK: movbeq	(%rdi), %rax
     64 ; SLM-LABEL: test6:
     65 ; SLM: movbeq	(%rdi), %rax
     66 }
     67