2011-11-01 18:51:48 +08:00
|
|
|
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
|
|
declare double @llvm.cos.f64(double)
|
|
|
|
declare double @llvm.exp.f64(double)
|
|
|
|
declare double @llvm.exp2.f64(double)
|
|
|
|
declare double @llvm.log.f64(double)
|
|
|
|
declare double @llvm.log10.f64(double)
|
|
|
|
declare double @llvm.log2.f64(double)
|
|
|
|
declare double @llvm.pow.f64(double, double)
|
|
|
|
declare double @llvm.powi.f64(double, i32)
|
|
|
|
declare double @llvm.sin.f64(double)
|
|
|
|
declare double @llvm.sqrt.f64(double)
|
|
|
|
|
|
|
|
define double @cos(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: cos:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl cos
|
|
|
|
%result = call double @llvm.cos.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.cos.f32(float)
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: cosf:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl cosf
|
|
|
|
define float @cosf(float %F) {
|
|
|
|
%result = call float @llvm.cos.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @exp(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: exp:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl exp
|
|
|
|
%result = call double @llvm.exp.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.exp.f32(float)
|
|
|
|
|
|
|
|
define float @expf(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: expf:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl expf
|
|
|
|
%result = call float @llvm.exp.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @exp2(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: exp2:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl exp2
|
|
|
|
%result = call double @llvm.exp2.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.exp2.f32(float)
|
|
|
|
|
|
|
|
define float @exp2f(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: exp2f:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl exp2f
|
|
|
|
%result = call float @llvm.exp2.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @log(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: log:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl log
|
|
|
|
%result = call double @llvm.log.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.log.f32(float)
|
|
|
|
|
|
|
|
define float @logf(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: logf:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl logf
|
|
|
|
%result = call float @llvm.log.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @log10(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: log10:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl log10
|
|
|
|
%result = call double @llvm.log10.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.log10.f32(float)
|
|
|
|
|
|
|
|
define float @log10f(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: log10f:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl log10f
|
|
|
|
%result = call float @llvm.log10.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @log2(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: log2:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl log2
|
|
|
|
%result = call double @llvm.log2.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.log2.f32(float)
|
|
|
|
|
|
|
|
define float @log2f(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: log2f:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl log2f
|
|
|
|
%result = call float @llvm.log2.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @pow(double %F, double %power) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: pow:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl pow
|
|
|
|
%result = call double @llvm.pow.f64(double %F, double %power)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.pow.f32(float, float)
|
|
|
|
|
|
|
|
define float @powf(float %F, float %power) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: powf:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl powf
|
|
|
|
%result = call float @llvm.pow.f32(float %F, float %power)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @powi(double %F, i32 %power) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: powi:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl __powidf2
|
|
|
|
%result = call double @llvm.powi.f64(double %F, i32 %power)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.powi.f32(float, i32)
|
|
|
|
|
|
|
|
define float @powif(float %F, i32 %power) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: powif:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl __powisf2
|
|
|
|
%result = call float @llvm.powi.f32(float %F, i32 %power)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @sin(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sin:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl sin
|
|
|
|
%result = call double @llvm.sin.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.sin.f32(float)
|
|
|
|
|
|
|
|
define float @sinf(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sinf:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl sinf
|
|
|
|
%result = call float @llvm.sin.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @sqrt(double %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sqrt:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl sqrt
|
|
|
|
%result = call double @llvm.sqrt.f64(double %F)
|
|
|
|
ret double %result
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.sqrt.f32(float)
|
|
|
|
|
|
|
|
define float @sqrtf(float %F) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sqrtf:
|
2011-11-01 18:51:48 +08:00
|
|
|
; CHECK: bl sqrtf
|
|
|
|
%result = call float @llvm.sqrt.f32(float %F)
|
|
|
|
ret float %result
|
|
|
|
}
|