llvm.memory.barrier, and impl for x86 and alpha
[oota-llvm.git] / test / CodeGen / Generic / llvm-ct-intrinsics.ll
1 ; Make sure this testcase is supported by all code generators
2 ; RUN: llvm-upgrade < %s | llvm-as | llc
3
4 declare ulong %llvm.ctpop.i64(ulong)
5 declare uint %llvm.ctpop.i32(uint)
6 declare ushort %llvm.ctpop.i16(ushort)
7 declare ubyte %llvm.ctpop.i8(ubyte)
8
9 void %ctpoptest(ubyte %A, ushort %B, uint %C, ulong %D, 
10                 ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
11         %a = call ubyte %llvm.ctpop.i8(ubyte %A)
12         %b = call ushort %llvm.ctpop.i16(ushort %B)
13         %c = call uint %llvm.ctpop.i32(uint %C)
14         %d = call ulong %llvm.ctpop.i64(ulong %D)
15
16         store ubyte %a, ubyte* %AP
17         store ushort %b, ushort* %BP
18         store uint   %c, uint* %CP
19         store ulong  %d, ulong* %DP
20         ret void
21 }
22
23 declare ulong %llvm.ctlz.i64(ulong)
24 declare uint %llvm.ctlz.i32(uint)
25 declare ushort %llvm.ctlz.i16(ushort)
26 declare ubyte %llvm.ctlz.i8(ubyte)
27
28 void %ctlztest(ubyte %A, ushort %B, uint %C, ulong %D, 
29                ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
30         %a = call ubyte %llvm.ctlz.i8(ubyte %A)
31         %b = call ushort %llvm.ctlz.i16(ushort %B)
32         %c = call uint %llvm.ctlz.i32(uint %C)
33         %d = call ulong %llvm.ctlz.i64(ulong %D)
34
35         store ubyte %a, ubyte* %AP
36         store ushort %b, ushort* %BP
37         store uint   %c, uint* %CP
38         store ulong  %d, ulong* %DP
39         ret void
40 }
41
42 declare ulong %llvm.cttz.i64(ulong)
43 declare uint %llvm.cttz.i32(uint)
44 declare ushort %llvm.cttz.i16(ushort)
45 declare ubyte %llvm.cttz.i8(ubyte)
46
47 void %cttztest(ubyte %A, ushort %B, uint %C, ulong %D, 
48                ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
49         %a = call ubyte %llvm.cttz.i8(ubyte %A)
50         %b = call ushort %llvm.cttz.i16(ushort %B)
51         %c = call uint %llvm.cttz.i32(uint %C)
52         %d = call ulong %llvm.cttz.i64(ulong %D)
53
54         store ubyte %a, ubyte* %AP
55         store ushort %b, ushort* %BP
56         store uint   %c, uint* %CP
57         store ulong  %d, ulong* %DP
58         ret void
59 }