[PATCH, rs6000] Add non-relative jump table support for 64bit rs6000

Kewen.Lin linkw@linux.ibm.com
Tue Jul 28 09:12:48 GMT 2020


Added more CCs.

Kewen

on 2020/7/28 下午1:25, HAO CHEN GUI via Gcc-patches wrote:
> Hi,
> 
> This patch adds non-relative jump table support for 64bit rs6000. It implements ASM_OUTPUT_ADDR_VEC_ELT and corresponding expansion of jump table instruction for 64bit rs6000. We want to put non-relative jump table in data.rel.ro section for rs6000. So I add a new target hook - TARGET_ASM_SELECT_JUMPTABLE_SECTION to choose which section jump table should be put in. It puts the jump table in data.rel.ro for 64bit rs6000. For other platforms, it calls targetm.asm_out.function_rodata_section, just as before. We want to have an option to use non-relative jump table even when PIC flag is set. So I add a new option - "mforce-nonrelative-jumptables" for rs6000.  It enables the feature by default. The option takes effect in target hook - TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC.
> 
> static bool
> rs6000_gen_pic_addr_diff_vec (void)
> {
>   return TARGET_32BIT || !rs6000_force_nonrelative_jumptables;
> }
> 
> The attachments are the patch diff file and change log file.
> 
> Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is this okay for trunk? Any recommendations? Thanks a lot.
> 


More information about the Gcc-patches mailing list