Update credits and fix sorting issue.
[llvm-complete.git] / test / Feature / intrinsics.ll
blob6733e3711948e505411b022accf48470c209906b
1 ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3 ; RUN: diff %t1.ll %t2.ll
6 declare bool %llvm.isunordered(float, float)
7 declare bool %llvm.isunordered(double, double)
8 declare bool %llvm.isunordered.f32(float,float)
9 declare bool %llvm.isunordered.f64(double,double)
11 declare void %llvm.prefetch(sbyte*, uint, uint)
13 declare uint %llvm.ctpop(uint)
14 declare ubyte %llvm.ctpop.i8(ubyte)
15 declare ushort %llvm.ctpop.i16(ushort)
16 declare uint %llvm.ctpop.i32(uint)
17 declare ulong %llvm.ctpop.i64(ulong)
19 declare ushort %llvm.cttz(ushort)
20 declare ubyte %llvm.cttz.i8(ubyte)
21 declare ushort %llvm.cttz.i16(ushort)
22 declare uint %llvm.cttz.i32(uint)
23 declare ulong %llvm.cttz.i64(ulong)
25 declare ulong %llvm.ctlz(ulong)
26 declare ubyte %llvm.ctlz.i8(ubyte)
27 declare ushort %llvm.ctlz.i16(ushort)
28 declare uint %llvm.ctlz.i32(uint)
29 declare ulong %llvm.ctlz.i64(ulong)
31 declare float %llvm.sqrt(float)
32 declare double %llvm.sqrt(double)
33 declare float %llvm.sqrt.f32(float)
34 declare double %llvm.sqrt.f64(double)
36 implementation
38 ; Test llvm intrinsics
40 void %libm() {
41         call bool %llvm.isunordered(float 0.0, float 1.0)
42         call bool %llvm.isunordered(double 0.0, double 0x7FF8000000000000)
43         call bool %llvm.isunordered.f32(float 1.0, float 2.0)
44         call bool %llvm.isunordered.f64(double 3.0, double 4.0)
46         call void %llvm.prefetch(sbyte* null, uint 1, uint 3)
48         call float %llvm.sqrt(float 4.0)
49         call double %llvm.sqrt(double 4.0)
50         call float %llvm.sqrt.f32(float 5.0)
51         call double %llvm.sqrt.f64(double 6.0)
53         call uint %llvm.ctpop(uint 3)
54         call ubyte %llvm.ctpop.i8(ubyte 10)
55         call ushort %llvm.ctpop.i16(ushort 11)
56         call uint %llvm.ctpop.i32(uint 12)
57         call ulong %llvm.ctpop.i64(ulong 13)
59         call ulong %llvm.ctlz(ulong 65000)
60         call ubyte %llvm.ctlz.i8(ubyte 14)
61         call ushort %llvm.ctlz.i16(ushort 15)
62         call uint %llvm.ctlz.i32(uint 16)
63         call ulong %llvm.ctlz.i64(ulong 17)
65         call ushort %llvm.cttz(ushort 7)
66         call ubyte %llvm.cttz.i8(ubyte 18)
67         call ushort %llvm.cttz.i16(ushort 19)
68         call uint %llvm.cttz.i32(uint 20)
69         call ulong %llvm.cttz.i64(ulong 21)
70         ret void
73 ; FIXME: test ALL the intrinsics in this file.