2007-09-26 21:12:10 +00:00
|
|
|
; Make sure this testcase codegens to the sin and cos instructions, not calls
|
2012-08-08 20:31:37 +00:00
|
|
|
; RUN: llc < %s -mtriple=i686-apple-macosx -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | FileCheck %s --check-prefix=SIN
|
|
|
|
; RUN: llc < %s -mtriple=i686-apple-macosx -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | FileCheck %s --check-prefix=COS
|
2012-09-15 12:44:27 +00:00
|
|
|
; RUN: llc < %s -mtriple=i686-apple-macosx -mattr=-sse,-sse2,-sse3 | FileCheck %s --check-prefix=SAFE
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2009-09-25 18:15:29 +00:00
|
|
|
declare float @sinf(float) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2009-09-25 18:15:29 +00:00
|
|
|
declare double @sin(double) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2009-09-25 18:15:29 +00:00
|
|
|
declare x86_fp80 @sinl(x86_fp80) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN: test1:
|
2007-09-26 21:12:10 +00:00
|
|
|
define float @test1(float %X) {
|
2009-09-25 18:15:29 +00:00
|
|
|
%Y = call float @sinf(float %X) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
ret float %Y
|
|
|
|
}
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN: {{^[ \t]*fsin$}}
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN-NOT: fsin
|
|
|
|
|
2012-09-15 12:44:27 +00:00
|
|
|
; SAFE: test1
|
|
|
|
; SAFE-NOT: fsin
|
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN: test2:
|
2007-09-26 21:12:10 +00:00
|
|
|
define double @test2(double %X) {
|
2009-09-25 18:15:29 +00:00
|
|
|
%Y = call double @sin(double %X) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
ret double %Y
|
|
|
|
}
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN: {{^[ \t]*fsin$}}
|
|
|
|
|
|
|
|
; SIN-NOT: fsin
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-09-15 12:44:27 +00:00
|
|
|
; SAFE: test2
|
|
|
|
; SAFE-NOT: fsin
|
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN: test3:
|
2007-09-26 21:12:10 +00:00
|
|
|
define x86_fp80 @test3(x86_fp80 %X) {
|
2009-09-25 18:15:29 +00:00
|
|
|
%Y = call x86_fp80 @sinl(x86_fp80 %X) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
ret x86_fp80 %Y
|
|
|
|
}
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN: {{^[ \t]*fsin$}}
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN-NOT: fsin
|
|
|
|
; COS-NOT: fcos
|
2009-09-25 18:15:29 +00:00
|
|
|
declare float @cosf(float) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2009-09-25 18:15:29 +00:00
|
|
|
declare double @cos(double) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2009-09-25 18:15:29 +00:00
|
|
|
declare x86_fp80 @cosl(x86_fp80) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
|
|
|
|
; SIN: test4:
|
|
|
|
; COS: test3:
|
2007-09-26 21:12:10 +00:00
|
|
|
define float @test4(float %X) {
|
2009-09-25 18:15:29 +00:00
|
|
|
%Y = call float @cosf(float %X) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
ret float %Y
|
|
|
|
}
|
2012-07-03 03:59:22 +00:00
|
|
|
; COS: {{^[ \t]*fcos}}
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-09-15 12:44:27 +00:00
|
|
|
; SAFE: test4
|
|
|
|
; SAFE-NOT: fcos
|
|
|
|
|
2007-09-26 21:12:10 +00:00
|
|
|
define double @test5(double %X) {
|
2009-09-25 18:15:29 +00:00
|
|
|
%Y = call double @cos(double %X) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
ret double %Y
|
|
|
|
}
|
2012-07-03 03:59:22 +00:00
|
|
|
; COS: {{^[ \t]*fcos}}
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-09-15 12:44:27 +00:00
|
|
|
; SAFE: test5
|
|
|
|
; SAFE-NOT: fcos
|
|
|
|
|
2007-09-26 21:12:10 +00:00
|
|
|
define x86_fp80 @test6(x86_fp80 %X) {
|
2009-09-25 18:15:29 +00:00
|
|
|
%Y = call x86_fp80 @cosl(x86_fp80 %X) readonly
|
2007-09-26 21:12:10 +00:00
|
|
|
ret x86_fp80 %Y
|
|
|
|
}
|
2012-07-03 03:59:22 +00:00
|
|
|
; COS: {{^[ \t]*fcos}}
|
2007-09-26 21:12:10 +00:00
|
|
|
|
2012-07-03 03:59:22 +00:00
|
|
|
; SIN-NOT: fsin
|
|
|
|
; COS-NOT: fcos
|