2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc
|
2005-04-30 04:07:15 +00:00
|
|
|
|
2005-04-30 04:41:27 +00:00
|
|
|
;; SQRT
|
2006-12-02 20:38:10 +00:00
|
|
|
declare float %llvm.sqrt.f32(float)
|
|
|
|
declare double %llvm.sqrt.f64(double)
|
2005-04-30 04:07:15 +00:00
|
|
|
double %test_sqrt(float %F) {
|
2006-12-02 20:38:10 +00:00
|
|
|
%G = call float %llvm.sqrt.f32(float %F)
|
2005-04-30 04:07:15 +00:00
|
|
|
%H = cast float %G to double
|
2006-12-02 20:38:10 +00:00
|
|
|
%I = call double %llvm.sqrt.f64(double %H)
|
2005-04-30 04:07:15 +00:00
|
|
|
ret double %I
|
|
|
|
}
|
2005-04-30 04:41:27 +00:00
|
|
|
|
|
|
|
; SIN
|
|
|
|
declare float %sinf(float)
|
|
|
|
declare double %sin(double)
|
|
|
|
double %test_sin(float %F) {
|
|
|
|
%G = call float %sinf(float %F)
|
|
|
|
%H = cast float %G to double
|
|
|
|
%I = call double %sin(double %H)
|
|
|
|
ret double %I
|
|
|
|
}
|
|
|
|
|
|
|
|
; COS
|
|
|
|
declare float %cosf(float)
|
|
|
|
declare double %cos(double)
|
|
|
|
double %test_cos(float %F) {
|
|
|
|
%G = call float %cosf(float %F)
|
|
|
|
%H = cast float %G to double
|
|
|
|
%I = call double %cos(double %H)
|
|
|
|
ret double %I
|
|
|
|
}
|