Tanya Lattner | 3f7706b | 2004-11-07 06:08:43 +0000 | [diff] [blame] | 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 |
| 4 | |
Chris Lattner | 86ee776 | 2004-06-11 02:29:57 +0000 | [diff] [blame] | 5 | |
Alkis Evlogimenos | 9685372 | 2004-06-12 19:19:14 +0000 | [diff] [blame] | 6 | declare bool %llvm.isunordered(float, float) |
| 7 | declare bool %llvm.isunordered(double, double) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 8 | declare bool %llvm.isunordered.f32(float,float) |
| 9 | declare bool %llvm.isunordered.f64(double,double) |
Alkis Evlogimenos | 9685372 | 2004-06-12 19:19:14 +0000 | [diff] [blame] | 10 | |
Chris Lattner | 47adf21 | 2005-02-28 19:31:42 +0000 | [diff] [blame] | 11 | declare void %llvm.prefetch(sbyte*, uint, uint) |
| 12 | |
Andrew Lenharth | f166ec6 | 2005-05-03 17:00:48 +0000 | [diff] [blame] | 13 | declare uint %llvm.ctpop(uint) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 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) |
| 18 | |
Andrew Lenharth | f166ec6 | 2005-05-03 17:00:48 +0000 | [diff] [blame] | 19 | declare ushort %llvm.cttz(ushort) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 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) |
| 24 | |
Andrew Lenharth | f166ec6 | 2005-05-03 17:00:48 +0000 | [diff] [blame] | 25 | declare ulong %llvm.ctlz(ulong) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 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) |
| 30 | |
| 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) |
Andrew Lenharth | 279a7b2 | 2005-05-03 16:49:48 +0000 | [diff] [blame] | 35 | |
Alkis Evlogimenos | fd39b30 | 2004-06-11 01:06:40 +0000 | [diff] [blame] | 36 | implementation |
| 37 | |
| 38 | ; Test llvm intrinsics |
| 39 | ; |
Chris Lattner | 86ee776 | 2004-06-11 02:29:57 +0000 | [diff] [blame] | 40 | void %libm() { |
Alkis Evlogimenos | 9685372 | 2004-06-12 19:19:14 +0000 | [diff] [blame] | 41 | call bool %llvm.isunordered(float 0.0, float 1.0) |
Chris Lattner | 5e9a7ca | 2004-06-15 21:29:40 +0000 | [diff] [blame] | 42 | call bool %llvm.isunordered(double 0.0, double 0x7FF8000000000000) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 43 | call bool %llvm.isunordered.f32(float 1.0, float 2.0) |
| 44 | call bool %llvm.isunordered.f64(double 3.0, double 4.0) |
| 45 | |
Chris Lattner | 47adf21 | 2005-02-28 19:31:42 +0000 | [diff] [blame] | 46 | call void %llvm.prefetch(sbyte* null, uint 1, uint 3) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 47 | |
| 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) |
| 52 | |
Andrew Lenharth | 279a7b2 | 2005-05-03 16:49:48 +0000 | [diff] [blame] | 53 | call uint %llvm.ctpop(uint 3) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 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) |
| 58 | |
Andrew Lenharth | 279a7b2 | 2005-05-03 16:49:48 +0000 | [diff] [blame] | 59 | call ulong %llvm.ctlz(ulong 65000) |
Reid Spencer | fd57ad7 | 2006-01-19 01:17:06 +0000 | [diff] [blame^] | 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) |
| 64 | |
| 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) |
Alkis Evlogimenos | fd39b30 | 2004-06-11 01:06:40 +0000 | [diff] [blame] | 70 | ret void |
Chris Lattner | 86ee776 | 2004-06-11 02:29:57 +0000 | [diff] [blame] | 71 | } |
Reid Spencer | 87bb7c6 | 2005-05-09 04:47:32 +0000 | [diff] [blame] | 72 | |
| 73 | ; FIXME: test ALL the intrinsics in this file. |