aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-10-13 09:53:00 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-10-13 09:53:00 +0000
commit250a60f3879d2d508d0d08e9da1dfa1648e1a369 (patch)
treefc2db3da8cc97b1a2250ffa755f81ed79f7052be /gcc/cfgexpand.c
parentfb98441af9c84caef6a0e3210ace4b8ffc7e3840 (diff)
downloadgcc-250a60f3879d2d508d0d08e9da1dfa1648e1a369.zip
gcc-250a60f3879d2d508d0d08e9da1dfa1648e1a369.tar.gz
gcc-250a60f3879d2d508d0d08e9da1dfa1648e1a369.tar.bz2
Make more use of GET_MODE_UNIT_BITSIZE
This patch is like the previous GET_MODE_UNIT_SIZE one, but for bit rather than byte sizes. 2017-10-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * cfgexpand.c (expand_debug_expr): Use GET_MODE_UNIT_BITSIZE. (expand_debug_source_expr): Likewise. * combine.c (combine_simplify_rtx): Likewise. * cse.c (fold_rtx): Likewise. * fwprop.c (canonicalize_address): Likewise. * targhooks.c (default_shift_truncation_mask): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r253716
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index bd3312e..be93c58 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4326,9 +4326,11 @@ expand_debug_expr (tree exp)
if (FLOAT_MODE_P (mode) && FLOAT_MODE_P (inner_mode))
{
- if (GET_MODE_BITSIZE (mode) == GET_MODE_BITSIZE (inner_mode))
+ if (GET_MODE_UNIT_BITSIZE (mode)
+ == GET_MODE_UNIT_BITSIZE (inner_mode))
op0 = simplify_gen_subreg (mode, op0, inner_mode, 0);
- else if (GET_MODE_BITSIZE (mode) < GET_MODE_BITSIZE (inner_mode))
+ else if (GET_MODE_UNIT_BITSIZE (mode)
+ < GET_MODE_UNIT_BITSIZE (inner_mode))
op0 = simplify_gen_unary (FLOAT_TRUNCATE, mode, op0, inner_mode);
else
op0 = simplify_gen_unary (FLOAT_EXTEND, mode, op0, inner_mode);
@@ -5191,9 +5193,11 @@ expand_debug_source_expr (tree exp)
if (FLOAT_MODE_P (mode) && FLOAT_MODE_P (inner_mode))
{
- if (GET_MODE_BITSIZE (mode) == GET_MODE_BITSIZE (inner_mode))
+ if (GET_MODE_UNIT_BITSIZE (mode)
+ == GET_MODE_UNIT_BITSIZE (inner_mode))
op0 = simplify_gen_subreg (mode, op0, inner_mode, 0);
- else if (GET_MODE_BITSIZE (mode) < GET_MODE_BITSIZE (inner_mode))
+ else if (GET_MODE_UNIT_BITSIZE (mode)
+ < GET_MODE_UNIT_BITSIZE (inner_mode))
op0 = simplify_gen_unary (FLOAT_TRUNCATE, mode, op0, inner_mode);
else
op0 = simplify_gen_unary (FLOAT_EXTEND, mode, op0, inner_mode);