From: Chris Dewhurst Date: Tue, 1 Nov 2016 14:23:37 +0000 (+0000) Subject: [Sparc][LEON] Test for FixFDIVSQRT erratum fix. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=447ffef48b2d4b192c502954592e84587fed8c9d;p=llvm [Sparc][LEON] Test for FixFDIVSQRT erratum fix. Note: Test is per differential review, but the other changed code in the review was for an optimisation that din't quite work. Nevertheless, the test is valid for the unoptimised version of the fix. Differential Review: https://reviews.llvm.org/D24658 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285692 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll b/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll new file mode 100755 index 00000000000..c79414d2791 --- /dev/null +++ b/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll @@ -0,0 +1,59 @@ +; RUN: llc %s -O0 -march=sparc -mcpu=leon3 -mattr=+fixallfdivsqrt -o - | FileCheck %s +; RUN: llc %s -O0 -march=sparc -mcpu=ut699 -o - | FileCheck %s + +; CHECK-LABEL: test_1 +; CHECK: nop +; CHECK: nop +; CHECK: fdivd +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +define double @test_1(double* byval %a, double* byval %b) { +entry: + %0 = load double, double* %a, align 8 + %1 = load double, double* %b, align 8 + %res = fdiv double %0, %1 + ret double %res +} + +declare double @llvm.sqrt.f64(double) nounwind readonly + +; CHECK-LABEL: test_2 +; CHECK: nop +; CHECK: nop +; CHECK: nop +; CHECK: nop +; CHECK: nop +; CHECK: fsqrtd +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +; CHECK-NEXT: nop +define double @test_2(double* byval %a) { +entry: + %0 = load double, double* %a, align 8 + %1 = call double @llvm.sqrt.f64(double %0) nounwind + ret double %1 +} +