X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FTransforms%2FInstCombine%2Fintrinsics.ll;h=88f03249827195ea549b492555f3c797d305243b;hb=c721349466de0c38024b45f13f211f83c30b2cc4;hp=bea063787a75113c98d082c8e4dca4370e1a1d08;hpb=7d40c4215d7439422a18e23790ba56546b483e8e;p=oota-llvm.git diff --git a/test/Transforms/InstCombine/intrinsics.ll b/test/Transforms/InstCombine/intrinsics.ll index bea063787a7..88f03249827 100644 --- a/test/Transforms/InstCombine/intrinsics.ll +++ b/test/Transforms/InstCombine/intrinsics.ll @@ -19,6 +19,11 @@ declare i32 @llvm.ctpop.i32(i32) nounwind readnone declare i8 @llvm.ctlz.i8(i8, i1) nounwind readnone declare double @llvm.cos.f64(double %Val) nounwind readonly declare double @llvm.sin.f64(double %Val) nounwind readonly +declare double @llvm.floor.f64(double %Val) nounwind readonly +declare double @llvm.ceil.f64(double %Val) nounwind readonly +declare double @llvm.trunc.f64(double %Val) nounwind readonly +declare double @llvm.rint.f64(double %Val) nounwind readonly +declare double @llvm.nearbyint.f64(double %Val) nounwind readonly define i8 @uaddtest1(i8 %A, i8 %B) { %x = call %overflow.result @llvm.uadd.with.overflow.i8(i8 %A, i8 %B) @@ -447,3 +452,63 @@ entry: ; CHECK-LABEL: @sin( ; CHECK: store volatile double 0.000000e+00, double* %P } + +define void @floor(double *%P) { +entry: + %B = tail call double @llvm.floor.f64(double 1.5) nounwind + store volatile double %B, double* %P + %C = tail call double @llvm.floor.f64(double -1.5) nounwind + store volatile double %C, double* %P + ret void +; CHECK-LABEL: @floor( +; CHECK: store volatile double 1.000000e+00, double* %P, align 8 +; CHECK: store volatile double -2.000000e+00, double* %P, align 8 +} + +define void @ceil(double *%P) { +entry: + %B = tail call double @llvm.ceil.f64(double 1.5) nounwind + store volatile double %B, double* %P + %C = tail call double @llvm.ceil.f64(double -1.5) nounwind + store volatile double %C, double* %P + ret void +; CHECK-LABEL: @ceil( +; CHECK: store volatile double 2.000000e+00, double* %P, align 8 +; CHECK: store volatile double -1.000000e+00, double* %P, align 8 +} + +define void @trunc(double *%P) { +entry: + %B = tail call double @llvm.trunc.f64(double 1.5) nounwind + store volatile double %B, double* %P + %C = tail call double @llvm.trunc.f64(double -1.5) nounwind + store volatile double %C, double* %P + ret void +; CHECK-LABEL: @trunc( +; CHECK: store volatile double 1.000000e+00, double* %P, align 8 +; CHECK: store volatile double -1.000000e+00, double* %P, align 8 +} + +define void @rint(double *%P) { +entry: + %B = tail call double @llvm.rint.f64(double 1.5) nounwind + store volatile double %B, double* %P + %C = tail call double @llvm.rint.f64(double -1.5) nounwind + store volatile double %C, double* %P + ret void +; CHECK-LABEL: @rint( +; CHECK: store volatile double 2.000000e+00, double* %P, align 8 +; CHECK: store volatile double -2.000000e+00, double* %P, align 8 +} + +define void @nearbyint(double *%P) { +entry: + %B = tail call double @llvm.nearbyint.f64(double 1.5) nounwind + store volatile double %B, double* %P + %C = tail call double @llvm.nearbyint.f64(double -1.5) nounwind + store volatile double %C, double* %P + ret void +; CHECK-LABEL: @nearbyint( +; CHECK: store volatile double 2.000000e+00, double* %P, align 8 +; CHECK: store volatile double -2.000000e+00, double* %P, align 8 +}