* Claudiu Zissulescu <claudiu.zissule...@synopsys.com> [2017-11-02 13:30:30 
+0100]:

> The ARCv2 ISA provides the JLI instruction, which is two-byte instructions
> that can be used to reduce code size in an application. To make use of it,
> we provide two new function attributes 'jli_always' and 'jli_fixed' which
> will force the compiler to call the indicated function using a jli_s
> instruction. The compiler also generates the entries in the JLI table for
> the case when we use 'jli_always' attribute. In the case of 'jli_fixed'
> the compiler assumes a fixed position of the function into JLI
> table. Thus, the user needs to provide an assembly file with the JLI table
> for the final link. This is usefully when we want to have a table in ROM
> and a second table in the RAM memory.
> 
> The jli instruction usage can be also forced without the need to annotate
> the source code via '-mjli-always' command.
> 
> gcc/
> 2017-02-10  Claudiu Zissulescu  <claz...@synopsys.com>
>           John Eric Martin <john.mar...@emmicro-us.com>
> 
>       * config/arc/arc-protos.h: Add arc_is_jli_call_p proto.
>       * config/arc/arc.c (_arc_jli_section): New struct.
>       (arc_jli_section): New type.
>       (rc_jli_sections): New static variable.
>       (arc_handle_jli_attribute): New function.
>       (arc_attribute_table): Add jli_always and jli_fixed attribute.
>       (arc_file_end): New function.
>       (TARGET_ASM_FILE_END): Define.
>       (arc_print_operand): Reuse 'S' letter for JLI output instruction.
>       (arc_add_jli_section): New function.
>       (jli_call_scan): Likewise.
>       (arc_reorg): Call jli_call_scan.
>       (arc_output_addsi): Remove 'S' from printing asm operand.
>       (arc_is_jli_call_p): New function.
>       * config/arc/arc.md (movqi_insn): Remove 'S' from printing asm
>       operand.
>       (movhi_insn): Likewise.
>       (movsi_insn): Likewise.
>       (movsi_set_cc_insn): Likewise.
>       (loadqi_update): Likewise.
>       (load_zeroextendqisi_update): Likewise.
>       (load_signextendqisi_update): Likewise.
>       (loadhi_update): Likewise.
>       (load_zeroextendhisi_update): Likewise.
>       (load_signextendhisi_update): Likewise.
>       (loadsi_update): Likewise.
>       (loadsf_update): Likewise.
>       (movsicc_insn): Likewise.
>       (bset_insn): Likewise.
>       (bxor_insn): Likewise.
>       (bclr_insn): Likewise.
>       (bmsk_insn): Likewise.
>       (bicsi3_insn): Likewise.
>       (cmpsi_cc_c_insn): Likewise.
>       (movsi_ne): Likewise.
>       (movsi_cond_exec): Likewise.
>       (clrsbsi2): Likewise.
>       (norm_f): Likewise.
>       (normw): Likewise.
>       (swap): Likewise.
>       (divaw): Likewise.
>       (flag): Likewise.
>       (sr): Likewise.
>       (kflag): Likewise.
>       (ffs): Likewise.
>       (ffs_f): Likewise.
>       (fls): Likewise.
>       (call_i): Remove 'S' asm letter, add jli instruction.
>       (call_value_i): Likewise.
>       * config/arc/arc.op (mjli-always): New option.
>       * config/arc/constraints.md (Cji): New constraint.
>       * config/arc/fpx.md (addsf3_fpx): Remove 'S' from printing asm
>       operand.
>       (subsf3_fpx): Likewise.
>       (mulsf3_fpx): Likewise.
>       * config/arc/simdext.md (vendrec_insn): Remove 'S' from printing
>       asm operand.
>       * doc/extend.texi (ARC): Document 'jli-always' and 'jli-fixed'
>       function attrbutes.
>       * doc/invoke.texi (ARC): Document mjli-always option.
> 
> gcc/testsuite
> 2017-02-10  Claudiu Zissulescu  <claz...@synopsys.com>
> 
>       * gcc.target/arc/jli-1.c: New file.
>       * gcc.target/arc/jli-2.c: Likewise.

This looks fine, but I wonder if there should be some documentation
that mentions the new .jlitab section added?

There's one whitespace issue I also spotted...

> @@ -5026,6 +5062,36 @@ static void arc_file_start (void)
>    fprintf (asm_out_file, "\t.cpu %s\n", arc_cpu_string);
>  }
>  
> +/* Implement `TARGET_ASM_FILE_END'.  */
> +/* Outputs to the stdio stream FILE jli related text.  */
> +
> +void arc_file_end (void)
> +{
> +  arc_jli_section *sec = arc_jli_sections;
> +
> +  while (sec != NULL)
> +  {

I think the '{' is not indented correctly.

Thanks,
Andrew

Reply via email to