2007-09-27 05:12:10 +08:00
|
|
|
; Make sure this testcase codegens to the sin and cos instructions, not calls
|
2009-09-12 02:36:27 +08:00
|
|
|
; RUN: llc < %s -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
|
2007-09-27 05:12:10 +08:00
|
|
|
; RUN: grep sin\$ | count 3
|
2009-09-12 02:36:27 +08:00
|
|
|
; RUN: llc < %s -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
|
2007-09-27 05:12:10 +08:00
|
|
|
; RUN: grep cos\$ | count 3
|
|
|
|
|
2009-09-26 02:15:29 +08:00
|
|
|
declare float @sinf(float) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
|
2009-09-26 02:15:29 +08:00
|
|
|
declare double @sin(double) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
|
2009-09-26 02:15:29 +08:00
|
|
|
declare x86_fp80 @sinl(x86_fp80) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
|
|
|
|
define float @test1(float %X) {
|
2009-09-26 02:15:29 +08:00
|
|
|
%Y = call float @sinf(float %X) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
ret float %Y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test2(double %X) {
|
2009-09-26 02:15:29 +08:00
|
|
|
%Y = call double @sin(double %X) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
ret double %Y
|
|
|
|
}
|
|
|
|
|
|
|
|
define x86_fp80 @test3(x86_fp80 %X) {
|
2009-09-26 02:15:29 +08:00
|
|
|
%Y = call x86_fp80 @sinl(x86_fp80 %X) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
ret x86_fp80 %Y
|
|
|
|
}
|
|
|
|
|
2009-09-26 02:15:29 +08:00
|
|
|
declare float @cosf(float) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
|
2009-09-26 02:15:29 +08:00
|
|
|
declare double @cos(double) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
|
2009-09-26 02:15:29 +08:00
|
|
|
declare x86_fp80 @cosl(x86_fp80) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
|
|
|
|
define float @test4(float %X) {
|
2009-09-26 02:15:29 +08:00
|
|
|
%Y = call float @cosf(float %X) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
ret float %Y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test5(double %X) {
|
2009-09-26 02:15:29 +08:00
|
|
|
%Y = call double @cos(double %X) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
ret double %Y
|
|
|
|
}
|
|
|
|
|
|
|
|
define x86_fp80 @test6(x86_fp80 %X) {
|
2009-09-26 02:15:29 +08:00
|
|
|
%Y = call x86_fp80 @cosl(x86_fp80 %X) readonly
|
2007-09-27 05:12:10 +08:00
|
|
|
ret x86_fp80 %Y
|
|
|
|
}
|
|
|
|
|