Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll |
| 2 | ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll |
| 3 | ; RUN: diff %t1.ll %t2.ll |
| 4 | |
| 5 | |
| 6 | declare bool %llvm.isunordered.f32(float,float) |
| 7 | declare bool %llvm.isunordered.f64(double,double) |
| 8 | |
| 9 | declare void %llvm.prefetch(sbyte*, uint, uint) |
| 10 | |
| 11 | declare uint %llvm.ctpop.i8(ubyte) |
| 12 | declare uint %llvm.ctpop.i16(ushort) |
| 13 | declare uint %llvm.ctpop.i32(uint) |
| 14 | declare uint %llvm.ctpop.i64(ulong) |
| 15 | |
| 16 | declare uint %llvm.cttz.i8(ubyte) |
| 17 | declare uint %llvm.cttz.i16(ushort) |
| 18 | declare uint %llvm.cttz.i32(uint) |
| 19 | declare uint %llvm.cttz.i64(ulong) |
| 20 | |
| 21 | declare uint %llvm.ctlz.i8(ubyte) |
| 22 | declare uint %llvm.ctlz.i16(ushort) |
| 23 | declare uint %llvm.ctlz.i32(uint) |
| 24 | declare uint %llvm.ctlz.i64(ulong) |
| 25 | |
| 26 | declare float %llvm.sqrt.f32(float) |
| 27 | declare double %llvm.sqrt.f64(double) |
| 28 | |
| 29 | implementation |
| 30 | |
| 31 | ; Test llvm intrinsics |
| 32 | ; |
| 33 | void %libm() { |
| 34 | call bool %llvm.isunordered.f32(float 1.0, float 2.0) |
| 35 | call bool %llvm.isunordered.f64(double 3.0, double 4.0) |
| 36 | |
| 37 | call void %llvm.prefetch(sbyte* null, uint 1, uint 3) |
| 38 | |
| 39 | call float %llvm.sqrt.f32(float 5.0) |
| 40 | call double %llvm.sqrt.f64(double 6.0) |
| 41 | |
| 42 | call uint %llvm.ctpop.i8(ubyte 10) |
| 43 | call uint %llvm.ctpop.i16(ushort 11) |
| 44 | call uint %llvm.ctpop.i32(uint 12) |
| 45 | call uint %llvm.ctpop.i64(ulong 13) |
| 46 | |
| 47 | call uint %llvm.ctlz.i8(ubyte 14) |
| 48 | call uint %llvm.ctlz.i16(ushort 15) |
| 49 | call uint %llvm.ctlz.i32(uint 16) |
| 50 | call uint %llvm.ctlz.i64(ulong 17) |
| 51 | |
| 52 | call uint %llvm.cttz.i8(ubyte 18) |
| 53 | call uint %llvm.cttz.i16(ushort 19) |
| 54 | call uint %llvm.cttz.i32(uint 20) |
| 55 | call uint %llvm.cttz.i64(ulong 21) |
| 56 | ret void |
| 57 | } |
| 58 | |
| 59 | ; FIXME: test ALL the intrinsics in this file. |