[LLVMdev] max/min intrinsics
Dan Gohman
dan433584 at gmail.com
Mon Dec 17 12:01:58 PST 2012
No; real fmin and fmax are symmetric, and fcmp+select patterns are not
symmetric.
Also, on point [3] "An SNaN may behave as a QNaN", LLVM doesn't
correctly implement SNaN anyway, so there's no need to clutter up the
rules with SNaN exceptions. When (if?) someone ever implements SNaN,
they'll probably need to introduce a new operator flag to allow passes
to ignore it (nsnan?), and then fmin/fmax can use that.
Dan
On Mon, Dec 17, 2012 at 11:20 AM, Nadav Rotem <nrotem at apple.com> wrote:
> Maybe we can have two versions of the intrinsic function, "ordered" and "unordered", just like fcmp has [1]. Would that work ?
>
> [1] - http://llvm.org/docs/LangRef.html#fcmp-instruction
>
>
>
> On Dec 17, 2012, at 11:14 AM, "Schoedel, Kevin P" <kevin.p.schoedel at intel.com> wrote:
>
>> At Monday, December 17, 2012 2:05 PM, Nadav Rotem [mailto:nrotem at apple.com] wrote:
>>> This part worries me. The new min/max intrinsics will only be useful if we could pattern match cmp/select into them.
>>
>> Yes, that's the obvious alternative. I don't think we have any strong opinion either way, and fcmp/select is certainly easier to implement.
>>
>> --
>> Kevin Schoedel, Software Developer, Intel of Canada
>> <kevin.p.schoedel at intel.com> +1 (519) 772-2580
>>
>>
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list