blob: 0ea5541c89dcaaa4c6dd66fda646a38044bb31be [file] [log] [blame]
John Bauman66b8ab22014-05-06 15:57:45 -04001; RUN: llc < %s -march=x86-64 > %t
2; RUN: not grep leaq %t
3; RUN: not grep incq %t
4; RUN: not grep decq %t
5; RUN: not grep negq %t
6; RUN: not grep addq %t
7; RUN: not grep subq %t
8; RUN: not grep {movl %} %t
9
10; Utilize implicit zero-extension on x86-64 to eliminate explicit
11; zero-extensions. Shrink 64-bit adds to 32-bit when the high
12; 32-bits will be zeroed.
13
14define void @bar(i64 %x, i64 %y, i64* %z) nounwind readnone {
15entry:
16 %t0 = add i64 %x, %y
17 %t1 = and i64 %t0, 4294967295
18 store i64 %t1, i64* %z
19 ret void
20}
21define void @easy(i32 %x, i32 %y, i64* %z) nounwind readnone {
22entry:
23 %t0 = add i32 %x, %y
24 %tn = zext i32 %t0 to i64
25 %t1 = and i64 %tn, 4294967295
26 store i64 %t1, i64* %z
27 ret void
28}
29define void @cola(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone {
30entry:
31 %p = load i64* %x
32 %t0 = add i64 %p, %y
33 %t1 = and i64 %t0, 4294967295
34 %t2 = xor i64 %t1, %u
35 store i64 %t2, i64* %z
36 ret void
37}
38define void @yaks(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone {
39entry:
40 %p = load i64* %x
41 %t0 = add i64 %p, %y
42 %t1 = xor i64 %t0, %u
43 %t2 = and i64 %t1, 4294967295
44 store i64 %t2, i64* %z
45 ret void
46}
47define void @foo(i64 *%x, i64 *%y, i64* %z) nounwind readnone {
48entry:
49 %a = load i64* %x
50 %b = load i64* %y
51 %t0 = add i64 %a, %b
52 %t1 = and i64 %t0, 4294967295
53 store i64 %t1, i64* %z
54 ret void
55}
56define void @avo(i64 %x, i64* %z, i64 %u) nounwind readnone {
57entry:
58 %t0 = add i64 %x, 734847
59 %t1 = and i64 %t0, 4294967295
60 %t2 = xor i64 %t1, %u
61 store i64 %t2, i64* %z
62 ret void
63}
64define void @phe(i64 %x, i64* %z, i64 %u) nounwind readnone {
65entry:
66 %t0 = add i64 %x, 734847
67 %t1 = xor i64 %t0, %u
68 %t2 = and i64 %t1, 4294967295
69 store i64 %t2, i64* %z
70 ret void
71}
72define void @oze(i64 %y, i64* %z) nounwind readnone {
73entry:
74 %t0 = add i64 %y, 1
75 %t1 = and i64 %t0, 4294967295
76 store i64 %t1, i64* %z
77 ret void
78}
79
80define void @sbar(i64 %x, i64 %y, i64* %z) nounwind readnone {
81entry:
82 %t0 = sub i64 %x, %y
83 %t1 = and i64 %t0, 4294967295
84 store i64 %t1, i64* %z
85 ret void
86}
87define void @seasy(i32 %x, i32 %y, i64* %z) nounwind readnone {
88entry:
89 %t0 = sub i32 %x, %y
90 %tn = zext i32 %t0 to i64
91 %t1 = and i64 %tn, 4294967295
92 store i64 %t1, i64* %z
93 ret void
94}
95define void @scola(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone {
96entry:
97 %p = load i64* %x
98 %t0 = sub i64 %p, %y
99 %t1 = and i64 %t0, 4294967295
100 %t2 = xor i64 %t1, %u
101 store i64 %t2, i64* %z
102 ret void
103}
104define void @syaks(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone {
105entry:
106 %p = load i64* %x
107 %t0 = sub i64 %p, %y
108 %t1 = xor i64 %t0, %u
109 %t2 = and i64 %t1, 4294967295
110 store i64 %t2, i64* %z
111 ret void
112}
113define void @sfoo(i64 *%x, i64 *%y, i64* %z) nounwind readnone {
114entry:
115 %a = load i64* %x
116 %b = load i64* %y
117 %t0 = sub i64 %a, %b
118 %t1 = and i64 %t0, 4294967295
119 store i64 %t1, i64* %z
120 ret void
121}
122define void @swya(i64 %y, i64* %z) nounwind readnone {
123entry:
124 %t0 = sub i64 0, %y
125 %t1 = and i64 %t0, 4294967295
126 store i64 %t1, i64* %z
127 ret void
128}
129define void @soze(i64 %y, i64* %z) nounwind readnone {
130entry:
131 %t0 = sub i64 %y, 1
132 %t1 = and i64 %t0, 4294967295
133 store i64 %t1, i64* %z
134 ret void
135}