pru: Inline muldi3 when optimizing for speed

When optimizing for speed, it is faster to inline the 32-bit
multiplication sub-operations, instead of calling a library function.
This saves instruction cycles spent for preparing a call to the multi64
library function, at the expense of duplication in text section.

The inlined muldi3 operation uses only a few temporary registers,
so there should be no negative effects due to increased register
pressure.  Even more, the register pressure may even decrease with
inlining because the number of temporary registers is much lower than
the number of caller-saved registers for PRU.

gcc/ChangeLog:

	* config/pru/constraints.md: Prevent allocating r27 as
	SImode destination for mulsi3 pattern.
	* config/pru/pru.h (enum reg_class): Expand MULDST_REGS
	to allow fitting DImode.
	* config/pru/pru.md (umulsidi3): New pattern.
	(muldi3): Ditto.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
3 files changed