+2019-10-07 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * config/msp430/msp430-protos.h (msp430_split_addsi): New prototype.
+ * config/msp430/msp430.c (msp430_split_addsi): New.
+ * config/msp430/msp430.md: Call msp430_split_addsi () instead of using
+ a block of C code for splitting addsi.
+
2019-10-07 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/i386-expand.c (ix86_expand_floorceildf_32,
void msp430_register_pragmas (void);
rtx msp430_return_addr_rtx (int);
void msp430_split_movsi (rtx *);
+int msp430_split_addsi (rtx *);
void msp430_start_function (FILE *, const char *, tree);
rtx msp430_subreg (machine_mode, rtx, machine_mode, int);
bool msp430_use_f5_series_hwmult (void);
return rv;
}
+int
+msp430_split_addsi (rtx *operands)
+{
+ operands[3] = msp430_subreg (HImode, operands[0], SImode, 0);
+ operands[4] = msp430_subreg (HImode, operands[1], SImode, 0);
+ operands[5] = msp430_subreg (HImode, operands[2], SImode, 0);
+ operands[6] = msp430_subreg (HImode, operands[0], SImode, 2);
+ operands[7] = msp430_subreg (HImode, operands[1], SImode, 2);
+ operands[8] = msp430_subreg (HImode, operands[2], SImode, 2);
+
+ /* BZ 64160: Do not use this splitter when the dest partially overlaps the
+ source. */
+ if (reg_overlap_mentioned_p (operands[3], operands[7])
+ || reg_overlap_mentioned_p (operands[3], operands[8]))
+ return 1;
+
+ if (GET_CODE (operands[5]) == CONST_INT)
+ operands[9] = GEN_INT (INTVAL (operands[5]) & 0xffff);
+ else
+ operands[9] = gen_rtx_ZERO_EXTEND (SImode, operands[5]);
+ return 0;
+}
+
/* Called by movsi_x to generate the HImode operands. */
void
msp430_split_movsi (rtx *operands)
(zero_extend:HI (reg:BI CARRY))))
]
"
- operands[3] = msp430_subreg (HImode, operands[0], SImode, 0);
- operands[4] = msp430_subreg (HImode, operands[1], SImode, 0);
- operands[5] = msp430_subreg (HImode, operands[2], SImode, 0);
- operands[6] = msp430_subreg (HImode, operands[0], SImode, 2);
- operands[7] = msp430_subreg (HImode, operands[1], SImode, 2);
- operands[8] = msp430_subreg (HImode, operands[2], SImode, 2);
-
- /* BZ 64160: Do not use this splitter when the dest partially overlaps the source. */
- if (reg_overlap_mentioned_p (operands[3], operands[7])
- || reg_overlap_mentioned_p (operands[3], operands[8]))
- FAIL;
-
- if (GET_CODE (operands[5]) == CONST_INT)
- operands[9] = GEN_INT (INTVAL (operands[5]) & 0xffff);
- else
- operands[9] = gen_rtx_ZERO_EXTEND (SImode, operands[5]);
- "
+ if (msp430_split_addsi (operands))
+ FAIL;
+ "
)