You still stuck with this issue ???

~Umesh

On Tue, Oct 15, 2013 at 9:08 PM, Ian Lance Taylor <i...@google.com> wrote:
> On Tue, Oct 15, 2013 at 8:04 AM, Nagaraju Mekala <gnuuser....@gmail.com> 
> wrote:
>>  Hi Ian,
>>
>>   Thanks for the reply.
>>
>> On Fri, Oct 11, 2013 at 10:31 PM, Ian Lance Taylor <i...@google.com> wrote:
>>> On Fri, Oct 11, 2013 at 9:20 AM, Nagaraju Mekala <gnuuser....@gmail.com> 
>>> wrote:
>>>>
>>>> I observed that in rs6000 port longcall is implemented by using
>>>> CALL_LONG define.
>>>> #define CALL_LONG 0x00000008 /* always call indirect */
>>>> In the md file they are checking the operand with CALL_LONG
>>>> if (INTVAL (operands[3]) & CALL_LONG)
>>>> operands[1] = rs6000_longcall_ref (operands[1]);
>>>> In my port I dont have suchthing to compare. Can we somehow parse the
>>>> tree chain and check the attributes of the functions..
>>>
>>> Look at init_cumulative_args in rs6000.c to see how CALL_LONG is set
>>> based on the function attribute.
>>
>> I was able to get the function attribute from the init_cumulative_args
>> function.  I have used the fndecl tree to get the attribute details
>> but I have failed to stop generating br instruction. It should print
>> bk instruction.
>> I was unable to relate the super attribute from init_cumulative_args
>> to the branch pattern in md file to generate bk instruction.
>> I have intialized a global variable to 1 if super is detected and
>> checking the same in my pattern.
>>  My branch pattern looks like below
>> (define_insn "call_int1"
>>   [(call (mem (match_operand:SI 0 "call_insn_simple_operand" "ri"))
>>          (match_operand:SI 1 "" "i"))
>>   (clobber (reg:SI R_RS))]
>>  ""
>>   {
>>     register rtx t = operands[0];
>>     register rtx t2 = gen_rtx_REG (Pmode,
>>                               GP_REG_FIRST + RETURN_ADDR_REGNUM);
>>     if (GET_CODE (t) == SYMBOL_REF) {
>>         if(super_var())             ---------------> Here I am
>> checking for global variable
>>         {
>>         return "bk\tr1,8\;%#";
>>         }
>>         else {
>>         gen_rtx_CLOBBER (VOIDmode, t2);
>>         return "br\tr1,%0\;%#";
>>
>> I observed that init_cumulative_args is called first for all the
>> functions once they are done then the above pattern for all the
>> instructions are called so my global variable is not useful.
>>
>> Can you help me how to exactly emit bk instruction from the pattern
>> when super function is called.
>
>
> Again I just have to say: look at the rs6000 port.  Look at the rs6000
> call instruction.  Look at how it decides whether to do a longcall or
> not.
>
> Ian

Reply via email to