[llvm] r334035 - NFC: adding baseline fneg case for fmf

Michael Berg via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 5 11:12:25 PDT 2018


Author: mcberg2017
Date: Tue Jun  5 11:12:25 2018
New Revision: 334035

URL: http://llvm.org/viewvc/llvm-project?rev=334035&view=rev
Log:
NFC: adding baseline fneg case for fmf

Modified:
    llvm/trunk/test/CodeGen/PowerPC/fmf-propagation.ll

Modified: llvm/trunk/test/CodeGen/PowerPC/fmf-propagation.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/fmf-propagation.ll?rev=334035&r1=334034&r2=334035&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/fmf-propagation.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/fmf-propagation.ll Tue Jun  5 11:12:25 2018
@@ -457,3 +457,31 @@ define double @log2_approx(double %x) no
   ret double %r
 }
 
+; -(X - Y) --> (Y - X)
+
+; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
+; FMFDEBUG:         fsub {{t[0-9]+}}, {{t[0-9]+}}
+; FMFDEBUG:       Type-legalized selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
+
+; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
+; GLOBALDEBUG:         fsub {{t[0-9]+}}, {{t[0-9]+}}
+; GLOBALDEBUG:       Type-legalized selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
+
+define float @fneg_fsub_nozeros_1(float %x, float %y, float %z) {
+; FMF-LABEL: fneg_fsub_nozeros_1:
+; FMF:       # %bb.0:
+; FMF-NEXT:    xssubsp 0, 1, 2
+; FMF-NEXT:    xxlxor 13, 13, 13
+; FMF-NEXT:    xssubsp 1, 13, 0
+; FMF-NEXT:    blr
+;
+; GLOBAL-LABEL: fneg_fsub_nozeros_1:
+; GLOBAL:       # %bb.0:
+; GLOBAL-NEXT:    xssubsp 0, 1, 2
+; GLOBAL-NEXT:    xxlxor 13, 13, 13
+; GLOBAL-NEXT:    xssubsp 1, 13, 0
+; GLOBAL-NEXT:    blr
+  %neg = fsub float %x, %y
+  %add = fsub float 0.0, %neg
+  ret float %add
+}




More information about the llvm-commits mailing list