* question about float insns like ceil/floor on mips machine
@ 2010-07-19 7:53 Amker.Cheng
2010-07-19 9:13 ` Ian Lance Taylor
0 siblings, 1 reply; 3+ messages in thread
From: Amker.Cheng @ 2010-07-19 7:53 UTC (permalink / raw)
To: gcc
Hi:
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.
Did I miss anything important? please help, thanks.
--
Best Regards.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about float insns like ceil/floor on mips machine
2010-07-19 7:53 question about float insns like ceil/floor on mips machine Amker.Cheng
@ 2010-07-19 9:13 ` Ian Lance Taylor
2010-07-19 9:54 ` Richard Guenther
0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2010-07-19 9:13 UTC (permalink / raw)
To: Amker.Cheng; +Cc: gcc
"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.
Ian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about float insns like ceil/floor on mips machine
2010-07-19 9:13 ` Ian Lance Taylor
@ 2010-07-19 9:54 ` Richard Guenther
0 siblings, 0 replies; 3+ messages in thread
From: Richard Guenther @ 2010-07-19 9:54 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: Amker.Cheng, gcc
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-19 9:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 7:53 question about float insns like ceil/floor on mips machine Amker.Cheng
2010-07-19 9:13 ` Ian Lance Taylor
2010-07-19 9:54 ` Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).