From: Craig Topper Date: Mon, 9 Sep 2019 02:44:46 +0000 (+0000) Subject: [X86] Add fp128 test cases for ceil/floor/trunc/nearbyint/rint/round libcalls. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f69074babe408e7c93e39119d276901c85f5eb1f;p=llvm [X86] Add fp128 test cases for ceil/floor/trunc/nearbyint/rint/round libcalls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371360 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/fp128-libcalls.ll b/test/CodeGen/X86/fp128-libcalls.ll index 046f9ee6936..cd1ace26daa 100644 --- a/test/CodeGen/X86/fp128-libcalls.ll +++ b/test/CodeGen/X86/fp128-libcalls.ll @@ -235,3 +235,92 @@ entry: } declare fp128 @llvm.cos.f128(fp128) +define void @Test128Ceil(fp128 %d1) nounwind { +; CHECK-LABEL: Test128Ceil: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq ceill +; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip) +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %sqrt = call fp128 @llvm.ceil.f128(fp128 %d1) + store fp128 %sqrt, fp128* @vf128, align 16 + ret void +} +declare fp128 @llvm.ceil.f128(fp128) + +define void @Test128Floor(fp128 %d1) nounwind { +; CHECK-LABEL: Test128Floor: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq floorl +; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip) +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %sqrt = call fp128 @llvm.floor.f128(fp128 %d1) + store fp128 %sqrt, fp128* @vf128, align 16 + ret void +} +declare fp128 @llvm.floor.f128(fp128) + +define void @Test128Trunc(fp128 %d1) nounwind { +; CHECK-LABEL: Test128Trunc: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq truncl +; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip) +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %sqrt = call fp128 @llvm.trunc.f128(fp128 %d1) + store fp128 %sqrt, fp128* @vf128, align 16 + ret void +} +declare fp128 @llvm.trunc.f128(fp128) + +define void @Test128Nearbyint(fp128 %d1) nounwind { +; CHECK-LABEL: Test128Nearbyint: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq nearbyintl +; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip) +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %sqrt = call fp128 @llvm.nearbyint.f128(fp128 %d1) + store fp128 %sqrt, fp128* @vf128, align 16 + ret void +} +declare fp128 @llvm.nearbyint.f128(fp128) + +define void @Test128Rint(fp128 %d1) nounwind { +; CHECK-LABEL: Test128Rint: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq rintl +; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip) +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %sqrt = call fp128 @llvm.rint.f128(fp128 %d1) + store fp128 %sqrt, fp128* @vf128, align 16 + ret void +} +declare fp128 @llvm.rint.f128(fp128) + +define void @Test128Round(fp128 %d1) nounwind { +; CHECK-LABEL: Test128Round: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq roundl +; CHECK-NEXT: movaps %xmm0, {{.*}}(%rip) +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %sqrt = call fp128 @llvm.round.f128(fp128 %d1) + store fp128 %sqrt, fp128* @vf128, align 16 + ret void +} +declare fp128 @llvm.round.f128(fp128)