• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2 -asm-instrumentation=address -asan-instrument-assembly | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-unknown-linux-gnu"
5
6; CHECK-LABEL: rep_movs_1b
7; CHECK: pushfq
8; CHECK-NEXT: testq %rcx, %rcx
9; CHECK-NEXT: je [[B:.*]]
10
11; CHECK: leaq -128(%rsp), %rsp
12; CHECK-NEXT: pushq %rax
13; CHECK-NEXT: pushq %rdx
14; CHECK-NEXT: pushq %rbx
15; CHECK-NEXT: pushfq
16
17; CHECK: leaq (%rsi), %rdx
18; CHECK: movq %rdx, %rdi
19; CHECK-NEXT: callq __asan_report_load1@PLT
20
21; CHECK: leaq -1(%rsi,%rcx), %rdx
22; CHECK: movq %rdx, %rdi
23; CHECK-NEXT: callq __asan_report_load1@PLT
24
25; CHECK: leaq (%rdi), %rdx
26; CHECK: movq %rdx, %rdi
27; CHECK-NEXT: callq __asan_report_store1@PLT
28
29; CHECK: leaq -1(%rdi,%rcx), %rdx
30; CHECK: movq %rdx, %rdi
31; CHECK-NEXT: callq __asan_report_store1@PLT
32
33; CHECK: popfq
34; CHECK-NEXT: popq %rbx
35; CHECK-NEXT: popq %rdx
36; CHECK-NEXT: popq %rax
37; CHECK-NEXT: leaq 128(%rsp), %rsp
38
39; CHECK: [[B]]:
40; CHECK-NEXT: popfq
41
42; CHECK: rep
43; CHECK-NEXT: movsb (%rsi), %es:(%rdi)
44
45; Function Attrs: nounwind sanitize_address uwtable
46define void @rep_movs_1b(i8* %dst, i8* %src, i64 %n) #0 {
47entry:
48  tail call void asm sideeffect "rep movsb \0A\09", "{si},{di},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %src, i8* %dst, i64 %n) #1
49  ret void
50}
51
52; CHECK-LABEL: rep_movs_8b
53; CHECK: pushfq
54; CHECK-NEXT: testq %rcx, %rcx
55; CHECK-NEXT: je [[Q:.*]]
56
57; CHECK: leaq (%rsi), %rdx
58; CHECK: movq %rdx, %rdi
59; CHECK-NEXT: callq __asan_report_load8@PLT
60
61; CHECK: leaq -1(%rsi,%rcx,8), %rdx
62; CHECK: movq %rdx, %rdi
63; CHECK-NEXT: callq __asan_report_load8@PLT
64
65; CHECK: leaq (%rdi), %rdx
66; CHECK: movq %rdx, %rdi
67; CHECK-NEXT: callq __asan_report_store8@PLT
68
69; CHECK: leaq -1(%rdi,%rcx,8), %rdx
70; CHECK: movq %rdx, %rdi
71; CHECK-NEXT: callq __asan_report_store8@PLT
72
73; CHECK: [[Q]]:
74; CHECK-NEXT: popfq
75
76; CHECK: rep
77; CHECK-NEXT: movsq (%rsi), %es:(%rdi)
78
79; Function Attrs: nounwind sanitize_address uwtable
80define void @rep_movs_8b(i64* %dst, i64* %src, i64 %n) #0 {
81entry:
82  tail call void asm sideeffect "rep movsq \0A\09", "{si},{di},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %src, i64* %dst, i64 %n) #1
83  ret void
84}
85
86attributes #0 = { nounwind sanitize_address uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
87attributes #1 = { nounwind }
88