[llvm] r313893 - [x86] add more tests for node-level FMF; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 10:40:59 PDT 2017


Author: spatel
Date: Thu Sep 21 10:40:58 2017
New Revision: 313893

URL: http://llvm.org/viewvc/llvm-project?rev=313893&view=rev
Log:
[x86] add more tests for node-level FMF; NFC

Modified:
    llvm/trunk/test/CodeGen/X86/fmf-flags.ll

Modified: llvm/trunk/test/CodeGen/X86/fmf-flags.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fmf-flags.ll?rev=313893&r1=313892&r2=313893&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fmf-flags.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fmf-flags.ll Thu Sep 21 10:40:58 2017
@@ -45,3 +45,48 @@ define float @fast_fmuladd_opts(float %a
   %res = call fast float @llvm.fmuladd.f32(float %a, float 2.0, float %a)
   ret float %res
 }
+
+; The multiply is strict.
+
+define double @not_so_fast_mul_add(double %x) {
+; X64-LABEL: not_so_fast_mul_add:
+; X64:       # BB#0:
+; X64-NEXT:    movsd {{.*#+}} xmm1 = mem[0],zero
+; X64-NEXT:    mulsd %xmm0, %xmm1
+; X64-NEXT:    addsd %xmm1, %xmm0
+; X64-NEXT:    retq
+;
+; X86-LABEL: not_so_fast_mul_add:
+; X86:       # BB#0:
+; X86-NEXT:    fldl {{[0-9]+}}(%esp)
+; X86-NEXT:    fld %st(0)
+; X86-NEXT:    fmull {{\.LCPI.*}}
+; X86-NEXT:    faddp %st(1)
+; X86-NEXT:    retl
+  %m = fmul double %x, 4.2
+  %a = fadd fast double %m, %x
+  ret double %a
+}
+
+; The sqrt is strict.
+
+define float @not_so_fast_recip_sqrt(float %x) {
+; X64-LABEL: not_so_fast_recip_sqrt:
+; X64:       # BB#0:
+; X64-NEXT:    sqrtss %xmm0, %xmm1
+; X64-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; X64-NEXT:    divss %xmm1, %xmm0
+; X64-NEXT:    retq
+;
+; X86-LABEL: not_so_fast_recip_sqrt:
+; X86:       # BB#0:
+; X86-NEXT:    flds {{[0-9]+}}(%esp)
+; X86-NEXT:    fsqrt
+; X86-NEXT:    fld1
+; X86-NEXT:    fdivp %st(1)
+; X86-NEXT:    retl
+  %y = call float @llvm.sqrt.f32(float %x)
+  %z = fdiv fast float 1.0, %y
+  ret float %z
+}
+




More information about the llvm-commits mailing list