question about float insns like ceil/floor on mips machine
Richard Guenther
richard.guenther@gmail.com
Mon Jul 19 09:54:00 GMT 2010
On Mon, Jul 19, 2010 at 11:12 AM, Ian Lance Taylor <iant@google.com> wrote:
> "Amker.Cheng" <amker.cheng@gmail.com> writes:
>
>> I found although there are standard pattern names such as "ceilm2/floorm2",
>> there is no insn pattern in mips.md for such float insns on mips target.
>> further more, there is no ceil/floor rtl code in rtl.def either.
>>
>> based on these facts, I assuming those float insns are not supported by gcc,
>> but don't know why, seems not difficult to add such insns.
>
> You're right that gcc does not currently have a way to represent those
> instructions directly in RTL. In current gcc it would have to be done
> using an unspec. E.g., see ceildf2 and ceildf2_fpr in rs6000.md.
>
> You're also right that it would not be difficult to add direct RTL
> support. I'm not sure how useful that would be, since I don't see a lot
> of additional optimization opportunity. An unspec will handle
> scheduling correctly, the only benefit I see of direct RTL exposure
> would be that you could do optimizations like floor(ceil(x)) => ceil(x),
> but that seems unlikely to occur in real code.
And we'd be doing that at the tree level anyway.
Richard.
> Ian
>
More information about the Gcc
mailing list