[llvm-commits] [llvm] r140296 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Duncan Sands
baldrick at free.fr
Thu Sep 22 09:08:27 PDT 2011
On 09/22/11 17:38, Eli Friedman wrote:
> On Thu, Sep 22, 2011 at 1:19 AM, Duncan Sands<baldrick at free.fr> wrote:
>>> The SSE version differences for fmin/fmax are more involved than I thought.
>>
>> While on the subject of fmin/fmax, I noticed that "isCommutable" is set to
>> zero for max/min. Yet the result of max/min presumably doesn't depend on
>> the order of its arguments, so is this a mistake?
>
> Strictly spearking, min/max on x86 are not commutable. It would
> probably be okay to commute them when -ffast-math is turned on,
> though.
I checked the Intel docs and you are correct. As a mathematician I find this
pretty amazing. I particularly enjoyed how max(+0.0, -0.0) is whatever is in
the second operand rather than +0.0.
Ciao, Duncan.
More information about the llvm-commits
mailing list