[X86] Avoid usage constant -1 for fminimum/fmaximum lowering
Instead of equality comparison of value to preferred zero we can check just the sign of value and if sign is set we should put this value as second operand for minimum and first operand for maximum. In this case FMIN/FMAX will choose the right result for 0.f and -0.f comparison. This allows us: 1. avoid loading of big 64-bit constant for fminimum. 2. for double on non-64-nib platform we need to check only high part of value. 3. test against zero to check sign takes less size of instruction Additionally, if we know that any of value is guaranteed to be non-zero we should not care about 0.f and -0.f comparison. Reviewed By: e-kud Differential Revision: https://reviews.llvm.org/D149812
Loading
Please sign in to comment