2009-09-09 08:09:15 +08:00
|
|
|
; RUN: llc < %s
|
2016-11-08 00:47:20 +08:00
|
|
|
; RUN: llc -O0 < %s
|
2005-04-30 12:07:15 +08:00
|
|
|
|
2005-04-30 12:41:27 +08:00
|
|
|
;; SQRT
|
2008-02-19 09:41:04 +08:00
|
|
|
declare float @llvm.sqrt.f32(float)
|
|
|
|
|
|
|
|
declare double @llvm.sqrt.f64(double)
|
|
|
|
|
|
|
|
define double @test_sqrt(float %F) {
|
|
|
|
%G = call float @llvm.sqrt.f32( float %F ) ; <float> [#uses=1]
|
|
|
|
%H = fpext float %G to double ; <double> [#uses=1]
|
|
|
|
%I = call double @llvm.sqrt.f64( double %H ) ; <double> [#uses=1]
|
|
|
|
ret double %I
|
2005-04-30 12:07:15 +08:00
|
|
|
}
|
2005-04-30 12:41:27 +08:00
|
|
|
|
2008-02-19 09:41:04 +08:00
|
|
|
|
2005-04-30 12:41:27 +08:00
|
|
|
; SIN
|
2009-11-03 10:19:31 +08:00
|
|
|
declare float @sinf(float) readonly
|
2008-02-19 09:41:04 +08:00
|
|
|
|
2009-11-03 10:19:31 +08:00
|
|
|
declare double @sin(double) readonly
|
2008-02-19 09:41:04 +08:00
|
|
|
|
|
|
|
define double @test_sin(float %F) {
|
|
|
|
%G = call float @sinf( float %F ) ; <float> [#uses=1]
|
|
|
|
%H = fpext float %G to double ; <double> [#uses=1]
|
|
|
|
%I = call double @sin( double %H ) ; <double> [#uses=1]
|
|
|
|
ret double %I
|
2005-04-30 12:41:27 +08:00
|
|
|
}
|
|
|
|
|
2008-02-19 09:41:04 +08:00
|
|
|
|
2005-04-30 12:41:27 +08:00
|
|
|
; COS
|
2009-11-03 10:19:31 +08:00
|
|
|
declare float @cosf(float) readonly
|
2008-02-19 09:41:04 +08:00
|
|
|
|
2009-11-03 10:19:31 +08:00
|
|
|
declare double @cos(double) readonly
|
2008-02-19 09:41:04 +08:00
|
|
|
|
|
|
|
define double @test_cos(float %F) {
|
|
|
|
%G = call float @cosf( float %F ) ; <float> [#uses=1]
|
|
|
|
%H = fpext float %G to double ; <double> [#uses=1]
|
|
|
|
%I = call double @cos( double %H ) ; <double> [#uses=1]
|
|
|
|
ret double %I
|
2005-04-30 12:41:27 +08:00
|
|
|
}
|
2008-02-19 09:41:04 +08:00
|
|
|
|
2016-11-08 00:47:20 +08:00
|
|
|
declare i8* @llvm.invariant.group.barrier(i8*)
|
|
|
|
|
|
|
|
define i8* @barrier(i8* %p) {
|
|
|
|
%q = call i8* @llvm.invariant.group.barrier(i8* %p)
|
|
|
|
ret i8* %q
|
|
|
|
}
|