This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Back end question.
- From: "Dmitry" <mittie at ukr dot net>
- To: "Ian Lance Taylor" <iant at google dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 04 May 2011 17:36:55 +0300
- Subject: Re: Back end question.
- References: <mcraafaifsm.fsf@coign.corp.google.com> <E1QFROw-000NSH-2Y@ffe7.ukr.net> <E1QFSFj-0001RU-FF@ffe17.ukr.net> <mcrei4mihs7.fsf@coign.corp.google.com> <mcrbozi35g0.fsf@coign.corp.google.com> <E1QHaln-000PPM-3V@ffe16.ukr.net> <E1QFnrO-0000MD-Ry@ffe11.ukr.net> <mcr8vutdmoz.fsf@coign.corp.google.com>
I see. Ok let's say it this way. If I have an move instruction that if a destination operand is an accumulator can set some status bits, like zero or sign. How can I use this feature with the compiler? For example, after "mov" to the accumulator the compiler could use the status bits from that "mov" with the branch insn (without a seperate compare).
Dmitry.
--- Исходное сообщение ---
От кого: "Ian Lance Taylor" <iant@google.com>
Кому: "Dmitry" <mittie@ukr.net>
Дата: 4 мая 2011, 17:29:03
Тема: Re: Back end question.
> "Dmitry" <mittie@ukr.net> writes:
>
> > Ok. But what if the compiler uses that unnecessary clobber for a
> > branch or another CC dependent insn before reload, and if I remove
> > that clobber in a define_split after reload, could I end up with a
> > corrupted code?
>
> I'm sorry, I don't understand what you are trying to say. The compiler
> can't use a clobber. Simply removing a clobber can't cause corrupted
> code, because the compiler was already assuming that the value in the
> register was unpredictable.
>
> Ian
>
> > --- Исходное сообщение ---
> > От кого: "Ian Lance Taylor" <iant@google.com>
> > Кому: "Dmitry" <mittie@ukr.net>
> > Дата: 29 апреля 2011, 19:52:44
> > Тема: Re: Back end question.
> >
> >
> >
> >> "Dmitry" <mittie@ukr.net> writes:
> >>
> >> > I have one more question. If I have, for example, a define_insn rtx which matches a pattern generated by previous define_expand rtx. define_expand and define_split combination produces either a simple "set" rtx or "set" plus clobber of CC reg. And if in define_insn I specify a constraint that requires such an operand type which should generate a CC clobber, but initially there could be a combination of operands that does not clobber a CC and also does not satisfy constraints, so compiler must reload one or two operands in appropriate registers which satisfies constraints. In the case those appropriate registers should clobber a CC does a compiler add a suitable clobber rtx as written in define_split, or it just changes the registers names without any knowledge of a necessary clobber?
> >>
> >> If I understand your question correctly, then the compiler is not going
> >> to add a clobber. Reload does not change the shape of the instruction.
> >> It just shuffles registers to match the constraints. If you have
> >> constraints which require a clobber, then the insn pattern should have a
> >> clobber. You can use define_split to remove an unnecessary clobber
> >> after reload is complete.
> >>
> >> Ian
> >>
> >>
>
>