[llvm] r285692 - [Sparc][LEON] Test for FixFDIVSQRT erratum fix.
Chris Dewhurst via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 1 07:23:37 PDT 2016
Author: lerochris
Date: Tue Nov 1 09:23:37 2016
New Revision: 285692
URL: http://llvm.org/viewvc/llvm-project?rev=285692&view=rev
Log:
[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
Added:
llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll (with props)
Added: llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll?rev=285692&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll (added)
+++ llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll Tue Nov 1 09:23:37 2016
@@ -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
+}
+
Propchange: llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: llvm/trunk/test/CodeGen/SPARC/LeonFixAllFDIVSQRTPassUT.ll
------------------------------------------------------------------------------
svn:executable = *
More information about the llvm-commits
mailing list