[LLVMdev] SoftenSetCCOpernads in LegalizeFloatTypes.cpp

Eli Friedman eli.friedman at gmail.com
Thu Dec 24 22:14:50 PST 2009


On Fri, Dec 25, 2009 at 9:16 AM, Sanjiv Gupta
<sanjiv.gupta at microchip.com> wrote:
> On Mon, 2009-10-05 at 16:54 -0700, Eli Friedman wrote:
>> On Mon, Oct 5, 2009 at 11:11 AM, Sanjiv Gupta
>> <sanjiv.gupta at microchip.com> wrote:
>> > Sanjiv Gupta wrote:
>> >> Sanjiv Gupta wrote:
>> >>
>> >>> Duncan Sands wrote:
>> >>>
>> >>>
>> >>>> Hi Sanjiv, I think a lot of the softening code assumes you are
>> dealing
>> >>>> with float (32 bits).  So it's not just a matter of changing the
>> libcall
>> >>>> return type.
>> >>>>
>> >>>>
>> >>>>
>> >>> Yes, we are dealing with 32-bits only. But why the cmp libcalls
>> have to
>> >>> return a 32-bit value.
>> >>> e.g. Our libcall for comparing two floats is
>> >>>
>> >>>   char _eq_f32 (float a, float b);
>> >>>
>> >>> rather than
>> >>>
>> >>>   long _eq_f32 (float a, float b);
>> >>>
>> >>>
>> >>> - Sanjiv
>> >>>
>> >>>
>> >> Why not use TLI.getSetCCResultType () ?
>> >>
>> >> - Sanjiv
>> >>
>> >>
>> > Duncan,
>> > Any thoughts ?
>> > Or am I missing something very obvious here?
>>
>> getSetCCResultType has nothing to do with the result of a libcall;
>> for
>> example, on x86 it's i8 even though any libcalls like that will
>> return
>> an i32.  You really need a separate method.
>>
>> -Eli
>>
>
> Attached a patch for adding the said method. I was off the trunk for a
> while so it took longer.

Looks fine except for the commented-out line of code.

-Eli




More information about the llvm-dev mailing list