Re: A Query regarding jump pattern

2008-04-16 Thread Mohamed Shafi
On Mon, Apr 14, 2008 at 11:07 PM, Ian Lance Taylor [EMAIL PROTECTED] wrote:

 Mohamed Shafi [EMAIL PROTECTED] writes:

   I have read in the internals that indirect_jump and jump pattern are
   necessary in any back-end for the compiler to be build and work
   successfully. For any back-end there will be some limitation as to how
   big the offset used in the jump instructions can be. If the offset is
   too big then the indirect_jump pattern has to utilized. Now my
   question is how will i be able to specify the limit of the offset so
   the gcc generates indirect_jump pattern instead of the jump pattern? I
   hope i am clear.

  From the perspective of insn names, it's not quite accurate to say
  that jump turns into indirect_jump.  It would be more correct to say
  that when there is a limit to the offset for jump, it needs to use a
  register.

  The way to handle this is to set the length attribute correctly for
  each insn, and to change code generation based on the length.  See,
  e.g., the mips.md jump insn for an example.

  Ok , looking at another reply from Jim
(http://gcc.gnu.org/ml/gcc/2008-04/msg00311.html), where he suggests
to use shorten_branhes in reorg and generate indirect branch, it looks
like i will have to reserve a register.  Am i right?

If that is the case it seems that there is no need for a indirect_jump pattern.
So can you tell me when exactly are the indirect_jump patterns will be
utilized by gcc?

Regards,
Shafi


Re: A Query regarding jump pattern

2008-04-16 Thread Ian Lance Taylor
Mohamed Shafi [EMAIL PROTECTED] writes:

   Ok , looking at another reply from Jim
 (http://gcc.gnu.org/ml/gcc/2008-04/msg00311.html), where he suggests
 to use shorten_branhes in reorg and generate indirect branch, it looks
 like i will have to reserve a register.  Am i right?

You will have to do something.  Having the jump pattern require a
scratch register is one approach.  For a much more complicated
approach, see sh.md.


 If that is the case it seems that there is no need for a indirect_jump 
 pattern.
 So can you tell me when exactly are the indirect_jump patterns will be
 utilized by gcc?

indirect_jump jumps to a value held in a register.  jump jumps to a
constant location.  indirect_jump is used for things like the gcc
label extension.

Ian


Re: A Query regarding jump pattern

2008-04-14 Thread Ian Lance Taylor
Mohamed Shafi [EMAIL PROTECTED] writes:

 I have read in the internals that indirect_jump and jump pattern are
 necessary in any back-end for the compiler to be build and work
 successfully. For any back-end there will be some limitation as to how
 big the offset used in the jump instructions can be. If the offset is
 too big then the indirect_jump pattern has to utilized. Now my
 question is how will i be able to specify the limit of the offset so
 the gcc generates indirect_jump pattern instead of the jump pattern? I
 hope i am clear.

From the perspective of insn names, it's not quite accurate to say
that jump turns into indirect_jump.  It would be more correct to say
that when there is a limit to the offset for jump, it needs to use a
register.

The way to handle this is to set the length attribute correctly for
each insn, and to change code generation based on the length.  See,
e.g., the mips.md jump insn for an example.

Ian


A Query regarding jump pattern

2008-04-13 Thread Mohamed Shafi
Hello all,

I have read in the internals that indirect_jump and jump pattern are
necessary in any back-end for the compiler to be build and work
successfully. For any back-end there will be some limitation as to how
big the offset used in the jump instructions can be. If the offset is
too big then the indirect_jump pattern has to utilized. Now my
question is how will i be able to specify the limit of the offset so
the gcc generates indirect_jump pattern instead of the jump pattern? I
hope i am clear.

Thank you for your time.

Regards,
Shafi