diff options
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 55c338e..ec7a062 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -6940,3 +6940,22 @@ register_asm_p (const_rtx x) && DECL_ASSEMBLER_NAME_SET_P (REG_EXPR (x)) && DECL_REGISTER (REG_EXPR (x))); } + +/* Return true if, for all OP of mode OP_MODE: + + (vec_select:RESULT_MODE OP SEL) + + is equivalent to the lowpart RESULT_MODE of OP. */ + +bool +vec_series_lowpart_p (machine_mode result_mode, machine_mode op_mode, rtx sel) +{ + int nunits; + if (GET_MODE_NUNITS (op_mode).is_constant (&nunits) + && targetm.can_change_mode_class (op_mode, result_mode, ALL_REGS)) + { + int offset = BYTES_BIG_ENDIAN ? nunits - XVECLEN (sel, 0) : 0; + return rtvec_series_p (XVEC (sel, 0), offset); + } + return false; +} |