blob: 1d1575d584a6235036fe4cbb7b152e2e3261fbb8 [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
Tanya Lattner3f7706b2004-11-07 06:08:43 +00002; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Chris Lattner86ee7762004-06-11 02:29:57 +00005
Reid Spencerfd57ad72006-01-19 01:17:06 +00006declare bool %llvm.isunordered.f32(float,float)
7declare bool %llvm.isunordered.f64(double,double)
Alkis Evlogimenos96853722004-06-12 19:19:14 +00008
Chris Lattner47adf212005-02-28 19:31:42 +00009declare void %llvm.prefetch(sbyte*, uint, uint)
10
Reid Spencerfd57ad72006-01-19 01:17:06 +000011declare ubyte %llvm.ctpop.i8(ubyte)
12declare ushort %llvm.ctpop.i16(ushort)
13declare uint %llvm.ctpop.i32(uint)
14declare ulong %llvm.ctpop.i64(ulong)
15
Reid Spencerfd57ad72006-01-19 01:17:06 +000016declare ubyte %llvm.cttz.i8(ubyte)
17declare ushort %llvm.cttz.i16(ushort)
18declare uint %llvm.cttz.i32(uint)
19declare ulong %llvm.cttz.i64(ulong)
20
Reid Spencerfd57ad72006-01-19 01:17:06 +000021declare ubyte %llvm.ctlz.i8(ubyte)
22declare ushort %llvm.ctlz.i16(ushort)
23declare uint %llvm.ctlz.i32(uint)
24declare ulong %llvm.ctlz.i64(ulong)
25
Reid Spencerfd57ad72006-01-19 01:17:06 +000026declare float %llvm.sqrt.f32(float)
27declare double %llvm.sqrt.f64(double)
Andrew Lenharth279a7b22005-05-03 16:49:48 +000028
Alkis Evlogimenosfd39b302004-06-11 01:06:40 +000029implementation
30
31; Test llvm intrinsics
32;
Chris Lattner86ee7762004-06-11 02:29:57 +000033void %libm() {
Reid Spencerfd57ad72006-01-19 01:17:06 +000034 call bool %llvm.isunordered.f32(float 1.0, float 2.0)
35 call bool %llvm.isunordered.f64(double 3.0, double 4.0)
36
Chris Lattner47adf212005-02-28 19:31:42 +000037 call void %llvm.prefetch(sbyte* null, uint 1, uint 3)
Reid Spencerfd57ad72006-01-19 01:17:06 +000038
Reid Spencerfd57ad72006-01-19 01:17:06 +000039 call float %llvm.sqrt.f32(float 5.0)
40 call double %llvm.sqrt.f64(double 6.0)
41
Reid Spencerfd57ad72006-01-19 01:17:06 +000042 call ubyte %llvm.ctpop.i8(ubyte 10)
43 call ushort %llvm.ctpop.i16(ushort 11)
44 call uint %llvm.ctpop.i32(uint 12)
45 call ulong %llvm.ctpop.i64(ulong 13)
46
Reid Spencerfd57ad72006-01-19 01:17:06 +000047 call ubyte %llvm.ctlz.i8(ubyte 14)
48 call ushort %llvm.ctlz.i16(ushort 15)
49 call uint %llvm.ctlz.i32(uint 16)
50 call ulong %llvm.ctlz.i64(ulong 17)
51
Reid Spencerfd57ad72006-01-19 01:17:06 +000052 call ubyte %llvm.cttz.i8(ubyte 18)
53 call ushort %llvm.cttz.i16(ushort 19)
54 call uint %llvm.cttz.i32(uint 20)
55 call ulong %llvm.cttz.i64(ulong 21)
Alkis Evlogimenosfd39b302004-06-11 01:06:40 +000056 ret void
Chris Lattner86ee7762004-06-11 02:29:57 +000057}
Reid Spencer87bb7c62005-05-09 04:47:32 +000058
59; FIXME: test ALL the intrinsics in this file.