[PATCH] [ARM] generate VMAXNM/VMINNM for a compare followed by a select (in safe math mode too)

Artyom Skrobov Artyom.Skrobov at arm.com
Thu Apr 30 02:56:38 PDT 2015


Hello,

The existing code in ARMISelLowering.cpp contained a FIXME:

// We only do this transformation in UnsafeFPMath and for no-NaNs
// comparisons, because signed zeros and NaNs are handled differently than
// the original code sequence.
// FIXME: There are more cases that can be transformed even with NaNs,
// signed zeroes and safe math.  E.g. in the following, the result will be
// FalseVal if a is a NaN or -0./0. and that's what vmaxnm will give, too.
//   c = fcmp ogt, a, 0. ; select c, a, 0. => vmaxnm a, 0.

The attached patch implements this missing functionality.

OK to commit?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vmaxnm-vminnm-safe.patch
Type: application/octet-stream
Size: 15502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150430/83579f2e/attachment.obj>


More information about the llvm-commits mailing list