From bb06a2d85567fc0d5d82d28629ebc54453c35f17 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 22 Oct 2017 21:39:29 +0000 Subject: Make more use of GET_MODE_UNIT_PRECISION This patch is like the earlier GET_MODE_UNIT_SIZE one, but for precisions rather than sizes. There is one behavioural change in expand_debug_expr: we shouldn't use lowpart subregs for non-scalar truncations, since that would just reinterpret some of the scalars and drop the rest. (This probably doesn't trigger in practice.) Using TRUNCATE is fine for scalars, since simplify_gen_unary knows when a subreg can be used. 2017-10-22 Richard Sandiford Alan Hayward David Sherwood gcc/ * cfgexpand.c (expand_debug_expr): Use GET_MODE_UNIT_PRECISION. (expand_debug_source_expr): Likewise. * combine.c (combine_simplify_rtx): Likewise. * cse.c (fold_rtx): Likewise. * optabs.c (expand_float): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. (simplify_binary_operation_1): Likewise. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r253991 --- gcc/optabs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/optabs.c') diff --git a/gcc/optabs.c b/gcc/optabs.c index 94092fc..15ca315 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -4655,7 +4655,8 @@ expand_float (rtx to, rtx from, int unsignedp) int doing_unsigned = unsignedp; if (fmode != GET_MODE (to) - && significand_size (fmode) < GET_MODE_PRECISION (GET_MODE (from))) + && (significand_size (fmode) + < GET_MODE_UNIT_PRECISION (GET_MODE (from)))) continue; icode = can_float_p (fmode, imode, unsignedp); -- cgit v1.1