aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:17:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:17:20 +0000
commit5e4e37bff76a3fbaf4f6e18a343f7c484eeb642e (patch)
treed48a76de8eb38795478f41a6e359ffce506390ce /gcc/rtl.h
parent401581b6eb93369a5e60c05e9f13d072ba23cff4 (diff)
downloadgcc-5e4e37bff76a3fbaf4f6e18a343f7c484eeb642e.zip
gcc-5e4e37bff76a3fbaf4f6e18a343f7c484eeb642e.tar.gz
gcc-5e4e37bff76a3fbaf4f6e18a343f7c484eeb642e.tar.bz2
[50/77] Add helper routines for SUBREG_PROMOTED_VAR_P subregs
When subregs contain promoted values, as indicated by SUBREG_PROMOTED_VAR_P, both the unpromoted (outer) and promoted (inner) values are known to be scalar integers. This patch adds helper routines that get the modes as scalar_int_modes. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * rtl.h (subreg_unpromoted_mode, subreg_promoted_mode): New functions. * expr.c (convert_move): Use them. (convert_modes): Likewise. (store_expr_with_bounds): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251502
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r--gcc/rtl.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 9e16b9b1..8f4c1fa 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2764,6 +2764,24 @@ unwrap_const_vec_duplicate (T x)
return x;
}
+/* Return the unpromoted (outer) mode of SUBREG_PROMOTED_VAR_P subreg X. */
+
+inline scalar_int_mode
+subreg_unpromoted_mode (rtx x)
+{
+ gcc_checking_assert (SUBREG_PROMOTED_VAR_P (x));
+ return as_a <scalar_int_mode> (GET_MODE (x));
+}
+
+/* Return the promoted (inner) mode of SUBREG_PROMOTED_VAR_P subreg X. */
+
+inline scalar_int_mode
+subreg_promoted_mode (rtx x)
+{
+ gcc_checking_assert (SUBREG_PROMOTED_VAR_P (x));
+ return as_a <scalar_int_mode> (GET_MODE (SUBREG_REG (x)));
+}
+
/* In emit-rtl.c */
extern rtvec gen_rtvec_v (int, rtx *);
extern rtvec gen_rtvec_v (int, rtx_insn **);