aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/vec_floor.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/vec_floor.ll')
-rw-r--r--test/CodeGen/X86/vec_floor.ll46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/CodeGen/X86/vec_floor.ll b/test/CodeGen/X86/vec_floor.ll
index 4db68bd..f35c4ab 100644
--- a/test/CodeGen/X86/vec_floor.ll
+++ b/test/CodeGen/X86/vec_floor.ll
@@ -180,3 +180,49 @@ define <8 x float> @nearbyint_v8f32(<8 x float> %p)
ret <8 x float> %t
}
declare <8 x float> @llvm.nearbyint.v8f32(<8 x float> %p)
+
+;
+; Constant Folding
+;
+
+define <2 x double> @const_floor_v2f64() {
+ ; CHECK: const_floor_v2f64
+ ; CHECK: movaps {{.*#+}} xmm0 = [-2.000000e+00,2.000000e+00]
+ %t = call <2 x double> @llvm.floor.v2f64(<2 x double> <double -1.5, double 2.5>)
+ ret <2 x double> %t
+}
+
+define <4 x float> @const_floor_v4f32() {
+ ; CHECK: const_floor_v4f32
+ ; CHECK: movaps {{.*#+}} xmm0 = [-4.000000e+00,6.000000e+00,-9.000000e+00,2.000000e+00]
+ %t = call <4 x float> @llvm.floor.v4f32(<4 x float> <float -3.5, float 6.0, float -9.0, float 2.5>)
+ ret <4 x float> %t
+}
+
+define <2 x double> @const_ceil_v2f64() {
+ ; CHECK: const_ceil_v2f64
+ ; CHECK: movaps {{.*#+}} xmm0 = [-1.000000e+00,3.000000e+00]
+ %t = call <2 x double> @llvm.ceil.v2f64(<2 x double> <double -1.5, double 2.5>)
+ ret <2 x double> %t
+}
+
+define <4 x float> @const_ceil_v4f32() {
+ ; CHECK: const_ceil_v4f32
+ ; CHECK: movaps {{.*#+}} xmm0 = [-3.000000e+00,6.000000e+00,-9.000000e+00,3.000000e+00]
+ %t = call <4 x float> @llvm.ceil.v4f32(<4 x float> <float -3.5, float 6.0, float -9.0, float 2.5>)
+ ret <4 x float> %t
+}
+
+define <2 x double> @const_trunc_v2f64() {
+ ; CHECK: const_trunc_v2f64
+ ; CHECK: movaps {{.*#+}} xmm0 = [-1.000000e+00,2.000000e+00]
+ %t = call <2 x double> @llvm.trunc.v2f64(<2 x double> <double -1.5, double 2.5>)
+ ret <2 x double> %t
+}
+
+define <4 x float> @const_trunc_v4f32() {
+ ; CHECK: const_trunc_v4f32
+ ; CHECK: movaps {{.*#+}} xmm0 = [-3.000000e+00,6.000000e+00,-9.000000e+00,2.000000e+00]
+ %t = call <4 x float> @llvm.trunc.v4f32(<4 x float> <float -3.5, float 6.0, float -9.0, float 2.5>)
+ ret <4 x float> %t
+}