Please find the attached "h8300-func-vect.patch" that adds 
'function_vector' attribute for H8300 target.

I have taken the reference from previously posted patch for GCC-3.4.2:

I have updated functionality of the attribute to GCC-4.7.0 source. 
Can someone please review the patch and let me know if there should be 
any modifications in it?

I will briefly mention about 'function_vector' attribute.
For test code:

void foo (void)
void bar (void)

For regular function call, compiler generates code as:
        mov.w   r6,@-r7
        mov.w   r7,r6
        jsr     @_foo   [length=4]
        mov.w   @r7+,r6

Using 'function_vector' attribute, code is generated as:
        mov.w   r6,@-r7
        mov.w   r7,r6
        jsr     @@ vector_number:8 [length=2]
        mov.w   @r7+,r6

I have built the toolchain with 'c' language enabled and did the 
regression testing. Results are fine. I could not build the toolchain 
for 'c++' language as GCC-4.7.0 build fails for it for H8300 target.

2012-26-03 Ajinkya Dhobale <ajinkya.dhob...@kpitcummins.com>

        * config/h8300/h8300.c
        (h8300_handle_function_vector_attribute): New function.
        (print_operand): 'B', new print_operand switch case for jsr
        (h8300_attrib): Redefined for argument and new function.

        * config/h8300/h8300.md
        (call): Changed assembly output to get processed by
        print_operand function.
        (call_value): Same as (call).

        * doc/extend.texi
        (function_vector): Added description for H8300 target.

Thanks & Regards,
Ajinkya Dhobale
KPIT Cummins Infosystems Ltd,
Pune (INDIA)

Attachment: h8300-func-vect.patch
Description: h8300-func-vect.patch

Reply via email to