mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 15:42:07 +08:00
optabs.c (debug_optab_libfunc): Update; make available to gdb.
* optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
This commit is contained in:
parent
6977374226
commit
8a33f10034
@ -1,3 +1,36 @@
|
||||
2007-09-04 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* optabs.c (debug_optab_libfunc): Update; make available to gdb.
|
||||
(libfunc_entry): New structure.
|
||||
(libfunc_hash): New hashtable.
|
||||
(hash_libfunc): New function.
|
||||
(eq_libfunc): New function.
|
||||
(convert_optab_libfunc): New function.
|
||||
(optab_libfunc): New function.
|
||||
(expand_binop, sign_expand_binop, expand_twoval_binop_libfunc,
|
||||
expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn,
|
||||
expand_float, expand_fix, new_optab, new_convert_optab):
|
||||
Update for new libfunc API.
|
||||
(init_libfunc, init_integral_libfuncs,
|
||||
init_floating_libfuncs, init_interclass_conv_libfuncs
|
||||
init_intraclass_conv_libfuncs): Remove; reorganize all logic to:
|
||||
(gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc,
|
||||
gen_intv_fp_libfunc, gen_interclass_conv_libfunc,
|
||||
gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc,
|
||||
gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc,
|
||||
gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc,
|
||||
gen_extend_conv_libfunc): New.
|
||||
(init_one_libfunc): Revamp for hashtables.
|
||||
(set_conv_libfunc): Likewise.
|
||||
(init_optabs): Initialize hashtable; use lazy initialization where possible.
|
||||
* optabs.h (optab_handlers): Move out of GGC.
|
||||
(optab, convert_optab): Move out of GGC; add lazy gen info.
|
||||
(code_to_optab, convert_optab_table, optab_table): Move out of GGC.
|
||||
(optab_libfunc, convert_optab_libfunc): New.
|
||||
* builtins.c (expand_builtin_powi): Update for new API.
|
||||
* expr.c (convert_move): Likewise.
|
||||
* expmed.c (expand_divmod): Likewise.
|
||||
|
||||
2007-09-04 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* config/rs6000/rs6000.c (rs6000_stack_info): Allocate space for the
|
||||
|
@ -3060,7 +3060,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
|
||||
if (GET_MODE (op1) != mode2)
|
||||
op1 = convert_to_mode (mode2, op1, 0);
|
||||
|
||||
target = emit_library_call_value (optab_handler (powi_optab, mode)->libfunc,
|
||||
target = emit_library_call_value (optab_libfunc (powi_optab, mode),
|
||||
target, LCT_CONST_MAKE_BLOCK, mode, 2,
|
||||
op0, mode, op1, mode2);
|
||||
|
||||
|
@ -3886,8 +3886,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
|
||||
if (compute_mode == VOIDmode)
|
||||
for (compute_mode = mode; compute_mode != VOIDmode;
|
||||
compute_mode = GET_MODE_WIDER_MODE (compute_mode))
|
||||
if (optab_handler (optab1, compute_mode)->libfunc
|
||||
|| optab_handler (optab2, compute_mode)->libfunc)
|
||||
if (optab_libfunc (optab1, compute_mode)
|
||||
|| optab_libfunc (optab2, compute_mode))
|
||||
break;
|
||||
|
||||
/* If we still couldn't find a mode, use MODE, but expand_binop will
|
||||
|
@ -443,7 +443,7 @@ convert_move (rtx to, rtx from, int unsignedp)
|
||||
}
|
||||
|
||||
/* Otherwise use a libcall. */
|
||||
libcall = convert_optab_handler (tab, to_mode, from_mode)->libfunc;
|
||||
libcall = convert_optab_libfunc (tab, to_mode, from_mode);
|
||||
|
||||
/* Is this conversion implemented yet? */
|
||||
gcc_assert (libcall);
|
||||
|
903
gcc/optabs.c
903
gcc/optabs.c
File diff suppressed because it is too large
Load Diff
24
gcc/optabs.h
24
gcc/optabs.h
@ -39,15 +39,17 @@ along with GCC; see the file COPYING3. If not see
|
||||
A few optabs, such as move_optab and cmp_optab, are used
|
||||
by special code. */
|
||||
|
||||
struct optab_handlers GTY(())
|
||||
struct optab_handlers
|
||||
{
|
||||
enum insn_code insn_code;
|
||||
rtx libfunc;
|
||||
};
|
||||
|
||||
struct optab GTY(())
|
||||
struct optab
|
||||
{
|
||||
enum rtx_code code;
|
||||
const char *libcall_basename;
|
||||
char libcall_suffix;
|
||||
void (*libcall_gen)(struct optab *, const char *name, char suffix, enum machine_mode);
|
||||
struct optab_handlers handlers[NUM_MACHINE_MODES];
|
||||
};
|
||||
typedef struct optab * optab;
|
||||
@ -55,9 +57,13 @@ typedef struct optab * optab;
|
||||
/* A convert_optab is for some sort of conversion operation between
|
||||
modes. The first array index is the destination mode, the second
|
||||
is the source mode. */
|
||||
struct convert_optab GTY(())
|
||||
struct convert_optab
|
||||
{
|
||||
enum rtx_code code;
|
||||
const char *libcall_basename;
|
||||
void (*libcall_gen)(struct convert_optab *, const char *name,
|
||||
enum machine_mode,
|
||||
enum machine_mode);
|
||||
struct optab_handlers handlers[NUM_MACHINE_MODES][NUM_MACHINE_MODES];
|
||||
};
|
||||
typedef struct convert_optab *convert_optab;
|
||||
@ -324,7 +330,7 @@ enum optab_index
|
||||
OTI_MAX
|
||||
};
|
||||
|
||||
extern GTY(()) optab optab_table[OTI_MAX];
|
||||
extern optab optab_table[OTI_MAX];
|
||||
|
||||
#define add_optab (optab_table[OTI_add])
|
||||
#define sub_optab (optab_table[OTI_sub])
|
||||
@ -498,7 +504,7 @@ enum convert_optab_index
|
||||
COI_MAX
|
||||
};
|
||||
|
||||
extern GTY(()) convert_optab convert_optab_table[COI_MAX];
|
||||
extern convert_optab convert_optab_table[COI_MAX];
|
||||
|
||||
#define sext_optab (convert_optab_table[COI_sext])
|
||||
#define zext_optab (convert_optab_table[COI_zext])
|
||||
@ -521,7 +527,7 @@ extern enum insn_code reload_in_optab[NUM_MACHINE_MODES];
|
||||
extern enum insn_code reload_out_optab[NUM_MACHINE_MODES];
|
||||
|
||||
/* Contains the optab used for each rtx code. */
|
||||
extern GTY(()) optab code_to_optab[NUM_RTX_CODE + 1];
|
||||
extern optab code_to_optab[NUM_RTX_CODE + 1];
|
||||
|
||||
|
||||
typedef rtx (*rtxfun) (rtx);
|
||||
@ -709,4 +715,8 @@ extern rtx expand_vec_shift_expr (tree, rtx);
|
||||
#define convert_optab_handler(optab,mode,mode2) \
|
||||
(&(optab)->handlers[(int) (mode)][(int) (mode2)])
|
||||
|
||||
extern rtx optab_libfunc (optab optab, enum machine_mode mode);
|
||||
extern rtx optab_libfunc (optab optab, enum machine_mode mode);
|
||||
extern rtx convert_optab_libfunc (convert_optab optab, enum machine_mode mode1,
|
||||
enum machine_mode mode2);
|
||||
#endif /* GCC_OPTABS_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user