diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2021-11-17 20:47:48 +0100 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2021-11-17 20:48:31 +0100 |
commit | 69a5b3ca5c8fdd074fbb26fec926fa25fbec77c1 (patch) | |
tree | c679daca100fd26e8b3d95031f7c93c57579722e /gcc/config | |
parent | 74509b963ef64101ce601a497913c13021994f51 (diff) | |
download | gcc-69a5b3ca5c8fdd074fbb26fec926fa25fbec77c1.zip gcc-69a5b3ca5c8fdd074fbb26fec926fa25fbec77c1.tar.gz gcc-69a5b3ca5c8fdd074fbb26fec926fa25fbec77c1.tar.bz2 |
i386: Redefine indirect_thunks_used as HARD_REG_SET.
Change indirect_thunks_used to HARD_REG_SET to avoid recalculations
of correct register numbers and allow usage of SET/TEST_HARD_REG_BIT
accessors.
2021-11-17 Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog:
* config/i386/i386.c (indirect_thunks_used): Redefine as HARD_REG_SET.
(ix86_code_end): Use TEST_HARD_REG_BIT on indirect_thunks_used.
(ix86_output_indirect_branch_via_reg): Use SET_HARD_REG_BIT
on indirect_thunks_used.
(ix86_output_indirect_function_return): Ditto.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0c5439d..c9129ae 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5733,7 +5733,7 @@ static bool indirect_thunk_needed = false; /* Bit masks of integer registers, which contain branch target, used by call thunk functions. */ -static int indirect_thunks_used; +static HARD_REG_SET indirect_thunks_used; /* True if return thunk function is needed. */ static bool indirect_return_needed = false; @@ -6030,8 +6030,7 @@ ix86_code_end (void) for (regno = FIRST_REX_INT_REG; regno <= LAST_REX_INT_REG; regno++) { - unsigned int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1; - if ((indirect_thunks_used & (1 << i))) + if (TEST_HARD_REG_BIT (indirect_thunks_used, regno)) output_indirect_thunk_function (indirect_thunk_prefix_none, regno, false); } @@ -6041,7 +6040,7 @@ ix86_code_end (void) char name[32]; tree decl; - if ((indirect_thunks_used & (1 << regno))) + if (TEST_HARD_REG_BIT (indirect_thunks_used, regno)) output_indirect_thunk_function (indirect_thunk_prefix_none, regno, false); @@ -16014,12 +16013,8 @@ ix86_output_indirect_branch_via_reg (rtx call_op, bool sibcall_p) != indirect_branch_thunk_inline) { if (cfun->machine->indirect_branch_type == indirect_branch_thunk) - { - int i = regno; - if (i >= FIRST_REX_INT_REG) - i -= (FIRST_REX_INT_REG - LAST_INT_REG - 1); - indirect_thunks_used |= 1 << i; - } + SET_HARD_REG_BIT (indirect_thunks_used, regno); + indirect_thunk_name (thunk_name_buf, regno, need_prefix, false); thunk_name = thunk_name_buf; } @@ -16307,7 +16302,7 @@ ix86_output_indirect_function_return (rtx ret_op) if (need_thunk) { indirect_return_via_cx = true; - indirect_thunks_used |= 1 << CX_REG; + SET_HARD_REG_BIT (indirect_thunks_used, CX_REG); } fprintf (asm_out_file, "\tjmp\t"); assemble_name (asm_out_file, thunk_name); |