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