bittest-intrin.ll
4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-windows-msvc19.11.0 | FileCheck %s
; This matches the code produced by clang/lib/CodeGen/bittest-intrin.c
@sink = global i8 0, align 1
define void @test32(i32* %base, i32 %idx) {
; CHECK-LABEL: test32:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: #APP
; CHECK-NEXT: btl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: btcl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: btrl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: btsl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: lock btrl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: lock btsl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: lock btsl %edx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: retq
entry:
%0 = tail call i8 asm sideeffect "btl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %0, i8* @sink, align 1
%1 = tail call i8 asm sideeffect "btcl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %1, i8* @sink, align 1
%2 = tail call i8 asm sideeffect "btrl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %2, i8* @sink, align 1
%3 = tail call i8 asm sideeffect "btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %3, i8* @sink, align 1
%4 = tail call i8 asm sideeffect "lock btrl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %4, i8* @sink, align 1
%5 = tail call i8 asm sideeffect "lock btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %5, i8* @sink, align 1
%6 = tail call i8 asm sideeffect "lock btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %base, i32 %idx)
store volatile i8 %6, i8* @sink, align 1
ret void
}
; Function Attrs: nounwind uwtable
define void @test64(i64* %base, i64 %idx) {
; CHECK-LABEL: test64:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: #APP
; CHECK-NEXT: btq %rdx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: btcq %rdx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: btrq %rdx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: btsq %rdx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: lock btrq %rdx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: #APP
; CHECK-NEXT: lock btsq %rdx, (%rcx)
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: setb {{.*}}(%rip)
; CHECK-NEXT: retq
entry:
%0 = tail call i8 asm sideeffect "btq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %base, i64 %idx)
store volatile i8 %0, i8* @sink, align 1
%1 = tail call i8 asm sideeffect "btcq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %base, i64 %idx)
store volatile i8 %1, i8* @sink, align 1
%2 = tail call i8 asm sideeffect "btrq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %base, i64 %idx)
store volatile i8 %2, i8* @sink, align 1
%3 = tail call i8 asm sideeffect "btsq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %base, i64 %idx)
store volatile i8 %3, i8* @sink, align 1
%4 = tail call i8 asm sideeffect "lock btrq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %base, i64 %idx)
store volatile i8 %4, i8* @sink, align 1
%5 = tail call i8 asm sideeffect "lock btsq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %base, i64 %idx)
store volatile i8 %5, i8* @sink, align 1
ret void
}