[PATCH] Lower FNEG ( FABS (x) ) -> FNABS (x) [X86 codegen] PR20578

Sanjay Patel spatel at rotateright.com
Thu Sep 4 19:25:50 PDT 2014


Hi chandlerc, nadav, hfinkel, andreadb,

Negative FABS of either a scalar or vector should be handled the same way on x86 with SSE/AVX: a single OR instruction of the FP operand with a constant to light up the sign bit(s)

I don't know if I've chosen the best or even the right way to bail out of lowering a FABS if it has an FNEG user. I want to lower any potential FNABS cases before lowering the FABS into an AND. If the FABS gets lowered first, then it's much harder to detect an FNABS opportunity - we'd have to look through a potential cast, then a constant pool load, then check the constant(s)...messy.

http://reviews.llvm.org/D5201

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/fnabs.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5201.13295.patch
Type: text/x-patch
Size: 5236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140905/abaa3d62/attachment.bin>


More information about the llvm-commits mailing list