2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
|
2004-11-07 06:08:43 +00:00
|
|
|
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
|
|
|
|
; RUN: diff %t1.ll %t2.ll
|
|
|
|
|
2004-06-11 02:29:57 +00:00
|
|
|
|
2006-01-19 01:17:06 +00:00
|
|
|
declare bool %llvm.isunordered.f32(float,float)
|
|
|
|
declare bool %llvm.isunordered.f64(double,double)
|
2004-06-12 19:19:14 +00:00
|
|
|
|
2005-02-28 19:31:42 +00:00
|
|
|
declare void %llvm.prefetch(sbyte*, uint, uint)
|
|
|
|
|
2007-04-01 07:36:28 +00:00
|
|
|
declare uint %llvm.ctpop.i8(ubyte)
|
|
|
|
declare uint %llvm.ctpop.i16(ushort)
|
2006-01-19 01:17:06 +00:00
|
|
|
declare uint %llvm.ctpop.i32(uint)
|
2007-04-01 07:36:28 +00:00
|
|
|
declare uint %llvm.ctpop.i64(ulong)
|
2006-01-19 01:17:06 +00:00
|
|
|
|
2007-04-01 07:36:28 +00:00
|
|
|
declare uint %llvm.cttz.i8(ubyte)
|
|
|
|
declare uint %llvm.cttz.i16(ushort)
|
2006-01-19 01:17:06 +00:00
|
|
|
declare uint %llvm.cttz.i32(uint)
|
2007-04-01 07:36:28 +00:00
|
|
|
declare uint %llvm.cttz.i64(ulong)
|
2006-01-19 01:17:06 +00:00
|
|
|
|
2007-04-01 07:36:28 +00:00
|
|
|
declare uint %llvm.ctlz.i8(ubyte)
|
|
|
|
declare uint %llvm.ctlz.i16(ushort)
|
2006-01-19 01:17:06 +00:00
|
|
|
declare uint %llvm.ctlz.i32(uint)
|
2007-04-01 07:36:28 +00:00
|
|
|
declare uint %llvm.ctlz.i64(ulong)
|
2006-01-19 01:17:06 +00:00
|
|
|
|
|
|
|
declare float %llvm.sqrt.f32(float)
|
|
|
|
declare double %llvm.sqrt.f64(double)
|
2005-05-03 16:49:48 +00:00
|
|
|
|
2004-06-11 01:06:40 +00:00
|
|
|
implementation
|
|
|
|
|
|
|
|
; Test llvm intrinsics
|
|
|
|
;
|
2004-06-11 02:29:57 +00:00
|
|
|
void %libm() {
|
2006-01-19 01:17:06 +00:00
|
|
|
call bool %llvm.isunordered.f32(float 1.0, float 2.0)
|
|
|
|
call bool %llvm.isunordered.f64(double 3.0, double 4.0)
|
|
|
|
|
2005-02-28 19:31:42 +00:00
|
|
|
call void %llvm.prefetch(sbyte* null, uint 1, uint 3)
|
2006-01-19 01:17:06 +00:00
|
|
|
|
|
|
|
call float %llvm.sqrt.f32(float 5.0)
|
|
|
|
call double %llvm.sqrt.f64(double 6.0)
|
|
|
|
|
2007-04-01 07:36:28 +00:00
|
|
|
call uint %llvm.ctpop.i8(ubyte 10)
|
|
|
|
call uint %llvm.ctpop.i16(ushort 11)
|
2006-01-19 01:17:06 +00:00
|
|
|
call uint %llvm.ctpop.i32(uint 12)
|
2007-04-01 07:36:28 +00:00
|
|
|
call uint %llvm.ctpop.i64(ulong 13)
|
2006-01-19 01:17:06 +00:00
|
|
|
|
2007-04-01 07:36:28 +00:00
|
|
|
call uint %llvm.ctlz.i8(ubyte 14)
|
|
|
|
call uint %llvm.ctlz.i16(ushort 15)
|
2006-01-19 01:17:06 +00:00
|
|
|
call uint %llvm.ctlz.i32(uint 16)
|
2007-04-01 07:36:28 +00:00
|
|
|
call uint %llvm.ctlz.i64(ulong 17)
|
2006-01-19 01:17:06 +00:00
|
|
|
|
2007-04-01 07:36:28 +00:00
|
|
|
call uint %llvm.cttz.i8(ubyte 18)
|
|
|
|
call uint %llvm.cttz.i16(ushort 19)
|
2006-01-19 01:17:06 +00:00
|
|
|
call uint %llvm.cttz.i32(uint 20)
|
2007-04-01 07:36:28 +00:00
|
|
|
call uint %llvm.cttz.i64(ulong 21)
|
2004-06-11 01:06:40 +00:00
|
|
|
ret void
|
2004-06-11 02:29:57 +00:00
|
|
|
}
|
2005-05-09 04:47:32 +00:00
|
|
|
|
|
|
|
; FIXME: test ALL the intrinsics in this file.
|