2013-08-23 20:39:19 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+sse4.1 | FileCheck -check-prefix=CHECK-SSE %s
|
2012-08-08 20:31:37 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+avx | FileCheck -check-prefix=CHECK-AVX %s
|
2011-12-09 15:44:03 +00:00
|
|
|
|
|
|
|
define float @test1(float %x) nounwind {
|
|
|
|
%call = tail call float @floorf(float %x) nounwind readnone
|
|
|
|
ret float %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test1:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-SSE: roundss $9
|
2011-12-09 15:44:03 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test1:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-AVX: vroundss $9
|
2011-12-09 15:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare float @floorf(float) nounwind readnone
|
|
|
|
|
|
|
|
define double @test2(double %x) nounwind {
|
|
|
|
%call = tail call double @floor(double %x) nounwind readnone
|
|
|
|
ret double %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test2:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-SSE: roundsd $9
|
2011-12-09 15:44:03 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test2:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-AVX: vroundsd $9
|
2011-12-09 15:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare double @floor(double) nounwind readnone
|
|
|
|
|
|
|
|
define float @test3(float %x) nounwind {
|
|
|
|
%call = tail call float @nearbyintf(float %x) nounwind readnone
|
|
|
|
ret float %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test3:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-SSE: roundss $12
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test3:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-AVX: vroundss $12
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @nearbyintf(float) nounwind readnone
|
|
|
|
|
|
|
|
define double @test4(double %x) nounwind {
|
|
|
|
%call = tail call double @nearbyint(double %x) nounwind readnone
|
|
|
|
ret double %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test4:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-SSE: roundsd $12
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test4:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-AVX: vroundsd $12
|
|
|
|
}
|
|
|
|
|
|
|
|
declare double @nearbyint(double) nounwind readnone
|
|
|
|
|
|
|
|
define float @test5(float %x) nounwind {
|
|
|
|
%call = tail call float @ceilf(float %x) nounwind readnone
|
|
|
|
ret float %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test5:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-SSE: roundss $10
|
2011-12-09 15:44:03 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test5:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-AVX: vroundss $10
|
2011-12-09 15:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare float @ceilf(float) nounwind readnone
|
|
|
|
|
|
|
|
define double @test6(double %x) nounwind {
|
|
|
|
%call = tail call double @ceil(double %x) nounwind readnone
|
|
|
|
ret double %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test6:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-SSE: roundsd $10
|
2011-12-09 15:44:03 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test6:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-AVX: vroundsd $10
|
2011-12-09 15:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare double @ceil(double) nounwind readnone
|
|
|
|
|
|
|
|
define float @test7(float %x) nounwind {
|
|
|
|
%call = tail call float @rintf(float %x) nounwind readnone
|
|
|
|
ret float %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test7:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-SSE: roundss $4
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test7:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-AVX: vroundss $4
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @rintf(float) nounwind readnone
|
|
|
|
|
|
|
|
define double @test8(double %x) nounwind {
|
|
|
|
%call = tail call double @rint(double %x) nounwind readnone
|
|
|
|
ret double %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test8:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-SSE: roundsd $4
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test8:
|
2011-12-09 15:44:03 +00:00
|
|
|
; CHECK-AVX: vroundsd $4
|
|
|
|
}
|
|
|
|
|
|
|
|
declare double @rint(double) nounwind readnone
|
|
|
|
|
|
|
|
define float @test9(float %x) nounwind {
|
|
|
|
%call = tail call float @truncf(float %x) nounwind readnone
|
|
|
|
ret float %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test9:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-SSE: roundss $11
|
2011-12-09 15:44:03 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test9:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-AVX: vroundss $11
|
2011-12-09 15:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare float @truncf(float) nounwind readnone
|
|
|
|
|
|
|
|
define double @test10(double %x) nounwind {
|
|
|
|
%call = tail call double @trunc(double %x) nounwind readnone
|
|
|
|
ret double %call
|
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-SSE-LABEL: test10:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-SSE: roundsd $11
|
2011-12-09 15:44:03 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-AVX-LABEL: test10:
|
2015-09-22 11:43:17 +00:00
|
|
|
; CHECK-AVX: vroundsd $11
|
2011-12-09 15:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare double @trunc(double) nounwind readnone
|