summaryrefslogtreecommitdiff
path: root/gcc/optabs-libfuncs.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:10:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:10:53 +0000
commitb4206259f10455603e0c90825566de1ea777c04a (patch)
tree7511466ff26d775b7a754d24ae68485928d10a95 /gcc/optabs-libfuncs.c
parentf67f4dfffe08b1cea5de407e35e03dd38b64fcd3 (diff)
[20/77] Replace MODE_INT checks with is_int_mode
Replace checks of "GET_MODE_CLASS (...) == MODE_INT" with "is_int_mode (..., &var)", in cases where it becomes useful to refer to the mode as a scalar_int_mode. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (is_int_mode): New fuction. * combine.c (find_split_point): Use it. (combine_simplify_rtx): Likewise. (simplify_if_then_else): Likewise. (simplify_set): Likewise. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Likewise. * cse.c (notreg_cost): Likewise. (cse_insn): Likewise. * cselib.c (cselib_lookup_1): Likewise. * dojump.c (do_jump_1): Likewise. (do_compare_rtx_and_jump): Likewise. * dse.c (get_call_args): Likewise. * dwarf2out.c (rtl_for_decl_init): Likewise. (native_encode_initializer): Likewise. * expmed.c (emit_store_flag_1): Likewise. (emit_store_flag): Likewise. * expr.c (convert_modes): Likewise. (store_field): Likewise. (expand_expr_real_1): Likewise. * fold-const.c (fold_read_from_constant_string): Likewise. * gimple-ssa-sprintf.c (get_format_string): Likewise. * optabs-libfuncs.c (gen_int_libfunc): Likewise. * optabs.c (expand_binop): Likewise. (expand_unop): Likewise. (expand_abs_nojump): Likewise. (expand_one_cmpl_abs_nojump): Likewise. * simplify-rtx.c (mode_signbit_p): Likewise. (val_signbit_p): Likewise. (val_signbit_known_set_p): Likewise. (val_signbit_known_clear_p): Likewise. (simplify_relational_operation_1): Likewise. * tree.c (vector_type_mode): Likewise. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_int_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251472
Diffstat (limited to 'gcc/optabs-libfuncs.c')
-rw-r--r--gcc/optabs-libfuncs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/optabs-libfuncs.c b/gcc/optabs-libfuncs.c
index 151a473a66b..5ad3c6d86f5 100644
--- a/gcc/optabs-libfuncs.c
+++ b/gcc/optabs-libfuncs.c
@@ -189,8 +189,9 @@ gen_int_libfunc (optab optable, const char *opname, char suffix,
{
int maxsize = 2 * BITS_PER_WORD;
int minsize = BITS_PER_WORD;
+ scalar_int_mode int_mode;
- if (GET_MODE_CLASS (mode) != MODE_INT)
+ if (!is_int_mode (mode, &int_mode))
return;
if (maxsize < LONG_LONG_TYPE_SIZE)
maxsize = LONG_LONG_TYPE_SIZE;
@@ -198,10 +199,10 @@ gen_int_libfunc (optab optable, const char *opname, char suffix,
&& (trapv_binoptab_p (optable)
|| trapv_unoptab_p (optable)))
minsize = INT_TYPE_SIZE;
- if (GET_MODE_BITSIZE (mode) < minsize
- || GET_MODE_BITSIZE (mode) > maxsize)
+ if (GET_MODE_BITSIZE (int_mode) < minsize
+ || GET_MODE_BITSIZE (int_mode) > maxsize)
return;
- gen_libfunc (optable, opname, suffix, mode);
+ gen_libfunc (optable, opname, suffix, int_mode);
}
/* Like gen_libfunc, but verify that FP and set decimal prefix if needed. */