[PATCH] D66050: Improve division estimation of floating points.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 05:49:48 PDT 2019


spatel added reviewers: RKSimon, andreadb, craig.topper.
spatel added inline comments.


================
Comment at: llvm/test/CodeGen/X86/recip-fastmath2.ll:602
 ; AVX-RECIP-NEXT:    vaddps %xmm2, %xmm1, %xmm1
-; AVX-RECIP-NEXT:    vmulps %xmm1, %xmm0, %xmm0
-; AVX-RECIP-NEXT:    vsubps %xmm0, %xmm3, %xmm0
+; AVX-RECIP-NEXT:    vmovaps {{.*#+}} xmm2 = [1.0E+0,2.0E+0,3.0E+0,4.0E+0]
+; AVX-RECIP-NEXT:    vmulps %xmm2, %xmm1, %xmm3
----------------
xbolva00 wrote:
> Extra instruction
It is an extra instruction, but it's not an extra uop. We're loading the constant numerator into a register because it is used twice now.

My guess is that fdiv with a constant isn't the usual case. We should have tests with 2 variable operands (fdiv x, y). 

That might show that we save an instruction/uop with this patch because we don't have to load the "1.0" constant.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66050/new/

https://reviews.llvm.org/D66050





More information about the llvm-commits mailing list