[PATCH] [x86] make reciprocal estimate code generation more flexible

Sanjay Patel spatel at rotateright.com
Fri Apr 10 13:27:53 PDT 2015


Hi andreadb, alexr, craig.topper,

This is effectively an 'NFC' patch because we should not be changing any default codegen for any CPU.

But we need separation of scalar and vector reciprocal codegen to handle an -mrecip clang flag that provides equal functionality to gcc's:
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627

After we have the front-end support for the -mrecip flag, we may alter the default codegen for btver2 and other CPUs because users will be able to easily control all aspects of reciprocal codegen from clang. If greater similarity to gcc defaults is desired, we would enable rsqrt codegen for all CPUs that support it. All of this assumes we're using fast-math of course.

http://reviews.llvm.org/D8982

Files:
  lib/Target/X86/X86.td
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86Subtarget.cpp
  lib/Target/X86/X86Subtarget.h
  test/CodeGen/X86/recip-fastmath.ll
  test/CodeGen/X86/sqrt-fastmath.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8982.23616.patch
Type: text/x-patch
Size: 19231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150410/fbfdfeed/attachment.bin>


More information about the llvm-commits mailing list