[LLVMdev] [RFC][Float2Int] Converting (fcmp Pred, x * F, y) to (ICmp ...)
Stephen Canon
scanon at apple.com
Wed Apr 29 12:01:44 PDT 2015
> On Apr 29, 2015, at 3:00 PM, Stephen Canon <scanon at apple.com> wrote:
>
>> On Apr 29, 2015, at 2:33 PM, Matt Arsenault <arsenm2 at gmail.com <mailto:arsenm2 at gmail.com>> wrote:
>>
>>> On Apr 29, 2015, at 10:06 AM, Silviu Baranga <Silviu.Baranga at arm.com <mailto:Silviu.Baranga at arm.com>> wrote:
>>>
>>> Note that dividing by an integer constant should be a cheap operation
>>> compared to FP multiplication and comparison as this would get lowered to a
>>> multiply+subtract+shift sequence (and should certainly be true on cores with no
>>> FP unit)
>>>
>>
>> This is not true on the targets I care about. The integer division (which, even with the division by constant expansion to multiplies with magic constants) would be significantly more expensive.
>
> What targets *does* this benefit? Soft-float targets and Cortex-A8?
>
> Anyway, both integer and floating-point multiplication and division are monotonic, so it suffices to check the two values of x that bracket y/f.
Ah, I see now that y is not a constant. Slightly more subtle. =)
I’ll respond later.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150429/d04720d3/attachment.html>
More information about the llvm-dev
mailing list