Please do not send e-mail to both gcc and gcc-help.  Please just write
to one mailing list.  Thanks.

"kernel coder" <[EMAIL PROTECTED]> writes:

> I modified mips backend to support stw instruction.But during the
> compilation of crtstuff.c it is generating an instrucion
> 
> stw $2,p.2249
> 
> as this format of instruction is not supported on assembler,an error
> for illegal operands(p.2249) is being generated.
> 
> First of all i'm not been able to understand the operand p.2249 as i'm
> newbie to mips assembly.According to tc-mips.c code in GAS ,it seems
> to be a 32 address,but still the syntax is not clear to me.

p.2249 is simply the name of a symbol.

> Where in mips backend in gcc (mips.md,mips.h,mips.c) such type of
> offset(p.2249) is being generated because i need to tell the compiler
> that only allowed offset for stw instruction is 16-bit and  generated
> format should be
> 
> stw reg,offset(reg)

The name p.2249 is most likely coming from the machine independent
code.  You can see names like this for a function static variable
named "p".

Note that all MIPS processors are restricted to 16 bit offsets in the
sw instruction.  Most MIPS assemblers support "sw $2,foo" by expanding
it into multiple instructions.  However, the compiler also supports
expanding that into multiple instructions itself, which is generally
better for scheduling purposes.  So if you are modifying the existing
MIPS backend, you should force TARGET_EXPLICIT_RELOCS to be true.
Then the compiler will not normally a store word for a symbol.

Ian

Reply via email to