aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.h
diff options
context:
space:
mode:
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 f854550..8e82f04 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2877,6 +2877,24 @@ subreg_lowpart_offset (machine_mode outermode, machine_mode innermode)
GET_MODE_SIZE (innermode));
}
+/* Given that a subreg has outer mode OUTERMODE and inner mode INNERMODE,
+ return the mode that is big enough to hold both the outer and inner
+ values. Prefer the outer mode in the event of a tie. */
+
+inline machine_mode
+wider_subreg_mode (machine_mode outermode, machine_mode innermode)
+{
+ return partial_subreg_p (outermode, innermode) ? innermode : outermode;
+}
+
+/* Likewise for subreg X. */
+
+inline machine_mode
+wider_subreg_mode (const_rtx x)
+{
+ return wider_subreg_mode (GET_MODE (x), GET_MODE (SUBREG_REG (x)));
+}
+
extern unsigned int subreg_size_highpart_offset (unsigned int, unsigned int);
/* Return the SUBREG_BYTE for an OUTERMODE highpart of an INNERMODE value. */